There are a couple different scenarios. If a surface is composed of triangles that all have a normal consistent with the winding order, but some of the triangles are facing the wrong way, then two-sided lighting will address the issue. That's why I asked the OP if he had tried this.
If your surface has normals that are not consistent with vertex winding order, then you might be able to fix this in a shader by flipping the normal only when the dot product is negative, but I've never tried this. I've always just called it a modeling bug. :-) On Thu, Mar 14, 2013 at 12:27 PM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC <shayne.tuel...@hill.af.mil> wrote: > If you enable two-sided lighting, the driver flips the lighting normals > so that the back side of the polygon is lit correctly. There should be > no need to do this in a shader (with OGL that supports fixed > functionality...). > > -----Original Message----- > From: osg-users-boun...@lists.openscenegraph.org > [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of > Christian Buchner > Sent: Thursday, March 14, 2013 10:46 AM > To: OpenSceneGraph Users > Subject: Re: [osg-users] [forum] Rendering backface like front face > > > The front and back material properties were set to same values, it's > just that when doing the calculations for the back side, the normal > vector is not pointing towards the light source but away from it. > > I only looked at this issue briefly, and concluded that it would take > some GLSL to fix it. > > Christian > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- Paul Martz Skew Matrix Software LLC
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org