<!--
===========================================================================
Copyright 2015 Autodesk, Inc. All rights reserved.

Use of this software is subject to the terms of the Autodesk license
agreement provided at the time of installation or download, or which
otherwise accompanies this software in either electronic or hard copy form.
===========================================================================

Top level fragment graph for constant shader plugin

-->

<fragment_graph name="colorMask" ref="colorMask" class="FragmentGraph" version="1.0">
	<fragments>
        <fragment_ref name="mayaTextureOutput" ref="mayaTextureOutput" />
		<fragment_ref name="combineMayaTextureOutput" ref="combineMayaTextureOutput" />
		<fragment_ref name="colorConditionBase" ref="colorConditionBase" />
		<fragment_ref name="colorMaskBase" ref="colorMaskBase" />
		<fragment_ref name="floatMask" ref="floatMask" />
		<fragment_ref name="floatSubtract" ref="floatSubtract" />
		<fragment_ref name="floatCondition" ref="floatCondition" />
		<fragment_ref name="mayaLuminance" ref="mayaLuminance" />
		<fragment_ref name="baseColorPassThrough" ref="mayafloat3PassThrough" />
		<fragment_ref name="maskColorPassThrough" ref="mayafloat3PassThrough" />
	</fragments>
	<connections>
        <connect from="combineMayaTextureOutput.output" to="mayaTextureOutput.mayaTextureOutput" name="mayaTextureOutput" />
        <connect from="colorConditionBase.outColor" to="combineMayaTextureOutput.base" name="combineBase" />
        <connect from="colorMaskBase.outColor" to="colorConditionBase.colorB" name="colorConditionB" />
        <connect from="floatMask.outFloat" to="combineMayaTextureOutput.alpha" name="combineAlpha" />
        <connect from="floatCondition.outFloat" to="colorMaskBase.maskAlpha" name="colorMaskAlpha" />
        <connect from="floatCondition.outFloat" to="floatMask.mask" name="floatMask" />
        <connect from="floatSubtract.floatSubtract" to="floatCondition.floatA" name="subtractCondition" />
        <connect from="mayaLuminance.outValue" to="floatSubtract.floatB" name="lumeSubtract`" />
		<connect from="baseColorPassThrough.mayafloat3PassThrough" to="colorConditionBase.colorA" name="colorConditionA" />
        <connect from="baseColorPassThrough.mayafloat3PassThrough" to="colorMaskBase.inColor" name="colorMaskBase" />
        <connect from="maskColorPassThrough.mayafloat3PassThrough" to="colorMaskBase.mask" name="colorMaskMask" />
        <connect from="maskColorPassThrough.mayafloat3PassThrough" to="mayaLuminance.value" name="lumeInput" />
	</connections>
	<properties>
		<float3 name="inColor" ref="baseColorPassThrough.input" />
		<float name="inAlpha" ref="floatMask.inFloat" />
		<bool name="preserveColor" ref="colorConditionBase.condition" />
		<float3 name="mask" ref="maskColorPassThrough.input" />
		<float name="maskAlpha" ref="floatCondition.floatB" />
		<bool name="maskAlphaIsLuminance" ref="floatCondition.condition" />
	</properties>
	<values>
		<float3 name="inColor" value="0.3,0.3,0.3" />
		<float name="inAlpha" value="0.0" />
		<bool name="preserveColor" value="false" />
		<float3 name="mask" value="1.0,0.0,0.5" />
		<float name="maskAlpha" value="0.0" />
		<bool name="maskAlphaIsLuminance" value="true" />
	</values>
	<outputs>
        <struct name="mayaTextureOutput" ref="mayaTextureOutput.mayaTextureOutput" />
	</outputs>
</fragment_graph>