Need mapper input on optimising a model.


Trp. Jed
01-22-2007, 08:18 AM
O.K. I finally finished my U-Boat model. Exhibit A one badle distored HLMV screenshot...



There's not deck or flak gun on it yet - I'll provide them as seperate models. Currently as you see it in the picture, it stands at a whopping 8878 polys so it's about the equvelent of 2 player models.

Now, the question...

Because of the size of the model, doing LOD levels for it is a bit of a problem. As LOD is calculated from the origin, from center to tip is a metric of about 100. However, if you're stood at the bow, the stern is 200 away so ideally you want that to have less detail as its so far away.

Because it's a single model and so large and LOD is origin based this is going to be a bit tricky so I need mapper input on the following options.

Option 1 - Don't bother with LOD
Argument is to not to do LOD levels for it. It's so large and dominates so much of the "room" it's in you'll be able to see pretty much all of it all the time anyway and the only time you wont see it you'll probably be in another room/corridor and it wont get draw at all.

Option 2 - Split it into multiple models
Leaving the hull as one model, split the conning tower, hull hatches and detailing off into seperate models. This will have their own origins and can therefore have their own LODs. However this will require multiple model entities placed at specific distances from each other to build up the uboat.

My main concern with option 2 is will having multiple models screw with the lighting in some way? And secondly, are there any potential problems with parts of the model dissapearing?

So yeah, I could do with some mapper feedback on how you think this beast would work best in terms of using LOD for performance.

DjBourgeoisie
01-22-2007, 08:20 AM
It would be a really good idea to chop this model into 3 sections, the main part of the sub in 2 chunks split down the middle where the waterline would be, then the finer details being the 3rd part or split those into 2 separate and set those to lod.

*edit* btw since water will make the engine draw the model twice, you could even not make a lower half and just delete that part completely so the sub doesnt have to be submerged at all. Just let the ld's know to use a non transparent water texture liket he moving plane one and clip the water off so its not accessible.

ultranew_b
01-22-2007, 08:23 AM
Great looking model !!

Option 1 - Don't bother with LOD. It dominates the room and would not be visible outside the sub area (in my case).

What are the dimensions of the model (in Hammer units)?

Did you leave a gap on the conning tower railing so that a ladder can be installed and players can get on the conning tower?


Any chance you could send it to me as it is, for fitting etc?

Looking at it, the area I created for my sub may not be large enough, this is why im asking.


:)

Trp. Jed
01-22-2007, 08:42 AM
Well it's built to scale so assume 1" = 1 hammer unit then it fits in a box 3012 x 276 x 550

Interesting - I had no idea transparent water made it draw the model twice...
Actually I'd have to butcher it to cut it in half along the waterline but the submerged part of the hull is about 1100 polys as is.

The original idea was to leave the hull as one piece which is 1100 polys as it makes up the bulk of the model. I was then thinking of giving the connig tower its own model and then splitting the details up into 5 "sectors" lengthwise each with its own origin. So in hammer you'd have 7 model entities - one for the hull, one for the tower then 5 more for the details along it's length.

DjBourgeoisie
01-22-2007, 08:57 AM
Yep, because of that you would be drawing 4 player models not 2. You seriously have to chop up the finer details and make them separate models and lod them, you will really limit the ld to how they place this in their maps otherwise. Best bet would be to lod one side of the subs details separate from the other assuming the entrances to the hangar will be from the subs sides and not front/rear. Since dods doesnt have swimming animations, players shouldnt ever be in the water anyways, so deleting the bottom half at the waterline would be really smart as I stated earlier. Its up to the ld to playerclip the water off however.

Trp. Jed
01-22-2007, 09:04 AM
OK well riddle me this. What if the sub was it two halves one to be placed above, on below the water line? I'd move the origins of these two slightly so they wouldnt sit on the actual waterline.

Would be a shame to force a mapper to use non-transparent water for it and I didn go to the effort of even painting caustic reflections on the lower hull surface! :D

What I'm thinking is if its two models, one with an origine above, one below the water line will Source still draw the model twice or only once per model as their either side of the surface?

DjBourgeoisie
01-22-2007, 09:14 AM
Originally posted by Trp. Jed
OK well riddle me this. What if the sub was it two halves one to be placed above, on below the water line? I'd move the origins of these two slightly so they wouldnt sit on the actual waterline.

Would be a shame to force a mapper to use non-transparent water for it and I didn go to the effort of even painting caustic reflections on the lower hull surface! :D

What I'm thinking is if its two models, one with an origine above, one below the water line will Source still draw the model twice or only once per model as their either side of the surface?

You could do that, and was actually my first suggestion instead of completely chopping off the bottom. Or you could compile 2 versions, one lower poly for those who are optimization freaks like me, and a higher poly version for people who just dont care hehe.

*edit* it will only draw the model twice if its actually touching the water.

Trp. Jed
01-22-2007, 09:18 AM
LOL. Well I want the model in maps at its full detail but obviously I don't want to murder performance.

So at this stage we're saying I definately need to make the top and bottom as seperate models with origins above and below the water line? Just one thing, with transparent water will that still make reflections and allow the bottom of the hull to be seen from above the water level?

