Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Denoiser not being initialized for OptiX 8.0.0 #422

Open
JoeHegartyNV opened this issue Mar 31, 2024 · 0 comments
Open

Denoiser not being initialized for OptiX 8.0.0 #422

JoeHegartyNV opened this issue Mar 31, 2024 · 0 comments

Comments

@JoeHegartyNV
Copy link

The commit 44a61fa broke the initialization of the OptiX denoiser in pbrt-v4\src\pbrt\gpu\denoiser.cpp

Previously there were two code blocks with calls to optixDenoiserCreate() inside a define #if #else #endif. This was changed to three blocks of code inside a define #if #elif #else #endif, but only the last two blocks contained calls to optixDenoiserCreate(), so for the first block used by OptiX 8.0.0 the denoiserHandle was not being initialized.

Easy fix, just add a #endif after the newly added #if that sets the denoiseAlpha parameter for 8.0.0, and change the subsequent #elif back to a #if

    OptixDenoiserOptions options = {};
#if (OPTIX_VERSION >= 80000)
    options.denoiseAlpha = OPTIX_DENOISER_ALPHA_MODE_COPY;
#endif

#if (OPTIX_VERSION >= 70300)
    if (haveAlbedoAndNormal)
        options.guideAlbedo = options.guideNormal = 1;

    OPTIX_CHECK(optixDenoiserCreate(optixContext, OPTIX_DENOISER_MODEL_KIND_HDR, &options,
                                    &denoiserHandle));
#else
    options.inputKind = haveAlbedoAndNormal ? OPTIX_DENOISER_INPUT_RGB_ALBEDO_NORMAL
                                            : OPTIX_DENOISER_INPUT_RGB;

    OPTIX_CHECK(optixDenoiserCreate(optixContext, &options, &denoiserHandle));

    OPTIX_CHECK(
        optixDenoiserSetModel(denoiserHandle, OPTIX_DENOISER_MODEL_KIND_HDR, nullptr, 0));
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant