Maniphest T101071

Denoising passes are darkened when denoising is enabled for multi-device rendering
Confirmed, Normal

Assigned To
None
Authored By
Rafael Miziara (Rafamizi)
Sep 14 2022, 8:06 PM
Tags
  • BF Blender
  • Render & Cycles
  • Cycles
Subscribers
Germano Cavalcante (mano-wii)
Omar Emara (OmarSquircleArt)
Rafael Miziara (Rafamizi)
Richard Antalik (ISS)
Shane Killian (shanedk)

Description

Simplified Report

Denoising passes like Albedo and Normal are darkened when denoising is enabled when rendering using multiple devices.
This is most likely because the passes are scaled in-place during denoising and then scaled again in the pixel accessor.

Original report

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.77

Blender Version
Broken: version: 3.3.0, branch: master, commit date: 2022-09-06 15:39, hash: rB0759f671ce1f
Worked: 3.2.2

Short description of error
When rendering a scene using Cycles with the Denoise option enabled, the Denoising Normal and Denoising Albedo passes don't render correctly, the images correspondent to those passes are much darker than they should be.

Exact steps for others to reproduce the error

  1. Open attached file or
    • Open Blender.
    • Delete the default cube.
    • Add an icosphere and set it shade smooth.
    • With the icosphere selected, go to the Shading workspace and add a material to it.
    • In Principled BSDF of the icosphere's material, go to base color and add a color (any color other than black, white or gray).
    • Go to Render Properties and select Cycles as render engine and GPU as Device.
    • In the Render section of the Render Properties, disable Denoise (it is enabled by default).
    • Go to View Layer Properties.
    • In the View Layer Properties, go to Passes section, Data sub-section and enable Denoising Data.
    • Go to the Compositing workspace and enable Use Nodes.
  2. Render the image (Press F12).
  3. In the Render Layers node, visualize the Denoising Normal and Denoising Albedo outputs (Ctrl+Shift+LeftClick with the Node Wrangler Add-on enabled).
  4. In the Properties Editor Go to SamplingRender and re-enable Denoise.
  5. Render the image again (Press F12 or use the small buttom at the bottom right of the Render Layers node).
  6. Repeat step 3.

By comparing the images from step 3 and step 6, the difference is clear, the images from step 6 (Cycles' denoise enabled) are much darker than they should be;
I tested with a more complex scene and noticed that the darker images do remove noise when used with the Denoise node in the compositor, so it may not be a big problem for Blender, but it may affect someone using other softwares in a pipeline, unfortunally, I can not tested it because I don't have acess to external compositing softwares, I only use Blender.

Thank you, have a nice day :).

Event Timeline

Rafael Miziara (Rafamizi) created this task.Sep 14 2022, 8:06 PM
Omar Emara (OmarSquircleArt) changed the task status from Needs Triage to Needs Information from User.Sep 15 2022, 3:18 PM
Omar Emara (OmarSquircleArt) added a subscriber: Omar Emara (OmarSquircleArt).

I can't reproduce this issue using the OIDN denoiser with CPU rendering. Can you reproduce the issue with CPU rendering and OIDN?
Can you also attach a file just so that we are on the same page with testing?

Germano Cavalcante (mano-wii) changed the task status from Needs Information from User to Needs Triage.Sep 15 2022, 3:18 PM
Germano Cavalcante (mano-wii) updated the task description.
Germano Cavalcante (mano-wii) added a subscriber: Germano Cavalcante (mano-wii).Sep 15 2022, 3:20 PM

I also can't reproduce the problem with a Radeon RX 480 Graphics. It should depend on Denoiser and GPU.

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Needs Information from User.Sep 15 2022, 3:27 PM
Rafael Miziara (Rafamizi) added a comment.Sep 15 2022, 5:32 PM

Hi :).

I made some tests with the T101071 blend file provided and I can confirm that the bug doesn't happen with CPU render, regardless if the Denoiser is on or off:
CPU Render, Albedo Pass, Denoise OFF:


CPU Render, Normal Pass, Denoise OFF:

CPU Render, Albedo Pass, Denoise ON:

