Allow for multiple distortions at once
This commit is contained in:
+10
-14
@@ -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
|
||||
// ) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user