View Full Version : About Mag and Min Filter
in openGL, we can use glTexParameter() to set the Mag or Min filter parameter, but in actural implementation, how does it work? For example, if i set Mag = Linear and Min = Nearest, when drawing a pixel, how do i need to do to detect which mode to use? Is the filter's unit a polygon or a pixel? Thx
04-26-2004, 03:27 AM
If you want the nitty gritty, read the spec (http://www.opengl.org/documentation/spec.html) . Go to the rasterization->texturing
section and you'll find more than you ever wanted to know.
I have read the spec but there are still few things that i don't understand. How do i need to do to calculate the value du/dx. If i don't have texture translation, u = kx. Could you give me an example to calculate the value?
Thank you very much.
04-28-2004, 10:17 AM
I think for such answers a look at the source code of Mesa will surely help :
04-29-2004, 07:00 AM
Graphics adapters draw each 2x2 pixel block in parallel to get the derivatives from neighboring pixels.
du/dx would then be proprotional (u from left pixels - u from right pixels)
du/dy = (v from upper pixel - u from lower pixels)
and the same for dv/dx etc.
it all boils down to know how much the texcoords are changing wrt screenspace and selecting your LOD accordingly.
05-05-2004, 06:25 AM
Whether the minification or magnification filter is used depends on whether lamba (the texture level of detail) is less than or greater than a threshold value. The threshold is either 0.0 or 0.5 depending on the minification filter setting (see the spec).
lambda is computed from the texture coordinate derivatives (ds/dx, ds/dy, dt/dx, dt/dy, etc). The derivatives are easily computed during triangle rasterization. You don't have to be concerned with that though.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.