Sign in to follow this  
sirob

How do I know which MIP level to use?

Recommended Posts

This sounds like a silly question, but I havn't the slightest clue which MIP level to use at what view distance. I'm drawing my terrain with 0.2f x 0.2f quads, each using up an entire 512x512 texture (at the moment). So, which MIP level do I use at what view distance? Is there some formula or something?

Share this post


Link to post
Share on other sites
Yes there is a formula based upon the scale factor between the texture image and the size of the polygon to be textured. It is described in full on page 386 in the OpenGL Programming Guide (3rd edition, OpenGL v1.2) - It'll be in most OpenGL programming guides if you've got one. You could always let OpenGL automatically build texture mipmaps and do it all for you.

Share this post


Link to post
Share on other sites
I just don't know about any way to do this automatically in Dx.

Also, I've googled for it with no results. Got any good websites on the matter?

Share this post


Link to post
Share on other sites
DirectX (more precisely the hardware) handles it for you. Just enable mipmapping like this: Direct3DDevice->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); It's explained in detail in the SDK documentation.

Share this post


Link to post
Share on other sites
oh, wow, I had now idea I could do this.

I was manually using texture->SetLOD for that.

Thanks a lot :).

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