Skip to content

Instantly share code, notes, and snippets.

@otanodesignco
Created August 2, 2023 07:20
Show Gist options
  • Save otanodesignco/863421c11836d7a0a91c234bb453fa0c to your computer and use it in GitHub Desktop.
Save otanodesignco/863421c11836d7a0a91c234bb453fa0c to your computer and use it in GitHub Desktop.
calculate surface normals in three.js
/* calculate surface normals shader material three.js */
out vec3 vSurfaceNormal;
void main()
{
vSurfaceNormal = normalize( normalMatrix * normal );
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1. );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment