• Advertisement
Sign in to follow this  

Source code for Camera Space Shadow Mapping (CSSM)

This topic is 880 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

Advertisement

Demo looks impressive. smile.png
 
Single-shadowmap omni lights are a particularly nice feature. Didn't see the "light in front of camera" case so well in the video but it's visible in this screenshot: http://i.imgur.com/qUQTbfm.png
 
One minor issue though - I noticed that shadowmaps were slightly broken in one specific location - http://i.imgur.com/DDZkFhi.png. Seems like simply a case of depth bias/depth value space mismatch, though I'm not sure how hard it would be to fix in this case.

Share this post


Link to post
Share on other sites

Demo looks impressive. smile.png
 
Single-shadowmap omni lights are a particularly nice feature. Didn't see the "light in front of camera" case so well in the video but it's visible in this screenshot: http://i.imgur.com/qUQTbfm.png
 
One minor issue though - I noticed that shadowmaps were slightly broken in one specific location - http://i.imgur.com/DDZkFhi.png. Seems like simply a case of depth bias/depth value space mismatch, though I'm not sure how hard it would be to fix in this case.

 

Yep, CSSM has some issues - probably due to the way projections are packed into textures - which causes some discontinuities. Maybe you can change the focus range to some smaller value - that should fix it.

 

I'm hoping that most of these issues will be solved with depth histogram version, but I'm yet to figure out exactly how to apply it on all possible cases. Directional light coming from a side is most basic case (displayed on image above) is relatively easy to figure out, but others might be tricky.

 

NOTE: Some people have been complaining about some weird things in my math library. That is exactly why I’ve omitted it from the code (some parts are ugly), but if someone needs it I’ll share it. Just let me know.

Things like these are sometimes unclear: does matrix.Inverse() inverts the “matrix” or returns a new matrix that is inverse of a “matrix”.

Most correct answer to questions like these is: if it returns the reference, then “matrix” is changed. If it returns a new matrix then…  So, use intellisense :)

And/or check for the "const" keyword....

Share this post


Link to post
Share on other sites

I will look deep inside this, thank you so much for sharing it!

I have recently been doing some shadows work but i centered myself on shadows from depth basic and applied some cascades stuff.

I would like to know, if possible, how my technic and that one differs on:

 

- versatility (I saw it is applied on more than directional lights which is a  really nice improvement).

- filtering

- accuracy

- performance

- if there are more and you feel to extend it is also well received by me biggrin.png

 

Nonetheless my deepest congratulations for your effort! Its a  great demo.

 

Thank you so much.

Edited by #Include Graphics

Share this post


Link to post
Share on other sites

Hello, I am reading the paper, so far one thing i cannot understand is.

 

1. During the shadow pass generation, it is written: Then, the perspective-correct UV coordinates can be determined, and the actual test can be performed: stretched pixel p belongs to the triangle if the UV coordinates are positive and their sum is smaller than 1.

 

What happens if the pixel does not pass the test. It is killed by the shader, right? 

 

I am asking, because it can be a performance problem if hiz depth rejection cannot be used during shadoew generation.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement