Page MenuHome

Geometry Nodes Instance Invisible in Cycles
Closed, ResolvedPublicBUG

Description

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: rBbdbc7e12a02e
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


Event Timeline

Zijun Zhou (Eary) updated the task description. (Show Details)
Pratik Borhade (PratikPB2123) changed the task status from Needs Triage to Confirmed.Sep 20 2021, 7:54 AM
Brecht Van Lommel (brecht) triaged this task as High priority.Sep 22 2021, 6:29 PM
Brecht Van Lommel (brecht) changed the subtype of this task from "Report" to "Bug".

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

This second issue is fixed with the following patch. @Brecht Van Lommel (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.

@Brecht Van Lommel (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 Van Lommel (brecht) lowered the priority of this task from High to Normal.Sep 30 2021, 5:47 PM

@Jacques Lucke (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.

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.

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.

Brecht Van Lommel (brecht) claimed this task.

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