TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class Tinman.Image.EncodeNormals

Short Name:
  • class EncodeNormals
Derived From:
Fields:

Encodes a normal map image, assuming that all tangent-space normal vectors point upwards (i.e. the minimum blue channel value is 0.5).

The pixels of the given normal map are interpreted as follows:

red  :[0..1] => X:[-1 .. +1]
green:[0..1] => Y:[-1 .. +1]
blue :[0..1] => Z:[-1 .. +1]

The vector (X,Y,Z) is then normalized to unit-length. The grayscale intensity I is computed from the pixel in map (if not null). The pixel P of the resulting image is then computed like this:

map == null :
  P.red   = X * 0.5 - 0.5
  P.green = Y * 0.5 - 0.5

map != null :
  P.red   = X * 0.5 - 0.5
  P.green = I
  P.blue  = Y * 0.5 - 0.5

Fields

The following table lists all fields of this config type.

Field Type Constraint Default
required normal Image
# != null
 

The normal map image.

optional map Image  
null

Optional grayscale map to encode.

external info Image.Info    

Contains information about the image data source, including image format and embedded georeferencing information.