2014-01-04 19:08:00 -05:00
|
|
|
#version 130
|
2013-11-30 16:33:06 -05:00
|
|
|
uniform sampler2D tex;
|
|
|
|
uniform sampler2D caustictex;
|
|
|
|
uniform vec2 dir;
|
|
|
|
uniform vec2 dir2;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec2 tc = gl_TexCoord[0].xy;
|
|
|
|
|
2014-01-19 12:53:35 -05:00
|
|
|
vec3 col = texture(tex, tc).xyz;
|
|
|
|
float caustic = texture(caustictex, tc + dir).x;
|
|
|
|
float caustic2 = texture(caustictex, (tc.yx + dir2 * vec2(-0.6, 0.3)) * vec2(0.6)).x;
|
2013-11-30 16:33:06 -05:00
|
|
|
|
|
|
|
col += caustic * caustic2 * 10.0;
|
|
|
|
|
|
|
|
gl_FragColor = vec4(col, 1.0);
|
|
|
|
}
|