Hi, I'm using hardware shadow map using the stencil buffer surface as texture, writting 0 to rgb channels in the depth pass, later in normal pass I use tex2Dproj to get the filtered intensity of the shadow, that's ok, it works, but,
it is very very dark:
As tex2Dproj gives me the filtered intensity, I can't controll the "darkness" of the shadow as if I do the PCF manually, the only values that I can change is D3DRS_DEPTHBIAS and D3DRS_SLOPESCALEDEPTHBIAS...
Some ideas?
Thanks
[Edited by - _Camus_ on September 29, 2010 7:52:10 PM]
Nvidia HW Shadow Map tex2Dproj very dark shadow[SOLVED]
It should not. "non-shadowed parts" on your depth textures are already "full" white so adding to it will not change anything.
I guess you're blending shadows with your scene something like this:
I guess you're blending shadows with your scene something like this:
float shadow = tex2Dproj(depth_samp, shadowTexCoord) + 0.2f;float3 scene = tex2D(scene_samp, texCoord).rgb;OUT.Color = float4(shadow * scene, 1.0);
Hi, thanks for reply. I don't think you are taking into account that tex2Dproj returns values between 0 ... 1, without filter 0 or 1... The tex2Dproj function makes the depth comparison and the filtering by hardware, for just attenuate the "full color", if tex2Dproj returns 1.0f your suggestion will return 1.0f + 0.2f, the actual "full color" pixel will be multiplied by 1.2f. In fact that was one of my first attempts to correct this situation:
Other approach:
It "works", but makes other problem on the edges:
That's why
Other approach:
float shadowamount = tex2Dproj( ShadowSampler, OtherCoords ).r; if( shadowamount < .9 ) shadowamount+=.5f;return shadowamount;
It "works", but makes other problem on the edges:
That's why
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement