dpdxFine

dpdx measured per pixel rather than per 2×2 pixel block.

dpdxFine(x: Val): Expr

Import math from shaders/std and use math.dpdxFine.

Plain derivatives may be shared by each 2×2 block of pixels, so anything scaled by them can step in a 2-pixel grid. Use the fine forms when a derivative drives a visible quantity.

Parameters

NameTypeNotes
xVal

Example

const stepX = dpdxFine(lookupUV)

See also

  • dpdx — How much a value changes from this pixel to the next one to the right.
  • dpdyFine — dpdy measured per pixel rather than per 2×2 pixel block.
  • fwidthFine — fwidth measured per pixel rather than per 2×2 pixel block.

Used by

PrismaticGlass

Keep reading