Jump to content
  • Advertisement
Sign in to follow this  
sirob

How do I know which MIP level to use?

This topic is 5035 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

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!