Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

VanKurt

TextureUnits

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

I want to texture my landscape using multitexturing. So I''ve got two texture levels: 1) The "lower" textures for the terrain (256 of them) 2) One "upper" texture for the detail-map (only 1) My question: Can I bind all "lower" textures to one TextureUnit, or do I have to create 256 TextureUnits (One for each of them) ? I hope you can help me to understand multitexturing a little better... thx VanKurt

Share this post


Link to post
Share on other sites
Advertisement
You cant create new texture units, you can only work within what your card supports. Most cards only support 2 texture units, so thats how many you should aim for.

Youll have to bind each of the different textures to the first texture init, and put the detail map on the 2nd one.

-----------------------
0wn 0wn 0wn your goat
gently down the pw33n

Share this post


Link to post
Share on other sites
Ok, first of all: Thank you !
But I''ve got another question:

How do I bind the textures before I draw my Quad ? Using single-texturing this is easy:

glBindTexture(GL_TEXTURE_2D, tex1);

But how does this look, if use multitexturing ? Like this:

glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, tex1);

glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, tex2);

?????????????????????????????????????????????

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
*push
;-)

Share this post


Link to post
Share on other sites
quote:
But how does this look, if use multitexturing ? Like this:

glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, tex1);

glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, tex2);

?????????????????????????????????????????????


Yep. And during your terrain rendering, you won''t have to bind any other textures to GL_TEXTURE1_ARB anymore because you use the same detail texture for each tile.

Share this post


Link to post
Share on other sites

  • 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!