Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: glCompressedTexSubImage2D use for real subrect of bigger texture

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Newbie Newbie
    Join Date
    Oct 2012

    glCompressedTexSubImage2D use for real subrect of bigger texture

    I read spec and exceptions, but I'm not sure still. Is it possible to use glCompressedTexSubImage2D for place smaller texture into bigger texture? For example.. I have texture 512x512 and 4 textures 256x256. I want to create atlas of texture dynamically right through the code. Everything works fine with glTexSubImage2D, but with glCompressedTexSubImage2D not.

    Maybe is because compressed textures are more complex and it's not possible to find the location for smaller compressed texture into bigger. How can I solve the problem if I need to use dynamic generated atlases + PVR textures? Seems it's not possible. Two options:

    use much more draw calls and PVRs textures or standard textures from png file for example. Am I right?

    Thanks.. Lucas

  2. #2
    Advanced Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    The restrictions on CompressedTexSubImage depend on the format.

    The general rules are described in the ARB_texture_compression spec which disallows partial SubImage by default (see Issue 5).
    This rule may be relaxed by format-specific extensions. For example see EXT_texture_compression_s3tc which allows any subimage aligned to 4x4 blocks (see Issue 3).

    If you are using PVRTC, you are out of luck. This format inherently requires neighboring blocks to decompress, so you can not edit individual blocks. See IMG_texture_compression_pvrtc language about CompressedTexSubimage.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts