Sign in to follow this  

Cube map shadows

This topic is 4308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone, what is the advantages and disadvantages of using cube map shadows in games? Or maybe perspective shadow maps is more efficient then cube map shadows? Thank you.

Share this post


Link to post
Share on other sites
Well cube mapped shadows gives you the possibility of having projected shadowing with point lights, not just with spot lights. The disadvantage is that it is 6 times slower ebcause it has to be done through 6 directions.

Dave

Share this post


Link to post
Share on other sites
Quote:
Original post by Dave
Well cube mapped shadows gives you the possibility of having projected shadowing with point lights, not just with spot lights. The disadvantage is that it is 6 times slower ebcause it has to be done through 6 directions.

Dave



Well, the shadow _generation_ is about 6x slower. Shadow cubemaps (and derivations of) are basically the only way to make shadow mapping with omnidirectional (aka point) lights work. Perspective shadow maps is for directional lights exclusively (even though the PSM paper suggests that they could be used for omni lights, which I think is an absolute joke. Offscreen omni lights do NOT produce the same results as directional lights).

Share this post


Link to post
Share on other sites
Cube maps aren't the only way, Cypher. There's also dual paraboloid shadow maps - thats 2 renders, which is a bit better. Daver, as everyone has says - cube maps give you 360° coverage around a point, which means that a point light can be used.

Share this post


Link to post
Share on other sites
Has anyone here implemented dual paraboloid shadow mapping? I had a really hard time finding any decent articles about the paraboloid map generation. I finally just got the map generation working correctly, hopefully in the next day or 2 I'll have to time to to finish it all up. I'll post some screens showing quality and speed comparisons between dual paraboloid maps and cube maps for point light shadowing in the next couple days.

Share this post


Link to post
Share on other sites
Quote:

Has anyone here implemented dual paraboloid shadow mapping?


There is a demo at Delphi3D demonstrating the technique. It might help if you don't mind reading Delphi code.

HellRaiZer

Share this post


Link to post
Share on other sites
Quote:
Original post by acid2
There's also dual paraboloid shadow maps - thats 2 renders, which is a bit better


Yes, but i have been read that: "...Sphere and paraboloid maps uses only 78% of the actual texture resolution available in the texture map image..."
and in that Delphi3D demo I found unprofitable results:
http://img208.imageshack.us/img208/9550/paraboloidshadows5bc.jpg

Also "paraboloid mapping ... is more expensive because it requires two texture units or two rendering passes", so if I have only one spare texture unit (0-color map, 1-normal map, 2-height map for parallax mapping, 3-spare), I have to draw all scene twice (this is expensive if I have a huge amount of polygons in the scene).

So what is the best solution (speed and quality) of soft shadows in the next-generation engine?

And what do you think about shadow volumes that is blured in screen space (like in Unigine)?

Quote:
Original post by Leafteaner
I'll post some screens showing quality and speed comparisons between dual paraboloid maps and cube maps for point light shadowing in the next couple days.


Oh, it would be great :)

Share this post


Link to post
Share on other sites
Quote:
Original post by acid2
Cube maps aren't the only way, Cypher. There's also dual paraboloid shadow maps - thats 2 renders, which is a bit better. Daver, as everyone has says - cube maps give you 360° coverage around a point, which means that a point light can be used.


I hardly feel that DPSMs are practical for scenarios in the real world.

They may be 2 renders, but they're really only useful for either:
-Fairly faraway lights and used as a level of detail control or
-Ridiculously high poly environments (and even in this case, the resulting shadow detail of DPSMs are still absolutely horrible. Plus, what's the point in having 1/3 of the render calls when you need >100x the number of vertices to get correct shadows most of the time?)

The argument of 2 passes just isn't very compelling to me considering the tradeoffs you have to make with regards to resulting detail and extra transformation in the general case scenario. I will totally give you the argument of using them as a LoD system, but even then I'll need some hard results in order to be fully convinced that they're robust enough for even that manner of use.

The main reasoning behind my gripe is the fact that you need to do a curved projection for DPSMs, not a linear one. Plus, you end up getting a ridiculously low quality, as Daver's screenshot of the DPSM demo demonstrates.

Oh, and for the Delphi3d demo, did you check out the wireframe shot of the environment?


Quote:
Also "paraboloid mapping ... is more expensive because it requires two texture units or two rendering passes", so if I have only one spare texture unit (0-color map, 1-normal map, 2-height map for parallax mapping, 3-spare), I have to draw all scene twice (this is expensive if I have a huge amount of polygons in the scene).


4 Texture units? I thought most hardware had 8?

Share this post


Link to post
Share on other sites
Quote:
Original post by Brian Lawson
All modern shader model 2.0 hardware and greater have at least 16.


Holly cow, I didn't know!!! :))):O I thouth for example geforce 6200 have only 4, because according this: http://delphi3d.net/hardware/

Share this post


Link to post
Share on other sites
That's a known.. hum... "side effect" of NVidia's implementation. It only reports 4 for the fixed function pipeline, but you can use 16 when using the programmable pipeline (ie. fragment shaders ).

Y.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ysaneya
That's a known.. hum... "side effect" of NVidia's implementation. It only reports 4 for the fixed function pipeline, but you can use 16 when using the programmable pipeline (ie. fragment shaders ).

Y.


Actually I did not know that. But then again, I haven't used the fixed function pipeline for years now. :)

Share this post


Link to post
Share on other sites
Link : http://www.mpi-sb.mpg.de/~tannen/papers/cgi_02.pdf

This DPSMs require programable texture blending. Is this a nvidia only feature ? Is this only in opengl ? Good links please ?

Moreover I think this DPSMs are a big fake and this require hight tesselation (but this is maybe a good fake).
The paraboloid mapping is carry out on vertex ! Vulgarly, edges should be curved but will not be curved at all. Then the resulting shadows will be wrong.

Is this correct ?

Share this post


Link to post
Share on other sites
If clipping is enabled and a 180° perspective matrix is set, the DPSMs alpha test is not necessary, does'nt it ? If not, a big disadvantage, is that all objects must be rendered (360°). On this subject, what about use multi-element textures ?

Share this post


Link to post
Share on other sites

This topic is 4308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this