[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Volumetric Stencil Shadows

Volumetric Stencil Shadows

Discuss programming topics that involve the OpenGL API.

Moderator: InsideQC Admins

Volumetric Stencil Shadows

Postby r00k » Tue Jan 20, 2015 11:15 pm

r00k
 
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Volumetric Stencil Shadows

Postby Barnes » Wed Jan 21, 2015 10:08 am

User avatar
Barnes
 
Posts: 232
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow

Re: Volumetric Stencil Shadows

Postby Spike » Wed Jan 21, 2015 12:49 pm

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Volumetric Stencil Shadows

Postby Irritant » Wed Jan 21, 2015 3:10 pm

Yeah, what he said ^^ Forget stencil volumes, they are CPU heavy, and completely outdated visually.

There is a method to blur them however. It requires blitting the FB and sending it to a blur shader, then rendering it with the proper blending over your screen. It's actually quite visually accurate and impressive, but shadows at a distance are quite blurry, and it's also hell on performance. We used to have this code in CRX, but have since stripped it out and gone solely with shadowmapping. The performance and appearance is vastly improved, although in our current code there are still the occasional annoying artifacts. We are still in the process of cleaning it up and optimizing, but you can view the code here - it's quite simple really. http://svn.icculus.org/alienarena/trunk/source/ref_gl/

The files to look at are:

http://svn.icculus.org/*checkout*/alien ... xt%2Fplain
http://svn.icculus.org/*checkout*/alien ... xt%2Fplain

The gist of what occurs is that you render the caster that is going to cast a shadow on the bsp into the depth buffer, then switch back to the main framebuffer and re-render the nearby bsp surfaces that the shadow will be on(rendering the shadow onto white surfaces, and blending into the scene). Then, switch back to the depth buffer and render any casters that might cast a shadow on the original entity(using the original entity's camera perspective), then render the entity using the completed shadowmap. This method has very little overhead as long as you're using VBO. The result is you get shadows on the bsp, and self shadowing plus nearby caster shadowing on the entity. My next goal is adjusting the frustom and perspective of the depth buffer and camera to make more efficient use of the depth buffer, and possibly get some better resolution and performance.

Here is an example of what it looks like - pay no attention to the fps, these shots were taken on my laptop which generally has roughly half the fps of what I get on my NV560 card. However, that same scene, when using blurred stencil volumes was less that half the FPS that you see here ;)

Image
Image
http://red.planetarena.org - Alien Arena and the CRX engine
Irritant
 
Posts: 250
Joined: Mon May 19, 2008 2:54 pm
Location: Maryland

Re: Volumetric Stencil Shadows

Postby Barnes » Wed Jan 21, 2015 7:45 pm

Each technology has drawbacks - shadow volumes strongly hit the vertex processor, shadow maps to the pixel. In quake2 polygonal very low and we can use the shadow volumes. In doom3 Carmack also prefer shadow volumes. But if you look in the debugger, tri-call can be "scary". Q2dm1 - up to 25k opengl calls, and 50-55k tris (3k ambient and light pass). 52k its shadows...
John rightly said - you can use soft shadow volumes, but if we still have the shadow of the level, the load on the video card will be much stronger, because we have to blur the shadow with the depth map. And when we move quickly, you notice the difference "hard or soft shadow" very difficult)
User avatar
Barnes
 
Posts: 232
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow


Return to OpenGL Programming

Who is online

Users browsing this forum: No registered users and 1 guest