FidelityFX-CACAO icon indicating copy to clipboard operation
FidelityFX-CACAO copied to clipboard

Bug: Disparity in quality levels

Open MatusT opened this issue 4 years ago • 2 comments

Hello,

I found some disparities in quality levels in the code. Could you comment on It whether I am missing something, or It is indeed a bug?

In fx_cacao.cpp on line 1974 the importance map is generated only if the level is Highest (4) which seems correct.

if (context->settings.qualityLevel == FFX_CACAO_QUALITY_HIGHEST) {
  // generate importance map code
}

BUT, in fx_cacaco.hlsl for level HIGH (3) you call GenerateSSAOShadowsInternal with qualityLevel = 3 and adaptiveBase = false which results in:

static const uint g_numTaps[5] = { 3, 5, 12, 0, 0 };
// ... later
const int numberOfTaps = (adaptiveBase) ? (SSAO_ADAPTIVE_TAP_BASE_COUNT) : (g_numTaps[qualityLevel]);

^ number of taps being 0! which I believe should be 12 as in https://software.intel.com/content/www/us/en/develop/articles/adaptive-screen-space-ambient-occlusion.html.

and

if ((qualityLevel != 3) || adaptiveBase)
{

}
else // if ( qualityLevel == 3 ) adaptive approach
{
 // ...
 float importance = g_ImportanceMap.SampleLevel(g_LinearClampSampler, fullResUV, 0.0).x;
 // ...
}

^ you sample from a map that is not generated. Because level 3 (High) is not the adaptive one. That is 4. I believe the if should be qualityLevel !=4.

MatusT avatar Aug 04 '20 17:08 MatusT

@jayfraser can you take a look and check if @MatusT's comment is valid and explain why or why not?

rys avatar Apr 28 '21 18:04 rys

I almost forgot that I opened this issue. Looking at the code, it had major revisions since I looked at it. It might be possible that this issue is now obsolete.

MatusT avatar Apr 29 '21 09:04 MatusT