Skip to content

Archive

Tag: BC7
上一篇提到了BC7的结构,以及压缩的巨大计算量。本篇将阐述FasTC算法,一种可以快速压缩BC7的方法。 慢的根源 之前讲过,传统BC7压缩之所以慢,是因为需要穷举所有的可能性,从中挑出最好的一种。在这种情况下,最快的实现靠的是GPU的巨大并行度,虽然能解决问题,但效率仍然很低,并依赖于D3D11的CS。 审视BC7的压缩步骤,可以看出首先有64个partition,8个mode,有的mode有2种颜色编码和3种旋转。很显然,占决定性作用的是64个partition。如果能有个算法不需要穷举就能决定一个partition,就能迅速把计算量减少几十倍。 Partition的确定 那么有没有可能直接确定出partition呢?09年刚完成BC6H/BC7 DirectCompute Encoder Tool的时候 ...
DXT到了D3D10之后,就改名为BC(Block Compression)。到了D3D11/OpenGL 4.2时代,又增加了BC6和BC7两种高效的压缩法,分别针对HDR和LDR。但是,由于BC6/7的压缩复杂度远超过以往的BC1-5,D3DX的压缩函数又不是特别给力,限制了它的应用。本系列将专注于介绍一个BC7的快速压缩算法。 和其他BC的比较 BC1的只能用于RGB565,或者RGBA5551。压缩质量不高但速度很快。BC2和BC3的RGB部分和BC1完全一样,都是RGB565。BC2的A是4bit采样,BC3的A是8bit插值。如果要用他们来压缩非颜色信息,比如normal,结果基本都不怎么样。因为最好的BC3也只能提供一个8bit通道和一个6bit通道。 BC4和BC5只有1通道和2通道。BC5在用于normal压缩的时候能提供2个 ...
上文介绍了D3D11的两个重要特性compute shader和multi-threaded,本篇专注于两个不能在D3D10硬件上使用的、纯D3D11的新特性tessellation和BC6H/BC7纹理压缩。 Tessellation 很 多人会说D3D11增加了tessellation shader这个stage,但真相是增加了hull shader、tessellator和domain shader三个stage。Hull shader的输入是patch的控制点(三角形、四边形这样的图元,最多有32个控制点),计算出tessellation等级、确定 tessellation的方法等。它的输出被送给固定单元的tessellation进行细分。Domain shader的输入是细分后的bary centric坐标、来自hull shader的控制点,它负责计算插值后的顶点坐标。 Tessellation早就存在于一些GPU。 D3D9 ...
Direct3D 11 class hardware through the Direct3D 11 API supports two new texture compression formats: BC6H and BC7. These new Block Compressed formats provide excellent compression for High-Dynamic Range (HDR) images and higher-fidelity traditional content. The D3DX11 library includes a software implementation of the encoder, but the new BC formats are extremely asymmetric meaning the encoding algorithm has a very large search space to determine the optimal compression for each 4x4 block. This makes a great candidate for a GPGPU DirectCompute implementation of the compression algorithm. The ...