Sign in to follow this  

Formula for calculating different L.O.D levels?

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
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 LODs
lodStep = 10 # completely arbitrary. Will depend entirely on the scale you're using
lodCoefficient = 0.5
lodBoundary = lodStep
lods = []
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[i]:
return i
return len(lods) - 1

Share this post


Link to post
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 ).

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this