Skip to content

Instantly share code, notes, and snippets.

@iregina
Created April 22, 2025 17:17
Show Gist options
  • Save iregina/1740cb4978cf17746afa2f7b03034697 to your computer and use it in GitHub Desktop.
Save iregina/1740cb4978cf17746afa2f7b03034697 to your computer and use it in GitHub Desktop.
// the tangents are computed when the mesh is created, and passed as an attribute
attribute vec3 tangent;
vec3 lookDirection = normalize(position.xyz - cameraPosition);
vec3 offset = cross(lookDirection, tangent);
vec3 adjustedPosition = position.xyz + normalize(offset) * thickness;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment