Jump to content
  • Advertisement
Sign in to follow this  
Gavinl

What exactly are 3d textures

This topic is 4368 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

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

Share this post


Link to post
Share on other sites
Advertisement
3D textures are useful for displaying volumetric information, like the density map generated by a CT scan.

Share this post


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

Share this post


Link to post
Share on other sites
You can use it to smoothly blend between two 2D textures, like a terrain with low sandy pits and grassy knolls.

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!