Open DragonAxe opened 3 weeks ago
I noticed this on a few of my projects, was just struggling to nail down the repro. Good find on the exact count that causes this. Some notes that might help with the investigation:
queue_free()
a mesh when this happens and that brings you back under the magic number, you'll get your game world back. You can flicker between this state and visibility (one of our games allowed us to "claw back" the viewport by blindly collecting spawned objects)
Tested versions
Tested on: v4.3.stable.official [77dcf97d8] (compatibility renderer) Firefox: 130.0 (64 bit) Chromium: Version 128.0.6613.119 (Official Build) Arch Linux (64-bit)
System information
Manjaro Linux #1 SMP PREEMPT_DYNAMIC Mon Aug 19 09:51:26 UTC 2024 - Wayland - GLES3 (Compatibility) - Mesa Intel(R) UHD Graphics 620 (KBL GT2) - Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz (8 Threads)
Issue description
In my 3D project, I was using blender to create my level by making hundreds of copies of the same object with different offsets and rotations but using the same mesh to save on video memory. Everything worked as expected when running natively. 2D elements like Controls and Sprites still render fine on web. All 3D elements are gone and only the clear color remains on web.
Screenshot of my Blender scene with 2543 objects all using the same mesh:
After some testing, I narrowed the problem down to the number of MeshInstance3D nodes. If the scene has more than 1000 MeshInstance3Ds, the web export scene will go blank. I did not find any mention of this limitation in the documentation, github issues, or reddit posts.
Steps to reproduce
Create a new scene with a Node as root.
Attach the below script to the root node.
Set new scene as "Main Scene".
Note: you may need to set up a web export for the project.
Go to the "Remote Debug" menu.
You should see 1000 spheres set up in a grid.
Edit the root node script to comment out
add_generated_meshes(1000)
and un-commentadd_generated_meshes(1001)
.You should see a gray screen without 1001 spheres.
Minimal reproduction project (MRP)
Add the following script to a root node of an empty scene.