Jump to content
  • Advertisement
Sign in to follow this  
Quat

DX11 Shadows for Outdoors

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

I have a large outdoor scene. I implemented CSM using 4 cascades for my dx9 engine. One of the main shortcomings was that the last sub-frustum was very large and so I got very poor resolution in that area.

I want to fix this in my dx11 engine. Two obvious choices is that to increase the cascade count or shadow map resolution. However, I still think it will be hard to fight how large the frustum size grows with distance.

I've seen that a lot of games fade shadows out with distance like here:



Is this the recommened solution?

Share this post


Link to post
Share on other sites
Advertisement
Another solution is to reduce the size of the last frustum. If your camera has a far plane of 1000, why use a light far plane of 1000? you can use a smaller value and add an attenuation function to eliminate artifacts when it is outside the frustum.

More or less what you show in the video. tongue.png

Share this post


Link to post
Share on other sites

Another solution is to reduce the size of the last frustum. If your camera has a far plane of 1000, why use a light far plane of 1000? you can use a smaller value and add an attenuation function to eliminate artifacts when it is outside the frustum.

More or less what you show in the video. tongue.png


Another solution is to generate rough low res distant shadow map for your world across multiple frames. Once it is ready, use it and start computing the next one. When that one is ready, fade in between the old and the new. If you use this SM far enough from the camera, it is not so noticeable that it does not update every frame or really match your CSM. The blurrier the better in this case of course.

Share this post


Link to post
Share on other sites

[quote name='InvalidPointer' timestamp='1334802621' post='4932667']
As an alternative to cascaded shadow maps, consider using adaptive shadow maps by way of rectilinear texture warping instead.

That is downright stunning.

I wonder how well it would handle the pathological worst-case I am dealing with (a near-infinite space scene, with ships ranging from 10 metres to 3 kilometres).
[/quote]
Probably insanely well. It'll probably just super-scale things like ships, etc. and can completely squeeze out empty space.

EDIT: You can very easily customize the importance functions to your specific needs. They suggest three in the paper, but you can always invent your own.
EDIT 2: In fact, I think you're suggesting what is basically a *best-case* scenario for the algorithm. This may not be immediately obvious if you just watched the video, but shadow map regions can be arbitrarily enlarged or shrunk-- it isn't a global operator like perspective or trapezoidal shadow maps.

Share this post


Link to post
Share on other sites
What is the minimum capable hardware support required to do this? He mentions a non-tessellated version in the paper but I didn’t have time to read the whole thing to determine if there is something else required above DirectX 9 capabilities.

Also how much of a problem would you guess blur kernels would be on the shadow map?


L. Spiro

Share this post


Link to post
Share on other sites
Yeah, it was easily one of my favorite papers presented at I3D. I (and many other game developers) told him as much immediately after the the conference ended. We all got giddy about heading home to implement it and see how it worked out. Of course, then I returned to the reality of a milestone. Still, I think it's extremely promising, even without using tessellation. Definitely worth attempting...

Share this post


Link to post
Share on other sites

What is the minimum capable hardware support required to do this? He mentions a non-tessellated version in the paper but I didn’t have time to read the whole thing to determine if there is something else required above DirectX 9 capabilities.

Also how much of a problem would you guess blur kernels would be on the shadow map?


L. Spiro

Vertex texture fetch is a requirement; I don't think R2VB is an adequate substitute. Other than that, everything's bog-standard Direct3D9 stuff. You basically goof around with the on-screen position of vertices based on an importance map, shrinking or enlarging their size based on 2D interest values in shadow map space.

Blur kernels are super-easy, you just scale the texture coordinate offset by the above-mentioned interest value and sample from the shadow map again.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!