开发者

What does GL_TEXTURE_3D mean?

As I know the texture is just an image (absolutely 2D), so why d开发者_StackOverflow中文版o we have GL_TEXTURE_3D? What does it mean? and usage?


A texture is not absolutely 2d. Most of the time it is 2d but you can also have 1d textures (a line) and 3d textures (a volume). A 3D texture is accessed using three texture coordinates. You can use it when your 3d model can be clipped by a plane. Then instead of seeing the other side of the object (the object is hollow), you can use a 3d texture to make a solid object and view what the plane clipped. So for example, if you model a cell phone and you cut it in half, instead of seeing the backside, you can see the circuitry inside.


Textures in OpenGL can be 1D, 2D, or 3D. 3D textures are, AFAIK, not that much used by games, but more by things like scientific visualization applications. E.g. you have a dataset with 3D coordinates (x,y,z) and some value (v). Then you can upload the dataset (or more likely, a reduced size version of it due to memory constraints) to the GPU and visualize it in some way (e.g. creating a 2D slice from a 3D texture is VERY fast compared to creating the 2D slice as a texture on the CPU and uploading it).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