Allow for multiple distortions at once

This commit is contained in:
2025-11-18 22:49:51 +00:00
parent 8428f08ebd
commit b633b9d55f
5 changed files with 41 additions and 31 deletions
+10 -14
View File
@@ -1,12 +1,11 @@
#version 450 core
in vec2 texPos;
in vec2 distmask;
in vec2 pinch;
in vec2 distmask[2];
in vec2 pinch[2];
out vec4 fColor;
layout (binding = 1) uniform sampler2D screenTexture;
float x = 1 - min(1, sqrt(distance(distmask,vec2(0,0))));
float xab = abs(distmask.x);
float yab = abs(distmask.y);
float x = 1 - min(1, sqrt(distance(distmask[0],vec2(0,0))));
//float x = 1 - min(1, dot(distmask,distmask));
vec3 toYUV (vec3 rgb)
{ return rgb * mat3
( 0.299 , 0.587 , 0.114
@@ -23,14 +22,12 @@ vec3 toRGB (vec3 yuv)
}
void main()
{
fColor = texture(screenTexture, (texPos + x * pinch));
//fColor = texture(screenTexture, (texPos + x*pinch));
//fColor = texture(screenTexture, (texPos + x*pinch));
// fColor = vec4
// ( texture(screenTexture, (texPos + x*pinch)).r
// , texture(screenTexture, (texPos + x*(-pinch))).g
// , texture(screenTexture, texPos).ba
// ) ;
float y = 1 - min(1, sqrt(distance(distmask[1],vec2(0,0))));
fColor = texture(screenTexture
, (texPos + x * pinch[0]
+ y * pinch[1]
));
}
// fColor = vec4
// ( toRGB(vec3( toYUV(texture(screenTexture, texPos).rgb).r
// , toYUV(texture(screenTexture, (texPos + x*pinch)).rgb).g
@@ -38,4 +35,3 @@ void main()
// ) )
// , 1
// ) ;
}