Show checker pattern with transparent files

This commit is contained in:
2022-11-28 17:32:23 +01:00
parent 9e98127084
commit 34d466c3e0
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -22,6 +22,12 @@ vec4 MTF(vec4 x, vec3 m)
return ((m.y - 1) * x) / ((2 * m.y - 1) * x - m.y);
}
vec3 checker()
{
vec2 pattern = fract(gl_FragCoord.xy * 0.0625) - 0.5;
return vec3(step(pattern.x * pattern.y, 0.0) * 0.25 + 0.25);
}
void main(void)
{
color = texture(qt_Texture0, qt_TexCoord0);
@@ -30,6 +36,8 @@ void main(void)
if(invert)color = vec4(1.0) - color;
color.rgb = mix(checker(), color.rgb, color.a);
if(srgb)color.rgb = Linear2sRGB(color.rgb);
if(any(lessThan(qt_TexCoord0, vec2(0.0))) || any(greaterThan(qt_TexCoord0, vec2(1.0))))