From f895e96500246844a287811073d794d995a9fc3f Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Mon, 1 Apr 2019 14:22:26 +0200 Subject: [PATCH] Fixed wrong sample count --- libraries/image/src/image/CubeMap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/image/src/image/CubeMap.cpp b/libraries/image/src/image/CubeMap.cpp index f818f1f6e0..62cca1f248 100644 --- a/libraries/image/src/image/CubeMap.cpp +++ b/libraries/image/src/image/CubeMap.cpp @@ -588,7 +588,7 @@ void CubeMap::convolveForGGX(CubeMap& output, const std::atomic& abortProc params.points.reserve(MAX_SAMPLE_COUNT); for (gpu::uint16 mipLevel = 0; mipLevel < mipCount; ++mipLevel) { - // This is the inverse code found in fragment.glsl in evaluateAmbientLighting + // This is the inverse code found in LightAmbient.slh in getMipLevelFromRoughness float levelAlpha = float(mipLevel) / (mipCount - ROUGHNESS_1_MIP_RESOLUTION); float mipRoughness = levelAlpha * (1.0f + 2.0f * levelAlpha) / 3.0f; @@ -599,7 +599,7 @@ void CubeMap::convolveForGGX(CubeMap& output, const std::atomic& abortProc size_t sampleCount = 1U + size_t(4000 * mipRoughness * mipRoughness); sampleCount = std::min(sampleCount, 2 * mipTotalPixelCount); - sampleCount = std::min(MAX_SAMPLE_COUNT, 4 * mipTotalPixelCount); + sampleCount = std::min(MAX_SAMPLE_COUNT, sampleCount); params.points.resize(sampleCount); generateGGXSamples(params, mipRoughness, _width);