osgShadow::StandardShadowMap has a straightforward GLSL implementation of standard OpenGL lighting.
On 6/23/2011 1:24 PM, Jeremy Moles wrote: > I'm looking to collect some sample code from OSG users (if this code is > shareable) for some basic lighting examples done purely in GLSL. If > anyone is willing to share this (I can certainly adapt it, so there's no > need to modify it), I'd be grateful. > > What I'm looking for mainly is how lighting code from source like the > Orange Book are different/adapted to OSG. I've begun to compile OSG > without support for the FFP, and I'm trying to work up a basic default > set of shaders to emulate the FFP functionality. > > I'm very close, but I'm having trouble figuring out how exactly to > caclulate the eye coordinate in my vertex shader when using osgViewer. > Right now I'm using: > > eyePos = vec3(osg_ModelViewMatrix * gl_Vertex); > > ...but this starts to fall out of whack as I use the standard > TracballManipulator. It works, of course, when in the home() position > (and with a new ViewMatrix for the default camera with Y-up). > > Thanks! > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Peter Amstutz Senior Software Engineer Technology Solutions Experts Natick, MA 02131 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

