예제 #1
0
        protected override VFXExpression[] BuildExpression(VFXExpression[] inputExpression)
        {
            var type = inputExpression[0].valueType;

            VFXExpression input;

            if (Clamp)
            {
                input = VFXOperatorUtility.Saturate(inputExpression[0]);
            }
            else
            {
                input = inputExpression[0];
            }

            return(new[] { VFXOperatorUtility.Mad(input, VFXOperatorUtility.TwoExpression[type], VFXOperatorUtility.Negate(VFXOperatorUtility.OneExpression[type])) });
        }
예제 #2
0
        protected override VFXExpression[] BuildExpression(VFXExpression[] inputExpression)
        {
            var type = inputExpression[0].valueType;

            var half       = VFXOperatorUtility.HalfExpression[type];
            var expression = VFXOperatorUtility.Mad(inputExpression[0], half, half);

            if (Clamp)
            {
                return new[] { VFXOperatorUtility.Saturate(expression) }
            }
            ;
            else
            {
                return new[] { expression }
            };
        }