Created
August 18, 2019 11:24
-
-
Save thomasvanta/3480e075f0d0a7895e93ee147c25987b 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
vec3 getNormal(vec3 p){ | |
//sampling around the point | |
vec2 e = vec2(0.01, 0.0); | |
float d = map(p); | |
vec3 n = d - vec3( | |
map(p-e.xyy), | |
map(p-e.yxy), | |
map(p-e.yyx)); | |
return normalize(n); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment