Work on distortion shader

This commit is contained in:
2025-11-15 23:17:44 +00:00
parent d436b853eb
commit 1205823ddb
12 changed files with 108 additions and 119 deletions
+15 -2
View File
@@ -1,10 +1,23 @@
#version 450 core
in vec2 texPos;
in vec2 distmask;
in vec2 pinch;
out vec4 fColor;
layout (binding = 1) uniform sampler2D screenTexture;
float x = min(1, dot(distmask,distmask));
float x = 1 - min(1, dot(distmask,distmask));
float xab = abs(distmask.x);
float yab = abs(distmask.y);
void main()
{
fColor = mix(texture(screenTexture, texPos),vec4(1,0,0,1),x);
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
// ) ;
}