Hi, im pretty new to GL, and im having trouble using dependant texture reads in a ARB_fragment_shader. i would imagine that my code should produce something, but currently it dosent produce any artifacts on the screen.
I have simplified my program to try and texture one polygon that is passed into the card with tex coords to carry out a lookup on a 3d texture, the result of this 3d texture read i want to use in another lookup for colouring.
The data i’m intrested in is encoded in the 3d textures red channel, from this i want the red channels value to be used in a 1D texture lookup to get a RGBA quadruple for the final fragment colour.
Im unsure if my shader code is incorrect, or the way i manipulate the ogl state?
Im using a GeForceFX card
TEX R0, fragment.texcoord, texture, 3D;
TEX result.color, R0.x, texture, 1D;
glClear(GL_COLOR_BUFFER_BIT); glEnable(GL_VERTEX_PROGRAM_ARB); glEnable(GL_FRAGMENT_PROGRAM_ARB); pglBindProgramARB(GL_VERTEX_PROGRAM_ARB, vrVertexShader); pglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, vrFragmentShader); glEnable(GL_TEXTURE_3D); glBindTexture(GL_TEXTURE_3D, texName); glEnable(GL_TEXTURE_1D); glBindTexture(GL_TEXTURE_1D, texName); glCallList(vrSliceGeometryList); glDisable(GL_VERTEX_PROGRAM_ARB); glDisable(GL_FRAGMENT_PROGRAM_ARB); glFlush ();
could it be the way i specify the texture, or have i done something wrong in the draw proc, or maybe the shader, or maybe my state is setup wrong ??
any help would be greatly appreciated!!