SHARE
TWEET

Untitled

a guest Aug 18th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top