natiny.camera.set_clip

Lua
natiny.camera.set_clip(cam, near, far)

Sets the near and far planes of a camera, in world units. Nothing closer than near or further than far is drawn, and the depth buffer spreads its precision between them.

Parameters

Name Type Description
cam number Camera handle
near number Distance to the near plane; must be above 0
far number Distance to the far plane; must be beyond near

Example

Lua
natiny.camera.set_clip(cam, 0.2, 2000.0)

Notes

  • Defaults are 0.1 and 100.
  • near is clamped to at least 0.0001; far is clamped to at least near * 1.001.
  • A large far / near ratio reduces depth-buffer precision.