﻿<?xml version="1.0" encoding="utf-8"?>

<!-- simple shader to manipulate materials for debugging purposes -->

<CustomShader version="5">
    <Parameters>
        <Parameter name = "mixAmount" target = "mixAmount" type = "float"  group="base" defaultValue = "1.0"         minValue = "0.0"         maxValue = "1.0"/>
        <Parameter name = "color"     target = "col0"      type = "float3" group="base" defaultValue = "0.5 0.5 0.5" minValue = "0.0 0.0 0.0" maxValue = "1.0 1.0 1.0"/>
        <Parameter name = "alpha"     target = "alpha"     type = "float"  group="base" defaultValue = "1.0"         minValue = "0.0"         maxValue = "1.0"/>
    </Parameters>
    <UvUsages>
        <UvUsage textureName="baseMap"        uvType="uv0" uvScale="1.0"/>
    </UvUsages>
    <LodLevel startDistance="0">
        <CodeInjections>
            <CodeInjection position = "OBJECT_PARAMETERS">
<![CDATA[
    float mixAmount;
    float3 color;
    float alpha;
]]>
            </CodeInjection>
            <CodeInjection position = "POST_DIFFUSE_COLOR_FS">
<![CDATA[
#if defined(ALBEDO_MAP)
    diffuseColor.rgb = lerp( diffuseColor.rgb, object.color.rgb, object.mixAmount );
#endif
]]>
            </CodeInjection>
            <CodeInjection position="ALPHA_FS">
<![CDATA[
    alpha = object.alpha;
]]>
            </CodeInjection>
        </CodeInjections>
    </LodLevel>
</CustomShader>
