Skip to content

Search

Kembali
· 1 menit baca

2D global illumination

The gi pass on camera2d: soft light from every light2d and soft shadows from every occluder2d outline, through kiss3d's Gi2d.

post = ["gi"] on a camera2d lights the frame by marching rays from every pixel to every light, so shadows widen and soften with distance.

A warm and a cold light either side of a wall, each throwing a soft shadow past it

  • Every light2d emits from a disc of source_radius, 0.25 world units by default. A spot has no cone here, and a directional light no form.
  • Every occluder2d outline and every tile map wall blocks the light, up to 128 segments; up to 32 lights emit.
  • gi_solver is ray_march, a fan of gi_rays per pixel, or cascades, probe grids that gather farther light for less.
  • gi_temporal_blend keeps 0.85 of last frame's light, and gi_downscale halves the light field by default.
  • With gi in the list the light map does not draw, so nothing is lit twice. ambient_color lights where no ray reaches.
  • The march steps in field pixels, so a world at 60 pixels to the unit resolves as finely as one counted in pixels.
[nodes.camera2d]
post = ["gi"]
gi_rays = 48
ambient_color = [0.02, 0.02, 0.03, 1.0]