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

faceforward - return a vector pointing in the same direction as another

Declaration

genTypefaceforward(genTypeN,genTypeI,genTypeNref);genDTypefaceforward(genDTypeN,genDTypeI,genDTypeNref);

Description

faceforward orients a vector to point away from a surface as defined by its normal. If dot()(Nref, I) < 0
       faceforward returns N, otherwise it returns -N.

Name

       faceforward - return a vector pointing in the same direction as another

Parameters

N
           Specifies the vector to orient.

       I
           Specifies the incident vector.

       Nref
           Specifies the reference vector.

See Also

reflect(), refract()

Version Support

       ┌─────────────┬───────────────────────────────────────────────────────────────────────────────────┐
       │             │        OpenGLShadingLanguageVersion                                            │
       ├─────────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤
       │ Function1.101.201.301.401.503.304.004.104.204.304.404.50 │
       │ Name        │      │      │      │      │      │      │      │      │      │      │      │      │
       ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ faceforward │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       │ (genType)   │      │      │      │      │      │      │      │      │      │      │      │      │
       ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ faceforward │  -   │  -   │  -   │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       │ (genDType)  │      │      │      │      │      │      │      │      │      │      │      │      │
       └─────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘

See Also