-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the instance count of MultiMesh is changed, strange data appears in the buffer. #75485
Comments
I did some related digging during my MultiMesh bugfix and I can confirm this happening, it's pretty easy to repro. I suspect the reason might either be the semi-asynchronous nature of the buffer update or simply uninitialized data somewhere. Either way, the end result is that sometimes when resizing the buffer data in the editor, it gets filled with garbage data. |
I'm going to chime in on this rather than raise a new ticket as suspect it's the same bug still happening in v4.3.dev4.official [df78c06] Essentially I have a function that programmatically spawns new MultiMeshes, and am having to regenerate a new buffer manually to stop it generating junk:
|
I believe this is also the case in v4.2.2 (release) by the way. |
Confirming that it is happening in 4.2.2. I am generating MultiMeshes and MultiMeshInstance3Ds in code in a [Tool] C# script to make grass on a procedural mesh terrain and this started happening after a while. Only form of replicating the workaround posted above is by setting the buffer to null, which Godot complains about and then does render the MultiMeshInstance3Ds as expected. It didn't happen for the first 1000 times I regenerated the map, but then it started happening every time until I found this thread. Rebuilding the scene, reloading the project, restarting the machine didn't work. I am not resizing the array, just running queue_free in the Tool script and then creating new MultiMeshes and MultiMeshInstance3Ds. I have a Radeon 6650XT on Windows 11 and my grass runs great until this happens. Before the workaround (commenting out the line MultiMesh.Buffer = null;) After adding it back in: Edit for clarity: these MultiMeshInstance3Ds are children of the root of the node tree and are visible in the scene hierarchy. They are updated over the course of multiple frames where additional instances are added to them, but this is present on the very first frame they are generated as well. They contain up to 16k grass mesh objects each and I've seen the buffer grow to around 200k in length. I didn't actually count if it happened after 1000 times, just that I had been using this logic for a week before I saw this occur. The error also occurs if I set the buffer to a new float[0]. |
Update: that workaround is not consistent. Even when the error is thrown, vertices will still show up screwed up. Currently having the buffer set to new float[0] and its running as expected for now. |
Godot versionv4.3.beta3.official System informationMacBook with M1 Pro Chip Issue descriptionI just tried out this project, which also uses MultiMeshInstance3D and the problem still exists: |
Still an issue with v4.3.stable - note that it also affects |
Still in 4.4-rc1 |
Godot version
v4.1.dev.custom_build.c29866dbc
System information
Win10, AMD 2600, GeForce GTX 1060, Vulkan API 1.3.205
Issue description
I don’t know if it’s normal.
When I change the instance count of MultiMesh, sometimes strange data will appear in the buffer like below:
Steps to reproduce
Just change the number of instance_count several times.
Minimal reproduction project
nothing
The text was updated successfully, but these errors were encountered: