Show checker pattern with transparent files
This commit is contained in:
@@ -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))))
|
||||
|
||||
Reference in New Issue
Block a user