Results 1 to 1 of 1

Thread: GL_TEXTURE_CUBE_MAP min/mag filter problem

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2010
    Location
    SE
    Posts
    13

    GL_TEXTURE_CUBE_MAP min/mag filter problem

    Hello! I found it hard getting min/mag filtering to work with cubemap texture. In the screenshot-attachment I've created a cube using a cubemap texture, and also a grid of planes using a 2D texture. For both the cubemap and 2D texture I use GL_LINEAR_MIPMAP_LINEAR, for min-filter. For 2D texture it works, but for the cubemap it doesn't.

    Below, I've listed the code for how I set up my cubemap texture. I would be glad if someone could help me out with this, thanks in advance

    Code :
    levels = floor(log2(max(width, height))) + 1;
     
     
    glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
    glGenTextures(1, &id);
    glActiveTexture(textureUnit);
    glBindTexture(GL_TEXTURE_CUBE_MAP, id);
     
     
    glTexStorage2D(GL_TEXTURE_CUBE_MAP, levels, internalFormat, width, height);
     
     
    for (GLenum target = GL_TEXTURE_CUBE_MAP_POSITIVE_X, i = 0; target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z; target++, i++)
    {
        glTexSubImage2D(target, 0, 0, 0, width, height, format, GL_UNSIGNED_BYTE, cubeMapList[i]->pixels);
    }
     
     
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glGenerateMipmap(GL_TEXTURE_CUBE_MAP);
    Attached Images Attached Images

Similar Threads

  1. Texture filter and atlas image distortion problem
    By hellgasm in forum OpenGL: Basic Coding
    Replies: 17
    Last Post: 05-22-2018, 06:51 PM
  2. glTexStorage2D with GL_TEXTURE_CUBE_MAP on AMD
    By mhagain in forum OpenGL: Drivers
    Replies: 5
    Last Post: 09-12-2012, 11:20 AM
  3. Help for GL_TEXTURE_CUBE_MAP
    By fau78 in forum OpenGL: GLSL
    Replies: 3
    Last Post: 05-25-2011, 07:11 PM
  4. Load GL_TEXTURE_CUBE_MAP
    By fau78 in forum OpenGL: GLSL
    Replies: 3
    Last Post: 05-23-2011, 10:09 AM
  5. Problem w/ convolution and filter size
    By Foxbat in forum OpenGL: GLSL
    Replies: 1
    Last Post: 03-28-2007, 01:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean