iterator
This commit is contained in:
parent
2faeeb3296
commit
82aa077069
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Reference in a new issue