LOD switching distance explained. . . (sort of)

More
20 years 1 month ago #18261 by Second Chance
For any modelers who didn't know this already:

The distance from the camera at which a model changes it's LOD varies according to the size of the model's collision hull. So a massive object like a base or a station, which can be seen for many kilometers, will take long distances to switch detail levels as you make you way towards it. But a small object, like a Star Wars fighter, will remain at the lowest LOD until you get relatively close to it. Then it will change up through the LODs very quickly, using very short distances.

The reason this is important is; when building small objects like fighters, it's basically a waste of time to build a medium LOD for your model. Since anything beyond a few meters will switch away from the high (read: not crappy looking) LOD, your best bet is to use the high LOD model for the high and medium posistions. Otherwise, you'll rarely (if ever) get close enough to actually see the nice high LOD model you spent so much time making. I first spotted this when I looked at some of Major Tom's SW mod screenshots. Even though he's pretty close to the other ships when he snapped the shots, I noticed that they were already at medium detail level and looking crappy. And that really annoyed me. You should still be seeing the full detail model at those distances, not watching the ship pop in and out of medium and high detail. That's probably one reason why things like cargo pods don't use LODs. But since ships are too polygonally complex to forego the LOD system, I now use a copy of the high LOD model in both the high and medium LOD positions. Which looks much better.

And don't worry about the drastic switch from high to low LOD. By the time you reach the low LOD switch distance the model is so tiny you can barely see it anyway. You won't notice the switch unless you're really looking for it.

As always, you'll have to be the judge as to when your object is small enough to apply this method.

I hope this saves someone a little time and aggrevation while modeling.

mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.

Please Log in or Create an account to join the conversation.

More
20 years 1 month ago #11777 by MajorTom
Glad you've done some work on this.

I had mentioned in a couple of posts (or was it emails?), that I suspected the LOD switching is done at distances proportional to the size of the model. Have you been able measure the actual distance/size relationship? I think it would be important for us to really know the size relationship because of the questions below:

I think one can safely assume the game creates and stores a model for each LOD?
If so, what effects on memory and preformance, would it have if you use a copy of the High LOD for the the medium LOD on a "little" ship ? I think the preformance hit would be nelegable because the switching distances are so close together as you explained above. However, more memory would be used for an identical copy of the high detailed LOD that the engine then uses to render the mid LOD?

If, on a larger model you use a copy of the high detailed LOD for the medium LOD it would probably have a negative effect on preformance too, because the medium LOD does require less resources than the high detailed LOD?



Iwar2 Multiplayer Fan Site

Please Log in or Create an account to join the conversation.

More
20 years 4 weeks ago #11783 by Second Chance
I thought maybe it had something to do with this entry in flux.ini
Code:
[FcDetailSwitchNode] global_detail_scale = 0.7 cull_detail = 0.002 box_detail = 0.004
But who knows.

As for large ships; you really wouldn't use this technique. The LOD system was designed with big ships in mind, so it works perfectly well for them. EoC never intended to have important ships as tiny as the SW ones, so I just had to improvise in order to improve the visual quality.

However, more memory would be used for an identical copy of the high detailed LOD that the engine then uses to render the mid LOD?

This is true. But the frequency with which this is done, combined with the small difference between high and medium detail makes it, to me, not that big of a deal.

Given the permanent limit of 800 polys per mesh, but the ever increasing performance of computers; I think this actually becomes less of a problem as time goes on. And the stock EoC ships are pretty low detail to begin with.

Now that I think of it, it's really the texture sizes that do the most damage. And since the textures are Mip-mapped and assigned independently of the models, the poly count becomes even less of an issue.

mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.

Please Log in or Create an account to join the conversation.

More
20 years 4 weeks ago #11789 by MajorTom

Originally posted by Second Chance

I thought maybe it had something to do with this entry in flux.ini

Code:
[FcDetailSwitchNode] global_detail_scale = 0.7 cull_detail = 0.002 box_detail = 0.004
But who knows.


That could well be, and the values do sound about right, based on observations when the X-Wing sFoils animate.

We'll need to do some testing soon.

Bummer, Since it is a config value in flux we won't be able to manipulate it for each ship specifically. As we also have some very big ships in the SW mod, your option to copy the high detail LOD for LOD1, is probably the only way to go (for the little ships).



Iwar2 Multiplayer Fan Site

Please Log in or Create an account to join the conversation.

More
20 years 4 weeks ago #11792 by Second Chance
Yeah, just doing it on a per-ship basis is the simplest way I think. Although I'd like to see some test results on that flux entry, because I think flux switches the LODs a little too early anyway (probably owing to the really nice ship models but low computing power of the time EoC came out.)

I also want to point out something I forgot to mention before: The poly count for models may be permanently limited, but the texture sizes are up for grabs. Literally, anything goes. Flux will accept textures of virtually any shape or size. So modelers have to keep this in mind when generating final texture maps. As it's very easy to go overboard. Interestingly though, when the first several SW models were put into the mod for testing, I had inadvertantly used these huge 1024 pixel textures and no one complained about slow-downs when the models would come on-screen. I guess that's just the awsome power of mip-mapping :D.

Which brings me to another modding, but not modeling, point. Remember modders, when you place raw IFF textures into mods, they aren't mip-mapped. That texture takes up the same amount of memory when viewed from any distance, so don't make them too big. And if anyone knows if it's possible to embed mip-maps into the IFF texture format, now would be a good time to speak up.

mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.

Please Log in or Create an account to join the conversation.

More
20 years 4 weeks ago #11793 by GrandpaTrout
Hi SecondChance,
Forgive me for being totally ignorant. How are mip maps created? Or, should I say, how do we translate the IFF into these faster/smaller mip-maps? Does this happen normally when you run through the PS texture converter?



-Gtrout

Please Log in or Create an account to join the conversation.