From ad04490ef84d7565fbec0fa878a21694ad2d61f0 Mon Sep 17 00:00:00 2001 From: pryazha Date: Tue, 26 Aug 2025 10:55:18 +0500 Subject: guess that's all --- in_practice/breakout/shaders/post.vert | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 in_practice/breakout/shaders/post.vert (limited to 'in_practice/breakout/shaders/post.vert') diff --git a/in_practice/breakout/shaders/post.vert b/in_practice/breakout/shaders/post.vert new file mode 100644 index 0000000..7a8ac4f --- /dev/null +++ b/in_practice/breakout/shaders/post.vert @@ -0,0 +1,33 @@ +#version 330 core + +layout (location = 0) in vec4 vertex; + +out vert_t { + vec2 tex_coords; +} vert; + +uniform bool chaos; +uniform bool confuse; +uniform bool shake; +uniform float time; + +void main() +{ + gl_Position = vec4(vertex.xy, 0.0, 1.0); + vec2 texture = vertex.zw; + if (chaos) { + float strength = 0.3; + vec2 pos = vec2(texture.x + sin(time) * strength, + texture.y + cos(time) * strength); + vert.tex_coords = pos; + } else if (confuse) { + vert.tex_coords = vec2(1.0) - texture; + } else { + vert.tex_coords = texture; + } + if (shake) { + float strength = 0.01; + gl_Position.x += cos(time * 10) * strength; + gl_Position.y += cos(time * 15) * strength; + } +} -- cgit v1.2.3-70-g09d2