3D texture with color lookup in 1D texture [SOLVED]

Started by
-1 comments, last by mrr 14 years, 4 months ago
Solution to problem below was to use TIU0 and TIU2 not TIU0 and TIU1. I do not now why? Maybe a 3D texture needs more than one TIU? or I made some other error. Hello I want to use a 3D texture and perform color lookup in a 1D texture, but I get total black ??, tried following: // Fragment shader for 3D texture color lookup uniform sampler3D texture_3d; // Index texture (Luminance format) uniform sampler1D texture_col; // Color table lookup texture void main() { vec4 texel; vec4 color; texel = texture3D(texture_3d,gl_TexCoord[0].stp); color = texture1D(texture_col,texel.r); gl_FragColor = color; } I know the 3D texture is there because with the standard shaders I can see it, intersected by many quad planes. Also I know the frag shader is running, since if I do gl_FragColor = vec4(0.5,0.5,0.5,0.5); i see gray quad planes. I also bind the textures and associate the samplers to different TIUs every frame. What am i doing wrong? OK, it seems to be the sampling of the 3d texture that does not work..sampling the 1D texture works.. why not 3D ???? [Edited by - mrr on December 6, 2009 9:10:08 AM]

This topic is closed to new replies.

Advertisement