Hi. I've been thinking some more about my misplaced shadows, and I finally came to realize that the fragment shaders of the first pass (that fill G-buffers) produce fragments in Screen space, not in World space, and thus all G-buffers contain Screen space fragments. That's why shadow Screen space is applied to deferred Screen space as is, always facing the viewer. Does that mean that I should transform the final pass' gl_Vertex to shadow Screen space (shadow model view projection matrix) and pass it to the final pass' fragment shader to check against shadow map in the same shadow Screen space? Thanks.
2013/10/12 Marcel Pursche <marcel.purs...@student.hpi.uni-potsdam.de> > Hi, > > No shadow with 0,0,1 is a bug. I'm not sure where ist comes from. > The length in the shader was a test I forgot to revert this change. > -viewspacePosition.z shold be used instead in both cases. > 1000.0 is my far plane, i write the depth value unormalized [near, far]. > > Thank you! > > Cheers, > Marcel > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=56758#56758 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org