API Reference › Light › Light.height
method

Light.height

Light.height(height)

Sets how far above the surface plane lights sit, in pixels — the z distance used when shading normal-mapped surfaces. A low height makes light rays graze the surface, so tilted faces contrast sharply; a high height lights everything more head-on. It only affects the N·L term, so a scene with no stamped normals is unchanged. The default (64) suits most scenes. Persists until changed.

Parameters

heightthe light's height above the plane in pixels (> 0)

Example

program Demo {
  property Wall { x: int = 0, y: int = 0 }
  model Block { Wall }
  handler Render phase Update {
    Screen.clear(0)
    Light.clear_normals()
    Light.height(24)                                       # low, grazing light
    Light.normal(60, 50, 16, 24, 0.7, 0.0)
    Light.point(120, 62, 90, Color.rgb(255, 240, 200), 1.0)
    Screen.show()
  }
}
← All symbols