Log inGet started
Package

probegi_trace.computeShader

Newest version

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

README.md

probegi_trace

One ray per invocation, ray x of the probe in slot y, traced through the scene's acceleration structure from the probe's position. It stores the radiance the ray brings back in rgb and the distance it travelled in a: the ray's length where it found nothing, the hit distance at a surface facing it, and the hit distance negated at the back of a surface.

A ray that leaves the scene returns the captured sky when one is bound. A ray that hits a surface facing it returns the surface's emission, the sun's light where a shadow ray toward the sun reaches the surface clear, the light of the scene's point, spot, area and distant lights where a shadow ray toward each reaches the surface clear, and the surface's diffuse colour times the light the probe field held the frame before.

The scene's lights are the ones the light grid lists where the hit stands (@builtin::shaderModules.scene_lights), each lighting the hit with the falloff, spot cone and rect integral the surfaces are shaded with; the hit counts as a surface on the default light channel. Of those that reach it, the hit takes the maxLocalLights that put the most light on it unshadowed, and traces one shadow ray toward each, as long as the way to the light. A rect's ray goes to a point drawn across its face for each ray and frame, so the field's rays, averaged over frames, read the share of the rect a hit sees. A hit reached by more lights than it takes writes the frame, how many reached it and the cap into the stats store, a texel per ray-store row.

The bindings are the field's parameter buffer, the scene's light, the scene's light buffer, the captured sky, the two atlases as the frame before left them, the scene's acceleration structure, the ray store and the stats store.