// Greater than 
// GreaterThan.osl, by Zap Andersson
// Modified: 2019-11-26
// Copyright 2019 Autodesk Inc, All rights reserved. This file is licensed under Apache 2.0 license
//    https://github.com/ADN-DevTech/3dsMax-OSL-Shaders/blob/master/LICENSE.txt

shader GreaterThan
[[ string help = "Simpler comparision shader that just returns two different colors for value being creater than (or not)",
   string label= "Greater Than",
   string category = "Switchers" ]]
(
	float A      = 0.0  [[ string label = "Input A" ]],
	float B      = 0.0  [[ string label = "Input B" ]],
	color Greater= color(0.0,1.0,0.0)  [[ string label = "Result if A > B" ]],
	color Else   = color(1.0,0.0,0.0)  [[ string label = "Result if not" ]],	
	
	output color Out   = 0.0,
	output float Float = 0.0,
)
{
	if (A > B)
		Out = Greater;
	else 
		Out = Else;
		
	// Float output is just the average
	Float = (Out[0]+Out[1]+Out[2])/3.0;
}
