Dependent texture reads and nVidia

Hi, I have a newbe question, I think. I’m trying to do dependent texturing, like reading a value from a 3Dtexture and use this value as texture coordinate for a 1Dtexture. Like a color look-up table.

The program is simple:

uniform sampler1D Colormap;
uniform sampler3D IndexTexture;

void main(void)
{
vec4 index = texture3D(IndexTexture, gl_TexCoord[0]);
gl_FragColor = texture1D(Colormap, index[0]);
}

The problem is that it doesn’t work on my nVidia 5700 card. If I program it using GL_ARB_FRAGMENT_PROGRAM or CG it works.

Is it true that the nVidia driver compiles the GLSlang program to CG before compiling it to GPU-code?

If so, how does the driver know which CG profile to use?

With the last version of CG the cgc (command-line compiler) can compile GLSlang programs. If I do not specify a CG profile I get an error message, if I use profile supporting dependent texture reads, like fp30 or fp40 the programs compile into correct GPU asm code.

Any idea, anyone?

General question about GLSlang: Is there a notion of profiles, like in CG, to distinguish between different GPU hardware?

I’m running on Linux and have the latest driver (6629).

Have you set the samplers to different texture units using glUniform1iARB? Initially all samples are bound to texture unit 0 so you’ll need to bind them to the appropriate texture units before rendering anything that uses that shader.

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