Try / Tempest

3d graphics engine
MIT License
83 stars 24 forks source link

Rethinking a engine structure #23

Closed Try closed 2 years ago

Try commented 3 years ago

Things to do:

Things to think about:

Try commented 3 years ago

synchronization: Metal model look quite promising:

CommandBuffer cmd;
...
cmd.addCompletionHandler([]() {

  });
cmd.wait();

Can be done naively in Metal; By Timeline Semaphore + extra thread on Vulka/Dx12

Try commented 3 years ago

Wanna rethink framebuffer/renderpass api.

Goal:

  1. Simplify usage
  2. Add support for resolve attachment(msaa)
  3. Add support for density-map and vrs-attachment

Current syntax:

fboGBuf     = device.frameBuffer(lightingBuf,gbufDiffuse,gbufNormal,gbufDepth,zbuffer);
gbufPass    = device.pass(FboMode(FboMode::PreserveOut,Color(0.0)),
                          FboMode(FboMode::PreserveOut),
                          FboMode(FboMode::PreserveOut),
                          FboMode(FboMode::PreserveOut,Color(1.0)),
                          FboMode(FboMode::PreserveOut,1.f));

'Good' metal example

desc.colorAttachments[0].texture     = tex;
desc.colorAttachments[0].loadAction  = MTLLoadActionClear;
desc.colorAttachments[0].clearColor  = MTLClearColorMake(1, 1, 1, 1);
desc.colorAttachments[0].storeAction = MTLStoreActionStore;
Try commented 2 years ago

new syntax idea:

  1. discard FrameBuffer & RenderPass classes
  2. {
    auto enc = cmdBuf.startEncoding(device);
    enc.setFramebuffer({{color,Color(0,0,0,0),Tempest::Preserve}, {normal,Tempest::Discard,Tempest::Preserve}});
    enc.setUniforms(op,ubo,&uboCpu,sizeof(uboCpu));
    enc.draw(Resources::fsq());
    }
Try commented 2 years ago

Add readable depth texture

Moved: #27

Reconsider design cross-queue/cpu synchronization

De-scoped, single queue case is problematic enough.

VK_EXT_inline_uniform_block

Moved: #32