Log inGet started
Package

contact_shadows.computeShader

Newest version

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

README.md

contact_shadows

Traces a short ray through the depth buffer per pixel toward the point, spot and distant 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 contact is contact_shadows_sun's.

The trace settings arrive in contact_params; the 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)