# HG changeset patch # User František Kučera # Date 1701899664 -3600 # Node ID bcc53967ab3c2aa4ad836ca3141bbbfa1da27cb4 # Parent 0899e966993efaf18deb04004bf963cf5939128d shaders: dynamic line count derived from the texture resolution diff -r 0899e966993e -r bcc53967ab3c shaders/phosphor-basic.frag --- a/shaders/phosphor-basic.frag Tue Dec 05 22:55:25 2023 +0100 +++ b/shaders/phosphor-basic.frag Wed Dec 06 22:54:24 2023 +0100 @@ -26,10 +26,10 @@ // fColor = invert(fColor); fColor = (fColor-rand(vTextureXY)*0.3) * 1.6; - float lineCount = 200.; + float lineCount = textureSize(uTexture, 0).y; fColor.xyz *= abs(sin(radians(vTextureXY.y * 180. * lineCount))); - // float columnCount = 320; + // float columnCount = textureSize(uTexture, 0).x; // fColor.xyz *= // clamp(abs(sin(radians(vTextureXY.x * 180. * columnCount)))+0.6, 0., 1.); diff -r 0899e966993e -r bcc53967ab3c shaders/scanlines-basic.frag --- a/shaders/scanlines-basic.frag Tue Dec 05 22:55:25 2023 +0100 +++ b/shaders/scanlines-basic.frag Wed Dec 06 22:54:24 2023 +0100 @@ -7,6 +7,6 @@ void main() { fColor = texture(uTexture, vTextureXY).rgba; - float lineCount = 200.; + float lineCount = textureSize(uTexture, 0).y; fColor.xyz *= abs(sin(radians(vTextureXY.y * 180. * lineCount))); }