Menu

#29 Support for cube maps

open
nobody
None
3
2011-07-06
2011-07-06
No

Would be nice to have built-in GLTexutre. 6 images define a single cube map:

glGenTextures(1, &cmap_obj); // Make texture object
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, cmap_obj); // Make it a cubemap
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, 0, GL_RGBA, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data_px); // postive x
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, 0, GL_RGBA, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data_nx); // negative x
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, 0, GL_RGBA, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data_py); // postive y
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, 0, GL_RGBA, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data_ny); // negative y
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, 0, GL_RGBA, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data_pz); // positive z
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, 0, GL_RGBA, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data_nz); // negative z
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Set far filtering mode
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // Set near filtering mode

Maybe for GLGraphics 2?

Discussion

  • Andres Colubri

    Andres Colubri - 2011-07-06
    • priority: 5 --> 3
     
  • Andres Colubri

    Andres Colubri - 2011-07-06

    this discussion could be useful as well:

    https://forum.processing.org/topic/cube-map

     
  • Andres Colubri

    Andres Colubri - 2011-10-02

    After 1.0

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.