当前位置: 首页>>代码示例>>C#>>正文


C# DX11.DX11RenderContext类代码示例

本文整理汇总了C#中FeralTic.DX11.DX11RenderContext的典型用法代码示例。如果您正苦于以下问题:C# DX11RenderContext类的具体用法?C# DX11RenderContext怎么用?C# DX11RenderContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DX11RenderContext类属于FeralTic.DX11命名空间,在下文中一共展示了DX11RenderContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnBeginQuery

 protected void OnBeginQuery(DX11RenderContext context)
 {
     if (this.BeginQuery != null)
     {
         this.BeginQuery(context);
     }
 }
开发者ID:kopffarben,项目名称:dx11-vvvv,代码行数:7,代码来源:DX11BaseShaderNode.cs

示例2: Render

        public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
        {
            if (this.FEnabled[0])
            {
                if (this.FLayerIn.PluginIO.IsConnected)
                {
                    List<IDX11RenderSemantic> semantics = new List<IDX11RenderSemantic>();
                    if (this.FInSemantics.PluginIO.IsConnected)
                    {
                        semantics.AddRange(this.FInSemantics);
                        settings.CustomSemantics.AddRange(semantics);
                    }

                    List<DX11Resource<IDX11RenderSemantic>> ressemantics = new List<DX11Resource<IDX11RenderSemantic>>();
                    if (this.FInResSemantics.PluginIO.IsConnected)
                    {
                        ressemantics.AddRange(this.FInResSemantics);
                        settings.ResourceSemantics.AddRange(ressemantics);
                    }

                    this.FLayerIn[0][context].Render(this.FLayerIn.PluginIO, context, settings);

                    foreach (IDX11RenderSemantic semantic in semantics)
                    {
                        settings.CustomSemantics.Remove(semantic);
                    }

                    foreach (DX11Resource<IDX11RenderSemantic> rs in ressemantics)
                    {
                        settings.ResourceSemantics.Remove(rs);
                    }

                }
            }
        }
开发者ID:sunep,项目名称:dx11-vvvv,代码行数:35,代码来源:DX11LayerSemanticsNode.cs

示例3: Render

        public void Render(DX11RenderContext context)
        {
            if (!this.FInLayer.IsConnected && this.AllowEmptyLayer == false) { return; }

            if (this.rendereddevices.Contains(context)) { return; }

            if (!this.updateddevices.Contains(context))
            {
                this.Update(null, context);
            }

            if (this.FInEnabled[0])
            {
                DX11RenderSettings rs = this.settings[context];

                this.PreRender(context, rs);

                for (int j = 0; j < this.FInLayer.SliceCount; j++)
                {
                    this.FInLayer[j][context].Render(this.FInLayer.PluginIO, context, rs);
                }

                this.PostRender(context);
            }
        }
开发者ID:dotprodukt,项目名称:dx11-vvvv,代码行数:25,代码来源:AbstractComputeRenderer.cs

示例4: Render

        public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
        {
            IDX11Geometry g = settings.Geometry;
            if (this.FEnabled[0])
            {
                if (this.FLayerIn.IsConnected)
                {
                    if (this.FInGeometry.IsConnected)
                    {
                        settings.Geometry = this.FInGeometry[0][context];
                    }

                    for (int i = 0; i < this.FLayerIn.SliceCount; i++)
                    {
                        this.FLayerIn[i][context].Render(this.FLayerIn.PluginIO, context, settings);
                    }
                }
            }
            else
            {
                if (this.FLayerIn.IsConnected)
                {
                    for (int i = 0; i < this.FLayerIn.SliceCount; i++)
                    {
                        this.FLayerIn[i][context].Render(this.FLayerIn.PluginIO, context, settings);
                    }
                }
            }
            settings.Geometry = g;
        }
开发者ID:sebllll,项目名称:dx11-vvvv,代码行数:30,代码来源:DX11LayerGeometryNode.cs

示例5: GetGeom

        /*[Input("Size",DefaultValues= new double[] { 1,1,1})]
        IDiffSpread<Vector3> FSize;*/
        protected override DX11IndexedGeometry GetGeom(DX11RenderContext context, int slice)
        {
            Isocahedron iso = new Isocahedron();
            iso.Size = new Vector3(1, 1, 1);

            return context.Primitives.Isocahedron(iso);
        }
开发者ID:hameleon-ed,项目名称:dx11-vvvv,代码行数:9,代码来源:DX11IsocahedronNode.cs

