Jump to content
  • Advertisement
Sign in to follow this  
Eber Kain

OpenGL Has anyone ever tried to use a 3D texture?

This topic is 4628 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!