Exemplo n.º 1
0
        sealed protected override VFXExpression ConvertExpression(VFXExpression expression, VFXSlot sourceSlot)
        {
            if (sourceSlot != null)
            {
                if (sourceSlot.GetType() == typeof(VFXSlotDirection))
                {
                    return(expression); //avoid multiple normalization
                }
                if (sourceSlot.property.attributes != null && sourceSlot.property.attributes.OfType <NormalizeAttribute>().Any())
                {
                    return(expression); //avoid multiple normalization from Normalize attribute (rarely used for output slot)
                }
            }

            if (expression.valueType == VFXValueType.Float4)
            {
                expression = VFXOperatorUtility.CastFloat(expression, VFXValueType.Float3);
            }

            return(ApplyPatchExpression(expression));
        }