logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

dFdx,_dFdy - return the partial derivative of an argument with respect to x or y

Declaration

genTypedFdx(genTypep);genTypedFdy(genTypep);genTypedFdxCoarse(genTypep);genTypedFdyCoarse(genTypep);genTypedFdxFine(genTypep);genTypedFdyFine(genTypep);

Description

Availableonlyinthefragmentshader, these functions return the partial derivative of expression p with
       respect to the window $x$ coordinate (for dFdx*) and $y$ coordinate (for dFdy*).

       dFdxFine and dFdyFine calculate derivatives using local differencing based on on the value of p for the
       current fragment and its immediate neighbor(s).

       dFdxCoarse and dFdyCoarse calculate derivatives using local differencing based on the value of p for the
       current fragment's neighbors, and will possibly, but not necessarily, include the value for the current
       fragment. That is, over a given area, the implementation can compute derivatives in fewer unique
       locations than would be allowed for the corresponding dFdxFine and dFdyFine functions.

       dFdx returns either dFdxCoarse or dFdxFine.  dFdy returns either dFdyCoarse or dFdyFine. The
       implementation may choose which calculation to perform based upon factors such as performance or the
       value of the API GL_FRAGMENT_SHADER_DERIVATIVE_HINT hint.

       Expressions that imply higher order derivatives such as dFdx(dFdx(n)) have undefined results, as do
       mixed-order derivatives such as dFdx(dFdy(n)). It is assumed that the expression p is continuous and
       therefore, expressions evaluated via non-uniform control flow may be undefined.

Name

       dFdx,_dFdy - return the partial derivative of an argument with respect to x or y

Parameters

p
           Specifies the expression of which to take the partial derivative.

See Also

fwidth(), glHint()

Version Support

       ┌─────────────┬───────────────────────────────────────────────────────────────────────────────────┐
       │             │        OpenGLShadingLanguageVersion                                            │
       ├─────────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤
       │ Function1.101.201.301.401.503.304.004.104.204.304.404.50 │
       │ Name        │      │      │      │      │      │      │      │      │      │      │      │      │
       ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ dFdx        │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ dFdy        │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ dFdxCoarse, │  -   │  -   │  -   │  -   │  -   │  -   │  -   │  -   │  -   │  -   │  -   │  ✔   │
       │ dFdxFine,   │      │      │      │      │      │      │      │      │      │      │      │      │
       │ dFdyCoarse, │      │      │      │      │      │      │      │      │      │      │      │      │
       │ dFdyFine    │      │      │      │      │      │      │      │      │      │      │      │      │
       └─────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘

See Also