Furyo
01-22-2007, 09:25 AM
Please make it three different parts, so people that would want a submarine wreckage on their maps can place either part of the model (with a new skin, without having 9000 polies to deal with

Origin won't have anything to do with the way water interacts with the object. Water starts dealing with props when their bounding box touches the water brush (or goes through it)

Trp. Jed
01-22-2007, 09:36 AM
So basically, if I split the hull or not it'll do a double draw anyway. Hmm ok. I may just submit (no pun intended) and make the hull just one model and just deal with the fact water will double draw it and then just put the top/bottom elements seperate where their bounding boxes one touch or cross the surface.

pedroleum
01-22-2007, 10:21 AM
first off, nice model, jed :)


second: from the hl2 map editing optimization page: (source (http://www.student.ru.nl/rvanhoorn/optimization.php?chapter=notices))

Make sure as few entities as possible touch the water. Any model that touches the water (but isn't completey in it) will be rendered twice: Once normally, and once with special water effects.

i'm confused about the part "but isn't completely in it". does that mean as soon as the model is completely in the water (no visible parts/bounding box outside the water) the model is only rendered once? if that would be the case, you could have the waterline defined and split the model exactly where the waterline is. but in my understanding, that would make reflections weird, because the water is moving slightly in height, so there would be a visible border in the water distortion, right?


other than that, a third option would be to use different lod on certain modelparts as written in the source wiki (http://developer.valvesoftware.com/wiki/LOD_Models)
under "Replacing or removing a specific mesh". you could set the part below water to a shorter distance than the one above or you could set the smallparts to a nearer distance than the whole hull.

i never tried that version of lod, so i don't know if it works...

*edit* i think that third option isn't really one :P same problem as with the full model.

anyway, i guess the parts are the best idea. i don't know if the lighting is an issue. it wasn't with my two pieced nebelwerfer...

Trp. Jed
01-22-2007, 12:00 PM
Well how to use LOD I know about (I wrote a large chunk of that wiki article) it's just whats best for mappers. I think the water split will be the big issue, but the stuff on deck and below the surface (like propellers, dive planes, etc.) aren't a big problem.

At the moment I'm leaning towards optimising the hull as a whole and just letting it sit in the water and just having to live with it getting drawn twice. Everything attached to it will either be in or out of the water and I'll do those as normal just divided up with their own origins and LOD levels.

Ultimately it'll men a handful of entities to build the uboat in your map but considering the size of the thing and how much area it covers I figure that's reasonable.

pedroleum
01-22-2007, 12:36 PM
Ultimately it'll men a handful of entities to build the uboat in your map but considering the size of the thing and how much area it covers I figure that's reasonable.

yes, i think that shouldn't be a problem. it's not quite the kind of model u use 10 times a day.

btw. are you going to do a skybox version of the thing?

ultranew_b
01-22-2007, 12:52 PM
I understand lods and all. I think its unneccesary to split it up. One model is fine.

Unless of course the Uboat is in the middle a giant outdoor canyon with long view distances. In most cases it would be in an enclosed "pen" so the sub would not be rendered outside of the "pen".

Trp. Jed
01-22-2007, 02:05 PM
Yeah ultra the issue is if say your stood at the bow, stuff down the stern is about 3000 hammer units away and getting drawn at full detail. Hence the point of this thread. The plan now is to split the model up so the hull is one big piece and stuff on the deck is seperate models with their own local origins and lod levels. As the stern elements have their own origin the LOD level choice is based on the centre of that, not the centre of the whole u-boat.

And yes, I'll make a 16th scale skybox version and after make a version of the tower all blown out for det maps.

pedroleum
01-22-2007, 03:13 PM
sweetness :)

JakeParlay
01-22-2007, 09:47 PM
oh, man. f-ing sweet! :yar:

McJewels
01-23-2007, 02:47 AM
Originally posted by Trp. Jed
And yes, I'll make a 16th scale skybox version and after make a version of the tower all blown out for det maps. [/B]

awesome model. but 1/8th is the scale they use for the skybox in dod.

Trp. Jed
01-25-2007, 05:24 PM
Just an update.

I've started the optimisation process and tested it with the help of GingerLord.

Some figures for the performance freaks.

Single model in water with LODs:
@ tower - 20376 primitives drawn.
@ bow - 18904 primitives drawn.
@ stern 18904 primitves drawn.

Split models, one in water others either above or below, all with LODs:
@ tower - 8984 primitives drawn.
@ bow - 6665 primitives drawn.
@ stern 6189 primitves drawn.

The above are for a map with transparent water.

pedroleum
01-26-2007, 02:11 AM
wow, thats amazing!
so it was a good idea. i didn't think it would make that much difference.

Trp. Jed
01-26-2007, 04:04 AM
Yeah the numbers will probably got up a little when I finish up addin all the parts but I think we're looking at a hit no worse than say there being 1 or 2 extra player models in the scene which is not bad considering it's size and the fact it's in water.

Mugsy told me that in some cases objects in water are rendered up to three times which probably attributes for the 20k+ primitives in the first test.

So certainly splitting up a model, LODing each part with its own origin and keeping pieces above or below the water line helps a LOT.

Day of Defeat Forum Archive created by Neil Jedrzejewski.

This in an partial archive of the old Day of Defeat forums orignally hosted by Valve Software LLC.
Material has been archived for the purpose of creating a knowledge base from messages posted between 2003 and 2008.