Created
May 23, 2020 12:55
-
-
Save h3r/f16ab7ea5ebaec193e5a874e7c5d1f75 to your computer and use it in GitHub Desktop.
GLSL Matcap funcs
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
vec4 matcap(sampler2D sampler, mat4 view_matrix, vec3 normal, float scale){ | |
vec3 vN = (view_matrix * vec4(normal, 0.)).xyz; | |
float2 uvs = view_N.xy * vec2(1.,-1.) * 0.48 * scale + vec2(.5, .5); | |
return texture2D(sampler, uvs); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment