shaders/soften-borders.frag
author František Kučera <franta-hg@frantovo.cz>
Sun, 03 Dec 2023 17:26:26 +0100
branchv_0
changeset 16 0883358bc11d
parent 15 shaders/default.frag@1eb7cfefbeea
child 18 c4384f43c739
permissions -rw-r--r--
new shader: soften-borders.frag

#version 330 core

uniform  sampler2D  uTexture;
in       vec2       vTextureXY;
out      vec4       fColor;

void main(){
	fColor = texture(uTexture, vTextureXY).rgba;

	float width = 0.01;
	fColor.a *= smoothstep(0., 0.+width, vTextureXY.x);
	fColor.a *= smoothstep(1., 1.-width, vTextureXY.x);
	fColor.a *= smoothstep(0., 0.+width, vTextureXY.y);
	fColor.a *= smoothstep(1., 1.-width, vTextureXY.y);
}