# Formula for calculating different L.O.D levels?

This topic is 4113 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi! Hopefully I havn't confused anyone with the topic, since it probably sounds more advanced than it really is. ;) What I need is the following: I have eight levels of detail, sorted as an integer value. The view space should be divided from the camera viewpoint to the farplane at these steps, i.e anything between step 2 and 3 has the same detail level. I've been trying to get this into a simple formula, similar to how int(somefloatvalue) return a whole number. I could probably solve it with a couple of "if larger than and smaller than", but cleary there must be a simplier, algorithmic, way ? :) Thankful for any help! /Robert

##### Share on other sites
I use a simple algorithm to determine where the LOD boundaries are. I don't know if it's the "standard" but it seems logical to me:

(python)
# determine LODslodStep = 10 # completely arbitrary. Will depend entirely on the scale you're usinglodCoefficient = 0.5lodBoundary = lodSteplods = []for i in range(8):    print lodBoundary    lods.append(lodBoundary)    lodStep *= lodCoefficient    lodBoundary += lodStep

Result:
10
15.0
17.5
18.75
19.375
19.6875
19.84375
19.921875

I would just put these values into an array and be done with it.

def findLod(distance):    for i in range(len(lods)):        if distance < lods:            return i    return len(lods) - 1

##### Share on other sites
Try this: If LOD i has ni polygons and it is displayed starting at a distance of di, and LOD i+1 has ni+1 polygons, then it should be displayed starting at a distance of di * sqrt( ni/ni+1 ).

1. 1
2. 2
JoeJ
17
3. 3
4. 4
5. 5
frob
11

• 13
• 16
• 13
• 20
• 13
• ### Forum Statistics

• Total Topics
632181
• Total Posts
3004623

×