Sign in to follow this  

texture parameters giving me grief

Recommended Posts

Hi, i have a problem with texture parameters, i have some geometry where i want to run a vertex shader and a fragment shader, each having their own texture parameter. My problem is that the parameter for the vertex shader apparently "overshadows" or destroys the parameter for fragment shader. I'm running on a Geforce 6800 ultra. This is the code that screws me. When i hardcode the values i would get from the texture in the vertex shader, it all works just fine. The 3 commented lines are the parameters that screws me. Any help is appreciated, i can't find sh*t on it on the web or anywhere else... glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glPushMatrix(); cgGLEnableProfile(cgFragmentProfile); cgGLEnableProfile(CG_PROFILE_VP40); cgGLBindProgram(lightingFragmentProgram); cgGLBindProgram(vertexPositionProgram); cgGLSetTextureParameter(lightingTextureParam, rt[0]->GetTextureID()); cgGLEnableTextureParameter(lightingTextureParam); cgGLSetParameter3fv(cgGetNamedParameter(lightingVertexProgram, "eyePosition"), eyePosition); // cgGLSetTextureParameter(vertexPositionParam, vertices->GetTextureID()); // cgGLEnableTextureParameter(vertexPositionParam); maxS = rt[1 - currentTexture]->GetMaxS(); maxT = rt[1 - currentTexture]->GetMaxT(); glBegin(GL_TRIANGLES); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, 1.0, 0.0, 0.0); //tangent glNormal3f(0.0, 0.0, 1.0); //normal glMultiTexCoord2fARB(GL_TEXTURE2_ARB, 0.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 0.0f); glVertex3f(-1, -1, 0); glMultiTexCoord2fARB(GL_TEXTURE2_ARB, 1.0f/256.0f, 0.0); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 0.0f); glVertex3f(1, -1, 0); glMultiTexCoord2fARB(GL_TEXTURE2_ARB, 2.0f/256.0f, 0.0); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 1.0f); glVertex3f(1, 1, 0); glEnd(); // cgGLDisableTextureParameter(vertexPositionParam); cgGLDisableProfile(CG_PROFILE_VP40); cgGLDisableTextureParameter(lightingTextureParam); cgGLDisableProfile(cgFragmentProfile); glPopMatrix();

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this