Has anyone ever tried to use a 3D texture?

Started by
6 comments, last by Eber Kain 18 years, 5 months ago
With the opengl system, glBegin(GL_TEXTURE_3D); Im thinking about attempting a small 3d tileable texture as the atmosphere layer of a planet. The planet will be about fullscreen size, and no bigger. Im thinking about a 16x16x16 texture, but I cannot find any good article on this type of application. For instace, how does OpenGL render the depth of the texture, or is it more like a multilayer texture on a flat surface? If its an actual volume, is the depth centered on the poly? or is the poly surface the back of the 3d texture? How does it work on curved surfaces? Anyone tried any experements that can offer some advice?
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
Advertisement
It definitely isn't rendered as a volume. See here for some volumetric visualisation techniques.

For what I think you want you could just have some concentric spheres with different (2d) texture maps.
first of all, it's glBindTexture(GL_TEXTURE_3D, texture). glBegin doesn't allow textures. second of all, a prediction: performance will suck without anything less than a 6800 GT, and even then will only suck a little.
As your leader, I encourage you from time to time, and always in a respectful manner, to question my logic. If you're unconvinced that a particular plan of action I've decided is the wisest, tell me so, but allow me to convince you and I promise you right here and now, no subject will ever be taboo. Except, of course, the subject that was just under discussion. The price you pay for bringing up either my Chinese or American heritage as a negative is - I collect your f***ing head.
Quote:Original post by anist
first of all, it's glBindTexture(GL_TEXTURE_3D, texture). glBegin doesn't allow textures. second of all, a prediction: performance will suck without anything less than a 6800 GT, and even then will only suck a little.


Sorry for the typo man, ment to say glEnable(GL_TEXTURE_3D);

So you have tried 3D textures before? All im going to be rendering is one planet, a starfield and the interface. 16x16x16 is nothing memory wist compared to the 2048x1024 planet maps im going to be using.

www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
Quote:Original post by Eber Kain
So you have tried 3D textures before? All im going to be rendering is one planet, a starfield and the interface. 16x16x16 is nothing memory wist compared to the 2048x1024 planet maps im going to be using.

Go for it. It's absolutely not true that 3D textures are slow. The problem is that many people are using them wrong. But if done correctly (ie. accessing them in a cache friendly way, or using very small ones like yours), they exhibit performance very similar to standard 2D textures on modern hardware. Even on older hardware (GF4 style), performance is acceptable if you keep the resolution in reasonable limits (<= 256³).

On really old hardware (GF3 and below), performance will be pretty bad though.
IDefinitely agree with Yann,
expanding further:

3d textures dont get rendered a volometric visualsiations as mentioned eariler.

Instead think of just geting Texture Interpoation in 3 dimentions, excellent for something like multiple frame animations, or representing a area of light that attenuation.

You can only make flat polygons, but the texture data is interpolated on all 3 axis, and produces the appearance of a 2d slice though the 3d texture data mapped to the flat polygon.

I hope that clears the subject up.

hope I that was coherent enough to help. Im rather tired at the moment...
"I seek knowledge and to help those who also seek it"
another thumbs up for 3d textures from me, very easy to set up + use.
i use a 64x64x64 sized one for 2d(animated) + 3d noise + its plenty fast
Quote:Original post by Xero-X2
You can only make flat polygons, but the texture data is interpolated on all 3 axis, and produces the appearance of a 2d slice though the 3d texture data mapped to the flat polygon.



Now that makes sense, why couldn't one of the dozen sites I read on 3d textures have said that.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.

This topic is closed to new replies.

Advertisement