Normal map shader

../../../_images/normalmap.jpg

From left to right : original material without normal shader, normal vector field image, material with the normal map shader

Normal shader This shader alters the surface normal based on an image giving the normal vector in tangent space coordinates. As the tangent space uses the surface normal as z base vector, this means that a uniform normal map image with (0,0,1) values will be neutral and have no effect. The normal coordinates must be encoded to RGB values using the following convention:

  • Red(0 to 1) maps to X or “tangent” (1.0 to -1.0)

  • Green(0 to 1) maps to Y or “bitangent” (-1.0 to 1.0)

  • Blue(0 to 1) maps to Z or “normal” (-1.0 to 0.0)

The inversion of the red channel is there for compatibility with standard normal map software, which mostly use “Y-top” left-handed base, while Ocean uses “Z-top” right-handed base.

Children Nodes

Image image

The normal vector field map image

Parameters

name

type

description

uvscale

real

The UV coordinates scaling factor. Scales the texture spatially over the geometry

multiplier

real

A factor for increasing or decreasing the amplitude

Ocean XML 6.1 example

<normalshader type="normalmap" name="bricks" uvscale="5" multiplier="0.5">
     <image type="file" name="image" path="bricks.jpg"/>
</normalshader>