CYCLES : in the final render, objects and smoke domains render black if the material output node's volume input is the only one in use and there are custom aov nodes in the node _tree #113871

Closed
opened 2023-10-18 03:38:43 +02:00 by michael campbell · 11 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.99

Blender Version
Broken: version: 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-10-12 18:54, hash: 1c4b2ad17f5f
Worked: (3.6.3)

Short description of error

I'm aware that volumes can't generate AOV data, but to avoid breaking an addon, would it be possible for this to still be fixed?

In Cycles, if the material output node's volume socket is the only one wired, then the object or smoke domain will render black if there is also a shader AOV node in the material's node_tree. Only affects final render.

The world output node doesn't exhibit the same issue if only it's volume input is wired and there's a custom aov node in the world's node tree, although I did notice that if surface and volume have inputs, the hdri turns black if the principled volume's density is anything other than 0, which was unexpected (and happens even without an aov node present). I don't use volumes in the world node tree, so I'm not sure if that is a bug or not.

Exact steps for others to reproduce the error

  1. Open the attached blend file, go to the compositor and render with f12.
  2. The object and smoke domain appear black
  3. connect something to the surface input of the material output node and re-render
  4. the objects now render correctly.
  5. remove connection to the surface input and delete the aovs group node and re-render
  6. the objects now render

Viewport:
image

render:
image

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.99 **Blender Version** Broken: version: 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-10-12 18:54, hash: `1c4b2ad17f5f` Worked: (3.6.3) **Short description of error** I'm aware that volumes can't generate AOV data, but to avoid breaking an addon, would it be possible for this to still be fixed? In Cycles, if the material output node's volume socket is the only one wired, then the object or smoke domain will render black if there is also a shader AOV node in the material's node_tree. Only affects final render. The world output node doesn't exhibit the same issue if only it's volume input is wired and there's a custom aov node in the world's node tree, although I did notice that if surface and volume have inputs, the hdri turns black if the principled volume's density is anything other than 0, which was unexpected (and happens even without an aov node present). I don't use volumes in the world node tree, so I'm not sure if that is a bug or not. **Exact steps for others to reproduce the error** 1. Open the attached blend file, go to the compositor and render with f12. 2. The object and smoke domain appear black 3. connect something to the surface input of the material output node and re-render 4. the objects now render correctly. 5. remove connection to the surface input and delete the aovs group node and re-render 6. the objects now render Viewport: ![image](/attachments/cbdd7bcb-bb84-4601-b810-8c0a5cacf4e0) render: ![image](/attachments/9a6d6313-3753-4819-bb8f-98d8fec32a30)
michael campbell added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-10-18 03:38:44 +02:00
michael campbell changed title from CYCLES : in the final render, objects and smoke domains render black if the material output node's volume input is the only one in use and there are custom aov nodes in the node _tree to CYCLES : in the final render, objects and smoke domains render black if the material output node's volume input is the only one in use and there are custom aov nodes in the node _tree 2023-10-18 05:55:29 +02:00
michael campbell changed title from CYCLES : in the final render, objects and smoke domains render black if the material output node's volume input is the only one in use and there are custom aov nodes in the node _tree to CYCLES : in the final render, objects and smoke domains render black if the material output node's volume input is the only one in use and there are custom aov nodes in the node _tree 2023-10-18 06:10:11 +02:00
Member

Hi, thanks for the report. Can confirm the regression.
@lichtwerk , can you help in bisecting?

Hi, thanks for the report. Can confirm the regression. @lichtwerk , can you help in bisecting?
Member

Hi, thanks for the report. Can confirm the regression.
@lichtwerk , can you help in bisecting?

On it

> Hi, thanks for the report. Can confirm the regression. > @lichtwerk , can you help in bisecting? On it
Blender Bot added
Status
Resolved
and removed
Status
Needs Info from Developers
labels 2023-10-18 17:24:48 +02:00

@brecht , thanks for the quick fix, it's worked a treat for the render but I think the solution of adding a transparency bsdf leads to additional problems with the AOV data. The behaviour in 3.6 of the aov being ignored if only the volume socket was wired was preferable, because it allowed objects occluded by the volume that also write to the same AOV to still generate reasonably clean data.

scene (all objects have custom AOV):
image

render:
image

3.6 aov output:
image

4.0 with above commit:
image

I've modified the addon now to no longer create custom AOV's for volumes without surfaces, so I'm fine either way, but just thought I'd point it out in case it affects anyone elses 👍

@brecht , thanks for the quick fix, it's worked a treat for the render but I think the solution of adding a transparency bsdf leads to additional problems with the AOV data. The behaviour in 3.6 of the aov being ignored if only the volume socket was wired was preferable, because it allowed objects occluded by the volume that also write to the same AOV to still generate reasonably clean data. scene (all objects have custom AOV): ![image](/attachments/f6ac96b8-4a8c-4ad3-8a2a-466856ca535b) render: ![image](/attachments/52feffed-6f87-48ae-9dc3-c2ceaa9e9000) 3.6 aov output: ![image](/attachments/014fd6b0-36ca-4177-96c7-3bd992de8f4f) 4.0 with above commit: ![image](/attachments/328b1c73-cd2d-40dc-930d-01b3708184e5) I've modified the addon now to no longer create custom AOV's for volumes without surfaces, so I'm fine either way, but just thought I'd point it out in case it affects anyone elses 👍

