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): void
import { renderLit } from '@driftengine/capture';

Parameters

ParameterTypeDescription
sceneLitScene
cameraRasterCamera
lightLight
outFloat32Array

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.