Jump to content
  • Advertisement
Sign in to follow this  

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

This topic is 3272 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!