07/06/2017

Research:

Some important tips about loading textures in shaders:

  • Remember to glDeleteTextures(1, &texId) in each cycle. Otherwise, it will cause memory overflow.
  • GLuint textureId must be initialized to different numbers, if there are 2 textures:
    • GLuint textureId[2];
      • It will load the second texture for BOTH textures, the first texture will disappear.
    • GLuint textureId[2] = {0,0};
      • It will load the second texture for BOTH textures, the first texture will disappear.
    • GLuint textureId[2] = {0,1};
      • Good! This is the correct way!
  • GL_PIXEL_UNPACK_BUFFER

Leave a Reply

Your email address will not be published. Required fields are marked *