Andreas Goebel schrieb: > Hi, > > I use two-sided polygons (as I display no real objects but mathematical > ones like planes this makes sense) and use shadows on them. > > After upgrading to 2.8.2, this does no longer work. I get the correct > shadow on one side of a plane, but if the shadow should be on the other > side, I get strange artifacts but no shadow. > > Is there a setting to change the shadow to two-sided? Thanks for your help. > Hi,
I have now found out why that is. a) Backfaces are culled (via cull face) b) In case you look at a backface from front, changing the sign of the polygon offset produces artifacts (very strong artifacts). I have turned off those things, and now it works good for me. Should I refactor that in a way that the application programmer can choose the behaviour and submit that? Another thing: I have written a vertex and a fragment shader that work together in a way that allows the shadows to be rendered exactly in the ambient color. This means that shadowed surfaces look the same as surfaces that face away from the light. This gives a much more natural feeling, and you don´t get false shadows on the backs of polygons. I needed the vertex shader to get the correct ambient color, I think it is not possible to do this with a fragment shader alone. If someone is interested in those shaders, I can make them available here. Regards, Andreas _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

