yzt
2023-05-26 de4278af2fd46705a40bac58ec01122db6b7f3d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifdef MRT
#extension GL_EXT_draw_buffers : enable
#endif
 
uniform vec4 u_bgColor;
uniform sampler2D u_depthTexture;
 
varying vec2 v_textureCoordinates;
 
void main()
{
    if (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)
    {
#ifdef MRT
        gl_FragData[0] = u_bgColor;
        gl_FragData[1] = vec4(u_bgColor.a);
#else
        gl_FragColor = u_bgColor;
#endif
        return;
    }
    
    discard;
}