Work on distortion shader
This commit is contained in:
@@ -1,20 +1,10 @@
|
||||
#version 450 core
|
||||
in vec2 texPos;
|
||||
in vec2 texDist;
|
||||
in float gfactor;
|
||||
in vec2 vcpos;
|
||||
in vec2 distmask;
|
||||
out vec4 fColor;
|
||||
layout (binding = 1) uniform sampler2D screenTexture;
|
||||
float f ( float x) {
|
||||
if (x>1) {return 1;} else {return (1-gfactor)*x + gfactor;}
|
||||
}
|
||||
float x = min(1, dot(distmask,distmask));
|
||||
void main()
|
||||
{
|
||||
float t = f(length(texDist));
|
||||
float r = texture(screenTexture , (t*texPos - vcpos)).r ;
|
||||
vec2 gb = texture(screenTexture
|
||||
, 0.5+0.5 *( vcpos + t * (texPos - vcpos))
|
||||
).gb
|
||||
;
|
||||
fColor = vec4(r,gb,1);
|
||||
fColor = mix(texture(screenTexture, texPos),vec4(1,0,0,1),x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user