diff --git a/Assets/Shaders/SSAO_CS.glsl b/Assets/Shaders/SSAO_CS.glsl index 42ab220c..7e818141 100644 --- a/Assets/Shaders/SSAO_CS.glsl +++ b/Assets/Shaders/SSAO_CS.glsl @@ -8,7 +8,7 @@ const int ROTATION_KERNEL_W = 4; const int ROTATION_KERNEL_H = 4; // can perhaps pass in as push constant. -const float RADIUS = 0.2f; +const float RADIUS = 0.35f; const float BIAS = 0.0025f; layout(local_size_x = 16, local_size_y = 16) in; diff --git a/Assets/Shaders/SSAO_CS.shshaderb b/Assets/Shaders/SSAO_CS.shshaderb index 36e627d6..06438d58 100644 Binary files a/Assets/Shaders/SSAO_CS.shshaderb and b/Assets/Shaders/SSAO_CS.shshaderb differ diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp index 1cbd359c..c1938f60 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp @@ -145,10 +145,10 @@ namespace SHADE //SHAssetManager::CompileAsset("../../Assets/Shaders/Trajectory_FS.glsl", false); //SHAssetManager::CompileAsset("../../Assets/Shaders/ShadowMapBlur_CS.glsl", false); //SHAssetManager::CompileAsset("../../Assets/Shaders/Anim_VS.glsl", false); - SHAssetManager::CompileAsset("../../Assets/Shaders/Particle_VS.glsl", false); - SHAssetManager::CompileAsset("../../Assets/Shaders/Particle_FS.glsl", false); - SHAssetManager::CompileAsset("../../Assets/Shaders/ParticleEmit_CS.glsl", false); - SHAssetManager::CompileAsset("../../Assets/Shaders/ParticleUpdate_CS.glsl", false); + //SHAssetManager::CompileAsset("../../Assets/Shaders/Particle_VS.glsl", false); + //SHAssetManager::CompileAsset("../../Assets/Shaders/Particle_FS.glsl", false); + //SHAssetManager::CompileAsset("../../Assets/Shaders/ParticleEmit_CS.glsl", false); + //SHAssetManager::CompileAsset("../../Assets/Shaders/ParticleUpdate_CS.glsl", false); // Load Built In Shaders static constexpr AssetID VS_DEFAULT = 39210065; defaultVertShader = SHResourceManager::LoadOrGet(VS_DEFAULT); diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/PostProcessing/SHSSAO.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/PostProcessing/SHSSAO.cpp index db5b08c3..f71c3f93 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/PostProcessing/SHSSAO.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/PostProcessing/SHSSAO.cpp @@ -19,15 +19,16 @@ namespace SHADE // generate samples for (uint32_t i = 0; i < NUM_SAMPLES; ++i) { - //SHVec3 temp - //{ - // distrib(generator) * 2.0f - 1.0f, // -1.0f - 1.0f - // distrib(generator) * 2.0f - 1.0f, // -1.0f - 1.0f - // distrib(generator), // 0.0f - 1.0f so that sample space is a hemisphere - //}; + SHVec3 temp + { + distrib(generator) * 2.0f - 1.0f, // -1.0f - 1.0f + distrib(generator) * 2.0f - 1.0f, // -1.0f - 1.0f + distrib(generator), // 0.0f - 1.0f so that sample space is a hemisphere + }; - //temp = SHVec3::Normalise(temp); - //temp *= distrib(generator); + temp = SHVec3::Normalise(temp); + temp *= distrib(generator); + samples[i] = SHVec4 (temp.x, temp.y, temp.z, 0.0f); //// This makes sure that most points are closer to fragment's position //float scale = 1.0f / static_cast(NUM_SAMPLES); @@ -36,16 +37,16 @@ namespace SHADE //samples[i] = SHVec4 (temp.x, temp.y, temp.z, 0.0f); - samples[i] = SHVec4 - { - distrib(generator) * 2.0f - 1.0f, // -1.0f - 1.0f - distrib(generator) * 2.0f - 1.0f, // -1.0f - 1.0f - distrib(generator), // 0.0f - 1.0f so that sample space is a hemisphere - 0.0f - }; + //samples[i] = SHVec4 + //{ + // distrib(generator) * 2.0f - 1.0f, // -1.0f - 1.0f + // distrib(generator) * 2.0f - 1.0f, // -1.0f - 1.0f + // distrib(generator), // 0.0f - 1.0f so that sample space is a hemisphere + // 0.0f + //}; // This makes sure that most points are closer to fragment's position - float scale = 1.0f / static_cast(NUM_SAMPLES); + float scale = static_cast(i) / static_cast(NUM_SAMPLES); scale = std::lerp(0.1f, 1.0f, scale * scale); samples[i] *= scale; }