Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commandList.Begin();
- {
- commandList.SetFramebuffer(graphicsDevice.MainSwapchain.Framebuffer);
- commandList.ClearColorTarget(0, RgbaFloat.Black);
- commandList.ClearDepthStencil(1f);
- foreach (SceneObject o in scene.objects)
- {
- if (o is Camera c)
- {
- // View & projection buffer stuff
- }
- else
- {
- commandList.SetPipeline(GetPipeline(o.material));
- commandList.UpdateBuffer(transformBuffer, 0, o.transform.GetMatrix());
- commandList.SetVertexBuffer(0, o.model.VertexBuffer);
- commandList.SetIndexBuffer(o.model.IndexBuffer, o.model.IndexFormat);
- commandList.SetGraphicsResourceSet(0, projectionViewSet);
- commandList.SetGraphicsResourceSet(1, transformSet);
- commandList.DrawIndexed(o.model.IndexCount, 1, 0, 0, 0);
- }
- }
- }
- commandList.End();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement