OptixPathTracer Sample: how to to save image after the denoiser?

I would like to use the feature of capturing the rendered image in pathTracer optix sample.
If I understood it well, I just have to insert the argument “-f test.png” in order to get the rendered image at current/default camera position.
Indeed, I got the exported test.png file, but I noticed that it had a lot of noise in it. How could I export the final smoothened image of the path tracer?
Should I apply some kind of wait/sleep for some milliseconds in order to get the image without the noise?

If you look at what happens before the saveImage function call inside the optixPathTracer.cpp main function, that is calling launchSubframe( output_buffer, state ); only once.
If you want that to accumulate more sub-frames, you would need to add a loop around that which calls that the number of sub-frames you want while incrementing the launch parameter’s subframe_index accordingly.

So something like this instead of the single launchSubframe() call there:

 for (state.params.subframe_index = 0; state.params.subframe_index < NUMBER_OF_SUBFRAMES, ++state.params.subframe_index)
   updateState( output_buffer, state.params );
   launchSubframe( output_buffer, state );

If you want to save the image when rendering interactively instead, you would need to add some key event, like when pressing S, setting some global dirty flag that a screenshot should be taken, similar to the geometry adding code I showed you before, and when that new flag is set, call the saveImage() function inside the main render loop once and clear the flag again.

It doesn’t get much simpler than that.

thanks <3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.