ShaderX5 on Selective SuperSampling


A few interesting notes on this article. One is ddx() and ddy(). These functions exist because pixels go through the pipeline in batches of 4:

12
34

if we put a texture coordinate as the param, e.g. ddx(texCoord) from pixel #1 then the result would be the texture coordinate in pixel #2. Likewise for ddy(texcoord) it would be the texture coordinate of pixel #3.

Another thing: specular aliases much worse than diffuse does. So we could apply selective supersampling only on the specular component.

One last thing, in a dynamic branch, the gradient is not computed for tex2D (it is used for determining the LOD). Instead, you ought to call tex2Dgrad