Page 1 of 1

The Low Down on LODs

PostPosted: Sun Jul 26, 2009 7:23 pm
by coder0xff
I've determined the exact and accurate description of how LODs are computed. First, I'll just say what it is... and then I'll explain. LOD is 100 divided by the number of pixels spanned by one unit (vertically) at a distance equal to the model origin's distance...

K, so WTF does that mean, right? Most importantly, it means that LOD is NOT dependent upon the model size, and IS dependent on screen resolution and the FOV.

Here's an example: You make a model of an upright cylinder that's one unit tall. At a certain distance, the cylinder will appear to be 5 pixels tall in game. Hence, one vertical unit is 5 pixels tall - at this specific distance. So this distance would have a LOD of 20 (100 / 5).

Now, of course, if you increase your screen resolution (or lower FOV), then the number of pixels at the same distance is going to be greater - which means the LOD has changed, too. Now that it's, say, 10 pixels tall, the LOD is 10 (100 / 10). You are going to see greater detail LODs used at further distance with a higher resolution. This way you won't have high res renders of low polygon models.

Hope someone finds this useful. I've always wanted to know exactly how it's done.

Re: The Low Down on LODs

PostPosted: Sun Jul 26, 2009 8:18 pm
by joe_rogers_11155
interesting...but can you define LOD for me?

Re: The Low Down on LODs

PostPosted: Tue Jul 28, 2009 7:12 am
by johnmagicson
LOD stands for Level of Detail. It's when a model changes to lower poly models when you're farther away from them.

Re: The Low Down on LODs

PostPosted: Tue Jul 28, 2009 7:14 am
by Lord Ned
I'm a tard and can't read.

Re: The Low Down on LODs

PostPosted: Tue Jul 28, 2009 10:04 am
by coder0xff
Lord Ned wrote:I'm a tard and can't read.


???

Re: The Low Down on LODs

PostPosted: Tue Jul 28, 2009 11:04 am
by Carbon14
Useful info, I was just looking into LOD's today as well! After I realized Source seems to be pretty much pants on head retarded and wont let you use normal maps on vertex shadowed props I started looking at adding detail that I would usually put in the normal map onto the actual model and using LOD's to keep performance ok.

Re: The Low Down on LODs

PostPosted: Tue Jul 28, 2009 11:04 am
by joe_rogers_11155
I think he meant...

"I'm a tard and can't read." -joe

Re: The Low Down on LODs

PostPosted: Tue Jul 28, 2009 11:24 am
by The Wanderer
Nice read, i was always under the impression it was handled trough the drawdistance radius; so between not drawing and up close, it would make it's own cuts as to when to transfer to a lower/higher poly version.
Sad to see i was wrong :cry: , glad to know how it's actually done :D

Re: The Low Down on LODs

PostPosted: Tue Jul 28, 2009 2:06 pm
by destructo
nice system, smarter than drawdistance alone. slightly off-topic (but useful if this is a lod info thread), when making lods for custom trees/bushes, any idea if billboards are supported for distant lods?

Re: The Low Down on LODs

PostPosted: Tue Jul 28, 2009 4:11 pm
by vcool
Any model can have a LOD, destructo.

Re: The Low Down on LODs

PostPosted: Tue Jul 28, 2009 4:57 pm
by coder0xff
Destructo, you mean going from a 3d representation of a tree to a completely 2D one, correct? I would have to say no, but I'm not an expert on that.

Re: The Low Down on LODs

PostPosted: Tue Jul 28, 2009 5:12 pm
by Zipfinator
coder0xff wrote:Destructo, you mean going from a 3d representation of a tree to a completely 2D one, correct? I would have to say no, but I'm not an expert on that.


Well technically you could do that, but you couldn't make it act like a sprite only when it's in that LOD. Would be better to use say 3 intersecting planes. A LOD like that would probably be for a few thousand units away though.

Re: The Low Down on LODs

PostPosted: Tue Jul 28, 2009 5:31 pm
by destructo
right, 3 plane lod it is then. i've got a set of overgrowth in an old bf2 map that i might bring to hammer, a lot lower poly than the hl2 trees (<1k polys, smaller textures)- http://poe1.pointofexistence.com/poe/ne ... ape_02.jpg

Re: The Low Down on LODs

PostPosted: Wed Jul 29, 2009 4:22 pm
by Lord Ned
coder0xff wrote:
Lord Ned wrote:I'm a tard and can't read.


???


I edited the post. Orginally I said "Why can't it be based on distance" and then I realized it was retarded, and went and re-read the post and understood it. :p