馃懟 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鈥檚 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鈥檒l meet most: choosing a texture鈥檚 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.