Jump to content
  • Advertisement
Sign in to follow this  
procgen

OpenGL 3D texture mipmapping.

This topic is 2709 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 create mipmap textures which shrink only in width and height.

1024x1024x4
512x512x4
256x256x4
etc.

glGenerateMipmap and glTexParameteri with GL_GENERATE_MIPMAP seem to shrink all dimensions for each mipmap level. This doesn't look good at all. I tried generating my own mipmaps by creating the downscaled versions myself and uploading them through glTexImage3D. This doesn't work. I'm basically wondering if it should work? Also, some general insight into how strict OpenGL is with the 3D mipmap dimensions would be helpful. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
It's a very convenient method of interpolating between multiple 2D textures. Imagine a grassy terrain, you don't want the same grass texture repeating over and over. It looks much better with many different textures of grass in different colors and configurations. If you have a 3D texture where each layer is a variety of "grass texture", then you can easily create variety by simply changing the depth texture coordinate throughout the terrain. The alternative to this is one big 2D texture where all the different grass textures are side-by-side, or multiple 2D textures bound to different texture units. These methods work as well, but they are not as elegant, in my opinion.

Share this post


Link to post
Share on other sites
By definition, when you have mipmapping, each side gets smaller by HALF until all sides reaches 1.
For a 3D texture, it will be 1x1x1.
What you are asking for is not supported by hardware.

You have to have several 2D textures and you do the blending between them yourself or
using GL_TEXTURE_2D_ARRAY and you dothe blending between them yourself. The advantage of GL_TEXTURE_2D_ARRAY is that you only need to bind the texture once.

http://www.opengl.org/wiki/Array_Textures

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!