stk-code_catmod/data/shaders/ppdisplace.frag
vincentlj 47d7f4fdd4 Use direct gl calls for ppdisplace.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@15028 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2014-01-12 23:43:00 +00:00

30 lines
410 B
GLSL

#version 130
uniform sampler2D tex;
uniform sampler2D dtex;
uniform int viz;
in vec2 uv;
void main()
{
vec2 tc = uv;
vec4 shiftval = texture2D(dtex, tc) / vec4(50.0);
vec2 shift;
shift.x = -shiftval.x + shiftval.y;
shift.y = -shiftval.z + shiftval.w;
tc += shift;
vec4 newcol = texture2D(tex, tc);
if (viz < 1)
{
gl_FragColor = newcol;
} else
{
gl_FragColor = shiftval * vec4(50.0);
}
}