mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 19:23:04 +02:00
Fixed wrong sample count
This commit is contained in:
parent
706dc0e303
commit
f895e96500
1 changed files with 2 additions and 2 deletions
|
@ -588,7 +588,7 @@ void CubeMap::convolveForGGX(CubeMap& output, const std::atomic<bool>& 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<bool>& 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);
|
||||
|
|
Loading…
Reference in a new issue