OpenGL纹理——Cubemap Texture

A Cubemap Texture is a texture, where each mipmap level consists of six 2D images which must be square. The 6 images represent the faces of a cube. The texture coordinate used to access a cubemap is a 3D direction vector which represents a direction from the center of the cube to the value to be accessed.
https://www.khronos.org/opengl/wiki/Cubemap_Texture

error

1
Mesa: User error: GL_INVALID_ENUM in glSamplerParameteri(pname=GL_TEXTURE_CUBE_MAP_SEAMLESS)
  • 错误打印

    1
    2
    3
    case INVALID_PNAME:
    _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(pname=%s)\n",
    _mesa_enum_to_string(pname));

    mesa:src/mesa/main/samplerobj.c

  • 错误函数

    1
    glSamplerParameteri(state->ids[i], GL_TEXTURE_CUBE_MAP_SEAMLESS, templ->seamless_cube_map);

GL_TEXTURE_CUBE_MAP_SEAMLESS

1
glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);

立方体贴图的边界利用相邻面线性差值,消除立方体边缘的缝隙

参考

  • 立方体贴图(Cubemap)