From 96c459ca2f52cf2c5bec269d0f30e01d21bc916b Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 29 Dec 2024 14:49:07 +1100 Subject: add depth prepass --- c2.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'c2.cpp') diff --git a/c2.cpp b/c2.cpp index d3b414b..b11b769 100644 --- a/c2.cpp +++ b/c2.cpp @@ -188,6 +188,10 @@ extern "C" int entrypoint() { pb.rp_depth_target(dev->get_depth_target(), 1.0f); dev->get_ctx().submit(pb.build_rp()); + pb.begin_rp(); + pb.rp_depth_target(dev->get_depth_target(), Clear_Mode::restore); + Render_Pass& depth_prepass = pb.build_rp(); + pb.begin_rp(); pb.rp_target(dev->get_backbuffer(), Clear_Mode::restore); pb.rp_depth_target(dev->get_depth_target(), Clear_Mode::restore); @@ -209,6 +213,13 @@ extern "C" int entrypoint() { raxis )); monkey->update_transforms(); + monkey->render( + dev, + &frame_arena, + depth_prepass, + transform, + projection + ); monkey->render( dev, &frame_arena, -- cgit v1.2.3-54-g00ecf