1#version 450 2 3layout(location = 0) out vec4 FragColor; 4layout(location = 0) flat in vec2 vTex; 5layout(location = 1) flat in int vIndex; 6layout(binding = 0) uniform sampler2D uSampler[4]; 7layout(binding = 4) uniform sampler uSamplers[4]; 8layout(binding = 8) uniform texture2D uTextures[4]; 9 10vec4 sample_from_argument(sampler2D samplers[4]) 11{ 12 return texture(samplers[vIndex], vTex + 0.2); 13} 14 15vec4 sample_single_from_argument(sampler2D samp) 16{ 17 return texture(samp, vTex + 0.3); 18} 19 20vec4 sample_from_global() 21{ 22 return texture(uSampler[vIndex], vTex + 0.1); 23} 24 25void main() 26{ 27 FragColor = vec4(0.0); 28 FragColor += texture(sampler2D(uTextures[2], uSamplers[1]), vTex); 29 FragColor += texture(uSampler[vIndex], vTex); 30 FragColor += sample_from_global(); 31 FragColor += sample_from_argument(uSampler); 32 FragColor += sample_single_from_argument(uSampler[3]); 33} 34