Skip to content

Commit

Permalink
Added option to enable HDR training data
Browse files Browse the repository at this point in the history
  • Loading branch information
DeclanRussell committed Jul 28, 2018
1 parent 89c9812 commit 9fcf6f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ You will require an Nvidia driver of at least 390.xx or higher to use the optix
Command line parameters
* -i [string] : path to input image
* -o [string] : path to output image
* -a [string] : path to input albedo AOV
* -n [string] : path to input normal AOV
* -b [float] : blend amount
* -a [string] : path to input albedo AOV (optional)
* -n [string] : path to input normal AOV (optional, requires albedo AOV)
* -b [float] : blend amount (default 0)
* -hdr [int] : Use HDR training data (default 1)
* -h/--help : Lists command line parameters

You need to at least have an input and output for the app to run. If you also have them, you can add an albedo AOV or albedo and normal AOVs to improve the denoising. All images should be the same resolutions, not meeting this requirement will lead to unexpected results (likely a crash).
Expand Down
Binary file modified images/denoised_test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 13 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ int main(int argc, char *argv[])
// Pass our command line args
std::string out_path;
float blend = 0.f;
unsigned int hdr = 1;
for (int i=1; i<argc; i++)
{
const std::string arg( argv[i] );
Expand Down Expand Up @@ -102,14 +103,22 @@ int main(int argc, char *argv[])
blend = std::stof(blend_string);
std::cout<<"Blend amount: "<<blend<<std::endl;
}
else if (arg == "-hdr")
{
i++;
std::string hdr_string( argv[i] );
hdr = std::stoi(hdr_string);
std::cout<<((hdr) ? "HDR training data enabled" : "HDR training data disabled")<<std::endl;
}
else if (arg == "-h" || arg == "--help")
{
std::cout<<"Command line parameters"<<std::endl;
std::cout<<"-i [string] : path to input image"<<std::endl;
std::cout<<"-o [string] : path to output image"<<std::endl;
std::cout<<"-a [string] : path to input albedo AOV"<<std::endl;
std::cout<<"-n [string] : path to input normal AOV"<<std::endl;
std::cout<<"-b [float] : blend amount"<<std::endl;
std::cout<<"-a [string] : path to input albedo AOV (optional)"<<std::endl;
std::cout<<"-n [string] : path to input normal AOV (optional, requires albedo AOV)"<<std::endl;
std::cout<<"-b [float] : blend amount (default 0)"<<std::endl;
std::cout<<"-hdr [int] : Use HDR training data (default 1)"<<std::endl;
}
}

Expand Down Expand Up @@ -245,6 +254,7 @@ int main(int argc, char *argv[])
denoiserStage->declareVariable("input_buffer")->set(beauty_buffer);
denoiserStage->declareVariable("output_buffer")->set(out_buffer);
denoiserStage->declareVariable("blend")->setFloat(blend);
denoiserStage->declareVariable("hdr")->setUint(hdr);
denoiserStage->declareVariable("input_albedo_buffer")->set(albedo_buffer);
denoiserStage->declareVariable("input_normal_buffer")->set(normal_buffer);

Expand Down

0 comments on commit 9fcf6f2

Please sign in to comment.