Add ray-query hard shadow: TLAS/BLAS, descriptors and shader path#7
Open
Add ray-query hard shadow: TLAS/BLAS, descriptors and shader path#7
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
GlfwGeneral.hpp) and enable the feature chain (VkPhysicalDeviceRayQueryFeaturesKHR→VkPhysicalDeviceAccelerationStructureFeaturesKHR→VkPhysicalDeviceBufferDeviceAddressFeatures) by attaching toVkDeviceCreateInfo::pNext(vkBase.h).RayTracingAS.hpp/.cppthat builds per-mesh BLAS and a single TLAS (static build, no per-frame updates) and exposesSceneAS::Tlas().binding = 9,VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR) to the lighting descriptor set layout/pool and updatingUpdateLightingDescriptorSet()to write the TLAS while preserving all existing gbuffer/shadow/light bindings (main.cpp).vertexCounttracking for BLAS inputs (main.cpp).CreateRayTracingAS()and call it after scene resources are created, and destroy the AS on exit (main.cpp).shaders/lighting.ps.hlsl: add[[vk::binding(9, 0)]] RaytracingAccelerationStructure sceneTLAS;, implement aRayQuery-based hard shadow function with a normal bias to avoid self-shadow acne, and guard it behindUSE_RAYQUERY_SHADOWto allow A/B testing and fallback to the original shadow-map path.easy_vulkan.vcxproj/.filters).Testing
git diff --checkandgit statuswhich passed locally after edits and the change was committed (add ray query hard shadow path).msbuild easy_vulkan.sln /p:Configuration=Debug /p:Platform=x64but the container does not providemsbuild, so a full Visual Studio build could not be executed here; please build and run the project in Visual Studio 2022+ with the Vulkan SDK to validate runtime behavior and shader compilation.Codex Task