Пример #1
0
 public void CreateDeviceObjects(GraphicsDevice gd, CommandList cl, SceneRenderPipeline sp)
 {
     TranslateGizmoX.CreateDeviceObjects(gd, cl, sp);
     TranslateGizmoY.CreateDeviceObjects(gd, cl, sp);
     TranslateGizmoZ.CreateDeviceObjects(gd, cl, sp);
     RotateGizmoX.CreateDeviceObjects(gd, cl, sp);
     RotateGizmoY.CreateDeviceObjects(gd, cl, sp);
     RotateGizmoZ.CreateDeviceObjects(gd, cl, sp);
 }
Пример #2
0
        /*public override DbgPrim Instantiate(string newName, Transform newLocation, Color? newNameColor = null)
         * {
         *  var newPrim = new DbgPrimGizmo();
         *  newPrim.Indices = Indices;
         *  newPrim.GeometryBuffer = GeometryBuffer;
         *  newPrim.Vertices = Vertices;
         *  newPrim.NeedToRecreateGeomBuffer = NeedToRecreateGeomBuffer;
         *
         *  newPrim.Transform = newLocation;
         *
         *  newPrim.Name = newName;
         *
         *  newPrim.NameColor = newNameColor ?? NameColor;
         *
         *  return newPrim;
         * }*/

        public void CreateDeviceObjects(Veldrid.GraphicsDevice gd, CommandList cl, SceneRenderPipeline sp)
        {
            /*var factory = gd.ResourceFactory;
             * WorldBuffer = Renderer.UniformBufferAllocator.Allocate(128, 128);
             * var identity = System.Numerics.Matrix4x4.Identity;
             * WorldBuffer.FillBuffer(cl, ref identity);
             *
             * ResourceLayout projViewCombinedLayout = StaticResourceCache.GetResourceLayout(
             *  gd.ResourceFactory,
             *  new ResourceLayoutDescription(
             *      new ResourceLayoutElementDescription("ViewProjection", ResourceKind.UniformBuffer, ShaderStages.Vertex)));
             *
             * ResourceLayout worldLayout = StaticResourceCache.GetResourceLayout(gd.ResourceFactory, new ResourceLayoutDescription(
             *  new ResourceLayoutElementDescription("World", ResourceKind.UniformBuffer, ShaderStages.Vertex, ResourceLayoutElementOptions.DynamicBinding)));
             *
             * VertexLayoutDescription[] mainVertexLayouts = new VertexLayoutDescription[]
             * {
             *  new VertexLayoutDescription(
             *      new VertexElementDescription("position", VertexElementSemantic.TextureCoordinate, Veldrid.VertexElementFormat.Float3),
             *      new VertexElementDescription("color", VertexElementSemantic.TextureCoordinate, Veldrid.VertexElementFormat.Byte4),
             *      new VertexElementDescription("normal", VertexElementSemantic.TextureCoordinate, Veldrid.VertexElementFormat.Float3))
             * };
             *
             * //Shaders = factory.CreateFromSpirv(vertexShaderDesc, fragmentShaderDesc);
             * var res = StaticResourceCache.GetShaders(gd, gd.ResourceFactory, "DebugWire").ToTuple();
             * Shaders = new Shader[] { res.Item1, res.Item2 };
             *
             * ResourceLayout mainPerObjectLayout = StaticResourceCache.GetResourceLayout(gd.ResourceFactory, new ResourceLayoutDescription(
             *  new ResourceLayoutElementDescription("WorldBuffer", ResourceKind.StructuredBufferReadWrite, ShaderStages.Vertex | ShaderStages.Fragment, ResourceLayoutElementOptions.None)));
             *
             * PerObjRS = StaticResourceCache.GetResourceSet(factory, new ResourceSetDescription(mainPerObjectLayout,
             *  Renderer.UniformBufferAllocator._backingBuffer));
             *
             * GraphicsPipelineDescription pipelineDescription = new GraphicsPipelineDescription();
             * pipelineDescription.BlendState = BlendStateDescription.SingleOverrideBlend;
             * pipelineDescription.DepthStencilState = new DepthStencilStateDescription(
             *  depthTestEnabled: true,
             *  depthWriteEnabled: true,
             *  comparisonKind: ComparisonKind.GreaterEqual);
             * pipelineDescription.RasterizerState = new RasterizerStateDescription(
             *  cullMode: FaceCullMode.None,
             *  fillMode: PolygonFillMode.Solid,
             *  frontFace: FrontFace.CounterClockwise,
             *  depthClipEnabled: true,
             *  scissorTestEnabled: false);
             * pipelineDescription.PrimitiveTopology = PrimitiveTopology.TriangleList;
             * pipelineDescription.ShaderSet = new ShaderSetDescription(
             *  vertexLayouts: mainVertexLayouts,
             *  shaders: Shaders);
             * pipelineDescription.ResourceLayouts = new ResourceLayout[] { StaticResourceCache.GetResourceLayout(
             *  gd.ResourceFactory,
             *  StaticResourceCache.SceneParamLayoutDescription), mainPerObjectLayout, Renderer.GlobalTexturePool.GetLayout(), Renderer.GlobalCubeTexturePool.GetLayout(), Renderer.MaterialBufferAllocator.GetLayout(), SamplerSet.SamplersLayout };
             * pipelineDescription.Outputs = gd.SwapchainFramebuffer.OutputDescription;
             * RenderPipeline = StaticResourceCache.GetPipeline(factory, ref pipelineDescription);*/
        }
Пример #3
0
 public void Render(Renderer.IndirectDrawEncoder encoder, SceneRenderPipeline sp)
 {
     Draw(encoder, sp, null, new Matrix4x4());
 }
Пример #4
0
 public void CreateDeviceObjects(Veldrid.GraphicsDevice gd, CommandList cl, SceneRenderPipeline sp)
 {
     throw new NotImplementedException();
 }
Пример #5
0
 public void Render(Renderer.IndirectDrawEncoder encoder, SceneRenderPipeline sp)
 {
     throw new NotImplementedException();
 }