Jump to content
  • Advertisement
Sign in to follow this  

texture parameters giving me grief

This topic is 5124 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

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
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!