// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
shader ComputeColorColorBurn : ComputeColor
{
    compose ComputeColor color1;
    compose ComputeColor color2;

    override float4 Compute()
    {
        float4 backColor = color1.Compute();
        float4 frontColor = color2.Compute();

        // http://en.wikipedia.org/wiki/Blend_modes#Dodge_and_burn
        // The Color Burn mode divides the inverted bottom layer by the top layer, and then inverts the result
         return float4(1.0f - BlendUtils.ColorDivide((1.0f - backColor.rgb), frontColor.rgb), 1.0f);
    }
};
