shaders/default.frag
author František Kučera <franta-hg@frantovo.cz>
Tue, 26 Dec 2023 23:46:45 +0100
branchv_0
changeset 28 4cbd9c0beb4c
parent 20 0899e966993e
permissions -rw-r--r--
pass texture xattr 'shader-shark.texture.scale' to the shaders as 'uTextureScale' + update variable locations on each shader reload

#version 330 core

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

vec4 grayscale(vec4 original) {
	const vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721);
	float luminance = dot(original.rgb, luminanceWeighting);
	return vec4(vec3(luminance), original.a);
}

void main() {
	fColor = texture(uTexture, vTextureXY).rgba;
	// fColor = grayscale(fColor);
	// fColor *= vec4(0.8, 1., 0.2, 1.);

	// if (fColor.a < 0.1) discard;
	// Pretty, pretty, pretty, pretty, Peggy Sue
}