PDA

View Full Version : texture sampling in vertex shader



diegor
12-27-2005, 05:02 AM
Hello everybody,

Does someone know why I get a linking error int this vertex shader?
How can I test if texture sampling at vertex processing is available?

uniform sampler1D VertexSampler;
varying vec4 interp_vertex_color;
void main()
{
gl_Position = ftransform();

interp_vertex_color = texture1D(VertexSampler,gl_MultiTexCoord0.x);
}

Thanks for any subsequent contribution!

Diego

sqrt[-1]
12-27-2005, 02:46 PM
Care to share what linking error you got? (look at the info log)

I was under the impression that in a vertex shader that only texture1DLod type calls were allowed. (Not having used vertex texturing, I have not looked into it too deeply)

Also be aware that hardware support only exists on Nvidia cards and you need to use float textures that are nearest filtered.
ftp://download.nvidia.com/developer/Papers/2004/Vertex_Textures/Vertex_Textures.pdf

Mars_999
12-29-2005, 02:59 AM
Dont' quote me but vertex textures need to be fp16 or fp32 images to work. Look on Nvidia's website for info on it...

Gong
12-29-2005, 07:06 PM
Vertex texture fetch only exists on NV40 and up.