예제 #1
0
        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);
        }
예제 #2
0
파일: BasicTypes.cs 프로젝트: yarwelp/tooll
        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);
            }
        }
예제 #3
0
        public OperatorPartContext Eval(OperatorPartContext context, int outputIdx)
        {
            if (Disabled)
            {
                return(context);
            }

            if (EvaluateCallback != null)
            {
                EvaluateCallback();
            }

            return(_function.Eval(context, _connections, outputIdx));
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
 protected abstract void UpdateOnChange(OperatorPartContext context);
예제 #7
0
 protected virtual ViewportF GetViewport(OperatorPartContext context)
 {
     return(context.Viewport);
 }
예제 #8
0
 protected virtual Format GetColorBufferFormat(OperatorPartContext context)
 {
     return(context.ImageBufferFormat);
 }
예제 #9
0
 public abstract OperatorPartContext Eval(OperatorPartContext context, List <OperatorPart> inputs, int outputIdx);
예제 #10
0
 public OperatorPartContext Eval(OperatorPartContext context)
 {
     return(Eval(context, Func.EvaluationIndex));
 }
예제 #11
0
 public sealed override OperatorPartContext Eval(OperatorPartContext context, List <OperatorPart> inputs, int outputIdx)
 {
     Logger.Debug(this, "Supplier Assembly '{0}' evaluated.", Name);
     return(context);
 }
예제 #12
0
 public OperatorPartContext(OperatorPartContext other, float globalTime)
     : this(other)
 {
     GlobalTime = globalTime;
     Time       = globalTime;
 }
예제 #13
0
파일: BasicTypes.cs 프로젝트: yarwelp/tooll
 public OperatorPartContext SetValueInContext(OperatorPartContext context)
 {
     context.Text = Val;
     return(context);
 }
예제 #14
0
파일: BasicTypes.cs 프로젝트: yarwelp/tooll
 public void SetValueFromContext(OperatorPartContext context)
 {
     Val = context.Value;
 }
예제 #15
0
 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));
 }
예제 #16
0
 public override OperatorPartContext Eval(OperatorPartContext context, List <OperatorPart> inputs, int outputIdx)
 {
     Value.SetValueInContext(context);
     Changed = false;
     return(context);
 }
예제 #17
0
파일: BasicTypes.cs 프로젝트: yarwelp/tooll
 public OperatorPartContext SetValueInContext(OperatorPartContext context)
 {
     return(context);
 }