Mapmodel LODs?


(No1_sonuk) #1

Is there a way I can make a mapmodel with 3 LODs?

I need to make an invasion beach obstacle called a “hedgehog” or “dragon’s teeth” that could do with at least 2 LODs, preferably 3, because we’re going to be using a lot of them in a large area.

Rough estimates put the poly counts at 250 for the “in your face” model, down to 17 (or less) at a distance.

I know ET already has a hedgehog model, but our mapper doesn’t like it.


(No1_sonuk) #2

Surely someone knows.

BUMP!


(No1_sonuk) #3

Since I’m talking to myself, I guess no one wants to know this:

How to use Level of Detal (LOD) models in ET

Thanks to Digibob of splashdamage for the heads-up on this.

LOD models are lower-poly models that replace high-poly ones as you move away from them. The idea is to cut down the number of drawn polygons when you have a lot of models in view, and/or you’re too far away to see details.

This is the naming format for LoD models in Q3 engine games:
modelname.md3 for the high-poly model
modelname_1.md3 for the first lod level
modelname_2.md3 for the second

To make the LOD system work in ET is very simple.

  1. Create your 3 models, named using the above system, all in the same directory.
  2. Place a misc_gamemodel in your map using modelname.md3
  3. Compile the map
  4. Pak the files, including the modelname_1.md3 and modelname_2.md3 files and distribute

The engine detects the presence of LOD models and uses them automatically.

So, for our beach hedgehog model, the model files are (poly count in parentheses)
pop_hedgehog.md3 (262) High detail - This is the model you’ll see when you’re hiding behind it, trying to avoid the MG fire.
pop_hedgehog_1.md3 (118) Medium detail - This is the model you’ll see when you look at hedgehogs a little way away that you hope you can reach while the MGs are reloading.
pop_hedgehog_2.md3 (24) Low detail - This is the one you’ll see from long distance, while you’re raining MG fire down on the Allies.

Note that it has to be a misc_gamemodel, NOT a misc_model. Models placed as misc_model entities are compiled into the BSP and therefore can’t change to a different model as you move away.


(chavo_one) #4

Thanks for sharing that valuable information sonuk! I for one wanted to know the answer to this one. I didn’t want you to have to carry on a conversation by yourself, but any post I would have made would have been a waste of everyone’s time. (sort of like this one I guess) :slight_smile:


(No1_sonuk) #5

You’re welcome.

I just edited it to make the filenames stand out a bit more.

As a test for the distances, I used LOD models that were a completely different shape. It helps to determine the change distances so you can determine how much detail to take out for the LODs.


(sock) #6

Very good thread, even thou its a one person conversation! :wink:

Added to top sticky thread : http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=1710

Sock
:moo:


(dime1622) #7

yeah, i had a quick convo w/ digibob today that solved everything. SD guys are the best!


(jah) #8

very cool tip. Didn’t even knew what mapmodel LOD’s were :s

dime1622 wrote:
SD guys are the best!

very true. i truly don’t believe that any other game has so much support from it’s developers as ET have. thank the lord aleluia for splash damage! :smiley:


(Jaquboss) #9

Will this work with game models (guns, items ) too?
I think it will , but I´m not sure…


(nUllSkillZ) #10

Hmm, just came to my mind:
Could this be used for terrain?


(carnage) #11

there is something similar, i read it on gensurf site

if you make your terain out of curve patches then they used different numbers of pollys depending on the distance, but obviously eatch poly would require a curve patch adn they draw at least 1 poly so you dont gain anything performance wise but it makes your terain look sweet, but if you were to say make fueldump with curve patches you could 10 times the number of brushes and hit very low fps


(thegnat) #12

I think it can.
But keep in mind, that maybe other objects can appear to float in the air, when the lowest LOD is active.
That was a really annoying “feature” of Project:IGI 2, that supports really huge terrains and handles LOD like a flight-simulation.


(SCDS_reyalP) #13

It would be interesting to see how much dynamic LOD on models helps FPS in various situations.

And FWIW, patch meshes also have dynamic LOD, if you don’t compile with -patchmeta. I’m not sure if there is an entity key or shader option you can use to control this on a per-patch basis.


(No1_sonuk) #14

It would be interesting to see how much dynamic LOD on models helps FPS in various situations.

We’ll be able to test it when our Omaha beach map is finalised.
We have a large number of those hedgehogs on the beach, so we can easily disable the LOD by removing the additional model files, and gauge the performance change.


(Shaderman) #15

Old thread - new post :smiley:

I thought about this LOD feature the last days but it seems to be worthless for me as long as players are able to bypass your LOD work with r_lodbias and/or r_lodscale. As long as these cvars can be modified (independent of any server restriction). I don’t see where it would be useful then - or did I miss something?


(No1_sonuk) #16

(independent of any server restriction). I don’t see where it would be useful then - or did I miss something?

The idea of it is to prevent your video card from working too hard. It’s not meant to be used for creating a situation that can be exploited. Reducing the polycount of models at a distance is designed to improve your video performance because your graphics card has less to draw for objects that are too far away for you to see the detail. If you choose to disable the LOD system, any degredation in FPS/performance is your own fault! :smiley:

My Czech Hedgehog model is a good example. When you’re up close, you need to see the detail, so the 262 poly model is needed. But when it’s the equivalent of 200 yards away, you can’t see the details like the notches, etc., so the 24 poly version is enough for you to see the general shape. It also means that seeing 10 of them at a distance has roughly the same polygon-processing impact as 1 up close.


(Shaderman) #17

Thanks for your fast answer.

But isn’t this exactly what players do? I think the majority of players do everything to get more FPS by chaning cvars like these.

Let’s say you have a map with open terrain and not much possibilities to block vis. Think of Radar without fog clipping for example. Let’s say the Axis forward hut would have more details than some bed models and so on (maybe something like 3000 tris). You can’t do any good vis blocking with this open building but you still would have full tris if you are near the side entrance for example and don’t see any detail inside this hut.
My idea is to “convert” such a building from brushwork to LOD gamemodels with clipped walls and beds and so on. If an Axis player spawns in this hut, he would have all the details drawn. Moving away from the hut would result in lower detail (tris) because only the walls of the hut need to be shown with maybe 300 tris.
I’d like to see (force) that even a player with lowest LOD activated would spawn in the hut and has to see all those nice details I spent lots of hours for instead of bumping clip brushes for things he doesn’t see :slight_smile:


(No1_sonuk) #18

As a mapper, you have to make a choice - Use LODs and someone might exploit it, or don’t use LODs and put up with the performance hit. Tweakers will screw up your fancy work anyway, so why bother worrying about them?

IMO, you shouldn’t use misc_gamemodels for map geometry anyway. Our primary use for them is for the large numbers of beach obstacles on our Omaha map.