Hi,
I encountered a (I think really strange) problem:
I have a 512x512 GL_RGBA32F-texture containing vertex positions which should be rendered as points. I do that by setting up a VBO which contains tex coord of each texel and render them as points. In the vertex shader, I use the gl_Vertex.xy to access my texture and set the gl_Position to the texel value (see vertex shader code below). The Frag shader only sets a color to mark the pixel.
In another project, I got about 600 fps on an NVidia GTX260 when doing this, which seems rather good. Now for the strange part: I set up exactly the same thing in a new project and now I get only about 120 fps! Since I didn’t change anything in the shaders, I suspect that I set something up the wrong way. Are there some OpenGL states which could cause this extreme drop of frame rate?
I know this problem is rather unspecific, but I would appreciate any help or suggestions!
Best regards, Michael
#version 120
#extension GL_EXT_gpu_shader4 : enable
uniform sampler2D positionTex;
vec4 texel = vec4( 1.0);
void main(void) {
// read vertex position from texture
texel = texelFetch2D( positionTex, ivec2( gl_Vertex.xy), 0);
gl_Position = gl_ModelViewProjectionMatrix * vec4( texel.xy, 0.0, 1.0);
}
PS: It doesn’t matter if I use texelFetch2D or texture2D…