19 lines
608 B
GLSL
19 lines
608 B
GLSL
#version 450 core
|
|
in vec2 vTexPos;
|
|
out vec4 fColor;
|
|
layout(binding = 0) uniform sampler2D wincol;
|
|
layout(binding = 1) uniform sampler2D winpos;
|
|
layout(binding = 2) uniform sampler2D cloudcol;
|
|
layout(binding = 3) uniform sampler2D cloudpos;
|
|
vec4 blend (vec4 src, vec4 dst) {
|
|
return src + (1-src.a) * dst;
|
|
}
|
|
void main() {
|
|
//fColor = texture(t0, vTexPos) + texture(t2, vTexPos);
|
|
vec4 x = texture(wincol, vTexPos);
|
|
float xz = texture(winpos, vTexPos).z;
|
|
vec4 y = texture(cloudcol, vTexPos);
|
|
float yz = texture(cloudpos, vTexPos).z;
|
|
fColor = ( xz > yz ? blend(x,y) : blend(y,x)) ;
|
|
}
|