Day 54 - 🧪 Experiment - Writing a BRDF from Scratch (Part 4)

General / 20 July 2026

The BRDF from Parts 1 through 3 covered opaque, non-transmissive materials. This post adds a translucency term to simulate light passing through the surface. Not full subsurface scattering, but a cheap approximation that reads well at a distance.


The Code

The translucency term bends the light direction slightly toward the surface normal, then raises the result to a power to control spread. A distance-based mask keeps it from affecting geometry too far from the light origin.

float translucencyPower = 175.0;
vec3 LTlight            = l + n * 0.003;
float LTDot             = pow(clamp(dot(e, -LTlight), 0.0, 1.0), translucencyPower) * 1.0;
float t                 = clamp(0.4 * length(fWorldPos - vec3(0.0, 0.3, 0.0)), 0.0, 1.0);
vec3 translucent_light  = light_color * (vec3(LTDot) + ambient) * t * light_strength;


Result

The diffuse contribution is softened by interpolating between the base color and the translucency-adjusted color. Applying a curve to the underlying albedo to lift saturation gives a more convincing read at the rim.

Before


After

© 2026 Stefan Groenewoud. All views are my own, not those of my employer.