Geometry Nodes Instance Invisible in Cycles #91516

Closed
opened 2021-09-19 10:56:01 +02:00 by Zijun Zhou · 13 comments
Contributor

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce MX130/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 471.96

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-09-18 19:45, hash: bdbc7e12a0
Worked: (newest version of Blender that worked as expected)

Short description of error
No sure whether it is on the Cycles side or Geometry Nodes side. The instances are not visible in the final render, in the viewport you can get it to work by chance if you keep turning the Geometry Nodes modifier on and off. I just happened to get the bug and saved this file, I don't know how to reproduce it from startup.

Exact steps for others to reproduce the error
Based on an attached .blend file

  1. Open the attached file and hit rendered view
  2. Confirm it is invisible, then try to turn the modifier on and off, see it shows up occasionally
  3. Hit final render, see it does not show in the final image

GN Geometry Instance Cycles Invisible Bug.blend
GN Geometry Instance Cycles Invisible Bug.mp4

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: NVIDIA GeForce MX130/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 471.96 **Blender Version** Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-09-18 19:45, hash: `bdbc7e12a0` Worked: (newest version of Blender that worked as expected) **Short description of error** No sure whether it is on the Cycles side or Geometry Nodes side. The instances are not visible in the final render, in the viewport you can get it to work by chance if you keep turning the Geometry Nodes modifier on and off. I just happened to get the bug and saved this file, I don't know how to reproduce it from startup. **Exact steps for others to reproduce the error** Based on an attached .blend file 1. Open the attached file and hit rendered view 2. Confirm it is invisible, then try to turn the modifier on and off, see it shows up occasionally 3. Hit final render, see it does not show in the final image [GN Geometry Instance Cycles Invisible Bug.blend](https://archive.blender.org/developer/F10506925/GN_Geometry_Instance_Cycles_Invisible_Bug.blend) [GN Geometry Instance Cycles Invisible Bug.mp4](https://archive.blender.org/developer/F10488777/GN_Geometry_Instance_Cycles_Invisible_Bug.mp4)
Author
Contributor

Added subscriber: @Eary

Added subscriber: @Eary
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Added subscribers: @brecht, @JacquesLucke

Added subscribers: @brecht, @JacquesLucke
Member

Don't have a full solution yet, but have some new info. Right now there are two problems:

  • The Auto Smooth option is set on the object. With this on, an assert is triggered in object_to_mesh.
  • A second issue introduced in e57ce464c2 hid this assert at first.

This second issue is fixed with the following patch. @brecht, does this look good to you?

