
#if USE_AAA_UNIFORM == 1
#else
#endif


#define time    aaa_fu_float[0]


layout(binding = 2) uniform sampler2D g_input_texture_0;
layout(binding = 1) uniform sampler2D g_input_texture_1;
layout(binding = 4) uniform sampler2D g_input_texture_2;


layout(location = 0) in vec2 in_texcoord;
layout(location = 0) out vec4 fragColor;

//CONST float u_mix_begin_1 = aaa_fu_float[1];
//CONST float u_mix_end_1   = aaa_fu_float[2];
//CONST float u_mix_begin_2 = aaa_fu_float[3];
//CONST float u_mix_end_2   = aaa_fu_float[4];

void main(void)
{
    vec4 color0 = texture(g_input_texture_0, in_texcoord);
    vec4 color1 = texture(g_input_texture_1, in_texcoord);
    vec4 color2 = texture(g_input_texture_2, in_texcoord);

    float y = in_texcoord.y;

    // Mix à 3 zones avec interpolation douce sur 10%
    float blend1 = smoothstep(0.25, 0.35, y);
    float blend2 = smoothstep(0.65, 0.75, y);

    vec4 mixed = mix(color0, color1, blend1);
    mixed = mix(mixed, color2, blend2);

    fragColor = mixed;

    //float mix1 = smoothstep(u_mix_begin_1, u_mix_end_1, y);
    //vec4 mixed_01 = mix(color0, color1, mix1);

    //float mix2 = smoothstep(u_mix_begin_2, u_mix_end_2, y);
    //vec4 final_color = mix(mixed_01, color2, mix2);

    //fragColor = final_color;
}