mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-04 11:35:06 +03:00
Started bloom pass
This commit is contained in:
@@ -94,6 +94,22 @@ SceneRenderPipeline::SceneRenderPipeline()
|
||||
|
||||
TonemappedOutput = CreateRef<VulkanImage>(ImageFormat::RGBA8, defaultSize);
|
||||
|
||||
// Setup bloom targets
|
||||
BloomOutput = CreateRef<VulkanImage>(ImageFormat::RGBA16F, defaultSize);
|
||||
BloomThreshold = CreateRef<VulkanImage>(ImageFormat::RGBA16F, defaultSize);
|
||||
|
||||
//Vector2 currentSize;
|
||||
//for (int i = 0; i < BloomIteration; i++)
|
||||
//{
|
||||
// Ref<VulkanImage> downSample = CreateRef<VulkanImage>(ImageFormat::RGBA16F, defaultSize);
|
||||
// BloomDownSample.push_back(downSample);
|
||||
//
|
||||
// m_DownSampleFB.push_back(downSample);
|
||||
// m_UpSampleFB.push_back(upSample);
|
||||
// m_HBlurFB.push_back(hBlur);
|
||||
// m_VBlurFB.push_back(vBlur);
|
||||
//}
|
||||
|
||||
// Initialize pipeline
|
||||
VkShaderManager& shaderMgr = VkShaderManager::Get();
|
||||
|
||||
|
||||
@@ -48,6 +48,18 @@ namespace Nuake
|
||||
int SourceTextureID;
|
||||
};
|
||||
|
||||
struct BloomConstant
|
||||
{
|
||||
int Stage;
|
||||
int SourceTextureID;
|
||||
int HasLensDirt;
|
||||
int LensDirtTextureID;
|
||||
float LensDirtIntensity;
|
||||
float Threshold;
|
||||
float BlurAmount;
|
||||
int BlurDirection;
|
||||
};
|
||||
|
||||
// This class handles all the rendering of the scene
|
||||
class SceneRenderPipeline
|
||||
{
|
||||
@@ -65,9 +77,22 @@ namespace Nuake
|
||||
|
||||
Ref<VulkanImage> TonemappedOutput;
|
||||
|
||||
// Bloom
|
||||
const int BloomIteration = 4;
|
||||
const float DownsampleScale = 0.4f;
|
||||
Ref<VulkanImage> BloomThreshold;
|
||||
std::vector<Ref<VulkanImage>> BloomDownSample;
|
||||
std::vector<Ref<VulkanImage>> BloomUpSample;
|
||||
std::vector<Ref<VulkanImage>> BloomHBlur;
|
||||
std::vector<Ref<VulkanImage>> BloomVBlur;
|
||||
Ref<VulkanImage> BloomOutput;
|
||||
|
||||
// Push constant
|
||||
GBufferConstant gbufferConstant;
|
||||
ShadingConstant shadingConstant;
|
||||
TonemapConstant tonemapConstant;
|
||||
BloomConstant bloomConstant;
|
||||
|
||||
static RenderPipeline GBufferPipeline;
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user