Hi everyone!
I’m trying to make denoising on Cycles to work on my own application (somewhat based on the standalone app).
Most of what I’ve done so far has been inspired on the Blender source code and the standalone app, but I can’t seem to get denoising to work at all. On the Blender source code, the parameters for the session seem to be very different (the SessionParams and DenoiseParams structures seem to be very different from the one in the standalone app), and the standalone app doesn’t have the options for this.
I’ve tried two ways of making it work:
DenoiseParams denoising;
denoising.use = true;
denoising.store_passes = true;
denoising.type = DenoiserType::DENOISER_OPENIMAGEDENOISE;
denoising.start_sample = 1;
_session = new Session(session_params);
_session->set_denoising(denoising);
This doesn’t seem to have any effect whatsoever on the output image.
session_params.denoising.use = true;
session_params.denoising.store_passes = true;
session_params.denoising.type = DenoiserType::DENOISER_OPENIMAGEDENOISE;
session_params.denoising.start_sample = 1;
_session = new Session(session_params);
This one renders up until 98% (according to session progress), and then just stands there, nothing happening…
Anybody has any ideas? I’m I missing an initialization somewhere?
The rest of the session initialization code is as follows in both cases:
std::vector<DeviceInfo> devices = Device::available_devices((DeviceTypeMask)(1 << DEVICE_CPU));
SessionParams session_params;
session_params.write_render_cb = [this](const unsigned char* pixels, int width, int height, int channels) { return this->write_pixels(pixels, width, height, channels); };
session_params.device = devices.front();
session_params.device.add_denoising_devices(DenoiserType::DENOISER_OPENIMAGEDENOISE);
session_params.progressive = true;
session_params.start_resolution = 64;
session_params.tile_size = make_int2(64, 64);
Best regards,
Diogo