[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/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 - Shadow volumes optimization

Shadow volumes optimization

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Shadow volumes optimization

Postby Barnes » Tue Oct 01, 2013 7:39 am

Some time ago i add "doom3 style" lighting in to my engine. First version was very slow, like 30-40fps.With some optimizations i'm get big speedup. Now i use
1 - frustrum, pvs and occlusion query lights culling
2- two side stencil
3- draw shadow volumes with precompiled static vbo
4- light scissors
5- light depth bounds
That make the new? Use z-pass volumes? Q2 geometry very simple, I'm not sure that this is an advantage in comparison with Carmack reverse...
User avatar
Barnes
 
Posts: 232
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow

Re: Shadow volumes optimization

Postby Spike » Tue Oct 01, 2013 12:45 pm

z-pass means that you can skip caps. it can be an effective optimisation as it means you only draw edges and don't have quite so much fill rate (stencil shadows are quite expensive in fillrate, of course). z-pass will not work if the view is in shadow, but will be faster in the cases where it does work. The trick is writing the code to decide whether its safe to use z-pass for each individual light.

one potential optimisation is to optimise your shadow volumes to avoid excessive overdraw which can greatly help in when given complex geometry.
the main issue imho with complex geometry is not the extra fillrate that results from it, but rather the cpu costs from working out whether each triangle surface is facing the light or not. With the world, this can be precompiled and with the extra filling clipped away, but moving models will need to be animated and rechecked every single frame.

Most people seem to prefer shadowmapping nowadays. Softer shadows are generally nicer and much less harsh. The real advantage though is that you don't have to generate lots of shadow edges based upon surface normals, meaning you can just push the entire mesh to the gpu in one... or 6 rather... goes. As a result, it can scale much better at higher detail levels. Especially if you can ensure that they're spot/sun lights.
Is the theoroy, anyway.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Shadow volumes optimization

Postby revelator » Tue Oct 01, 2013 4:16 pm

soft shadows are also doable with stencil volumes, albeit a bit hacky in doom3 since Theres no depth texture access sikkmod uses a small hack to emulate one.
Speedwise its even worse than sheer stencil volumes though and because of the hack it suffers from a bit of the same problem that SSAO does in sikkmod.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Shadow volumes optimization

Postby Barnes » Tue Oct 01, 2013 6:32 pm

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

Re: Shadow volumes optimization

Postby revelator » Wed Oct 02, 2013 1:49 am

Just an option :) doom3 actually has an experimental renderer in Draw_exp.cpp that utilized shadowmapping but the shaders were missing in the final release.
It was rather nasty though using the wgl extentions instead of newer ARB ones but it gave an idea on how to get it.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Shadow volumes optimization

Postby Barnes » Wed Oct 02, 2013 5:50 am

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

Re: Shadow volumes optimization

Postby revelator » Sat Oct 05, 2013 11:59 am

Biggest issue if fixing the exp renderer would be that the shadowmaps only Work on entities not on the World, so the World shadows would still be stencil volumes.
Someone WHO knows more about it than me could probably fix that oversight though :)
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Shadow volumes optimization

Postby Barnes » Sun Oct 06, 2013 10:06 am

I decided to use only the z-fail vulumes. Geometry as I said simple and large overload will not be
User avatar
Barnes
 
Posts: 232
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow

Re: Shadow volumes optimization

Postby revelator » Mon Oct 07, 2013 11:41 am

Your latest svn build seems to have reasonably nice shadows :) quite a bit better than doom3's even.
Nice Work :D i love your parallax shader also, would be damn nice to get that one working in Doom3 but as far as i know the problem is material based (well not really cause it applies the effect on every damn surface :S) id rather have a material based version that way i could apply the effect on select surfaces only. Hmm i hope someone can lend a hand with that part someday as it seems i have taken over maintainance off sikkmod heh :lol:
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Shadow volumes optimization

Postby Barnes » Mon Oct 07, 2013 7:14 pm

Thanks for the tip, but you overestimate my contribution in to parallax shader. I just optimized for speed is what you can see in qfusion or in dark places. The idea is simple as a couple of cents :)
User avatar
Barnes
 
Posts: 232
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow

Re: Shadow volumes optimization

Postby Spiney » Tue Oct 29, 2013 8:53 pm

I think D3 BFG added some optimizations found in this talk to reduce overdraw, at least I noticed some console variable...
http://www.terathon.com/gdc05_lengyel.pdf
Spiney
 
Posts: 63
Joined: Mon Feb 13, 2012 1:35 pm

Re: Shadow volumes optimization

Postby revelator » Tue Oct 29, 2013 11:11 pm

Still quite nice Work :) only recently started looking into C++ seriously and learning a new language like ARB assembly / GLSL is pretty hard at my age :S C++ was doable because it shares some parts with C but still yikes!!!. You do not want to know how long it took for me to get the ARB watershader working in my realm engine :oops:
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Shadow volumes optimization

Postby Barnes » Wed Oct 30, 2013 10:41 am

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


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 2 guests