How do I know which MIP level to use?

Started by
5 comments, last by sirob 19 years, 6 months ago
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?
Sirob Yes.» - status: Work-O-Rama.
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.
Sorry - thought this was irrelevant - I'm using DX :)
Sirob Yes.» - status: Work-O-Rama.
Well even if you are using dx, so what?
You wanted math & understanding on the matter didn't you?
_______________________________ ________ _____ ___ __ _`By offloading cognitive load to the computer, programmers are able to design more elegant systems' - Unununium OS regarding Python
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?
Sirob Yes.» - status: Work-O-Rama.
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.
oh, wow, I had now idea I could do this.

I was manually using texture->SetLOD for that.

Thanks a lot :).
Sirob Yes.» - status: Work-O-Rama.

This topic is closed to new replies.

Advertisement