Jump to content
  • Advertisement
Sign in to follow this  
Manja

OpenGL Texture Mapping in OpenGL ES

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

Hello, I have the following two questions: 1. I was debugging an OpenGL ES application, I checked with glGetIntegerv(GL_MAX_TEXTURE_UNITS, &Num) and found out that the maximum texture units the GL supports is 2. But the application loads 10 textures at the start of the application and binds to different texture depending upon the scenario. How is this possible? 2. My understanding is that the texture coordinates range from 0 to 1, but the application sets the texture coordinates to -10 to 10, how is this supported? Can some one help me understand these concepts? Thanks manja

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
GL_MAX_TEXTURE_UNITS is the number of texture units that can be used at the same time (multi-texturing). The texture coordinates do range from 0-1, using -10 to 10 will make the texture tile.

Share this post


Link to post
Share on other sites
Thank you.

Does it mean the rest of the textures loaded by the application (using glTexImage2d) will reside at the client side and only two of the last bound textures will be in GL server. Then there will be quite a bit of data transfer between GL client and GL server each time a new texture is bound.

Please clarify if my understanding is correct.

And also can you please explain what is the difference between a texture map and a texture tile.

Thanks
Manja

Share this post


Link to post
Share on other sites
Quote:
Original post by Manja
Does it mean the rest of the textures loaded by the application (using glTexImage2d) will reside at the client side and only two of the last bound textures will be in GL server. Then there will be quite a bit of data transfer between GL client and GL server each time a new texture is bound.

Please clarify if my understanding is correct.
No, that is just the maximum amount of textures that can be active at any one time. So you can only have two textures bound at the same time (texunit0 and texunit1). There can be as many textures as you can fit into the video memory. I'm not exactly sure how OpenGL ES and mobile devices work, but if I had to guess I would say they just have general memory that is shared between everything (again, I'm not too knowledgeable about mobile devices so that's just a guess). If it is like on PCs where there is system ram and separate video ram, then it is the driver's responsibility to page the texture data in and out of video ram when it deems it necessary.
Quote:
Original post by Manja
And also can you please explain what is the difference between a texture map and a texture tile.
A texture map is usually just a texture. What the AP means by it being tiled is that if texture coordinates go out of the range of [0, 1] then by default they are repeated (ie: range of [1,2] is equivalent to [0,1]). This behavior depends on the current wrap mode, which can also be set to clamp the values to the range [0,1] in which case anything outside will be clamped to either 1 or 0. There are also different ways of clamping, such as clamping to the edge or clamping to the border.

Hmm... I hope that was somewhat understandable.

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!