dpdyFine
On this page

dpdyFine

Function

A screen-space derivative estimates how a value changes between neighbouring fragment invocations along the y axis.

Related names in other languages

These related operations can differ in arguments, support, and semantics. The foreign names are not accepted TypeShade aliases. Check the target forms and restrictions.

  • GLSL: dFdy

Targets

Compare examples

Compare a constant field with a linear ramp. The result measures change per pixel, not the field value.

Model assumptionsf(px, py) = a × px + b × py + c

Example 1a = 0; b = 0; c = 5
5555
Field values at neighbouring pixels. The lower row adds a vertical pixel step.
Result
0
Example 2a = 0.25; b = 0; c = 0
00.2500.25
Field values at neighbouring pixels. The lower row adds a vertical pixel step.
Result
0
Example 3a = 0.25; b = -0.5; c = 1
11.250.50.75
Field values at neighbouring pixels. The lower row adds a vertical pixel step.
Result
-0.5

The examples are calculation models and do not run GPU work. The reference below gives the complete call signatures. Decimal results are rounded for display. The stated assumptions determine each example; actual shader results follow the target precision and execution rules.

When to use it

Use it to estimate a pixel footprint, recover a surface gradient, or control filtering.

Inputs and limits

The model uses an affine field, so coarse and fine estimates agree. Nonlinear fields can differ. Derivatives require fragment-stage uniform control flow; GLSL ES chooses its own granularity.

For shader input rules and precision, consult WGSL and GLSL ES 3.00.

WGSL
dpdyFine(a)
GLSL ES 3.00
dFdy(a)

The signature, the sentence and any message are the compiler's own text at commit af54ddad5.

The partial derivative of x with respect to the window y coordinate, computed at the finer granularity.

Syntax

declare function dpdyFine(a0: f32): f32
declare function dpdyFine<V extends vec2 | vec3 | vec4>(a0: V): V
declare function dpdyFine<T extends Numeric>(a0: T): T

A signature may name a type the ambient file declares for its own use. These are those declarations.

Numeric
type Numeric = number | vec2 | vec3 | vec4 | vec2i | vec3i | vec4i | vec2u | vec3u | vec4u

Parameters

A parameter named by position (a0, a1) carries a name the ambient file generates. A call passes its arguments in order and names none of them.

Return value

f32VT

Description

Fragment stage only; dFdy on GLSL; the CPU oracle returns zero.

Targets

WGSL
dpdyFine(a)
GLSL ES 3.00
dFdy(a)

See also

Edit this page Report a problem