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

<CustomShader version="1.0" classRequirement="">
    <LodLevel startDistance="0">
        <Parameters>
            <Parameter name="partScale" target="In.mat.partScale" type="float3"/>
        </Parameters>
				
        <CodeInjections>
	        <CodeInjection position="NUM_TEXCOORDS">
<![CDATA[
#ifdef ALPHA_TESTED
#undef ALPHA_TESTED
#endif
]]>
            </CodeInjection>
            <CodeInjection position="MATERIALINFO">
<![CDATA[
uniform float3 partScale;
]]>
            </CodeInjection>
            <CodeInjection position="POST_ALBEDO_FS">
<![CDATA[
albedo.xyz = lerp(albedo.xyz, albedo.xyz*In.mat.partScale.xyz, albedo.w);
]]>
	        </CodeInjection>


            <CodeInjection position="GET_REFLECTION_COLOR_FS">
<![CDATA[
#if defined(REFLECTION_MAP_2D) || defined(REFLECTION_MAP_CUBE)
    float fresnel2 = max(min(getFresnel(facing, In.mat.reflectionRefractionCoeffScale[0], 3.0)*0.3, 0.1), 0.075);
	fresnel2 *= tex2D(In.samplers.baseMap, getTexCoords(In, globals, ALBEDOMAP_TEXCOORD)).a;
    res = lerp(oColor.xyz, getReflectionColorTex(In, globals, normal, viewDir), fresnel2);
#endif
]]>
            </CodeInjection>
        </CodeInjections>
    </LodLevel>
</CustomShader>
