directx - Depth textures clamped to 1.0? -


i'm doing exponential shadow maps instead of outputing depth, output exp(depth), this:

float ps_main(float4 position : sv_position) : sv_depth {     return exp(position.z / position.w); } 

using exp() turns entire depth texture white (1.0f).

i thinking no depth gets written because depth texture cleared 1.0f, max, , exp() values equal or higher. how can around this? want write float value depth texture.

the sv_depth range determined depth min/max in viewport, , has maximum range of 0.0 1.0 (it unorm surface interpretation). invocations depth values outside range or greater current value of depth buffer discarded. if want encode expression in code, can either calculate on load whenever end using it, or write separate render target (e.g. r32_float) rather using depth buffer.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -