Mipmaps. Do they get used by Spring?

Mipmaps. Do they get used by Spring?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Mipmaps. Do they get used by Spring?

Post by Argh »

Simple question, but one I'm not really qualified to answer.

And, if the answer is "no", then... why not? This is a huge performance-enhancing area, and if we're going to make more extensive use of shaders in the future, then it's downright vital.

I know I saw a fairly large improvement in performance in NanoBlobs, when I went over to DDS. That's not even arguable. But, if the engine isn't using mipmaps, then I'm wasting fairly-significant amounts of texture RAM in my current game... and frankly, I think it's more important to fix this and make it work, than to avoid it, if we're going to use the Very Fancy Stuff that's coming, due to Trepan's work.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Hmm. The answer seems to be yes, they're loaded by Spring.

However, I don't see GL_NEAREST_MIPMAP_LINEAR in any of the rendering code, which (er, based on my very crappy understanding on this topic) is what actually applies this!
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Mipmaps aren't for improving performance, they're for improving the look of textures that are further away by reducing the number of texels per pixel and applying proper blurring. AFAIK mipmaps actually decrease performance and increase the memory footprint of a non-alpha texture by 1/3rd (not sure about alpha,we didn't have that in the CG course at uni).
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

I thought they improved performance, by lowering the size of the texture that was being wrapped around the model during a rendering pass...

At any rate, if Spring doesn't use them, and will not be using them, that's fine, but it means I should just take 'em out of all of the DDS files in my game (yay).
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

They also improve performance. Because the texels that are used are much closer together mipmaps improve the performance of the texture cache on the GPU.
But yeah they are used. Maybe search for GL_LINEAR_MIPMAP_LINEAR?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

jcnossen wrote:Maybe search for GL_LINEAR_MIPMAP_LINEAR?
Heh, now that you mention it I wonder how Spring would look if it used any NEAREST filters?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Almost the same ;)
increase the memory footprint of a non-alpha texture by 1/3rd (not sure about alpha,we didn't have that in the CG course at uni).
It doesn't really matter which format, its just math:

(1/4)^1+(1/4)^2+(1/4)^3+..+(1/4)^n...=1/3

Except for non-power-of-two textures, nvidia supports mipmapping on those and that increases the memory footprint with 1/2 i think.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

doesn't spring auto mip textures? It seems to do that in gundam on my uv mapped units.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

jcnossen wrote:Almost the same ;)
increase the memory footprint of a non-alpha texture by 1/3rd (not sure about alpha,we didn't have that in the CG course at uni).
It doesn't really matter which format, its just math:

(1/4)^1+(1/4)^2+(1/4)^3+..+(1/4)^n...=1/3

Except for non-power-of-two textures, nvidia supports mipmapping on those and that increases the memory footprint with 1/2 i think.
I wasn't sure about the alpha handling since the way it was explained to us was that it makes an 8-bit image of 2x*2y pixels with three quadrants being the color channels and the fourth the mipmaps (with each mipmap having three color quadrants and one quadrant for further mipmaps), that wouldn't fit into a square with alpha added so I wasn't sure if it won't leave some blank room like a filesystem would with its blocks.
Post Reply

Return to “Engine”