示例6: Update

        public void Update(IPluginIO pin, DX11RenderContext context)
        {
            if (this.FOutGeom.SliceCount == 0) { return; }

            if (this.dispatchBuffer == null)
            {
                this.dispatchBuffer = new DispatchIndirectBuffer(context);
            }

            if (!this.FOutGeom[0].Contains(context))
            {
                this.indirectDispatch = new DX11NullIndirectDispatcher();
                this.indirectDispatch.IndirectArgs = this.dispatchBuffer;

                DX11NullGeometry nullgeom = new DX11NullGeometry(context);
                nullgeom.AssignDrawer(this.indirectDispatch);

                this.FOutGeom[0][context] = nullgeom;
            }

            var countuav = this.FInArgBuffer[0][context];

            var argBuffer = this.dispatchBuffer.Buffer;

            int argOffset = this.FInArgOffset[0];
            ResourceRegion region = new ResourceRegion(argOffset, 0, 0, argOffset + 12, 1, 1); //Packed xyz value here
            context.CurrentDeviceContext.CopySubresourceRegion(this.FInArgBuffer[0][context].Buffer, 0, region, argBuffer, 0, 0, 0, 0);
        }
开发者ID:sunep,项目名称:dx11-vvvv,代码行数:28,代码来源:DispatchIndirectBufferNode.cs

示例7: Update

        public void Update(IPluginIO pin, DX11RenderContext context)
        {
            for (int i = 0; i < this.FOutGeom.SliceCount; i++)
            {
                DX11VertexGeometry geom = (DX11VertexGeometry)this.FInGeom[i][context].ShallowCopy();

                if (this.FInEnabled[i])
                {

                    if (this.FInGeom.IsChanged || this.FInCnt.IsChanged)
                    {
                        DX11VertexIndirectDrawer ind = new DX11VertexIndirectDrawer();
                        geom.AssignDrawer(ind);

                        ind.Update(context, this.FInCnt[i]);
                    }

                    DX11VertexIndirectDrawer drawer = (DX11VertexIndirectDrawer)geom.Drawer;

                    if (this.FInI.PluginIO.IsConnected)
                    {
                        drawer.IndirectArgs.CopyInstanceCount(context.CurrentDeviceContext, this.FInI[i][context].UAV);
                    }

                    if (this.FInV.PluginIO.IsConnected)
                    {
                        drawer.IndirectArgs.CopyVertexCount(context.CurrentDeviceContext, this.FInV[i][context].UAV);
                    }

                    this.FOutGeom[i][context] = geom;
                }
            }
        }
开发者ID:hameleon-ed,项目名称:dx11-vvvv,代码行数:33,代码来源:VertexIndirectDrawerNode.cs

示例8: Update

        public void Update(IPluginIO pin, DX11RenderContext context)
        {
            for (int i = 0; i < this.FOutGeom.SliceCount; i++)
            {
                if (this.FInEnabled[i])
                {
                    if (this.FInVCnt.IsChanged || this.FInICnt.IsChanged)
                    {
                        this.FOutGeom[i].Dispose(context);

                        this.FOutGeom[i][context] = new DX11NullGeometry(context);

                        DX11NullIndirectDrawer ind = new DX11NullIndirectDrawer();
                        ind.Update(context,this.FInVCnt[i],this.FInICnt[i]);
                        this.FOutGeom[i][context].AssignDrawer(ind);

                    }

                    DX11NullIndirectDrawer drawer = (DX11NullIndirectDrawer)this.FOutGeom[i][context].Drawer;

                    if (this.FInI.PluginIO.IsConnected)
                    {
                        drawer.IndirectArgs.CopyInstanceCount(context.CurrentDeviceContext, this.FInI[i][context].UAV);
                    }

                    if (this.FInV.PluginIO.IsConnected)
                    {
                        drawer.IndirectArgs.CopyVertexCount(context.CurrentDeviceContext, this.FInV[i][context].UAV);
                    }

                    //this.FOutGeom[i][context] = geom;
                }
            }
        }
开发者ID:kopffarben,项目名称:dx11-vvvv,代码行数:34,代码来源:NullIndirectDrawer.cs

示例9: Render

        public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
        {
            if (this.FEnabled[0])
            {
                List<IDX11ObjectValidator> valids = new List<IDX11ObjectValidator>();
                if (this.FInVal.PluginIO.IsConnected)
                {
                    for (int i = 0; i < this.FInVal.SliceCount; i++)
                    {
                        if (this.FInVal[i].Enabled)
                        {
                            IDX11ObjectValidator v = this.FInVal[i];
                            //v.Reset();
                            v.SetGlobalSettings(settings);

                            valids.Add(v);
                            settings.ObjectValidators.Add(v);
                        }
                    }
                }

                if (this.FLayerIn.PluginIO.IsConnected)
                {
                    this.FLayerIn[0][context].Render(this.FLayerIn.PluginIO, context, settings);
                }

                foreach (IDX11ObjectValidator v in valids)
                {
                    settings.ObjectValidators.Remove(v);
                }

            }
        }
开发者ID:hameleon-ed,项目名称:dx11-vvvv,代码行数:33,代码来源:DX11LayerValidatorNode.cs

