3D Textures

A 3D texture can be thought of as a volume of texels arranged in a 3D grid. To create a 3D texture, generate a texture object name and bind it initially to the GL_TEXTURE_3D target. Once bound, you may use glTexStorage3D() or glTexImage3D() to create the storage for the texture object. The 3D texture has not only a width and a height but also a depth. The maximum width and height of a 3D texture is the same as that of a 2D texture and may be found by retrieving the value of GL_MAX_TEXTURE_SIZE. The maximum depth of a 3D texture supported by your OpenGL implementation is found by retrieving the value of GL_MAX_3D_TEXTURE_SIZE, and this may be different than the maximum width and height of the texture.

3D textures are read in shaders ...

Get OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 4.3, Eighth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.