Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit65083fe8f2

README.md

contact_shadows

Traces a short ray through the depth buffer per pixel toward the lights reaching it, so contact between two surfaces reads as a hard nearby shadow the shadow map is too coarse to hold.

The sun's direction and the trace settings arrive in contact_params; the scene's other lights arrive in contact_lights, three vec4s each — (position, radius), (direction, coneOuterCos), (intensity, coneInnerCos, kind, luminance), with kind 0 distant, 1 point, 2 spot. Every light in that pool is weighed at the pixel by its intensity, colour luminance and N·L, and a local light's also by its attenuation and cone; the maxTracedLights heaviest are marched toward, so a pixel darkens by the share of its light the traces found blocked. A local light's ray stops at the light itself.

Bindings

namekind
scene_depthtexture_depth
scene_normaltexture2d
frame_cambuffer
contact_paramsbuffer
contact_lightsbuffer
contact_outstorage2d (rgba8)