示例10: Update

        public void Update(IPluginIO pin, DX11RenderContext context)
        {
            if (this.FInvalidate)
            {
                if (srv != null) { srv.Dispose(); }
                if (tex != null) { tex.Dispose(); }

                try
                {
                    int p = unchecked((int) this.FPointer[0]);
                    tex = context.Device.OpenSharedResource<Texture2D>(new IntPtr(p));
                    srv = new ShaderResourceView(context.Device, tex);

                    DX11Texture2D resource = DX11Texture2D.FromTextureAndSRV(context, tex, srv);

                    this.FTextureOutput[0][context] = resource;

                    this.FValid[0] = true;
                }
                catch (Exception ex)
                {
                    this.FValid[0] = false;
                }

                this.FInvalidate = false;
            }
        }
开发者ID:hameleon-ed,项目名称:dx11-vvvv,代码行数:27,代码来源:FromPointerTextureNode.cs

示例11: GetGeom

        protected override DX11IndexedGeometry GetGeom(DX11RenderContext context, int slice)
        {
            Quad quad = new Quad();
            quad.Size = this.FSize[slice];

            return context.Primitives.QuadCross(quad);
        }
开发者ID:hameleon-ed,项目名称:dx11-vvvv,代码行数:7,代码来源:DX11QuadCrossNode.cs

示例12: Render

        public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
        {
            if (this.FEnabled[0])
            {
                if (this.FLayerIn.IsConnected)
                {
                    settings.PreferredTechniques.Add(FTechnique[0].Trim().ToLower());

                    for (int i = 0; i < this.FLayerIn.SliceCount; i++)
                    {
                        this.FLayerIn[i][context].Render(this.FLayerIn.PluginIO, context, settings);
                    }

                    settings.PreferredTechniques.RemoveAt(settings.PreferredTechniques.Count - 1);
                }
            }
            else
            {
                if (this.FLayerIn.IsConnected)
                {
                    for (int i = 0; i < this.FLayerIn.SliceCount; i++)
                    {
                        this.FLayerIn[i][context].Render(this.FLayerIn.PluginIO, context, settings);
                    }
                }
            }
        }
开发者ID:sebllll,项目名称:dx11-vvvv,代码行数:27,代码来源:DX11LayerPreferTechniqueNode.cs

示例13: Render

        public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
        {
            if (this.FEnabled[0])
            {
                var rect = context.CurrentDeviceContext.Rasterizer.GetScissorRectangles();
                if (this.FLayerIn.IsConnected)
                {

                    context.CurrentDeviceContext.Rasterizer.SetScissorRectangles(this.rectangles);
                    try
                    {
                        for (int i = 0; i < this.FLayerIn.SliceCount; i++)
                        {
                            this.FLayerIn[i][context].Render(this.FLayerIn.PluginIO, context, settings);
                        }
                    }
                    finally
                    {
                        context.CurrentDeviceContext.Rasterizer.SetScissorRectangles(rect);
                    }
                }
            }
            else
            {
                if (this.FLayerIn.IsConnected)
                {

                    for (int i = 0; i < this.FLayerIn.SliceCount; i++)
                    {
                        this.FLayerIn[i][context].Render(this.FLayerIn.PluginIO, context, settings);
                    }
                }
            }
        }
开发者ID:sebllll,项目名称:dx11-vvvv,代码行数:34,代码来源:DX11LayerScissorNode.cs

示例14: OnEndQuery

 protected void OnEndQuery(DX11RenderContext context)
 {
     if (this.EndQuery != null)
     {
         this.EndQuery(context);
     }
 }
开发者ID:kopffarben,项目名称:dx11-vvvv,代码行数:7,代码来源:DX11BaseShaderNode.cs

示例15: Render

        public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
        {
            if (this.FEnabled[0])
            {
                if (this.FLayerIn.IsConnected)
                {
                    bool popstate = false;

                    if (this.FInState.IsConnected)
                    {
                        context.RenderStateStack.Push(this.FInState[0]);
                        popstate = true;
                    }

                    for (int i = 0; i < this.FLayerIn.SliceCount; i++)
                    {
                        this.FLayerIn[i][context].Render(this.FLayerIn.PluginIO, context, settings);
                    }

                    if (popstate) { context.RenderStateStack.Pop(); }

                }
            }
            else
            {
                if (this.FLayerIn.IsConnected)
                {
                    for (int i = 0; i < this.FLayerIn.SliceCount; i++)
                    {
                        this.FLayerIn[i][context].Render(this.FLayerIn.PluginIO, context, settings);
                    }
                }
            }
        }
开发者ID:sebllll,项目名称:dx11-vvvv,代码行数:34,代码来源:DX11LayerStateNode.cs


注:本文中的FeralTic.DX11.DX11RenderContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。