Game Development Community

LODs - a few questions

by Alex Rice · in Game Design and Creative Issues · 06/04/2005 (7:50 pm) · 4 replies

XSI has a rendermap feature where one can bake textures onto other polymesh, with a unique-UV texture projection, saved out as .jpg. Using this method is easy to produce realy nice looking textures on low-poly models. It would be easy to crank out say 4 or 5 LODs for a model.

Then I started thinking - wait isn't there a performance hit if every time LOD changes then the engine has to load a new texture image?

I started looking at Orbz (one of my fave TGE games) and was surprised they have no more than 2 LODs for any .dts and the LODs always share the same texture image(s). Also surprised to see a 128x64 texture in there.

1. What's the rule of thumb for LODs? No more than two or three per model?

2. If each LOD has it's own texture image, is that much of a performance hit for the engine or are all the textures loaded in ahead of time? XSI rendermap can also create 1 image and offset the textures for each LOD into cells or quadrants. In the TGE, would that worthwhile instead of say 3 separate .jpg textures for one model w/ LODs? It's still going to be the same number of pixels of texture images overall, just combined into one image instead of 3 or 4 images.

3. Aren't square texture files preferred because not all gfx cards support non-square texture files, e.g. 128x64? Not sure where I read that or how relevant it is. Maybe it was just that each dimension should be a power of two?

thanks in advance

#1
06/04/2005 (8:50 pm)
1. No real rule here; as few as possible, but as many as you need to not notice the "popping" when the engine decides to switch to a lower LOD.

2. Don't do different images for different LODs, I've never heard this being done.
Unless you need to have a ton of models on the screen at the same time you will probably want to use the highest LOD most of the time. Only when the model starts to get rather far away do you switch out to a lower LOD. Textures won't matter this much then as you probably want to use mip-mapping anyway (basically the same as lods, but for textures; the further away your model gets the smaller the texture gets). The texture won't be that particulary visible when the model only occupies 10 pixels on the screen anyway.

3. You only need power of two in each dimension (some older cards _may_ choke if the dimensions are extremely different though like 512x8 or so but those issues may have been resolved). As far as I can remember the last cards that had trouble with non square textures were the 3dfx voodoo ones =).
#2
06/04/2005 (9:05 pm)
Magnus- awesome thanks for the feedback.

About item 2. assuming I am going to rendermap my textures for each LOD. Or definitely for the highest LOD.

Here is an example texture for a hi-poly model

Here is an example texture for the lo-poly version of model Really that one should not be 512x512 it should be smaller.

But as you can see they are quite different because I'm using a unique UVs texture projection which results in a different layout.

What you are saying is if mip-mapping is turned on, and the lower LOD has basically the correct color scheme then it's going to look fine and doesn't need to have it's own separate texture map?
#3
06/04/2005 (9:18 pm)
I'm a max guy so I can't really say anything about XSI specifically but there's a "render to texture" option in max too that I use on occation. You generally DON'T want to use any automatic UV generation though, you should make all lods work with the same texture. As I said I have no idea how XSI works, but what I do in max is that I set up my UVs (the good old, painful, manual way. How to do this is an art in itself. =) on the highest LOD and then automatically decrease the poly count (with the "multires" modifier in max) for the lower lods. This keeps the same UVs (more or less) for the lower LODs so no need for a different texture. As the model of course have less polygons the UVs won't be perfect, but in most cases it will at least be "good enough". At the lower lods you won't see the texture too clearly anyway as the model will be small and far away.
#4
06/04/2005 (9:22 pm)
OK I got it. Thanks