コード例 #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
ファイル: FXImageFunction.cs プロジェクト: yarwelp/tooll
 protected virtual ViewportF GetViewport(OperatorPartContext context)
 {
     return(context.Viewport);
 }
コード例 #8
0
ファイル: FXImageFunction.cs プロジェクト: yarwelp/tooll
 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
ファイル: SupplierAssembly.cs プロジェクト: yarwelp/tooll
 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);
 }