Texture access in vertex shader on quadro 4500

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

Older Nvidia chips (your Quadro would belong to them) only suppert RGBA 32-bit floating-point textures in vertex shaders. Could it be that use a “normal” texture?

Ahhhhhh!!! I think this is it exactly. I’m using a generic file/image reader API that handles reading/creating/managing of the texture/image data so I’m sure it’s just unsigned char data…Wow. Thanks for the help here. I’ll give this a shot but I definitely think this is the problem.
:wink:

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.