Пример #1
0
        private void Update(EvaluationContext context)
        {
            Utilities.Dispose(ref _parameterBuffer);
            ResourceManager.Instance().SetupConstBuffer(new FogSettings.FogParameters
            {
                Bias     = Bias.GetValue(context),
                Distance = Distance.GetValue(context),
                Color    = Color.GetValue(context)
            }, ref _parameterBuffer);

            var previousParameters = context.FogParameters;

            context.FogParameters = _parameterBuffer;

            // Evaluate sub tree
            Command.GetValue(context);

            context.FogParameters = previousParameters;
        }
Пример #2
0
        private void Update(EvaluationContext context)
        {
            _phase = Phase.GetValue(context);
            _bias  = Bias.GetValue(context);
            _shape = (Shapes)Shape.GetValue(context);
            _ratio = Ratio.GetValue(context);
            var time = OverrideTime.IsConnected
                           ? OverrideTime.GetValue(context)
                           : EvaluationContext.BeatTime;

            var rate = Rate.GetValue(context);

            var t = time * rate;

            LastFraction = (float)MathUtils.Fmod(t, 1);

            var normalizedValue = CalcNormalizedValueForFraction(t);

            Result.Value = normalizedValue * Amplitude.GetValue(context) + Offset.GetValue(context);
        }