Log inGet started
Package

skyVisibility.package

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

overheadCover

The overhead cover map: the highest surface over each point of the ground around the camera, drawn each render from every opaque mesh the renderer holds, entity-owned and instanced alike. A render feature that lights the air reads it to know how much of the sky a point sees past what stands over it.

local OverheadCover = require("@builtin::systems.skyVisibility.overheadCover")

OverheadCover.enqueue(ctx)          -- in render(ctx): draws the map at afterLighting
OverheadCover.target()              -- the map's target guid, bound as `overhead_map`
OverheadCover.release()             -- in teardown: frees the map and its material

The map is 256 by 256 texels of 1 world unit, centred on the camera being drawn and moved in whole texels. A texel holds the height of the highest surface over it, measured from the camera's height, in .r and 1 in .g, and 0 in both where nothing stands over it. A pass reads it through @builtin::systems.skyVisibility.overhead_openness.