Jump to content
  • Advertisement
Sign in to follow this  
LordKraken

Help about glMultiTexCoord

This topic is 4248 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 all, I'm going into multitexturing now, and I'm told that I have to use glMultiTexCoord for that. It is quite easy to use, but I'm still wondering about the 2 last parameters. For example, let say I have: glBegin(GL_QUADS); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 0.0); glVertex3f(-FloorSize, 0.0, -FloorSize); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.5, 0.0); glVertex3f(FloorSize, 0.0, -FloorSize); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0, 1.0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.5, 0.5); glVertex3f(FloorSize, 0.0, FloorSize); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0, 1.0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0, 0.5); glVertex3f(-FloorSize, 0.0, FloorSize); glEnd(); Does that mean that all my uv coordinates will be scale from [0,1] to [0,0.5]? Now, let say I have a simple square surface. I want a standard (wood) texture on it on the first layer, and a second, smaller texture to simulate lighting on the second layer. Is it possible to use the code above to render this scene? Or did I miss something? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
It's coordinates and wont scale anything. The coords 0,0 is the lower left corner of the picture and 1,1 is the upper right corner of the picture. Therefor 0.5,0.5 is the half picture. So specifiying 0.5 coords will cut the image/texture in half, not scale it.
If you want to scale the texture you have to modify the texture matrix by first changing to texture matrix mode; glMatrixMode(GL_TEXTURE) and then scale it by glScalef().

Share this post


Link to post
Share on other sites
Well in fact, I did make a very stupid mistake, coz by replacing 0.5 by 2, I got my effect achieved. But you're right, using a texture matrix is more efficient and logical.

Thanks for your help :)

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!