Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Block Compression Pass

Hybrid View

  1. #1
    Newbie Newbie
    Join Date
    Dec 2012
    Posts
    1

    Post Block Compression Pass

    Normal path:

    1. Render scene into uncompressed framebuffer.
    2. Sample from that for post fx, etc.

    Suggestion:

    1. Render scene into uncompressed framebuffer.
    2. Compress framebuffer into BCn texture format.
    3. Sample from compressed texture.

    Tradeoff is compression cost and artifacts vs. memory bandwidth cost sampling the texture. So this only makes sense in situations where the sampler is read alot.

    Areas where this "BC pass" could be applied:

    • Impostors
    • Deferred Shading
    • Blurs, SSAO, etc.


    Implementation

    The ideal solution would be to accelerate gl(Copy)Tex(Sub)Image2D calls targeting a BCn internal format with the GPU. Like that, it could even accelerate existing code without any changes.

    A test case compressing a 1080p RGBA8 framebuffer to BC1 cost 18ms on a Geforce 680 when using glCopyTexImage2D, no clue how to determine whether that compression is CPU or GPU, but I'm fairly certain it's CPU because of some talk about C libraries that were at some point mentioned in conjunction with BCn compression.

    I wrote to both AMD and NV but no reply, so I'm posting this here so it's not forgotten or dies in a spam filter.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    985
    BPTC compression is very expensive, it is not really designed for real-time compression. Other compression methods might be useful for what you propose but even then you could already do this using a compute shader and ARB_copy_image which allows you to copy raw data from an uncompressed texture to a compressed one, thus the algorithm should look like the following:

    1. Render scene into uncompressed framebuffer
    2. Run compute shader that performs the compression, outputs to an uncompressed texture that is copy-compatible with the desired compressed format
    3. Copy uncompressed image to compressed image
    4. Sample from compressed texture

    Though, still would accentuate the fact that at least BPTC formats are very expensive to compress.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

Posting Permissions

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