From 53b9c8f746ad72b98d954d9f57ff41ffbcc7f62e Mon Sep 17 00:00:00 2001 From: Brandon Mak Date: Mon, 31 Oct 2022 23:28:46 +0800 Subject: [PATCH] SSAO WIP --- Assets/Shaders/SSAO_CS.glsl | 24 +++--- Assets/Shaders/SSAO_CS.shshaderb | Bin 6425 -> 6313 bytes .../MiddleEnd/Interface/SHGraphicsSystem.cpp | 7 +- .../MiddleEnd/PostProcessing/SHSSAO.cpp | 70 ++++++++++++++++-- .../MiddleEnd/PostProcessing/SHSSAO.h | 32 +++++--- .../RenderGraph/SHRenderGraphNodeCompute.cpp | 7 ++ .../RenderGraph/SHRenderGraphNodeCompute.h | 4 +- 7 files changed, 109 insertions(+), 35 deletions(-) diff --git a/Assets/Shaders/SSAO_CS.glsl b/Assets/Shaders/SSAO_CS.glsl index ac84cb81..9cc2de7b 100644 --- a/Assets/Shaders/SSAO_CS.glsl +++ b/Assets/Shaders/SSAO_CS.glsl @@ -19,10 +19,11 @@ layout(set = 4, binding = 2, rgba32f) uniform image2D outputImage; layout(std430, set = 5, binding = 0) buffer SSAOData { vec4 samples[NUM_SAMPLES]; - vec4 rotations[NUM_ROTATIONS]; } ssaoData; +layout (set = 5, binding = 1) uniform sampler2D noiseTexture; + layout(set = 2, binding = 0) uniform CameraData { vec4 position; @@ -32,33 +33,28 @@ layout(set = 2, binding = 0) uniform CameraData } cameraData; -shared vec4 sharedRotations[NUM_ROTATIONS]; void main() { ivec2 size = imageSize (outputImage); - // load rotations into shared memory - uint localThreadIndex = gl_LocalInvocationIndex; - if (localThreadIndex < NUM_ROTATIONS) - sharedRotations[localThreadIndex] = ssaoData.rotations[localThreadIndex]; - - barrier(); - ivec2 globalThread = ivec2 (gl_GlobalInvocationID.xy); // load all the necessary variables vec3 viewSpacePos = imageLoad (positions, globalThread).rgb; vec3 viewSpaceNormal = normalize (imageLoad (normals, globalThread).rgb); - // Get random vector - uint randomVecXIndex = globalThread.x % ROTATION_KERNEL_W; - uint randomVecYIndex = globalThread.y % ROTATION_KERNEL_H; - vec3 randomVec = (sharedRotations[randomVecYIndex * ROTATION_KERNEL_W + randomVecXIndex].rgb) * 2.0f - 1.0f; + ivec2 noiseDim = textureSize(noiseTexture, 0); + vec2 threadUV = globalThread / size; + vec2 noiseUV = vec2 (float(size.x)/float(noiseDim.x), float(size.y) / float(noiseDim.y)); + noiseUV *= threadUV; + vec3 randomVec = texture(noiseTexture, noiseUV).rgb * 2.0f - 1.0f; // Gram schmidt vec3 tangent = normalize (randomVec - (viewSpaceNormal * dot(viewSpaceNormal, randomVec))); vec3 bitangent = cross (tangent, viewSpaceNormal); + + // matrix for tangent to view mat3 TBN = mat3 (tangent, bitangent, viewSpaceNormal); float occlusion = 0.0f; @@ -85,7 +81,7 @@ void main() occlusion += (sampleDepth >= samplePos.z + BIAS ? 1.0f : 0.0f) * rangeCheck; } - occlusion = (occlusion / float(NUM_SAMPLES)); + occlusion = 1.0f - (occlusion / float(NUM_SAMPLES)); // store result into result image imageStore(outputImage, ivec2(gl_GlobalInvocationID.xy), vec4(occlusion.rrr, 0.0f)); diff --git a/Assets/Shaders/SSAO_CS.shshaderb b/Assets/Shaders/SSAO_CS.shshaderb index 78fd5087a76621f421742ffd5f2b9fa21528e843..9ba80c93e4334ef6e464462f7f9c384d0a450093 100644 GIT binary patch literal 6313 zcmZvf36zy(8OJ{cW@J-CQ89?MO)*qLQ#4s^ppY3^jh69p=Q3QKxp$g-K?O=k2{R)t zt!Q&XTWGbiz07P6Y@vOzY_n`%O*^M^`u)E9KA!K)={@H;&;R*9>-&E1_uZMc;VD_Z zMz_s5Cd)=;?=|3QR{n zQ(u35bE$vb)}czNw-q}!pTDoar!#l0tZlECOU-J%wsLu1t0S9=-d?R-wRW&nu5{NM zt-SVZ8ep*As2VJ3kJ-i8)%Br)Qa}8dYz}-aHyhaP*=f05ZB&+52Y`9*GlE-Jxw^S+ z=<&TQfN$m#uiwy$9h03Ou~63Q!X7Hsdg}ulDrK-eH=&!QT3@Bs%wyy?S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N_}eh;11EaaNRTeCaa zQS)4EYxaStc^z9Qcn6KuZympf`XaA^UaZr^HYWU=&^y7o>0Fnio8t=Z3UoR5 z3+~FqO)79#pswEL6nQP!49qjed5$6F)wdzXlfE5!9q@a2J<{*6@^S9h4agn9rT?`^ z{YvNVyZt&~jd-tbOk8~bUym&}7x>NBehsj;wbZR;-!}pKjM{HNw|0E<--x~d*snh0 zjz-=L^u_!4ro_p+oV#@Y0R7g8p1z4b@$7rxjCFZ-W8@;| zLG+1d{}!A%adu~jY4+hA$3eLubfihX}Kaq=$f)Y1&Thps>V#``|H_2lDD{QzA) z=J*i0T=e`y^d-RA+mr9xkAQsGKSnpt-)j9o0mjJtTP^ofU~g?ezwem*&w%$#|4jbw zl>0d__9QS4)&t|5>BC6pAqv`Mb6Q>2HzJ{0`(F!FJ%^ zg4%yd+(M-J`s9kgn>S#`{(nYykC^jc(B&QjvA>-0Gmw7;2PWIO{|%fB;{T4nCr;kw z^NIgE{(-JP_Wmcjd&f8BU+8jyxO@MG)8`8AKj?DS5AN~Ac}M$rUwsdr0OlL7-{({2 PES|%D^#6}4r-T0kYfO5x diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp index 2a59a5d1..6a3bd916 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp @@ -215,10 +215,15 @@ namespace SHADE graphicsQueue->WaitIdle(); + ssaoStorage->PrepareRotationVectorsVkData(device); + auto ssaoShader = shaderModuleLibrary.GetBuiltInShaderModule("SSAO_CS"); Handle ssaoPass = gBufferNode->AddNodeCompute(ssaoShader, {"Position", "Normals", "SSAO"}); auto ssaoDataBuffer = ssaoStorage->GetBuffer(); - ssaoPass->ModifyWriteDescBufferComputeResource(SHGraphicsConstants::DescriptorSetIndex::RENDERGRAPH_NODE_COMPUTE_RESOURCE, SHSSAO::DESC_SET_BINDING, {&ssaoDataBuffer, 1}, 0, ssaoStorage->GetBuffer()->GetSizeStored()); + ssaoPass->ModifyWriteDescBufferComputeResource(SHGraphicsConstants::DescriptorSetIndex::RENDERGRAPH_NODE_COMPUTE_RESOURCE, SHSSAO::DESC_SET_BUFFER_BINDING, { &ssaoDataBuffer, 1 }, 0, ssaoStorage->GetBuffer()->GetSizeStored()); + + auto viewSamplerLayout = ssaoStorage->GetViewSamplerLayout(); + ssaoPass->ModifyWriteDescImageComputeResource(SHGraphicsConstants::DescriptorSetIndex::RENDERGRAPH_NODE_COMPUTE_RESOURCE, SHSSAO::DESC_SET_IMAGE_BINDING, {&viewSamplerLayout, 1}); /*-----------------------------------------------------------------------*/ diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/PostProcessing/SHSSAO.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/PostProcessing/SHSSAO.cpp index c6aa1978..b145902f 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/PostProcessing/SHSSAO.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/PostProcessing/SHSSAO.cpp @@ -2,15 +2,14 @@ #include "SHSSAO.h" #include "Graphics/Devices/SHVkLogicalDevice.h" #include "Graphics/Buffers/SHVkBuffer.h" +#include "Graphics/Images/SHVkImage.h" +#include "Graphics/Images/SHVkSampler.h" #include namespace SHADE { void SHSSAO::Init(Handle logicalDevice, Handle cmdBuffer) noexcept { - // create memory on CPU side - ssaoData = std::make_unique(); - // Initialize a distribution to get values from 0 to 1 std::uniform_real_distribution distrib{0.0f, 1.0f}; @@ -18,7 +17,6 @@ namespace SHADE std::default_random_engine generator; // generate samples - auto& samples = ssaoData->samples; for (uint32_t i = 0; i < NUM_SAMPLES; ++i) { samples[i] = SHVec4 @@ -36,7 +34,6 @@ namespace SHADE } // generate rotation vector - auto& rotationVectors = ssaoData->rotatationVectors; for (uint32_t i = 0; i < NUM_ROTATION_VECTORS; ++i) { rotationVectors[i] = SHVec4 @@ -48,15 +45,74 @@ namespace SHADE }; } + SHImageCreateParams imageDetails = + { + .imageType = vk::ImageType::e2D, + .width = NUM_ROTATION_VECTORS_W, + .height = NUM_ROTATION_VECTORS_H, + .depth = 1, + .levels = 1, + .arrayLayers = 1, + .imageFormat = vk::Format::eR32G32B32A32Sfloat, + .usageFlags = vk::ImageUsageFlagBits::eSampled | vk::ImageUsageFlagBits::eTransferDst, + .createFlags = {} + }; + + uint32_t mipOffset = 0; + rotationVectorsImage = logicalDevice->CreateImage(imageDetails, reinterpret_cast( rotationVectors.data()), static_cast(sizeof(rotationVectors)), {&mipOffset, 1}, VMA_MEMORY_USAGE_AUTO, {}); + + vk::ImageMemoryBarrier transferBarrier{}; + rotationVectorsImage->PrepareImageTransitionInfo(vk::ImageLayout::eUndefined, vk::ImageLayout::eTransferDstOptimal, transferBarrier); + + cmdBuffer->PipelineBarrier(vk::PipelineStageFlagBits::eTopOfPipe, vk::PipelineStageFlagBits::eTransfer, {}, {}, {}, {transferBarrier}); + + rotationVectorsImage->TransferToDeviceResource(cmdBuffer); + + vk::ImageMemoryBarrier shaderReadBarrier{}; + rotationVectorsImage->PrepareImageTransitionInfo(vk::ImageLayout::eTransferDstOptimal, vk::ImageLayout::eShaderReadOnlyOptimal, shaderReadBarrier); + cmdBuffer->PipelineBarrier(vk::PipelineStageFlagBits::eTransfer, vk::PipelineStageFlagBits::eComputeShader, {}, {}, {}, { shaderReadBarrier }); + + // Get aligned size for buffer - uint32_t alignedSize = logicalDevice->PadSSBOSize(sizeof (SamplesAndKernel)); + uint32_t alignedSize = logicalDevice->PadSSBOSize(sizeof (samples)); // Create buffer - ssaoDataBuffer = logicalDevice->CreateBuffer(alignedSize, ssaoData.get(), alignedSize, vk::BufferUsageFlagBits::eStorageBuffer | vk::BufferUsageFlagBits::eTransferDst, VMA_MEMORY_USAGE_AUTO, {}); + ssaoDataBuffer = logicalDevice->CreateBuffer(alignedSize, samples.data(), alignedSize, vk::BufferUsageFlagBits::eStorageBuffer | vk::BufferUsageFlagBits::eTransferDst, VMA_MEMORY_USAGE_AUTO, {}); ssaoDataBuffer->TransferToDeviceResource(cmdBuffer); } + void SHSSAO::PrepareRotationVectorsVkData(Handle logicalDevice) noexcept + { + SHImageViewDetails DETAILS = + { + .viewType = vk::ImageViewType::e2D, + .format = vk::Format::eR32G32B32A32Sfloat, + .imageAspectFlags = vk::ImageAspectFlagBits::eColor, + .baseMipLevel = 0, + .mipLevelCount = 1, + .baseArrayLayer = 0, + .layerCount = 1 + }; + rotationVectorsImageView = rotationVectorsImage->CreateImageView(logicalDevice, rotationVectorsImage, DETAILS); + + SHVkSamplerParams samplerParams + { + .minFilter = vk::Filter::eNearest, + .magFilter = vk::Filter::eNearest, + .addressMode = vk::SamplerAddressMode::eRepeat, + .mipmapMode = vk::SamplerMipmapMode::eNearest, + .maxLod = 1u + }; + + rotationVectorsSampler = logicalDevice->CreateSampler(samplerParams); + } + + SHVkDescriptorSetGroup::viewSamplerLayout SHSSAO::GetViewSamplerLayout(void) const noexcept + { + return std::make_tuple(rotationVectorsImageView, rotationVectorsSampler, vk::ImageLayout::eShaderReadOnlyOptimal); + } + Handle SHSSAO::GetBuffer(void) const noexcept { return ssaoDataBuffer; diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/PostProcessing/SHSSAO.h b/SHADE_Engine/src/Graphics/MiddleEnd/PostProcessing/SHSSAO.h index 040b4695..c7c133c5 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/PostProcessing/SHSSAO.h +++ b/SHADE_Engine/src/Graphics/MiddleEnd/PostProcessing/SHSSAO.h @@ -3,39 +3,47 @@ #include "Resource/SHHandle.h" #include "Graphics/SHVulkanIncludes.h" #include "Math/Vector/SHVec4.h" +#include "Graphics/Descriptors/SHVkDescriptorSetGroup.h" namespace SHADE { class SHVkBuffer; class SHVkLogicalDevice; class SHVkCommandBuffer; + class SHVkImage; + class SHVkImageView; + class SHVkSampler; class SHSSAO { public: - static constexpr uint32_t DESC_SET_BINDING = 0; + static constexpr uint32_t DESC_SET_BUFFER_BINDING = 0; + static constexpr uint32_t DESC_SET_IMAGE_BINDING = 1; private: static constexpr uint32_t NUM_SAMPLES = 64; - static constexpr uint32_t NUM_ROTATION_VECTORS = 16; - - struct SamplesAndKernel - { - //! distances from a pixel we want to sample - std::array samples; - - std::array rotatationVectors; - }; + static constexpr uint32_t NUM_ROTATION_VECTORS_W = 4; + static constexpr uint32_t NUM_ROTATION_VECTORS_H = 4; + static constexpr uint32_t NUM_ROTATION_VECTORS = NUM_ROTATION_VECTORS_W * NUM_ROTATION_VECTORS_H; private: - //! Samples and kernel on CPU side - std::unique_ptr ssaoData; + //! distances from a pixel we want to sample + std::array samples; //! For passing SSAO samples and kernel to GPU Handle ssaoDataBuffer; + std::array rotationVectors; + + Handle rotationVectorsImage; + Handle rotationVectorsImageView; + Handle rotationVectorsSampler; + public: void Init (Handle logicalDevice, Handle cmdBuffer) noexcept; + void PrepareRotationVectorsVkData (Handle logicalDevice) noexcept; + SHVkDescriptorSetGroup::viewSamplerLayout GetViewSamplerLayout (void) const noexcept; + Handle GetBuffer (void) const noexcept; }; } diff --git a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNodeCompute.cpp b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNodeCompute.cpp index 2c471c83..a86acbc7 100644 --- a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNodeCompute.cpp +++ b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNodeCompute.cpp @@ -175,4 +175,11 @@ namespace SHADE computeResource->descSet->UpdateDescriptorSetBuffer(set, binding); } + void SHRenderGraphNodeCompute::ModifyWriteDescImageComputeResource(uint32_t set, uint32_t binding, std::span const& viewSamplerLayouts) noexcept + { + computeResource->descSet->ModifyWriteDescImage(set, binding, viewSamplerLayouts); + computeResource->descSet->UpdateDescriptorSetImages(set, binding); + + } + } diff --git a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNodeCompute.h b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNodeCompute.h index d61eda33..81157dc2 100644 --- a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNodeCompute.h +++ b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNodeCompute.h @@ -2,6 +2,7 @@ #include "Resource/SHHandle.h" #include "Graphics/MiddleEnd/Interface/SHGraphicsConstants.h" +#include "Graphics/Descriptors/SHVkDescriptorSetGroup.h" #include "Graphics/SHVulkanIncludes.h" #include #include @@ -10,7 +11,6 @@ namespace SHADE { class SHVkPipeline; - class SHVkDescriptorSetGroup; class SHVkDescriptorPool; class SHVkLogicalDevice; class SHVkPipelineLayout; @@ -74,6 +74,8 @@ namespace SHADE void SetDynamicOffsets (std::span perFrameSizes) noexcept; void ModifyWriteDescBufferComputeResource (uint32_t set, uint32_t binding, std::span> const& buffers, uint32_t offset, uint32_t range) noexcept; + void ModifyWriteDescImageComputeResource(uint32_t set, uint32_t binding, std::span const& viewSamplerLayouts) noexcept; + friend class SHRenderGraph; friend class SHRenderGraphNode;