예제 #1
0
        static public VFXExpression SequentialLine(VFXExpression start, VFXExpression end, VFXExpression index, VFXExpression count)
        {
            VFXExpression dt = new VFXExpressionCastUintToFloat(VFXOperatorUtility.Modulo(index, count));

            dt = dt / new VFXExpressionCastUintToFloat(count);
            dt = new VFXExpressionCombine(dt, dt, dt);
            return(VFXOperatorUtility.Lerp(start, end, dt));
        }
        static public VFXExpression SequentialLine(VFXExpression start, VFXExpression end, VFXExpression index, VFXExpression count)
        {
            VFXExpression dt   = new VFXExpressionCastUintToFloat(VFXOperatorUtility.Modulo(index, count));
            var           size = new VFXExpressionCastUintToFloat(count) - VFXOperatorUtility.OneExpression[VFXValueType.Float];

            size = new VFXExpressionMax(size, VFXOperatorUtility.OneExpression[VFXValueType.Float]);
            dt   = dt / size;
            dt   = new VFXExpressionCombine(dt, dt, dt);
            return(VFXOperatorUtility.Lerp(start, end, dt));
        }
예제 #3
0
        static private VFXExpression ApplyAddressingMode(VFXExpression index, VFXExpression count, SequentialAddressingMode mode)
        {
            VFXExpression r = null;

            if (mode == SequentialAddressingMode.Wrap)
            {
                r = VFXOperatorUtility.Modulo(index, count);
            }
            else if (mode == SequentialAddressingMode.Clamp)
            {
                r = VFXOperatorUtility.Clamp(index, ZeroExpression[VFXValueType.Uint32], count, false);
            }
            else if (mode == SequentialAddressingMode.Mirror)
            {
                var direction = VFXOperatorUtility.Modulo(index / count, VFXOperatorUtility.TwoExpression[VFXValueType.Uint32]);
                var modulo    = VFXOperatorUtility.Modulo(index, count);
                r = VFXOperatorUtility.Lerp(modulo, count - modulo, direction);
            }
            return(r);
        }
예제 #4
0
 static VFXExpression RandomFromVector2(VFXExpression input)
 {
     return(VFXOperatorUtility.Lerp(input.x, input.y, new VFXExpressionRandom()));
 }
 static VFXExpression RandomFromVector2(VFXExpression input, RandId randId)
 {
     return(VFXOperatorUtility.Lerp(input.x, input.y, new VFXExpressionRandom(false, randId)));
 }