diff --git a/intern/cycles/blender/blender_geometry.cpp b/intern/cycles/blender/blender_geometry.cpp
index fca8cb9eda3..63f865c97eb 100644
--- a/intern/cycles/blender/blender_geometry.cpp
+++ b/intern/cycles/blender/blender_geometry.cpp
@@ -80,8 +80,10 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
 {
   /* Test if we can instance or if the object is modified. */
   Geometry::Type geom_type = determine_geom_type(b_ob_info, use_particle_hair);
-  BL::ID b_key_id = (BKE_object_is_modified(b_ob_info.real_object)) ? b_ob_info.real_object :
-                                                                      b_ob_info.object_data;
+  BL::ID b_key_id = (BKE_object_is_modified(b_ob_info.real_object) &&
+                     b_ob_info.is_real_object_data()) ?
+                        b_ob_info.real_object :
+                        b_ob_info.object_data;
   GeometryKey key(b_key_id.ptr.data, geom_type);
 
   /* Find shader indices. */

Still have to investigate how the first issue should be solved.

Don't have a full solution yet, but have some new info. Right now there are two problems: * The `Auto Smooth` option is set on the object. With this on, an assert is triggered in `object_to_mesh`. * A second issue introduced in e57ce464c2 hid this assert at first. This second issue is fixed with the following patch. @brecht, does this look good to you? ``` diff --git a/intern/cycles/blender/blender_geometry.cpp b/intern/cycles/blender/blender_geometry.cpp index fca8cb9eda3..63f865c97eb 100644 --- a/intern/cycles/blender/blender_geometry.cpp +++ b/intern/cycles/blender/blender_geometry.cpp @@ -80,8 +80,10 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph, { /* Test if we can instance or if the object is modified. */ Geometry::Type geom_type = determine_geom_type(b_ob_info, use_particle_hair); - BL::ID b_key_id = (BKE_object_is_modified(b_ob_info.real_object)) ? b_ob_info.real_object : - b_ob_info.object_data; + BL::ID b_key_id = (BKE_object_is_modified(b_ob_info.real_object) && + b_ob_info.is_real_object_data()) ? + b_ob_info.real_object : + b_ob_info.object_data; GeometryKey key(b_key_id.ptr.data, geom_type); /* Find shader indices. */ ``` Still have to investigate how the first issue should be solved.

Thanks, I committed that change along with avoiding the problem with auto smooth in this file. But this code is still weak and I think there are more bugs. I need to look into it closer.

Thanks, I committed that change along with avoiding the problem with auto smooth in this file. But this code is still weak and I think there are more bugs. I need to look into it closer.
Member

@brecht Do you have a specific bug in mind that we can put in a bug report? Currently this task is marked as a high priority bug, but it is not really actionable for me.

@brecht Do you have a specific bug in mind that we can put in a bug report? Currently this task is marked as a high priority bug, but it is not really actionable for me.

@JacquesLucke, I have not had the time yet to investigate this more or confirm there are more issues. But the things I wanted to check:

  • If geometry nodes generate geometry like metaballs or curves, Cycles has no way of converting those to a mesh. I'm not sure if that can happen right now.
  • We currently apply autosmooth vertex splitting to the mesh owned by Blender. Not sure if this breaks anything in practice, but it's not great to permanently modify Blender data from the exporter.

I think these are mostly Cycles side things, so will lower the priority and remove the geometry nodes tag.

@JacquesLucke, I have not had the time yet to investigate this more or confirm there are more issues. But the things I wanted to check: * If geometry nodes generate geometry like metaballs or curves, Cycles has no way of converting those to a mesh. I'm not sure if that can happen right now. * We currently apply autosmooth vertex splitting to the mesh owned by Blender. Not sure if this breaks anything in practice, but it's not great to permanently modify Blender data from the exporter. I think these are mostly Cycles side things, so will lower the priority and remove the geometry nodes tag.
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

As far as I know, cycles shouldn't have to worry about converting curve objects to meshes anymore, since this is part of curve object evaluation-- if the curve object evaluates to a mesh, cycles will see a mesh object when it iterates through the evaluated objects.

Metaballs haven't been changed though, they will probably still need the displist -> mesh conversion.

As far as I know, cycles shouldn't have to worry about converting curve objects to meshes anymore, since this is part of curve object evaluation-- if the curve object evaluates to a mesh, cycles will see a mesh object when it iterates through the evaluated objects. Metaballs haven't been changed though, they will probably still need the displist -> mesh conversion.
Member

Generally, when geometry nodes outputs a curve, it's really just a curve without any thickness. So it can't really be rendered. People use the Curve to Mesh node to give the curve a profile so that it can be rendered. This mesh will then be passed to cycles, not the original curve. Cycles does not have to do the curve-to-mesh conversion.

Generally, when geometry nodes outputs a curve, it's really just a curve without any thickness. So it can't really be rendered. People use the Curve to Mesh node to give the curve a profile so that it can be rendered. This mesh will then be passed to cycles, not the original curve. Cycles does not have to do the curve-to-mesh conversion.

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Brecht Van Lommel self-assigned this 2021-11-05 22:06:49 +01:00

After all the latest fixes I think we can close this.

After all the latest fixes I think we can close this.
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
5 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#91516
No description provided.