Renderer · interface

ReflectiveSurfaceOptions

What a ReflectiveSurface is made with: its box, which way the surfaces inside it face, and how much and how far they reflect. Every number but the box has a default; see each field.

Explained in Hello world.

interface ReflectiveSurfaceOptions extends DecalBox
import type { ReflectiveSurfaceOptions } from '@driftengine/core';

Properties

NameTypeDescription
strengthreadonlyoptionalnumberHow much of what the ray finds lands on the surface, 0 to 1: one share over the box, or with fresnel the surface's reflectance head-on.
fresnelreadonlyoptionalbooleanWhether strength is the surface's reflectance head-on, F0, rather than one share over the box. Each pixel then returns F0 · A + B of what its ray finds, the split-sum environment BRDF at its own view and roughness — Karis's fit, the one the lit stage reflects its environment by — so a floor returns more toward the horizon than underfoot, and the share follows the camera as a physically based renderer weighs its reflections. False by default, the one share as before.
More

What it gives up: the pass has no material buffer, so the roughness and F0 are the box's, not each pixel's, and nothing occludes the reflection where the lit stage's ambient occlusion would. A floor of one material is what it is for.

roughnessreadonlyoptionalnumberThe surface's roughness, 0 to 1, that fresnel weighs by. 0, a polished surface, if absent.
reachMreadonlyoptionalnumberHow far a ray may travel, world metres.
thicknessMreadonlyoptionalnumberHow deep a depth sample is treated as being. See ScreenSpaceMarch.thicknessM.
stepsreadonlyoptionalnumberHow many samples along a ray.
facingCosreadonlyoptionalnumberHow far from facing the box's own axis a surface may be turned and still reflect.
tintreadonlyoptionalReadonlyVec3What the reflection is multiplied by, for a tinted mirror.