Ok, I understand what a 1D and a 2D texture is. But what exactly is a 3d texture? how would I as an artist make one? What would programmers do with it after I did make one?
Just curious as some of the programmers working on our in house engine just came and asked me if they needed to support 3d textures. I wasn't sure since I don't know exactly what they are. Best I can imagine is a 3d colour cube or something similar.
rube
Replies
edit: did you ask the programmer what he meant by "3d texture" ?
I've found a lot of the time when programmers talk to artists they use different words to describe the same thing (usually the artist use what they commonly understand by a certain term, whereas programmers tend to use the actual description which often sounds completely different even if it's the same thing!)
My head hurts after reading that:poly142:....
http://en.wikipedia.org/wiki/Voxel
3D textures are primarily used in procedural effects like "Perlin Marble" or "Terrible Wood Shader" as found in your favorite rendering package. They're handy if you don't want to unwrap your UVs because you can use your vertex positions as texture coordinates directly (x,y,z -> u,v,w). If you picture the stack of 2D textures as a solid volume of voxels, this would be like putting your model in the volume and every point on the model's surface samples what voxel its touching.
People use 3D textures for other, more programmery things as well. They're handy in some cases because they filter and mipmap across all 3 axes. DirectX 10 also has a concept of a "Texture Stack", in which each layer is mipmapped individually.
http://ericchadwick.com/img/gmts_styles.html
Used it for color-correcting the final rendered frame, in real-time. You can do this and much much more, any color filtering you can do in Photoshop, you can do with a colorcube (levels, curves, solarize, grayscale, inversions, etc).
We also did volume textures for atmospheric effects, like smoke in a light beam.
Except for those now SM4 2d stacks that were mentioned. Which are just regular 2d textures in a big pack, so that you can easily pass many 2d textures to a shader, and not have to pass many 2d textures individually.
A benefit of regular 3d textures is that you get interpolation between slices in all dimensions. Which is why they are used for effects mostly where you want some sort of smooth gradients over 3d dimension. Eric's colorcube is an excellent example for that type of use.
For procedural stuff in real-time one mostly uses a combo of multiple low-res 3d textures to mix a hi-res noise. As storing hi-res noise would be too costly. And on-the-fly generating "noise" isn't trivial and less effecient on gpu.
When doing sprite animation one could also pack them as 3d textures and get interpolation between slices for "free".
The main use of 3d textures is in science however. I am working a lot with 3d textures of medical data on "volume rendering". Either generating surfaces from it (nasal cavities)
http://isgwww.cs.uni-magdeburg.de/cv/pub/files/Vis2008_Krueger.png
more details here, I am the second author to that paper responsible for the tech, which was my diploma thesis
http://isgwww.cs.uni-magdeburg.de/cv/pub/files/Vis2008_Krueger.pdf
Or colorizing the density values in the volume to be meaningful (coronary vessels to prevent heart attacks)
http://crazybutcher.cottages.polycount.com/wip/vesselvis/preintfine.jpg
Other uses in science next to CT/MRT data could be velocity vectors in 3d as result of simulations. Think aerodynamics.
Thanks for sharing this info!