1D Textrue

my fragment shader is :

 uniform sampler2D Data;
 uniform sampler1D transfer;
 void main()
 {  
     gl_FragColor.rga = texture2D(Data,gl_TexCoord[0].st).rga;  
     gl_FragColor.b = texture1D(transfer,gl_TexCoord[1].s).b;
}

in my Render function:

        glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, Texture2D);
	glActiveTexture(GL_TEXTURE1);
	glBindTexture(GL_TEXTURE_1D, Texture1D);

	glBegin(GL_QUADS);
	glTexCoord2f(0.0, 0.0);
	glVertex3f(0.0, 0.0, 0.0);
	glTexCoord2f(0.0, 1.0);
	glVertex3f(5.0, 0.0, 0.0);
	glTexCoord2f(1.0, 1.0);
	glVertex3f(5.0, 5.0, 0.0);
	glTexCoord2f(1.0, 0.0);
	glVertex3f(0.0, 5.0, 0.0);
	glEnd();

But the quad is invisible. why?

I found my problem. I forgot to use glUniform1i()

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