DriftTexture · function

toksvigRoughness

How much roughness a shortened average normal implies.

Explained in DriftTexture.

function toksvigRoughness(normalLength: number, roughness: number): number
import { toksvigRoughness } from '@driftengine/texture';

Parameters

ParameterTypeDescription
normalLengthnumber
roughnessnumber

In depth

The averaged normal's length falls as the normals it averaged disagree, so 1 - length is a direct measure of the variance lost to averaging. Added in variance rather than in roughness, because variances of independent sources add and roughnesses do not.