shaders/soften-borders.frag
author František Kučera <franta-hg@frantovo.cz>
Thu, 28 Dec 2023 01:35:17 +0100
branchv_0
changeset 37 fb673fa1cad5
parent 28 4cbd9c0beb4c
permissions -rw-r--r--
documentation: mouse and keyboard controls

#version 330 core

uniform  sampler2D  uTexture;
uniform  float      uTextureScale;
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);
}