| Poster | : aerochu | | Posts | : 1 | | Country | : USA | | City | : FC |
| | | | Posted by aerochu on 20/03/2007 at 12:24:48
| | | Having a slight problem with this whole project. It seems that the light shines both ways, so if we moved the light around, we can see it emanating both in front and behind. We're doing some shadow mapping on a piece of terrain that we're looking down upon, so we're moving the light around to see if all the shadows are being done correctly. But we're seeing what looks to be a mirror image of the light shining behind the light that we're casting shadows with, and have no idea why this is. Thoughts are that this has something to do with the pixel shader, but not having any luch fixing it. Ideas? | |
|
|
| |
| |
| Poster | : riemer | | Posts | : 1392 | | Country | : Belgium | | City | : Antwerp |
| | | | Posted by riemer on 21/03/2007 at 14:02:10
| | | I have solved this in another thread somewhere.. Yes, I know, I should definately add search functionality to the forum!!! | |
|
|
| |
| |
| Poster | : Anonymous | | Posts | : | | Country | : | | City | : |
| | | | Posted by Anonymous on 11/07/2007 at 23:45:11
| | This topic is kind of old but I couldn't find the answer for this anywhere for some reason.
I fixed it by adding something to check that the z value of ShadowMapSamplingPos was positive
like
if ((saturate(ProjectedTexCoords.x) == ProjectedTexCoords.x) && (saturate(ProjectedTexCoords.y) == ProjectedTexCoords.y))
I changed to
if ((saturate(ProjectedTexCoords.x) == ProjectedTexCoords.x) && (saturate(ProjectedTexCoords.y) == ProjectedTexCoords.y) && ShadowMapSamplingPos.z > 0)
I don't exactly why its doing that exactly because projection matrices confuse me. But doesn't make any sense to look at the "screen space" coordinates of a point that is behind the projection. | |
|
|
| |
| |
| Poster | : Roy-t | | Posts | : 5 | | Country | : the Netherlands | | City | : Groningen |
| | | | Posted by Roy-t on 04/11/2007 at 14:55:58
| | This will make it work even after the preshader tutorial:
| if ((saturate(ProjectedTexCoords.x) == ProjectedTexCoords.x) && (saturate(ProjectedTexCoords.y) == ProjectedTexCoords.y) && PSIn.ShadowMapSamplingPos.z > 0) |
| |
|
|