Created
November 24, 2014 19:18
-
-
Save lcrs/21065f07e096f1c1f935 to your computer and use it in GitHub Desktop.
glasso
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
uniform float adsk_time; | |
uniform float adsk_result_w, adsk_result_h; | |
uniform sampler2D front, matte; | |
float get(vec2 p) { | |
return texture2D(matte, p).r; | |
} | |
void main(void) | |
{ | |
vec2 resolution = vec2(adsk_result_w, adsk_result_h); | |
vec2 p = gl_FragCoord.xy / resolution; | |
float g = get(p); | |
vec3 n = normalize(vec3(g - get(p+vec2(0.01, 0.0)), g - get(p+vec2(0.0, 0.01)), 0.3)); | |
p += n.xy * -0.2; | |
vec3 c = texture2D(front, p).rgb; | |
c *= n.z * 0.84; | |
c += 0.2 * pow(abs(dot(n, vec3(0.7))), 80.0); | |
gl_FragColor = vec4(c, 1.0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment