How do I set these up? From reading the NVIDIA GPU Programming Guide the only texture formats able to be used are R32F and A32FB32FG32FR32F, which I presume correspond to FLOAT_R_NV and FLOAT_RGBA_NV (or FLOAT_R32_NV and FLOAT_RGBA32_NV maybe?) respectively in OpenGL. The NV_float_buffer extension says “… FLOAT_R_NV, FLOAT_RG_NV, FLOAT_RGB_NV, and FLOAT_RGBA_NV are known as floating-point textures. Floating-point textures are only supported for the TEXTURE_RECTANGLE_NV target.” So I need to do e.g.
glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0, GL_FLOAT_RGBA_NV, 2, 2, 0, GL_RGBA, GL_FLOAT, (const GLvoid *)pNodeTex);
to create my texture (plus the other standard texture setup code)? Then I should be able to access it in my vertex shader? At the moment I’ve got something like
uniform sampler2D tex;
void main()
{
vec4 disp = texture2D(tex, gl_Vertex.xy);
gl_Position = ftransform();
}
where I’m using the vertex position to index the texture. This is just a do-nothing line at the moment to get texture access working. My info log gives me:
‘error C1115: unable to find compatible overloaded function “tex2D”’
‘error C1016: expression type incompatible with function return type’
Am I doing something obviously wrong that would cause this to happen? Forgetting to set anything up? I am providing the texture to the shader correctly AFAIK. E.g. I can take the same line and put it in the fragment shader and all works fine (with a plain TEXTURE_2D format - this is my first time messing with float textures). My texture at this stage is a simple 2x2 GLfloat texture that I just wanted to use to displace a quad’s vertices to get a feeling for vertex textures. Do I have to have a particular floating point color buffer to get this to work maybe? The NVSDK simple vertex texture demo doesn’t AFAIK. It uses GLUT_RGB. I’m using NeHe base code.
I’m embarrassed to say I’m using 65.62 drivers that have appeared on the net in the last couple of days, and I was under the impression that 65 series would support vertex textures in GLSL. Card is a 6800GT.
Thanks in advance.