mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Added irrKlang.dll and ikpMP2.dll to dlls folder. Added irrKlang as a sub-folder under includes. Added irrKlang.lib to lib folder. At this point running cmake gave an error it couldn't find source files under 2d_game. Moved 2d_game source up one folder level, then cmake found the files.
35 lines
792 B
GLSL
35 lines
792 B
GLSL
#version 330 core
|
|
layout (location = 0) in vec4 vertex; // <vec2 position, vec2 texCoords>
|
|
|
|
out vec2 TexCoords;
|
|
|
|
uniform bool chaos;
|
|
uniform bool confuse;
|
|
uniform bool shake;
|
|
uniform float time;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = vec4(vertex.xy, 0.0f, 1.0f);
|
|
vec2 texture = vertex.zw;
|
|
if(chaos)
|
|
{
|
|
float strength = 0.3;
|
|
vec2 pos = vec2(texture.x + sin(time) * strength, texture.y + cos(time) * strength);
|
|
TexCoords = pos;
|
|
}
|
|
else if(confuse)
|
|
{
|
|
TexCoords = vec2(1.0 - texture.x, 1.0 - texture.y);
|
|
}
|
|
else
|
|
{
|
|
TexCoords = texture;
|
|
}
|
|
if (shake)
|
|
{
|
|
float strength = 0.01;
|
|
gl_Position.x += cos(time * 10) * strength;
|
|
gl_Position.y += cos(time * 15) * strength;
|
|
}
|
|
} |