@@ -1485,7 +1485,7 @@ void Renderer::resetSampleAndFrameCounters()
1485
1485
m_prevCamTform = nbl::core::matrix4x3 ();
1486
1486
}
1487
1487
1488
- void Renderer::takeAndSaveScreenShot (const std::filesystem::path& screenshotFilePath, const DenoiserArgs& denoiserArgs)
1488
+ void Renderer::takeAndSaveScreenShot (const std::filesystem::path& screenshotFilePath, bool denoise, const DenoiserArgs& denoiserArgs)
1489
1489
{
1490
1490
auto commandQueue = m_rrManager->getCLCommandQueue ();
1491
1491
ocl::COpenCLHandler::ocl.pclFinish (commandQueue);
@@ -1500,35 +1500,39 @@ void Renderer::takeAndSaveScreenShot(const std::filesystem::path& screenshotFile
1500
1500
filename_wo_ext.replace_extension ();
1501
1501
if (m_tonemapOutput)
1502
1502
ext::ScreenShot::createScreenShot (m_driver,m_assetManager,m_tonemapOutput.get (),filename_wo_ext.string ()+" .exr" ,format);
1503
- if (m_albedoRslv)
1504
- ext::ScreenShot::createScreenShot (m_driver,m_assetManager,m_albedoRslv.get (),filename_wo_ext.string ()+" _albedo.exr" ,format);
1505
- if (m_normalRslv)
1506
- ext::ScreenShot::createScreenShot (m_driver,m_assetManager,m_normalRslv.get (),filename_wo_ext.string ()+" _normal.exr" ,format);
1507
-
1508
- const std::string defaultBloomFile = " ../../media/kernels/physical_flare_512.exr" ;
1509
- const std::string defaultTonemapperArgs = " ACES=0.4,0.8" ;
1510
- constexpr auto defaultBloomScale = 0 .1f ;
1511
- constexpr auto defaultBloomIntensity = 0 .1f ;
1512
- auto bloomFilePathStr = (denoiserArgs.bloomFilePath .string ().empty ()) ? defaultBloomFile : denoiserArgs.bloomFilePath .string ();
1513
- auto bloomScale = (denoiserArgs.bloomScale == 0 .0f ) ? defaultBloomScale : denoiserArgs.bloomScale ;
1514
- auto bloomIntensity = (denoiserArgs.bloomIntensity == 0 .0f ) ? defaultBloomIntensity : denoiserArgs.bloomIntensity ;
1515
- auto tonemapperArgs = (denoiserArgs.tonemapperArgs .empty ()) ? defaultTonemapperArgs : denoiserArgs.tonemapperArgs ;
1516
-
1517
- std::ostringstream denoiserCmd;
1518
- // 1.ColorFile 2.AlbedoFile 3.NormalFile 4.BloomPsfFilePath(STRING) 5.BloomScale(FLOAT) 6.BloomIntensity(FLOAT) 7.TonemapperArgs(STRING)
1519
- denoiserCmd << " call ../denoiser_hook.bat" ;
1520
- denoiserCmd << " " << filename_wo_ext.string () << " .exr" ;
1521
- denoiserCmd << " " << filename_wo_ext.string () << " _albedo.exr" ;
1522
- denoiserCmd << " " << filename_wo_ext.string () << " _normal.exr" ;
1523
- denoiserCmd << " " << bloomFilePathStr;
1524
- denoiserCmd << " " << bloomScale;
1525
- denoiserCmd << " " << bloomIntensity;
1526
- denoiserCmd << " " << " \" " << tonemapperArgs << " \" " ;
1527
- // NOTE/TODO/FIXME : Do as I say, not as I do
1528
- // https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152177
1529
- std::cout << " \n ---[DENOISER_BEGIN]---" << std::endl;
1530
- std::system (denoiserCmd.str ().c_str ());
1531
- std::cout << " \n ---[DENOISER_END]---" << std::endl;
1503
+
1504
+ if (denoise)
1505
+ {
1506
+ if (m_albedoRslv)
1507
+ ext::ScreenShot::createScreenShot (m_driver,m_assetManager,m_albedoRslv.get (),filename_wo_ext.string ()+" _albedo.exr" ,format);
1508
+ if (m_normalRslv)
1509
+ ext::ScreenShot::createScreenShot (m_driver,m_assetManager,m_normalRslv.get (),filename_wo_ext.string ()+" _normal.exr" ,format);
1510
+
1511
+ const std::string defaultBloomFile = " ../../media/kernels/physical_flare_512.exr" ;
1512
+ const std::string defaultTonemapperArgs = " ACES=0.4,0.8" ;
1513
+ constexpr auto defaultBloomScale = 0 .1f ;
1514
+ constexpr auto defaultBloomIntensity = 0 .1f ;
1515
+ auto bloomFilePathStr = (denoiserArgs.bloomFilePath .string ().empty ()) ? defaultBloomFile : denoiserArgs.bloomFilePath .string ();
1516
+ auto bloomScale = (denoiserArgs.bloomScale == 0 .0f ) ? defaultBloomScale : denoiserArgs.bloomScale ;
1517
+ auto bloomIntensity = (denoiserArgs.bloomIntensity == 0 .0f ) ? defaultBloomIntensity : denoiserArgs.bloomIntensity ;
1518
+ auto tonemapperArgs = (denoiserArgs.tonemapperArgs .empty ()) ? defaultTonemapperArgs : denoiserArgs.tonemapperArgs ;
1519
+
1520
+ std::ostringstream denoiserCmd;
1521
+ // 1.ColorFile 2.AlbedoFile 3.NormalFile 4.BloomPsfFilePath(STRING) 5.BloomScale(FLOAT) 6.BloomIntensity(FLOAT) 7.TonemapperArgs(STRING)
1522
+ denoiserCmd << " call ../denoiser_hook.bat" ;
1523
+ denoiserCmd << " \" " << filename_wo_ext.string () << " .exr" << " \" " ;
1524
+ denoiserCmd << " \" " << filename_wo_ext.string () << " _albedo.exr" << " \" " ;
1525
+ denoiserCmd << " \" " << filename_wo_ext.string () << " _normal.exr" << " \" " ;
1526
+ denoiserCmd << " \" " << bloomFilePathStr << " \" " ;
1527
+ denoiserCmd << " " << bloomScale;
1528
+ denoiserCmd << " " << bloomIntensity;
1529
+ denoiserCmd << " " << " \" " << tonemapperArgs << " \" " ;
1530
+ // NOTE/TODO/FIXME : Do as I say, not as I do
1531
+ // https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152177
1532
+ std::cout << " \n ---[DENOISER_BEGIN]---" << std::endl;
1533
+ std::system (denoiserCmd.str ().c_str ());
1534
+ std::cout << " \n ---[DENOISER_END]---" << std::endl;
1535
+ }
1532
1536
}
1533
1537
1534
1538
// one day it will just work like that
0 commit comments