👻 Helper Pixels: The Hidden Cost of ddx and ddy
The rules for using ddx and ddy safely, and helper pixels: the extra, invisible fragment shader runs that 2×2 groups need. See them on your own GPU.
The rules for using ddx and ddy safely, and helper pixels: the extra, invisible fragment shader runs that 2×2 groups need. See them on your own GPU.
Build each triangle’s normal in the fragment shader from ddx and ddy of its position: a faceted, low-poly look with no extra mesh data. Plus more uses for derivatives.
The two uses of ddx and ddy you’ll meet most: choosing a texture’s mipmap level, and smooth edges at any zoom with fwidth. With live WebGL demos.
What ddx and ddy (dFdx and dFdy in GLSL) tell a shader, and how the graphics card works them out by comparing neighbouring pixels in 2×2 groups, with interactive WebGL demos.
Row or column vectors? Row-major or column-major memory? Left- or right-handed? Depth from 0 or −1? Untangle the conventions that trip up everyone, and see which combinations really work.