• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DX11.DX11RenderContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetGeom

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

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


示例17: Render

        public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
        {
            if (this.FLayerIn.SliceCount == 0) { return; }

            if (this.FEnabled[0])
            {
                if (this.FLayerIn.IsConnected)
                {
                    Matrix view = settings.View;
                    Matrix projection = settings.Projection;
                    Matrix vp = settings.ViewProjection;
                    bool depthonly = settings.DepthOnly;

                    this.UpdateSettings(settings);

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

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


示例18: Render

        public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
        {
            if (this.FEnabled[0])
            {
                IDX11LayerOrder currentOrder = settings.LayerOrder;
                if (this.FInVal.IsConnected)
                {
                    settings.LayerOrder = this.FInVal[0];
                }

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

                settings.LayerOrder = currentOrder;
            }
            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:dotprodukt,项目名称:dx11-vvvv,代码行数:31,代码来源:DX11LayerOrderNode.cs


示例19: DX11DeviceRenderer

 public DX11DeviceRenderer(DX11RenderContext context, DX11Graph graph, ILogger logger)
 {
     this.logger = logger;
     this.context = context;
     this.graph = graph;
     this.DoNotDestroy = false;
 }
开发者ID:dotprodukt,项目名称:dx11-vvvv,代码行数:7,代码来源:DX11DeviceRenderer.cs


示例20: Update

        public void Update(IPluginIO pin, DX11RenderContext context)
        {
            Device device = context.Device;

            if (invalidate)
            {
                for (int i = 0; i < this.FOutGeom.SliceCount; i++)
                {
                    if (this.FInEnabled[i])
                    {

                        IDX11Geometry copy = this.FInGeom[i][context].ShallowCopy();
                        if (copy is DX11IndexedGeometry)
                        {
                            DX11DefaultIndexedDrawer drawer = new DX11DefaultIndexedDrawer();
                            ((DX11IndexedGeometry)copy).AssignDrawer(drawer);
                        }
                        else if (copy is DX11VertexGeometry)
                        {
                            DX11DefaultVertexDrawer drawer = new DX11DefaultVertexDrawer();
                            ((DX11VertexGeometry)copy).AssignDrawer(drawer);
                        }

                        this.FOutGeom[i][context] = copy;

                    }
                    else
                    {
                        this.FOutGeom[i][context] = this.FInGeom[i][context];
                    }

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FernBusinessBase.IDRequest类代码示例发布时间:2022-05-24
下一篇:
C# Dapper.DynamicParameters类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap