Tricky question avec Texture LOD

Started by
5 comments, last by zimerman 17 years, 11 months ago
Hi :) I have LODs on my models, and my artist told me he planed to create different size of the texture for the model. I told him that opengl do a Mipmaping anyway, but i'm not sure about the performances. I know that each time you make glBindTexture it have to move it into the VRAM, so bigger the texture is, more GPU time you take. So if my far LOD have a smaller texture, it can be faster at rendering, or there is no diff? I'm a little confused about this. Thank you!
Advertisement
Yes, OpenGL does mipmapping for you with gluBuild2DMipmaps. You can do it by yourself as well, using glTexImage2D, but I don't think there's much benefit.

The performance might increase if there are alot of texture reads. You might save some memory as well, since it only needs to keep the smaller texture in graphics card memory when it's far away.
Quote:Original post by James Trotter
The performance might increase if there are alot of texture reads. You might save some memory as well, since it only needs to keep the smaller texture in graphics card memory when it's far away.


No, thats not really how it works.

A texture will maintain all the image data in memory, its the section of the texture data it samples which changes. The reason it helps performance is the smaller texture data fits into the texture cache better thus the hardware has to touch memory less, which when compared to the cache is very slow.
Ok thanks, so in clear :

I have to do what the artist told me : making a different texture for different LOD of the models?

Anyway I will make hard test on it :P
Quote:Original post by James Trotter
You can do it by yourself as well, using glTexImage2D, but I don't think there's much benefit.
The standard approach in commercial PC titles nowadays is to generate the mipmaps offline, have an artist touch them up by hand, and then store the entire thing into a single DDS file.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Quote:Original post by Promit
Quote:Original post by James Trotter
You can do it by yourself as well, using glTexImage2D, but I don't think there's much benefit.
The standard approach in commercial PC titles nowadays is to generate the mipmaps offline, have an artist touch them up by hand, and then store the entire thing into a single DDS file.


Ah, I didn't know.

And thanks phantom for correcting that.
You might also use the GL_SGIS_generate_mipmap extension, which should provide automatic mipmap generation...

This topic is closed to new replies.

Advertisement