Skip to main content

Normals

Normal mapping simulates fine surface details by modifying how light interacts with the surface at each pixel, without adding actual geometry.

Parameters

ParameterTypeDefaultRange
normalTexturetexture2d_refnull-
flipNormalTextureGreenChannelint32_t01
flipNormalTextureBlueChannelint32_t01

Parameter Details

normalTexture

Type: texture2d_ref Default: null Format: RGB, Linear color space

Tangent-space normal map encoding surface detail.

  • Channels: RGB → XYZ direction
  • Neutral: (0.5, 0.5, 1.0) or RGB (128, 128, 255)

flipNormalTextureGreenChannel

Type: int32_t Default: 0 Values: 0 (normal), 1 (flipped)

Inverts Y component (green). Used for DirectX/OpenGL conversion.

flipNormalTextureBlueChannel

Type: int32_t Default: 0 Values: 0 (normal), 1 (flipped)

Inverts Z component (blue). Rarely used.

DirectX vs OpenGL Conventions

SystemGreen Channel (Y)
DirectXY+ down
OpenGLY+ up

Set flipNormalTextureGreenChannel = 1 to convert between conventions.