3d textures

Can someone explain to me 3d textures? How are they better than 2d. Do they slow things down alot? How much harder are they to use? Do most games use them?

they are the same, just in 3d. a 3d array of texels wich you access with 3d texture coordinates to sample colour values out of it.

same as 1d, and 2d textures.

they are often used as lookuptables, for examle for dynamic lighting, distance attentuation and similar stuff…

but there is not really a difference if i wanted to texture map an object?

no. its just a 3d array of pixels where you cut out the part you specify by your coordinates (you cut out a triangle wich get mapped onto your triangle).

just as for 2d textures, where you have a 2d array of pixels.

but be aware that 3d textures use much memory if they get big!

It’s usefull for lightmapping.

Instead of using 2 texture units, you use only one.

With a 2d texture and lightmapping, you need :

  • 1 texture unit for the X, Y coord.
  • 1 texture unit for Z

With a 3D Texture, with only one, it’s enough and the result is the same.

Originally posted by Leyder Dylan:
[b]It’s usefull for lightmapping.

Instead of using 2 texture units, you use only one.

With a 2d texture and lightmapping, you need :

  • 1 texture unit for the X, Y coord.
  • 1 texture unit for Z

With a 3D Texture, with only one, it’s enough and the result is the same.[/b]

If we forget that one need 10 times more memory…

Really ? I didn’t know that where have you grab this information ?

Originally posted by Leyder Dylan:
Really ? I didn’t know that where have you grab this information ?

Duh!? If a grayscale 64x64 2D texture takes 4KB, then a 64x64x64 3D texture takes 256KB. Which is 64 times more. The main reason you would want to use a 3D texture for attenuation mapping is because it allows you to encode arbitrary attenuation functions, which is not possible with a 2D/1D combo.

– Tom

Oups, damned, to the future, I need to close my mouth …