From 81541ec8427544759f0ad326a7fc7a088f4b05c6 Mon Sep 17 00:00:00 2001 From: Anish Bhobe Date: Sun, 24 Nov 2024 18:50:57 +0100 Subject: [PATCH] MInor updates and TODOs in README. --- README.md | 42 +++++++++++++++++++++++++++----------- samples/04_scenes/main.cpp | 9 +++++++- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 50b1df7..95d428d 100644 --- a/README.md +++ b/README.md @@ -8,30 +8,35 @@ A Vulkan based renderer created with Vulkan 1.3 in C++. - [X] Load Vertex Data - [X] Load Material Data - [ ] Load Animation Data - - [ ] Load Camera - [ ] Support Specular Materials - [X] Bindless Descriptors - [X] Simplified Descriptor Creation Pipeline +- [X] Lighting Equations + - [X] Blinn-Phong + - [X] PBR / IBL - [ ] Debugging - [ ] Tracy Integration - [X] Dear ImGui Integration - [ ] Transparency - [ ] Sorted - - [ ] Order Independent -- [ ] Shadows v1 + - [ ] Order Independent (Depth Peeling) +- [ ] Shadows + - [ ] Shadow Mapping - [ ] Omnidirectional Cubemap Shadows - [ ] SpotLight Shadows - [ ] Directional Shadows - [ ] Cascaded Shadows - [ ] PCF -- [ ] Lighting / Shading Pipelines - - [ ] Blinn-Phong - - [ ] PBR - - [ ] IBL + - [ ] Omnidirectional Dual Paraboloid Shadows + - [ ] Shadow Masks + - [ ] Perspective Shadow Mapping + - [ ] RTX Shadows - [ ] Rendering Techniques - - [ ] Forward Rendering + - [X] Forward Rendering - [ ] Deferred Rendering - [ ] Clustered-Forward Rendering + - [ ] V-Buffer Rendering + - [ ] Light Prepass - [ ] Ambient Occlusion - [ ] SSAO - [ ] HBAO @@ -43,16 +48,29 @@ A Vulkan based renderer created with Vulkan 1.3 in C++. - [ ] Cubemap/Probe Reflection - [ ] Ray-Traced Reflection - [ ] Global Illumination + - [ ] Light Mapping + - [ ] Light Probes - [ ] Precomputed Radiance Transfer - [ ] Voxel Cone Tracing - [ ] SDFGI - [ ] RTXGI -- [ ] Shadows v2 - - [ ] Omnidirectional Dual Paraboloid Shadows - - [ ] Perspective Shadow Mapping - - [ ] RTX Shadows - [ ] Animation - [ ] Skeletal Animation - [ ] TBD - [ ] Particle Effects - [ ] Full Path Tracing +- [ ] Culling + - [ ] Frustrum Culling + - [ ] Depth based Occlusion Culling + - [ ] TBD +- [ ] Performance Techniques + - [ ] Instancing + - [ ] Batching + - [ ] Depth Prepass + - [ ] Level of Detail + - [ ] Shadow Atlases + - [X] Buffer sub-division + - [ ] Resource streaming +- [ ] Light Effects + - [ ] Volumetric Lighting + - [ ] Depth based Fog \ No newline at end of file diff --git a/samples/04_scenes/main.cpp b/samples/04_scenes/main.cpp index f7ff544..410fbd0 100644 --- a/samples/04_scenes/main.cpp +++ b/samples/04_scenes/main.cpp @@ -116,7 +116,7 @@ main(int, char *[]) for (int j = -1; j <= 1; ++j) { INFO("{}, {}", i, j); - auto &model = models.emplace_back(std::move(assetLoader.LoadModelToGpu(MODEL_FILE, "Main Model"))); + auto &model = models.emplace_back(assetLoader.LoadModelToGpu(MODEL_FILE, "Main Model")); registry.get(model.m_RootEntity).m_Position = vec3(2 * i, 0, 2 * j); } } @@ -372,6 +372,7 @@ main(int, char *[]) DepthImage *currentDepthImage = &depthImages[currentFrame->m_FrameIdx]; AttachmentImage *currentAttachment = &attachmentImages[currentFrame->m_FrameIdx]; + // Resize outdated attachments if (currentAttachment->m_Extent.width != internalResolution.width || currentAttachment->m_Extent.height != internalResolution.height) { @@ -388,14 +389,17 @@ main(int, char *[]) vk::Image currentImage = currentAttachment->m_Image; vk::ImageView currentImageView = currentAttachment->m_View; + // Ready the barrier structs preRenderBarrier.image = currentImage; postRenderBarriers[0].image = currentImage; postRenderBarriers[1].image = currentSwapchainImage; transferDstToGuiRenderBarrier.image = currentSwapchainImage; prePresentBarrier.image = currentSwapchainImage; + // Write Camera ubo.Write(&device, 0, sizeof cameraController.m_Camera, &cameraController.m_Camera); + // Update all root dynamic object transforms. for (auto [entity, dynTransform, globalTransform] : rootNodeUpdateView.each()) { auto scale = glm::scale(mat4{1.0f}, dynTransform.m_Scale); @@ -406,6 +410,7 @@ main(int, char *[]) } // Has been sorted and ordered by parent. + // Update all dynamic object transforms. for (auto [entity, dynTransform, parent, globalTransform] : nodeWithParentsUpdateView.each()) { auto scale = glm::scale(mat4{1.0f}, dynTransform.m_Scale); @@ -421,6 +426,8 @@ main(int, char *[]) nodeDrawInfo.clear(); nodeData.reserve(objectCount); nodeDrawInfo.reserve(objectCount); + + // Write all objects into the node data to be pushed. for (auto [entity, globalTransform, mesh, material] : renderableObjectsGroup.each()) { nodeData.push_back({