Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Mipmaps and GL_TEXTURE_3D
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mipmaps and GL_TEXTURE_3D



I just wanted to report back in case anybody else has this problem and is scanning the list: I wrote a test and yes -- amazingly -- it seems that if I perform the mipmapping reduction myself, and submit each level manually, I can mipmap a 3D texture without a reduction of the R dimension. Woo hoo!

email@hidden
    "the electrodes of progress on the nipples of ignorance"
        -- Dr. Rick Solomon


On Aug 15, 2006, at 12:10 PM, Peter CK wrote:

You can specify each level of mipmap manually as opposed to letting
OpenGL build it for you. Generate 3 separate 3D textures with your
desired dimensions and specify the mipmap level for each of them in
your call to glTexImage3D (the 'level' parameter). You will have to
put the effort into creating your own mipmap images though. The Red
book has a good example of this in its section on mipmaps (p390 I
think).

Question... I've never used 3D textures for mapping terrain before. So
is this an alternate method from using multiple textures? How does
this work exactly?

Peter Kameo

PS: I dig your screenshots ;)


On 8/14/06, Shamyl Zakariya <email@hidden> wrote:
I've implemented a terrain texturing algorithm described in the
chapter in the Orange Book about RealWorldz, where a 3d texture has
its z-component set by looking up a value from an 8-bit altitude/
gradient map. The code works, but for mipmapping...

The problem is that the Z axis of my 3d texture, when mipmapped,
collapses from ( in my case 4 to 1 ) levels by the second level of
mipmap reduction.

E.g., if my 3D texture's 512x512x4, the reduction looks like:

0) 512x512x4
1) 256x256x2
2) 128x128x1

I know that this just is how mipmapping works, and I accept that, but
the results are hideous! You can't see any texture variations in my
terrain for anything beyond a short distance from the camera.
Obviously, when bringing the camera close, it looks like what I want.
Here's a couple screenshots to demonstrate my point:

With mipmaps disabled: http://zakariya.net/shamyl/Screenshots/
Screenshots-2006-08-12-14.png
With mipmaps enabled: http://zakariya.net/shamyl/Screenshots/
Screenshots-2006-08-12-15.png

You can clearly see different textures when mipmaps are disabled, but
I get the ugly aliasing effects which mipmaps are designed to avoid
in the first place, so that's unacceptable. And when mipmaps are
enabled, I see the muddy mixture of my four original textures.

My question is if there's a way to bias mipmap generation for 3d
textures such that the reduction would look like so:

0) 512x512x4
1) 256x256x4
2) 128x128x4

E.g., reduction along S & T, but not R.

Is there any way to do this?

I know I can simply drop 3d textures and use GLSL to look up from 4
distinct 2D textures, but the 3D texture approach is so nice, clean,
and most importantly scalable. Not to mention that the color plates
in the Orange Book didn't seem to have the ugly artifacting that I'm
seeing.

Thanks,


email@hidden "fodder for aggressive meta-lampoonery" -- From a review on a mediocre episode of _The Simpsons_


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Mac-opengl mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Mipmaps and GL_TEXTURE_3D (From: Shamyl Zakariya <email@hidden>)
 >Re: Mipmaps and GL_TEXTURE_3D (From: "Peter CK" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.