Пример #1
0
            public void Render(VeldridRenderState state)
            {
                var cmd     = state.Commands;
                var factory = state.Factory;
                var gd      = state.GrDevice;
                //Additive Blend State
                var _pipeline = factory.CreateGraphicsPipeline(new GraphicsPipelineDescription(
                                                                   BlendStateDescription.SingleAdditiveBlend,
                                                                   DepthStencilStateDescription.Disabled,
                                                                   RasterizerStateDescription.CullNone,

                                                                   //BlendStateDescription.SingleOverrideBlend,
                                                                   //DepthStencilStateDescription.Disabled,
                                                                   //RasterizerStateDescription.CullNone,

                                                                   PrimitiveTopology.PointList,
                                                                   Shader.passes.First().Description,
                                                                   new[] { Resources.Layout },
                                                                   gd.SwapchainFramebuffer.OutputDescription));

                cmd.SetPipeline(_pipeline);
                cmd.SetGraphicsResourceSet(0, Resources.Set);
                //  cmd.SetVertexBuffer(0, Bufferes.Vertex);
                //   cmd.SetIndexBuffer(Bufferes.Index, IndexFormat.UInt16);
                cmd.Draw(ParticleDeviceBufferesUpdater.PARTICLES_COUNT);
                //cmd.DrawIndexed((uint)ParticleDeviceBufferesUpdater.PARTICLES_COUNT, 1, 0, 0, 0);
            }
Пример #2
0
            public void Update(VeldridRenderState state)
            {
                var cmd      = state.Commands;
                var factory  = state.Factory;
                var viewport = state.Viewport;

                Bufferes.Update(factory, cmd);
                Resources.Update(factory, cmd);

                Shader.UpdateShaders(factory);

                Bufferes.UpdateWorld();
                Bufferes.UpdateVertex(null);
//                Bufferes.UpdateIndex();

                Resources.UpdateResourceLayout();
                Resources.UpdateResourceSet(new ResourceSetDescription(
                                                Resources.Layout,
                                                viewport.ProjectionBuffer,
                                                viewport.ViewBuffer,
                                                deviceBufferes.StructuredBuffer));
            }