volumetricSky.renderFeature
This package holds more than this page lists. See all of its files in its world.
README.md
volumetricSky
The cloud layer's render passes. The VolumetricSky component brings them up
and takes them down: to put clouds in a sky, add that component to one entity.
The layer is raymarched for the camera being drawn, each ray ending at the
surface the opaque scene drew along it (@scene.depth), copied into the target
the composite reads, temporally accumulated where there is a previous frame of
that view to accumulate against, and laid over the frame in two passes:
- over the pixels the opaque scene left as sky, once the opaque scene is lit
(
afterOpaqueLit) and ahead of the transparent phase, so a particle, a glass pane or any see-through surface that writes no depth stands in front of the clouds behind it; - over the pixels a surface stands on, the water a transparent draw wrote depth
for included, at the head of the
mediumstage, ahead of the air (aerial perspective, height fog, volumetric light):cloud_layer_surfacespicks the layer's cells a surface stands on out by the frame's own depth, and the composite lays them.
A cloud in front of a surface covers it at any distance, so from above the layer the clouds cover the ground and the sea below them, and a surface in front of a cloud keeps it out.
Every pass but the accumulation runs for each view the frame draws, an
environment cube's six faces included — which is what puts the clouds into
reflections. The accumulation blends against the previous render of the same
view: each view (the viewport, every camera rendering into a texture, every
capture) keeps its own images of the layer's history target and reprojects
them through its own camera. A cube face is rendered once with no previous
render, so the accumulation declares environmentCapture = false and the copy
before it is what those faces read.
The layer is part of the scene's sky and air, so every pass declares
atmospherics = true: a camera stating an isolated environment (an asset
preview, an icon, a portrait) draws no clouds over its backdrop.
VolumetricSky creates this feature; it is not meant to be created by hand.