DriftCapture · function
renderLit
scene seen from camera, into out as linear premultiplied RGBA.
Explained in DriftCapture.
function renderLit(scene: LitScene, camera: RasterCamera, light: Light, out: Float32Array): voidimport { renderLit } from '@driftengine/capture';Parameters
| Parameter | Type | Description |
|---|---|---|
scene | LitScene | |
camera | RasterCamera | |
light | Light | |
out | Float32Array |
In depth
Each pixel is one ray: the nearest triangle, its interpolated normal and albedo, Lambert against the light, a shadow ray back to it, and a Blinn–Phong lobe whose width is the roughness. What a real capture would have instead of the shadow ray is a shadow in the photograph; what matters for the test is that the shadow is there and that the caller knows where.