This commit is contained in:
Mylloon 2023-05-25 16:41:32 +02:00
parent 2faeeb3296
commit 82aa077069
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -8,19 +8,19 @@ in vec2 vsoTexCoord;
out vec4 fragColor;
// Fonction de déformation
vec2 deform(float progression) {
vec2 deform(float it) {
vec2 center = vec2(0.5);
vec2 offset = vsoTexCoord - center;
// Torsion
float angle = offset.y * progression * radians(180) * 2;
float angle = offset.y * it * radians(180) * 2;
float cosTheta = cos(angle);
float sinTheta = sin(angle);
vec2 twistedOffset = vec2(cosTheta * offset.x - sinTheta * offset.y, sinTheta * offset.x + cosTheta * offset.y);
// Vague
float wave = sin(twistedOffset.y * 20);
vec2 deformedUV = twistedOffset + vec2(wave * progression, 0);
vec2 deformedUV = twistedOffset + vec2(wave * it, 0);
return center + deformedUV;
}