Closed dogJ-1005 closed 2 years ago
NRD has been designed to denoise real-time raytracing outputs, not static images:
How to convert an image to nri::Texture?
HDD to CPU memory: Utils.cpp - search for "LoadTexture" CPU memory to GPU: Sample::UploadStaticData()
It doesn't include state transitions, shader resource view creation...
Hi there. I feel a little confused about how to use NRD to do denoise. Here are some questions I summarized based on the README.md and 09_RayTracing_NRD.cpp:
I want to use nrd to denoise an image, so the input is " image_path ", how to convert an image to nri::Texture?
At the beginning, I referred to the steps of 09_RayTracing_NRD.cpp. By the function utils::LoadTexture(), I converted image to utils::Texture textureData , and when I wanted to use nri::createTexture() to convert utils::Texture to nri::Texture, I found that the createTexture() function's parameters were format, height, width and mipnum. It seemed that I just created a blank texture.
Maybe I should refer to the method "STEP 4 - WRAP NATIVE POINTERS" in README.md, but I have never contacted DirectX before, so it is a little difficult for me to understand.
How can I get the image after denoising? From the userpool's output slot?
What should I do about unused slots? If I use {nullptr, nullptr, nri::Format::UNKNOWN} ,this error will be generated :
An exception was thrown: Read access permission conflict. state is nullptr.
The error occurred in the Nrd::Dispatch() function:
bool isStateChanged = nextAccess != state->nextAccess || nextLayout != state->nextLayout
Could you give me some advice?