Log inGet started
Package

cloud_shadow_space.shaderModule

Newest version

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

README.md

cloud_shadow_space

Where the cloud layer's shadow map stands. Each texel holds one straight line toward the sun, named by where it crosses the plane at the layer's base altitude, so a point finds its line by following the sun to that plane, with no search. The texels are spaced from the middle of the map outward by the square of their distance from it, so the lines near the camera stand closest together and the map still reaches as far as the layer is drawn.

  • cloud_shadow_line(to_sun) — the direction the lines run, lifted to at least CLOUD_SHADOW_LOWEST_SUN above the horizon.
  • cloud_shadow_crossing(p, line), cloud_shadow_centre(cam, line) — where a line crosses the base plane, and the map's middle for a camera.
  • cloud_shadow_map_at(offset), cloud_shadow_offset_at(m) — the map coordinate of a crossing and back.
  • cloud_shadow_block(), cloud_shadow_slice(step) — the side of the blocks the map is refreshed by, and which line of every block a render marches at a step of the refresh; a view's renders walk the block * block steps in turn.
  • The parameters' accessors: cloud_shadow_casting, cloud_shadow_extent, cloud_shadow_base, cloud_shadow_top, cloud_shadow_strength and others.

The including shader declares the parameters as cloud_shadow, written by @builtin::systems.volumetrics.cloudShadow.