Per axis filtering would be cool.
"Stephen J Baker" <[email protected]>
| Newsgroups | gmane.games.devel.opengl |
|---|---|
| Organization | Fat City Network Services, San Diego, California |
| Message-ID | <[email protected]> |
Something that's coming up more and more in our work with shaders is
that we're using textures as general lookup tables - and especially,
we find 3D textures vastly more useful than they were in the past.
However, nearly every non-traditional application trips up with the
problem of filtering.
For example: There are many cases where we'd like to pack multiple
small 2D maps into a single 3D map so that the shader can choose which
2D map to use on a pixel-by-pixel basis depending on some other criteria
without having to bind several dozen 2D maps at once. It's also a great
way to make a texture atlas without losing the ability to have maps that
wrap around.
What screws us for this (and many other) application of texture is
that MIPmapping (and other forms of filtering) have to be applied
uniformly in all axes of the texture. So as my 3D texture 'atlas'
drops down the MIP pyramid, I not only get (desirable) blurring between
the S,T axis texels - but also a blurring of two completely unrelated
maps caused by MIPmapping in the third dimension. Argh!
It would be spectacularly useful if you could choose to filter with
GL_LINEAR in (say) S,T - and use GL_NEAREST on the third axis.
Something like:
glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_S_EXT ) ;
glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST_T_EXT ) ;
...analogous to the way clamping is allowed independently in either axis.
It's really painful to fake this behavior - especially if you want MIPmapping.
For simple LINEAR and NEAREST filtering, it seems to me that existing hardware
might even be capable of doing this - if only the API had the hooks to turn it
on. Things are perhaps trickier for MIPmapping because the map sizes get
kinda strange.
So - if any IHV's or ARB members are listening...pretty please?
-----------------------------------------------------------------------
The second law of Frisbee throwing states: "Never precede any maneuver
by a comment more predictive than "Watch this!"...it turns out that
this also applies to writing Fragment Shaders.
-----------------------------------------------------------------------
Steve Baker (817)619-2657 (Vox/Vox-Mail)
L3Com/Link Simulation & Training (817)619-2466 (Fax)
Work: [email protected] http://www.link.com
Home: [email protected] http://www.sjbaker.org
-----
FAQ and OpenGL Resources at:
http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
--
Author: Stephen J Baker
INET: [email protected]
Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [email protected] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).