Skip to content

Instantly share code, notes, and snippets.

@mkvenkit
Created June 26, 2021 12:10
Show Gist options
  • Save mkvenkit/b8d649aa25cb8573d220fc5431d10ae5 to your computer and use it in GitHub Desktop.
Save mkvenkit/b8d649aa25cb8573d220fc5431d10ae5 to your computer and use it in GitHub Desktop.
Rim lighting shader
float rim = (1.0 - dot(N, V));
rim = smoothstep(0.0, 1.0, rim);
float rim_exp = 3.5;
rim = pow(rim, rim_exp);
vec3 rim_col = vec3(0.1, 0.1, 0.1);
crim = rim * rim_col;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment