Renderer · const
SCREEN_TRACE_BIAS_M
How far along the normal an indirect ray starts, in metres.
Explained in Hello world.
const SCREEN_TRACE_BIAS_M = 0.02import { SCREEN_TRACE_BIAS_M } from '@driftengine/core';In depth
It has to be larger than the depth buffer's quantum and smaller than anything it could hide. Two centimetres is about twenty times the rounding of a 24-bit buffer over a hundred-metre range at close quarters, and is below the contact detail a viewer reads — the gap where an object meets a floor, which is the first thing indirect light is judged on.
What would make it wrong is a scene whose unit is not the metre, which this engine's is; and a depth range far enough that the quantum grows past it, which is a reason to bias by a fraction of the sampled depth rather than by a constant. Nothing measured yet asks for that.