👻 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.
How values are blended smoothly across a triangle, how a fragment shader turns them into a colour, and why perspective needs special care. Includes a live fragment shader editor.
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.
The vertex shader runs once for every vertex, placing it on screen and passing data along. Edit one live: make waves, twist shapes and see exactly what it can and can’t do.