question about oD0 in vertex shader
#1 Members - Reputation: 104
Posted 05 December 2011 - 04:05 AM
can someone give me more detail of the oD0?thanks.
#2 Members - Reputation: 491
Posted 05 December 2011 - 04:36 AM
[...] there are many dark lines in the surface of the object, but the shadow is correct. [...]
This is a well known issue called shadow acne
It generally comes from a too small bias in the depth comparison
something like that should solve the problem :
shadowmap.Sample(...).x + depthBias <posLight.z ? 0.0f : 1.0f;
Nico
PS : Personally I get good results using values around [1e-4 , 1e-3] .
#4 Moderators - Reputation: 5467
Posted 05 December 2011 - 03:54 PM
#5 Members - Reputation: 913
Posted 05 December 2011 - 04:31 PM
Love DAOC? Tryout my DAOC clone: https://dl.dropboxusercontent.com/u/8974528/VON_Dist.zip
#6 Members - Reputation: 491
Posted 05 December 2011 - 07:38 PM
Won't using that depth bias cause another shadow map artifact, "Peter Panning"?
Hello
Yes, that a compromise, the chosen value is the minimal value for which there's no more acne,
but adding a bias results in a small shift of the shadow map, as you said Peter Panning artifact.
#7 Members - Reputation: 104
Posted 05 December 2011 - 08:18 PM
while generating the shadow texture, I move the depth value to oD0, what i know is the clr will be clamp to [0.0, 1.0] in each component of oD0, but i'm not clear about how many bits to store the value.In the pixel shader, I use tex to retrieve the value in shadow texture,If you're manually outputting depth from a pixel shader, then you just output a [0.0, 1.0] floating point value. It will then converted to whatever format is being used by the depth buffer, which is typically either 24-bit fixed point integer or 32-bit floating point.
what i have done has nothing to do with the depth buffer.while rendering the scene, i store the depth in oD1 in vertex shader, then get it from v1 in pixel shader.
Here are something i guess, but not sure.
the r# register is 128 bits with each component 32 bits.
the c# register is 128 bits with each component 32 bits.
the oD# register is 32 bits with each component 8 bits.
Are these correct ?






