Sign in to follow this  
TheKrust

A better way to Depth map...

Recommended Posts

So I have recently discovered this wonderful wonderful thing called depth mapping. I can do more things with this single method than I ever have before using something so simple. So far, I've been able to get effects such as motion blur, depth of field, shadow maps, soft particles, and volumetric fog (in a sense). Although, I am getting to where I am rendering a few more depth maps that I would like, such as for things like shadow spot lights. Are there any special tricks or techniqes to speed up depth map rendering. Btw, the format I'm using is R32F I was thinking about geometry simplification for smaller objects, but that tends to cause wrong depth values in the scene.

Share this post


Link to post
Share on other sites
Depending on what you need the depth map for you may be able to get away with a R16F, or you may even be able to pack the floating point value into an ARGB8 texture. Also in your depth shader use half precision when possible.

Otherwise just try to use the lowest resolution possible for the need, and use very aggressive scene management/culling.

Share this post


Link to post
Share on other sites
well here's what I've come up with so far that I can do.


shadow map optimizations:
-------------------------
-when shadows are closer, use higher res depth map, when farther away, use lower res depth map

-sense when nothing is moving in a shadow (depth) map and do not update

-for certain objects (at far distances), can have simplified geometry be rendered in the depth map

-certain objects may be able to be replaced with billboards


soft particle optimizations:
----------------------------
-lower res depth map enabled when no (or few) particles are present of the screen


oh and I know that R16F is possible, but I've never used it without things coming out really bad. Plus, the difference between 32 and 16 on modern hardware is so minimal it's just not worth the loss in quality.

Share this post


Link to post
Share on other sites

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