Skip to main content
gamedev.net
🔒 Locked

TextureUnits

Started by VanKurt Dec 30, 2001 at 4:36 AM 3 replies 200+ views
Original Post
VanKurt
VanKurt
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
Maximus
Maximus
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
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack
VanKurt
VanKurt
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);

?????????????????????????????????????????????
Scarab0
Scarab0
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.
Dirk =[Scarab]= Gerrits

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.