Multimodale-Visualisierung
3D Texturdaten
Ist ein Texturobjekt erzeugt und gebunden worden, so wird der Datenblock der gebundenen Textur geladen wie folgt:
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glTexImage3D(GL_TEXTURE_3D, // 3D texture
0, // level 0 (for mipmapping)
GL_LUMINANCE, // pixel format of texture
width,height,depth, // texture size
0, // border size 0
GL_LUMINANCE, // pixel format of data supplied
GL_UNSIGNED_BYTE, // pixel storage type of data supplied
volume); // pointer to data chunk
glTexImage3D(GL_TEXTURE_3D, // 3D texture
0, // level 0 (for mipmapping)
GL_LUMINANCE, // pixel format of texture
width,height,depth, // texture size
0, // border size 0
GL_LUMINANCE, // pixel format of data supplied
GL_UNSIGNED_BYTE, // pixel storage type of data supplied
volume); // pointer to data chunk
pixel format | components |
---|---|
GL_LUMINANCE | 1 |
GL_RGB | 3 |
GL_RGBA | 4 |
GL_ALPHA | 1 |
GL_LUMINANCE_ALPHA | 2 |
Die Größe einer Textur muss eine 2er-Potenz sein!