<!--
===========================================================================
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.
===========================================================================

Main fragment for color logic plugin
-->

<fragment uiName="floatLogic" name="floatLogic" type="plumbing" class="ShadeFragment" version="1.0">
	<description><![CDATA[Color with color mask fragment]]></description>
	<properties>
		<float name="floatA" />
		<float name="floatB" />
		<int name="operation" />
	</properties>
	<values>
		<float name="floatA" value="1.0" />
		<float name="floatB" value="0.0" />
		<int name="operation" value="0" />
	</values>
	<outputs>
		<bool  name="outBool" />
	</outputs>
	<implementation>
	<implementation render="OGSRenderer" language="Cg" lang_version="2.1">
		<function_name val="floatLogic" />
		<source>
		<![CDATA[
bool floatLogic(float floatA, float floatB, int operation) 
{
	if (operation==0)
	{
		return (floatA == floatB);
	}
	else if (operation==1)
	{
		return (floatA != floatB);
	}
	else if (operation==2)
	{
		return (floatA < floatB);
	}
	else if (operation==3)
	{
		return (floatA > floatB);
	}
	else if (operation==4)
	{
		return (floatA <= floatB);
	}
	else if (operation==5)
	{
		return (floatA >= floatB);
	}
	else
	{
		return false;
	}
}
		]]>
		</source>
	</implementation>
	<implementation render="OGSRenderer" language="HLSL" lang_version="11.0">
		<function_name val="floatLogic" />
		<source>
		<![CDATA[
bool floatLogic(float floatA, float floatB, int operation)
{ 
	if (operation==0)
	{
		return (floatA == floatB);
	}
	else if (operation==1)
	{
		return (floatA != floatB);
	}
	else if (operation==2)
	{
		return (floatA < floatB);
	}
	else if (operation==3)
	{
		return (floatA > floatB);
	}
	else if (operation==4)
	{
		return (floatA <= floatB);
	}
	else if (operation==5)
	{
		return (floatA >= floatB);
	}
	else
	{
		return false;
	}
}
		]]>
		</source>
		</implementation>
		<implementation render="OGSRenderer" language="GLSL" lang_version="3.0">
			<function_name val="floatLogic" />
			<source>
				<![CDATA[
bool floatLogic(float floatA, float floatB, int operation)
{ 
	if (operation==0)
	{
		return (floatA == floatB);
	}
	else if (operation==1)
	{
		return (floatA != floatB);
	}
	else if (operation==2)
	{
		return (floatA < floatB);
	}
	else if (operation==3)
	{
		return (floatA > floatB);
	}
	else if (operation==4)
	{
		return (floatA <= floatB);
	}
	else if (operation==5)
	{
		return (floatA >= floatB);
	}
	else
	{
		return false;
	}
}
		]]>
		</source>
	</implementation>
	</implementation>
</fragment>
