2013-11-06 18:17:18 -05:00
|
|
|
// SuperTuxKart - a fun racing game with go-kart
|
|
|
|
// Copyright (C) 2013 the SuperTuxKart team
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 3
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
|
2011-12-26 11:46:29 -05:00
|
|
|
// Creates a bubble (wave) effect by distorting the texture depending on time
|
2014-02-28 11:29:05 -05:00
|
|
|
|
2014-01-09 12:32:38 -05:00
|
|
|
uniform mat4 ModelViewProjectionMatrix;
|
2011-12-26 11:46:29 -05:00
|
|
|
uniform float time;
|
2014-01-20 15:42:38 -05:00
|
|
|
|
2014-07-09 11:49:47 -04:00
|
|
|
#if __VERSION__ >= 330
|
2014-06-29 10:26:12 -04:00
|
|
|
layout(location = 0) in vec3 Position;
|
|
|
|
layout(location = 3) in vec2 Texcoord;
|
2014-07-09 11:49:47 -04:00
|
|
|
#else
|
|
|
|
in vec3 Position;
|
|
|
|
in vec2 Texcoord;
|
|
|
|
#endif
|
2014-01-08 19:17:28 -05:00
|
|
|
out vec2 uv;
|
2011-12-26 11:46:29 -05:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2014-01-20 15:42:38 -05:00
|
|
|
gl_Position = ModelViewProjectionMatrix * vec4(Position, 1.);
|
2013-06-18 10:35:29 -04:00
|
|
|
|
2014-01-20 15:42:38 -05:00
|
|
|
float delta_x = cos(time*3.0) * sin( 4.0 * Texcoord.x * 6.28318531 );
|
|
|
|
float delta_y = cos(time*2.0) * sin( 3.0 * Texcoord.y * 6.28318531 );
|
2011-12-26 11:46:29 -05:00
|
|
|
|
2014-01-20 15:42:38 -05:00
|
|
|
uv = Texcoord + vec2(0.02*delta_x, 0.02*delta_y);
|
2011-12-26 11:46:29 -05:00
|
|
|
}
|