public static OperatorPartContext createDefault(ContextSettings settings) { var context = new OperatorPartContext(0.0f); context.D3DDevice = Core.D3DDevice.Device; context.Viewport = new ViewportF(0, 0, settings.DisplayMode.Width, settings.DisplayMode.Height); context.Variables.Add("Screensize.Width", settings.DisplayMode.Width); context.Variables.Add("Screensize.Height", settings.DisplayMode.Height); context.Variables.Add("AspectRatio", (float)settings.AspectRatio); context.Variables.Add("Samples", (float)settings.Sampling); context.Variables.Add("FullScreen", settings.FullScreen ? 1.0f : 0.0f); context.Variables.Add("LoopMode", settings.Looped ? 1.0f : 0.0f); return(context); }
public static string GetValueForTypeFromContext(FunctionType type, OperatorPartContext context) { switch (type) { case FunctionType.Float: return(context.Value.ToString()); case FunctionType.Text: return(context.Text); default: return(String.Empty); } }
public OperatorPartContext Eval(OperatorPartContext context, int outputIdx) { if (Disabled) { return(context); } if (EvaluateCallback != null) { EvaluateCallback(); } return(_function.Eval(context, _connections, outputIdx)); }
protected void Render(OperatorPartContext context) { var subContext = new OperatorPartContext(context) { DepthStencilView = _renderTargetDepthView, RenderTargetView = _renderTargetView, Effect = _effect, Renderer = _renderer, InputLayout = context.Renderer.ScreenQuadInputLayout, CameraProjection = Matrix.OrthoLH(1, 1, -100, 100), WorldToCamera = Matrix.Identity, ObjectTWorld = Matrix.Identity, TextureMatrix = Matrix.Identity }; subContext.Renderer.SetupEffect(subContext); subContext.Renderer.Render(subContext.Renderer._screenQuadMesh, subContext); }
protected void Render(OperatorPartContext context) { var subContext = new OperatorPartContext(context) { DepthStencilView = _renderTargetDepthView, RenderTargetView = _renderTargetView, Effect = _effect, Renderer = _renderer, InputLayout = context.Renderer.ScreenQuadInputLayout, CameraProjection = Matrix.OrthoLH(1, 1, -100, 100), WorldToCamera = Matrix.Identity, ObjectTWorld = Matrix.Identity, TextureMatrix = Matrix.Identity, BlendState = OperatorPartContext.DefaultRenderer.DisabledBlendState, }; subContext.Renderer.SetupEffect(subContext); subContext.Renderer.Render(subContext.Renderer._screenQuadMesh, subContext); // unbind RTs immediately in case the image created here is used without setting new RTs context.D3DDevice.ImmediateContext.OutputMerger.SetTargets((DepthStencilView)null, (RenderTargetView)null); }
protected abstract void UpdateOnChange(OperatorPartContext context);
protected virtual ViewportF GetViewport(OperatorPartContext context) { return(context.Viewport); }
protected virtual Format GetColorBufferFormat(OperatorPartContext context) { return(context.ImageBufferFormat); }
public abstract OperatorPartContext Eval(OperatorPartContext context, List <OperatorPart> inputs, int outputIdx);
public OperatorPartContext Eval(OperatorPartContext context) { return(Eval(context, Func.EvaluationIndex)); }
public sealed override OperatorPartContext Eval(OperatorPartContext context, List <OperatorPart> inputs, int outputIdx) { Logger.Debug(this, "Supplier Assembly '{0}' evaluated.", Name); return(context); }
public OperatorPartContext(OperatorPartContext other, float globalTime) : this(other) { GlobalTime = globalTime; Time = globalTime; }
public OperatorPartContext SetValueInContext(OperatorPartContext context) { context.Text = Val; return(context); }
public void SetValueFromContext(OperatorPartContext context) { Val = context.Value; }
public static Vector3 EvaluateVector3(OperatorPartContext context, List <OperatorPart> inputs, int startIdx) { return(new Vector3(inputs[startIdx].Eval(context).Value, inputs[startIdx + 1].Eval(context).Value, inputs[startIdx + 2].Eval(context).Value)); }
public override OperatorPartContext Eval(OperatorPartContext context, List <OperatorPart> inputs, int outputIdx) { Value.SetValueInContext(context); Changed = false; return(context); }
public OperatorPartContext SetValueInContext(OperatorPartContext context) { return(context); }