diff --git a/libraries/render-utils/src/AmbientOcclusionEffect.cpp b/libraries/render-utils/src/AmbientOcclusionEffect.cpp index 2b696dd444..596848cedd 100644 --- a/libraries/render-utils/src/AmbientOcclusionEffect.cpp +++ b/libraries/render-utils/src/AmbientOcclusionEffect.cpp @@ -210,7 +210,8 @@ void AmbientOcclusionEffect::setDepthInfo(float nearZ, float farZ) { } void AmbientOcclusionEffect::setResolutionLevel(int level) { - level = std::max(0, std::min(level, 4)); + const int MAX_RESOLUTION_LEVEL = 4; + level = std::max(0, std::min(level, MAX_RESOLUTION_LEVEL)); if (level != getResolutionLevel()) { auto& current = _parametersBuffer.edit().resolutionInfo; current.x = (float)level; diff --git a/libraries/render/src/render/Context.h b/libraries/render/src/render/Context.h index c438a91049..fcbdc5c6fe 100644 --- a/libraries/render/src/render/Context.h +++ b/libraries/render/src/render/Context.h @@ -74,18 +74,18 @@ public: class AmbientOcclusion { public: - int resolutionLevel = 1; - float radius = 0.5f; // radius in meters of the AO effect - float level = 0.5f; // Level of the obscrance value - int numSamples = 11; // Num Samples per pixel - float numSpiralTurns = 7.0f; - bool ditheringEnabled = true; - float falloffBias = 0.01f; - float edgeSharpness = 1.0f; - int blurRadius = 4; - float blurDeviation = 2.5f; + int resolutionLevel { 1 }; + float radius { 0.5f }; // radius in meters of the AO effect + float level { 0.5f }; // Level of the obscrance value + int numSamples { 11 }; // Num Samples per pixel + float numSpiralTurns { 7.0f }; + bool ditheringEnabled { true }; + float falloffBias { 0.01f }; + float edgeSharpness { 1.0f }; + int blurRadius { 4 }; + float blurDeviation { 2.5f}; - double gpuTime = 0.0; + double gpuTime { 0.0 }; }; RenderContext(ItemsConfig items, Tone tone, AmbientOcclusion ao, int drawStatus, bool drawHitEffect, glm::vec4 deferredDebugSize, int deferredDebugMode);