Sign in to follow this  
sirSolarius

Switching between levels of detail

Recommended Posts

Let's say I have textures of differing resolutions and vertex data of varying complexity. I understand how to calculate LOD, but how do I perform efficient transfers between LOD levels? With respect to my textures, how can I "fade" the high-res texture in without it looking cheesy? With respect to my vertex data, if it's stored in a VBO, is there any way to interpolate between LOD levels?

Share this post


Link to post
Share on other sites
Morphing the vertexes can be easily done in the vertex shader. Each vertex contains its position and its hypothetical position in the next lower LOD. Then you pass a LERP value to the shader as a constant and interpolate between the two positions.

The drawback to blending between LODS like this is that you are actually drawing the higher LOD so you lose some of the advantage of using LOD.

Share this post


Link to post
Share on other sites
hi sirSolarius,


1. the best way determining which mesh to use when doing LOD is calculating
the actual/direct projection size on the projection plane; this will give
you best results, because you are using the actual size, not an arbitrary
assumed size calculated on vertices...

2. depending on what mesh you will choose (determined by step [1]) you
will be also required to swap the necessary textures in: a distinct texture
resolution is bound to a distinct mesh-LOD (e.g. you want use a hires
texture for the mesh-LOD in it's smallest position)

3. yes, it's still possible to interpolate between different animation stages
even if your data is stored in VBO (or similar), but you have to do some
buffer mappings - done this once you will be able to act with the vertex
data as if it were stored in local AGP memory in sysmem.


If you have any further question, don't hesitate to ask !

Share this post


Link to post
Share on other sites
Thanks for the replies!

Can anyone point me to a good article about calculating LOD using projected size? That sounds like a great way to go, but I don't know too much about the projection matrix.

I'm also not sure I understand point 3... I don't have a firm grasp of vertex shaders, but how would I go about doing this?

Share this post


Link to post
Share on other sites

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