Hi All !
So i’ve got a question about shadow maps.
I’ve done work with these before and tried to port some of my old shader code to TD.
Something is not working .
In order to render a shadow using shadow mapping the technique is as follows:
- render the depth of the scene from the point of view of the light source.
- render the scene from the point of view of the camera
- during this part - take each rendered pixel and transform it’s original xyz into the above “light perspective”
- using this resulting xyz look up the depth map.
- if the current depth value is less than that in the depth map draw the pixel lit - otherwise it is in shadow
I’m using my own shaders to create a shadow map - this may eventually evolve into a shadow cube map for point lights found in the scene - or to do soft shadows.
From what i understand “uShadowMapMatrix0” is a matrix provided by TD that will transform a current gl_Vertex into the light space (for the first light - in my case the only light) …
I’ve tried all this and there is still some weird transform happening …
Then i placed a camera in the same spot as the point light. In theory this should render a completely shadow free scene - not so … help !!!
I’m attaching a toe of what i’m talking about.
Thank you in advance!
A
testMyShadow.toe (15.1 KB)