Deciding which LOD-level to draw

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
User avatar
Marc
Gremlin
Posts: 182
Joined: Tue Jan 25, 2005 7:56 am
Location: Germany
Contact:

Deciding which LOD-level to draw

Post by Marc »

Hi !

It looks as if Ogre uses just the distance to an object to decide which LOD-level of it gets drawn. Is there a way to change this to e.g. something proportional to the size of the bb of the object on the screen? E.g. if you zoom by changing the fov of the camera, the distance keeps the same but it would be better to use the LOD-level of a shorter distance. Otherwise you see the low-LOD-level quite large on the screen.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

You should just tweak the LOD distances based on the size of your object. Screen-space size would be possible, but it's derivable ahead of time so it's not worth the expense.
User avatar
Marc
Gremlin
Posts: 182
Joined: Tue Jan 25, 2005 7:56 am
Location: Germany
Contact:

Post by Marc »

sinbad wrote:You should just tweak the LOD distances based on the size of your object. Screen-space size would be possible, but it's derivable ahead of time so it's not worth the expense.
I meant you don't actually need to calculate the size of the object on the screen to do this. E.g. if I zoom by a factor of 10, the distance to the object could just get divided by 10 before the decision which LOD-detail to render is made. It's just an overhead of one multiplication per object.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Use Camera::setLodBias() to compensate if you like.
User avatar
Marc
Gremlin
Posts: 182
Joined: Tue Jan 25, 2005 7:56 am
Location: Germany
Contact:

Post by Marc »

sinbad wrote:Use Camera::setLodBias() to compensate if you like.
That's it! Thanks!
Post Reply