Hi,
I have a simple shader that attempts a texture fetch in the vertex shader
uniform sampler2D baseTexture;
uniform vec3 terrainOrigin;
uniform vec3 terrainScaleDown;
uniform vec2 altitudeRange;
varying vec4 texColor;
float greyscale(vec3 rgbColor)
{
return dot(vec3(0.2125,0.7154,0.0721),rgbColor);
}
void main(void)
{
vec2 texcoord = gl_Vertex.xy - terrainOrigin.xy;
texcoord.x *= terrainScaleDown.x;
texcoord.y *= terrainScaleDown.y;
vec4 position;
position.x = gl_Vertex.x;
position.y = gl_Vertex.y;
texColor = texture2D(baseTexture, texcoord);
position.z = mix(altitudeRange.x,altitudeRange.y,greyscale(texColor.rgb));
position.w = 1.0;
gl_Position = gl_ModelViewProjectionMatrix * position;
}
and the frag shader:
varying vec4 texColor;
void main(void)
{
gl_FragColor = texColor;
}
This runs great and as expected(~100 fps) on my nvidia 8600 (macbook pro) however on my RHEL_5 linux workstation which has dual nvidia quadro 4500’s the app becomes non-interactive (<1 fps)???Is there anything here that would cause such a slow down? I think that the texture look up in the vertex shader is the only “non-standard” thing I am doing. I looked at the specs and vertex shader texture access should be supported in the 4500’s but this seems like the problem…Am I missing something?
biv