From b871ae5cf7b69ca69eab024ce0ae006f0bb6f0ba Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 5 Jul 2006 13:18:00 +0000 Subject: [PATCH] Added vertex program hack to get round apparent NVidia bug when handling vertex texture read. --- examples/osgshaderterrain/osgshaderterrain.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/osgshaderterrain/osgshaderterrain.cpp b/examples/osgshaderterrain/osgshaderterrain.cpp index 8c215ffa6..482b23447 100644 --- a/examples/osgshaderterrain/osgshaderterrain.cpp +++ b/examples/osgshaderterrain/osgshaderterrain.cpp @@ -579,7 +579,8 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int /*numTreesToCreates* " vec4 position;\n" " position.x = gl_Vertex.x;\n" " position.y = gl_Vertex.y;\n" - " position.z = texture2D(terrainTexture, texcoord).r;\n" + " float zscale = 0.99;\n" + " position.z = texture2D(terrainTexture, texcoord).r * zscale;\n" " \n" " gl_Position = gl_ModelViewProjectionMatrix * position;\n" " gl_FrontColor = vec4(1.0,1.0,1.0,1.0);\n"