faceForward
On this page

faceForward

Function

Returns n if dot(nref, i) is negative, else -n: the normal that faces the incident vector.

The signature and the sentence under each name are the compiler's own text at commit 26de7be8.

Syntax

declare function faceForward<V extends vec2 | vec3 | vec4>(a0: V, a1: V, a2: V): V
declare function faceForward<T extends Numeric>(a0: T, a1: T, a2: 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.

  • a0 VT
  • a1 VT
  • a2 VT

Return value

VT

Description

faceforward on GLSL.

Targets

WGSL
faceForward(a, b, c)
GLSL ES 3.00
faceforward(a, b, c)

Examples

See also

Edit this page Report a problem