Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. commandList.Begin();
  2. {
  3.     commandList.SetFramebuffer(graphicsDevice.MainSwapchain.Framebuffer);
  4.     commandList.ClearColorTarget(0, RgbaFloat.Black);
  5.     commandList.ClearDepthStencil(1f);
  6.  
  7.     foreach (SceneObject o in scene.objects)
  8.     {
  9.         if (o is Camera c)
  10.         {
  11.             // View & projection buffer stuff
  12.         }
  13.         else
  14.         {
  15.             commandList.SetPipeline(GetPipeline(o.material));
  16.             commandList.UpdateBuffer(transformBuffer, 0, o.transform.GetMatrix());
  17.             commandList.SetVertexBuffer(0, o.model.VertexBuffer);
  18.             commandList.SetIndexBuffer(o.model.IndexBuffer, o.model.IndexFormat);
  19.             commandList.SetGraphicsResourceSet(0, projectionViewSet);
  20.             commandList.SetGraphicsResourceSet(1, transformSet);
  21.             commandList.DrawIndexed(o.model.IndexCount, 1, 0, 0, 0);
  22.         }
  23.     }
  24. }
  25. commandList.End();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement