• Advertisement
Sign in to follow this  

lighting and shadowing issues

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

hello, i have two issues with my current lighting setup. here is a screenshot that visualizes them: 1. as you can see on the arm of the model, there are some dark spots that shouldnt be there. looks like the normals are screwed up here. i am using a slightly modified BasicEffect, but i didnt do anything with the normals. 2. the shadowmap seems to apply itself on the backside of the model. you see this effect on the foot of the model.there are some shadowed and unshadowed areas, that should probably be totally shadowed. how can i avoid this? thanks a lot for any help!

Share this post


Link to post
Share on other sites
Advertisement
It does look like your normals are screwed up. Are you using the standard Model Importer/Exporter? Does the light look right if you use a standard BasicEffect? If it doesn't, then perhaps you should post your shader code here so we can have a look.

As for the self-shadowing artifacts, that's just your standard shadowmap biasing issues. You could probably fix this particular issue by adding or subtracting a small value (0.0001 or so) to the depth value retrieved from the shadowmap texture. Biasing is a very tricky subject...it's very dependent on how your scene is setup. For a more adaptable solution you can look into using slope-scaled depth bias, rendering backfaces-only into the shadowmap, or even adjusting your projection parameters.

Share this post


Link to post
Share on other sites
thank you!

Quote:
Original post by MJP
It does look like your normals are screwed up. Are you using the standard Model Importer/Exporter? Does the light look right if you use a standard BasicEffect? If it doesn't, then perhaps you should post your shader code here so we can have a look.


well for this model i use the SkinnedModel Pipeline importer from the XNA-tutorials. i will try it with BasicEffect only.

Quote:

As for the self-shadowing artifacts, that's just your standard shadowmap biasing issues. You could probably fix this particular issue by adding or subtracting a small value (0.0001 or so) to the depth value retrieved from the shadowmap texture. Biasing is a very tricky subject...it's very dependent on how your scene is setup. For a more adaptable solution you can look into using slope-scaled depth bias, rendering backfaces-only into the shadowmap, or even adjusting your projection parameters.


that backface-only solution sounds great! i'll try that one! any pointers on how to render backfaces only? :-)

Share this post


Link to post
Share on other sites
ok, as for the backface rendering of the shadow-pass, i tried it with

graphicsDevice.RenderState.CullMode = CullMode.CullClockwiseFace;

instead of CullCounterClockwiseFace, but it didnt change anything.

Share this post


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

  • Advertisement