- Forums
- Forum Help
- Search Forum
- Login
- Register
Truevision3D
>>
TV3D SDK
>>
TV3D SDK 6.5
>>
Shader Development
(Moderators:
Waterman
,
Mithrandir_
,
beyonder
,
ZaPPZion
) >>
Shadowmapping and Backfaces?
Pages: [
1
]
« previous
next »
Print
Author
Topic: Shadowmapping and Backfaces? (Read 1768 times)
sybixsus
Customers
Community Member
Posts: 1339
Shadowmapping and Backfaces?
«
on:
May 03, 2008, 01:52:24 PM »
I'm still tweaking and improving my shadowmapping, and one issue I'd like to take care of is shadows affecting faces of the object which are facing away from the lightsource. Clearly these faces do not need to be in shadow, because they are already facing away from the lightsource, and so are not being lit in the first place. Allowing them to cast a shadow is just going to cause artifacts, which is not good.
What's the procedure to stop faces which face away from the lightsource from casting shadows? As always my maths theory is a bit sketchy, but I think I want the dot product of the light vector and the surface normal here? Again, I might be wrong, but I think I just need to determine if the dot product of the two vectors ( I believe it doesn't matter which way around the angles are in the dot product? ) is below zero. If it's above zero, allow it to cast a shadow, if it's below zero, don't allow it to cast a shadow. Is that correct?
Logged
Mietze
Community Member
Posts: 415
Pleeease, don't let it crash!
Re: Shadowmapping and Backfaces?
«
Reply #1 on:
May 04, 2008, 02:13:46 PM »
actually its a good idea to hide the front faces in your shadow maps. but this can increase the "surface acne" artefact when your shadow shader doesnt use a good depth bias. Try a
CullMode = CCW;
in your depth technique. Im not sure if CCW is correct, try CW instead if its not.
Logged
Check out my blog at
www.e-studioz.de
- The finest in gross trash
sybixsus
Customers
Community Member
Posts: 1339
Re: Shadowmapping and Backfaces?
«
Reply #2 on:
May 04, 2008, 07:01:59 PM »
Thanks for the reply. I'm not sure I understand you though. Why would I want to hide front faces? Front faces are the ones I *do* want shadows cast onto.
I already don't render backfaces in my depth pass, but that's not the issue here either. When I'm rendering the shadows, I'm not doing so from the light position, I'm doing so from the normal camera position, so the culling is done according to that camera.
Anyway, I went ahead with my idea to get the dot product of the light direction and the surface normal (multiplied by the world matrix to get it into world space) and see if it's above or below zero, and that seems to work.
You're right about surface "acne" being a problem with self-shadowing. I was surpised at just how large the depth bias needs to be to stop it, but I think I've got rid of the worst of that too.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Truevision3D Official Information
-----------------------------
=> Development Information
-----------------------------
TV3D SDK
-----------------------------
=> TV3D SDK 6.3
===> Bugs
-----------------------------
Game Development
-----------------------------
=> Game Development
-----------------------------
Projects
-----------------------------
=> In-Development
=> Showcase
=> Recruitment
=> Announcements
-----------------------------
Truevision3D Official Information
-----------------------------
=> News and Announcements
-----------------------------
TV3D SDK
-----------------------------
=> TV3D SDK 6.5
-----------------------------
Game Development
-----------------------------
=> Engine Comparison
-----------------------------
TV3D SDK
-----------------------------
===> Shader Development
===> Content Pipeline
===> Bugs
-----------------------------
Game Development
-----------------------------
=> Companion Tools
=> Design and Theory
Powered by SMF 1.1.3
|
SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks