Skip to content

Instantly share code, notes, and snippets.

Created July 5, 2021 17:48
What would you like to do?
const light = /* a unit normal for light direction */;
// Determine the 3D position and normal from surface point
const [ u, v ] = penStart;
const [ position, normal ] = geometricNormal(parametricTerrain, u, v);
// Get lambertian diffuse
const diffuse = Math.max(0,, light));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment