Only your terrain have texture and for your trees - function call texture2D(baseTexture, gl_TexCoord[0].st) return black (0,0,0,1). Your trees have per-vertex color attribute, and your ground dont(?) (i dont know to what value it defaults). Simplest options to fix this - set 1x1 white texture to your trees or add color array to ground (with black color values) and use texture2D(baseTexture, gl_TexCoord[0].st) + gl_Color, or write different shaders (one version with texture, one without). If gl_Color defaults to black without color array, you can use vec4 color = texture2D(baseTexture, gl_TexCoord[0].st) + gl_Color; without any changes.
30.01.2012, 17:30, "Ethan Fahy" <[email protected]>: > I should have mentioned before that only the red channel is of any > importance; There is a viewer further down the pipeline that picks up the red > channel values from the framebuffer so the green and blue channels don't > matter at all. I just set the green and blue channels to the red channel in > case I ever want to use a different viewer and see things in grey-scale. > > I tried to do a bit of research on GLSL texture binding but am very confused > by it and not sure what I could change about my shader to fix binding issues. > > I tried using this line: > > Code: > vec4 color = texture2D(baseTexture, gl_TexCoord[0].st) + gl_Color; > > thinking that by adding the texture color to the tree colors I might get the > correct result. This actually makes me see both the terrain texture and the > tree colors. This may then be the correct solution, but I'm not sure if it > is really doing what I think it's doing... > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=45118#45118 > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