Ok, the AOV is no longer written when there is only a volume shader now.

Ok, the AOV is no longer written when there is only a volume shader now.

Thanks. But this will cause the volume to render black again if there's volume only and a custom AOV.

I think the section of code your editing isn't responsible for the change in behaviour, so somewhere else in the code, to keep the same behaviour as 3.6 perhaps this would be better?

if (!has_surface && has_volume) {
#ignore custom AOV rather than creating a transparent bsdf to force it to write.

By the way, there's no need to add a transparent BSDF if there's neither surface of volume. The AOV will already render correctly without the transparent bsdf, and in that case it would be intentional for the material output node to render black.

Current behaviour with neither surface or volume
image

Thanks. But this will cause the volume to render black again if there's volume only and a custom AOV. I think the section of code your editing isn't responsible for the change in behaviour, so somewhere else in the code, to keep the same behaviour as 3.6 perhaps this would be better? if (!has_surface && has_volume) { #ignore custom AOV rather than creating a transparent bsdf to force it to write. By the way, there's no need to add a transparent BSDF if there's neither surface of volume. The AOV will already render correctly without the transparent bsdf, and in that case it would be intentional for the material output node to render black. Current behaviour with neither surface or volume ![image](/attachments/5f019d0f-3911-4dd0-9055-0a5e265bb6ef)
1.2 MiB

Perhaps in this function on line 562 in svm.cpp, only have it find the AOV if the output node isn't a (volume with no surface)

void SVMCompiler::find_aov_nodes_and_dependencies(ShaderNodeSet &aov_nodes,
                                                  ShaderGraph *graph,
                                                  CompilerState *state)
{
  if !(! has_surface && has_volume) {
    foreach (ShaderNode *node, graph->nodes) {
      if (node->special_type == SHADER_SPECIAL_TYPE_OUTPUT_AOV) {
        OutputAOVNode *aov_node = static_cast<OutputAOVNode *>(node);
        if (aov_node->offset >= 0) {
          aov_nodes.insert(aov_node);
          foreach (ShaderInput *in, node->inputs) {
            if (in->link != NULL) {
              find_dependencies(aov_nodes, state->nodes_done, in);
            }
          }
        }
      }
    }
  }
}
Perhaps in this function on line 562 in svm.cpp, only have it find the AOV if the output node isn't a (volume with no surface) ``` void SVMCompiler::find_aov_nodes_and_dependencies(ShaderNodeSet &aov_nodes, ShaderGraph *graph, CompilerState *state) { if !(! has_surface && has_volume) { foreach (ShaderNode *node, graph->nodes) { if (node->special_type == SHADER_SPECIAL_TYPE_OUTPUT_AOV) { OutputAOVNode *aov_node = static_cast<OutputAOVNode *>(node); if (aov_node->offset >= 0) { aov_nodes.insert(aov_node); foreach (ShaderInput *in, node->inputs) { if (in->link != NULL) { find_dependencies(aov_nodes, state->nodes_done, in); } } } } } } } ```

But this will cause the volume to render black again if there's volume only and a custom AOV.

I can't confirm this. Are you sure you are testing a build with all the fixes applied?

> But this will cause the volume to render black again if there's volume only and a custom AOV. I can't confirm this. Are you sure you are testing a build with all the fixes applied?

No I was just reading the code, so I could be wrong. The previous commit fixed the black volume by adding a transparent bsdf if there was an aov without a surface. But the new commit undoes that because now it only adds the transparent bsdf if there is neither (which already worked properly). It doesn't seem to have anything in place if there is only a volume input.

Rather than adding a transparent BSDF, perhaps just not finding the AOV if it's only a volume would be better? That'd fix the original bug without the problem of volumes writing AOV data?

No I was just reading the code, so I could be wrong. The previous commit fixed the black volume by adding a transparent bsdf if there was an aov without a surface. But the new commit undoes that because now it only adds the transparent bsdf if there is neither (which already worked properly). It doesn't seem to have anything in place if there is only a volume input. Rather than adding a transparent BSDF, perhaps just not finding the AOV if it's only a volume would be better? That'd fix the original bug without the problem of volumes writing AOV data?

image

![image](/attachments/654695c9-6687-4c24-a911-db63e4d906cc)

unless that would break the current behaviour of the world node being able to write to AOVs if there's only a volume.

unless that would break the current behaviour of the world node being able to write to AOVs if there's only a volume.

I suppose the real question is, why is it now necessary to add a transparent BSDF to prevent the volume rendering black if there's an AOV node, when it wasn't needed in 3.6.

I suppose the real question is, why is it now necessary to add a transparent BSDF to prevent the volume rendering black if there's an AOV node, when it wasn't needed in 3.6.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#113871
No description provided.