#version 450 core
// Purpose: Engine postprocess fragment shader; blends source color with a sampled 3D LUT.

in vec2 vUv;
layout(location = 0) out vec4 FragColor;

uniform sampler2D uSourceTex;
uniform sampler3D uLutTex;
uniform float uStrength;

void main()
{
    vec4 color = texture(uSourceTex, vUv);
    vec3 graded = texture(uLutTex, clamp(color.rgb, vec3(0.0), vec3(1.0))).rgb;
    FragColor = vec4(mix(color.rgb, graded, clamp(uStrength, 0.0, 1.0)), color.a);
}
