Work on distortions
This commit is contained in:
+30
-12
@@ -4,20 +4,38 @@ in vec2 distmask;
|
||||
in vec2 pinch;
|
||||
out vec4 fColor;
|
||||
layout (binding = 1) uniform sampler2D screenTexture;
|
||||
float x = 1 - min(1, dot(distmask,distmask));
|
||||
float x = 1 - min(1, sqrt(distance(distmask,vec2(0,0))));
|
||||
float xab = abs(distmask.x);
|
||||
float yab = abs(distmask.y);
|
||||
vec3 toYUV (vec3 rgb)
|
||||
{ return rgb * mat3
|
||||
( 0.299 , 0.587 , 0.114
|
||||
,-0.14713,-0.28886, 0.436
|
||||
, 0.615 ,-0.51499,-0.10001
|
||||
) ;
|
||||
}
|
||||
vec3 toRGB (vec3 yuv)
|
||||
{ return yuv * mat3
|
||||
(1, 0 , 1.13983
|
||||
,1,-0.39465,-0.58060
|
||||
,1, 2.03211, 0
|
||||
) ;
|
||||
}
|
||||
void main()
|
||||
{
|
||||
fColor = (xab < 1 && yab < 1
|
||||
//? vec4 (0.5*(distmask.x+1),0.5*(distmask.y+1),0,1)
|
||||
? vec4 (0.5*(distmask.x+1),0.5*(distmask.y+1),0,1)
|
||||
: texture(screenTexture, texPos));
|
||||
//fColor = texture(screenTexture, (texPos + x*x*pinch));
|
||||
//fColor = vec4
|
||||
// ( texture(screenTexture, (texPos + x*x*pinch)).r
|
||||
// , texture(screenTexture, (texPos - x*x*pinch)).g
|
||||
// , texture(screenTexture, (texPos - x*x*(pinch.yx))).b
|
||||
// , texture(screenTexture, texPos).a
|
||||
// ) ;
|
||||
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
|
||||
// ) ;
|
||||
// fColor = vec4
|
||||
// ( toRGB(vec3( toYUV(texture(screenTexture, texPos).rgb).r
|
||||
// , toYUV(texture(screenTexture, (texPos + x*pinch)).rgb).g
|
||||
// , toYUV(texture(screenTexture, (texPos + x*(pinch))).rgb).b
|
||||
// ) )
|
||||
// , 1
|
||||
// ) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user