What exactly is your issue? The image matches what you programmed.
Citing the OptiX Programming Guide:
“The optional, noise-free albedo image represents an approximation of the color of the surface of the object, independent of view direction and lighting conditions. In physical terms, the albedo is a single color value approximating the ratio of radiant exitance to the irradiance under uniform lighting. The albedo value can be approximated for simple materials by using the diffuse color of the first hit, or for layered materials, by using a weighted sum of the albedo values of the individual BRDFs. For some objects such as perfect mirrors or highly glossy materials, the quality of the denoising result might be improved by using the albedo value of a subsequent hit instead. The fourth channel of this buffer is ignored, but must have the same type and dimensions as the input buffer. Specifying albedo can dramatically improve denoising quality, especially for very noisy input images.”
params.is_First_hit buffer used for anything else than tracking if you have written the albedo and normal buffers? Because if not, that is a waste of device memory and can be done with a local variable inside the ray generation program (or a flag on the per-ray data when you need that information inside the closest hit program).
The cleaner approach would be to store the albedo and normal of the current hit inside the closest hit program onto the per-ray payload for the first hit only and then write the result to the output buffers inside the ray generation program in one central place only.
The denoiser takes full range normals in the range [-1.0, 1.0]. Your commented out code setting the
params.normal_buffer can only work for the visualization of the normal buffer and for that should better be done with scale and bias (
N * 0.5f + 0.5f) to allow inspection of the whole range.
That the light is red is wrong. That should be white since that is emitting light. Means only using the diffuse color is not correct and the emission should be handled as well. Note that the emission is not limited and the albedo needs to be clamped to the valid color value range [0.0f, 1.0f] then.
Also there is a fully working OptiX 7 denoiser example rendering the noisy RGB, and optional albedo and normal buffers, which then used the OptiX HDR denoiser to look at.
That code shows how to generate the additional data here:
and writes those per-ray data fields in the correct range and coordinate space to the optional output buffers here: