【问题标题】:glTexImage2D - GL_TEXTURE_RECTANGLE_NV and compressed internal formatglTexImage2D - GL_TEXTURE_RECTANGLE_NV 和压缩的内部格式
【发布时间】:2020-03-03 20:54:42
【问题描述】:

我修改了一个旧代码 (OpenGL 2.1),它使用 glTexImage2D 和 GL_TEXTURE_RECTANGLE_NV 纹理目标。我注意到,当我设置一些压缩的内部格式时,例如 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 它不适用于 GL_TEXTURE_RECTANGLE_NV (我得到一个白色纹理)。我已经测试了其他场景并且一切正常,即带有压缩内部格式的 GL_TEXTURE_2D,带有非压缩内部格式的 GL_TEXTURE_RECTANGLE_NV。这是否意味着 GL_TEXTURE_RECTANGLE_NV 不能与压缩格式一起使用?

【问题讨论】:

    标签: opengl


    【解决方案1】:

    spec for NV_texture_rectangle extension 对压缩格式的看法如下:

    Can compressed texture images be specified for a rectangular texture?
    
          RESOLUTION:  The generic texture compression internal formats
          introduced by ARB_texture_compression are supported for rectangular
          textures because the image is not presented as compressed data and
          the ARB_texture_compression extension always permits generic texture
          compression internal formats to be stored in uncompressed form.
          Implementations are free to support generic compression internal
          formats for rectangular textures if supported but such support is
          not required.
    
          This extensions makes a blanket statement that specific compressed
          internal formats for use with CompressedTexImage<n>DARB are NOT
          supported for rectangular textures.  This is because several
          existing hardware implementations of texture compression formats
          such as S3TC are not designed for compressing rectangular textures.
          This does not preclude future texture compression extensions from
          supporting compressed internal formats that do work with rectangular
          extensions (by relaxing the current blanket error condition).
    

    因此,您的特定格式 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 不一定受支持,因为它被称为“不是为压缩矩形纹理而设计的”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-08
      • 2016-11-26
      • 2015-02-02
      • 1970-01-01
      相关资源
      最近更新 更多