CPU Render, Normal Pass, Denoise ON:

However, it consistently happens with GPU render and Denoise ON:
GPU Render, Albedo Pass, Denoise ON:


GPU Render, Normal Pass, Denoise ON:

I tested with OpenImage Denoiser (I assume this is OIDN, if not, sorry, I am not familiar with such terminology) and OptiX Denoiser, the bug happens with both.

The bug doesn't happen with GPU render if the Denoiser is off (as I expected):
GPU Render, Albedo Pass, Denoise OFF:


GPU Render, Normal Pass, Denoise OFF:

I hope this visual feedback be somehow useful for you :).

Thank you, have a nice day :D.

Richard Antalik (ISS) added a subscriber: Richard Antalik (ISS).Sep 16 2022, 2:05 AM

Also can't reproduce with Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.65

Omar Emara (OmarSquircleArt) changed the task status from Needs Information from User to Needs Triage.Sep 16 2022, 9:05 AM
Omar Emara (OmarSquircleArt) changed the task status from Needs Triage to Needs Information from User.Sep 16 2022, 10:18 AM

Are you rendering using multiple devices (Multiple GPUs or GPU+CPU) by any chance?

There is some logic in the code that scales down the passes in place for multi-device rendering, and I suspect it might be faulty because the denoising passes are eventually read back from the big buffer.

Rafael Miziara (Rafamizi) added a comment.Sep 16 2022, 5:25 PM
In T101071#1418064, @Omar Emara (OmarSquircleArt) wrote:

Are you rendering using multiple devices (Multiple GPUs or GPU+CPU) by any chance?

There is some logic in the code that scales down the passes in place for multi-device rendering, and I suspect it might be faulty because the denoising passes are eventually read back from the big buffer.

No, I only use a single GTX 1050Ti, it is the only GPU installed in my computer.

I use "GPU Compute" as Device in the Render Properties, so as far as I know, I only render with GPU, no GPU + CPU.

Omar Emara (OmarSquircleArt) added a comment.Sep 16 2022, 5:52 PM

To confirm CPU + GPU, you should check Preferences > System. Do you have both the CPU and GPY checked in that panel?

Rafael Miziara (Rafamizi) added a comment.Sep 16 2022, 6:47 PM
In T101071#1418363, @Omar Emara (OmarSquircleArt) wrote:

To confirm CPU + GPU, you should check Preferences > System. Do you have both the CPU and GPY checked in that panel?

Thank you for the tip :).

I checked and yes, I had both my GPU and CPU (an i5-4430 3.00 GHz) checked for CUDA and OptiX.

I made a test and the bug doesn't happen if I uncheck the CPU... Weird, I always rendered with both GPU and CPU checked and never had a problem with the passes, it only happen with 3.3.0, could it be a GPU/CPU driver problem?

Omar Emara (OmarSquircleArt) changed the task status from Needs Information from User to Needs Triage.Sep 16 2022, 7:44 PM

Great. I will wait for someone with a multi-device setup to double confirm.
It is unlikely to be a driver issue. Probably just a logic error in the code.

Omar Emara (OmarSquircleArt) renamed this task from Denoising Normal and Denoising Albedo passes not rendering correctly in Cycles with Denoise enabled to Denoising passes are darkened when denoising is enabled for multi-device rendering.Sep 16 2022, 7:47 PM
Omar Emara (OmarSquircleArt) updated the task description.
Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.Sep 16 2022, 11:32 PM
Richard Antalik (ISS) added a project: Render & Cycles.

Can confirm when rendering with CPU+GPU.

Omar Emara (OmarSquircleArt) added a project: Cycles.Sep 17 2022, 8:55 AM
Shane Killian (shanedk) added a subscriber: Shane Killian (shanedk).Nov 29 2022, 2:20 PM

I can confirm this in 3.3.1. The problem happens with GPU+CPU, but not with the GPU by itself.

Rafael Miziara (Rafamizi) added a comment.Dec 8 2022, 4:49 PM

Hi.

I would like to confirm that this bug still happens in 3.4 (version: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash: rBa95bf1ac01be).