Hi All,

About six months ago the osgshderterrain used to work, creating the
hang gliding terrain via reading the heights from a 2D texture.
However, a driver update from NVidia broke the app, I presumed due to
texture format issues, but in playing with formats and the vertex
shader today I came across what can only be a bug in the NVidia GLSL
compile:

The original code was:

              "    position.z = texture2D(terrainTexture, texcoord).r;\n"

And didn't work with later drivers.  And just now I tried:

              "    float zscale = 0.99;\n"
              "    position.z = texture2D(terrainTexture, texcoord).r
* zscale;\n"

And suddenly it worked.  All values of zscale work except 1.0, so it
would seem the GLSL compiler is over optimizing the code.

This hack/fix is now checked in to CVS.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to