3D Texture?

Does Three.js support GL 3D textures? As in, something that somehow maps to the following in GL:

glGenTextures(1, &texname);
glBindTexture(GL_TEXTURE_3D, texname);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT);
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB8, WIDTH, HEIGHT, DEPTH, 0, GL_RGB, 
             GL_UNSIGNED_BYTE, texels);

Author: Fantashit

2 thoughts on “3D Texture?

  1. As of WebGL version 2, WebGL has 3D textures. Is three.js expanding to support new features in WebGL 2?

  2. 3D textures as well as the unsigned short type would be a great feature which is probably not difficult to implement. I absolutely vote for it! 🙂

Comments are closed.