shaders/scanlines-basic.frag
author František Kučera <franta-hg@frantovo.cz>
Wed, 06 Dec 2023 22:54:24 +0100
branchv_0
changeset 21 bcc53967ab3c
parent 18 c4384f43c739
child 28 4cbd9c0beb4c
permissions -rw-r--r--
shaders: dynamic line count derived from the texture resolution

#version 330 core

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

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

	float lineCount = textureSize(uTexture, 0).y;
	fColor.xyz *= abs(sin(radians(vTextureXY.y * 180. * lineCount)));
}