What exactly are 3d textures

Started by
14 comments, last by Yann L 17 years, 6 months ago
Hi everyone, I'm just tryign to figure out what exactly is a 3d texture? I understand 2D and 1D, but how does a 3d texture look different from a 2D texture when mapped to an object, and when are 3d textures used? Thanks. Gavin
-------------------------------------Physics Labhttp://www.physics-lab.netC++ Labhttp://cpp.physics-lab.net
Advertisement
3D textures are useful for displaying volumetric information, like the density map generated by a CT scan.

3D textures aren't particularly useful for texturing objects.. As you point out you'd only see a 2D slice of it so you may as well use a 2D texture. One game-related use of 3D textures is you can store things like spherical light attenuation in one...
You can use it to smoothly blend between two 2D textures, like a terrain with low sandy pits and grassy knolls.
A 2D texture is a function of two variables, implemented as a two-dimensional look-up table with filtering: color = f(u, v).

A 3D texture is a function of three variables: color = f(u, v, w), implemented as a three-dimensional look-up table with filtering.

Typically, you use 3D textures as function look-ups; for example, noise functions for using in procedural shaders.

When trying to use 3D textures to blend between material layers, you have to be careful about MIP mapping, because the very first MIP map layer will blend two terrain types into one, and you won't get any cross-blending. I can't really recommend the method Boder suggests, because of this.
enum Bool { True, False, FileNotFound };
Quote:Original post by Boder
You can use it to smoothly blend between two 2D textures, like a terrain with low sandy pits and grassy knolls.


ooooo...Do you konw of any tutorials on this? I've been trying to figure out how to do this for my terrain.
-------------------------------------Physics Labhttp://www.physics-lab.netC++ Labhttp://cpp.physics-lab.net
Quote:Original post by Gavinl
Quote:Original post by Boder
You can use it to smoothly blend between two 2D textures, like a terrain with low sandy pits and grassy knolls.

ooooo...Do you konw of any tutorials on this? I've been trying to figure out how to do this for my terrain.

It's very rare to see 3D textures used for this. Most of the time, you'll use multitexturing to accomplish the same thing; a vertex parameter will be used in the pixel shader to blend between different bound textures. Googling for "terrain" and "multitexturing" will give you the details.
i use them for 3d noise eg for smoke
Ken Perlin has done some interesting things with 3D textures. Flip through the slideshow here to see some examples of potential real world applications for 3D textures.

EDIT: changed the link to start at the 3D textures portion of the talk.
the main advantage of 3d textures is more room for textures. e.g I use lightmaps, which means generating a texture for every polygon. This shouldn't be bounded again and again for drawing every polygon. therefore it is usefull to store mulitple textures in one. a 2 one can be used, but if this get to small, emply 3d to get more space

This topic is closed to new replies.

Advertisement