Created
July 5, 2021 17:48
-
-
Save mattdesl/119ef6c1849aa5461685da66258ad727 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, vec3.dot(normal, light)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment