blob: 8f94a10533207109016e0ad300a1d4d5c7b93b15 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
out vec4 FragColor;
uniform sampler2D wireColor;
uniform sampler2D wireDepth;
uniform sampler2D sceneDepth;
uniform float alpha;
void main()
{
ivec2 uv = ivec2(gl_FragCoord.xy);
float wire_depth = texelFetch(wireDepth, uv, 0).r;
float scene_depth = texelFetch(sceneDepth, uv, 0).r;
vec4 wire_color = texelFetch(wireColor, uv, 0).rgba;
FragColor = wire_color;
/* Modulate alpha if occluded */
if (wire_depth > scene_depth) {
FragColor.a *= alpha;
}
}
|