| 1 |
#version 450 |
| 2 |
|
| 3 |
layout(binding = 0) uniform sampler2D uCombined[4]; |
| 4 |
layout(binding = 4) uniform texture2D uTex[4]; |
| 5 |
layout(binding = 8) uniform sampler uSampler[4]; |
| 6 |
layout(binding = 12, rgba32f) uniform writeonly image2D uImage[8]; |
| 7 |
layout(location = 0) in vec2 vTex; |
| 8 |
layout(location = 1) flat in int vIndex; |
| 9 |
|
| 10 |
vec4 sample_in_function(sampler2D samp) |
| 11 |
{ |
| 12 |
return texture(samp, vTex); |
| 13 |
} |
| 14 |
|
| 15 |
vec4 sample_in_function2(texture2D tex, sampler samp) |
| 16 |
{ |
| 17 |
return texture(sampler2D(tex, samp), vTex); |
| 18 |
} |
| 19 |
|
| 20 |
void main() |
| 21 |
{ |
| 22 |
vec4 color = texture(uCombined[vIndex], vTex); |
| 23 |
color += texture(sampler2D(uTex[vIndex], uSampler[vIndex]), vTex); |
| 24 |
color += sample_in_function(uCombined[vIndex + 1]); |
| 25 |
color += sample_in_function2(uTex[vIndex + 1], uSampler[vIndex + 1]); |
| 26 |
|
| 27 |
imageStore(uImage[vIndex], ivec2(gl_FragCoord.xy), color); |
| 28 |
} |