godot: Creating or loading GPUParticles nodes crashes engine on macOS with Compatibility GLES3 renderer (Apple Silicon)
Godot version
4.0 beta 16
System information
macOS 13.1, GLES3, Apple M1 Pro GPU
Issue description
When creating a new GPUParticles2D
or a GPUParticles3D
node while having the editor set to the Compatibility (GLES3) renderer on a macOS device with an M1 architecture, it crashes reliably after a brief delay. This also happens when exporting the project and running it, as well as opening an existing project after switching from the Vulkan renderer to the GLES3 renderer. However, it only occurs when emitting
is set to true
, a non-emitting GPUParticles node does not cause a crash.
This only happens on macOS, it works just fine on Windows.
Steps to reproduce
- Create a new project
- Switch to Compatibility renderer
- Create a new 2D or 3D scene
- Create a new
GPUParticles2D
orGPUParticles3D
node - The editor crashes, since the node is automatically created with
emitting
set totrue
Alternatively:
- Open provided minimal reproduction project
- Change renderer to Compatibility and restart the editor
Minimal reproduction project
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 23
- Comments: 21 (11 by maintainers)
Commits related to this issue
- Add rainbow explosion Credit to @PlayWithFurcifer for the [sprite sheet][1] and [tutorial][2] that formed the basis of this explosion I've made minor tweaks compared to the settings they used in the... — committed to yndajas/qgjam-2023 by yndajas 8 months ago
- Add rainbow explosion Credit to @PlayWithFurcifer for the [sprite sheet][1] and [tutorial][2] that formed the basis of this explosion I've made minor tweaks compared to the settings they used in the... — committed to yndajas/qgjam-2023 by yndajas 8 months ago
- Add rainbow explosion Credit to @PlayWithFurcifer for the [sprite sheet][1] and [tutorial][2] that formed the basis of this explosion I've made minor tweaks compared to the settings they used in the... — committed to yndajas/qgjam-2023 by yndajas 8 months ago
What you can do in the meantime is add a
macos
override to the Rendering Method project setting as follows, before adding any GPUParticles to the project:After clicking Add, set the override’s value to
forward_plus
ormobile
. The project will look different than with the Compatibility rendering method (especially in 3D), but GPUParticles should work.If you’re importing an existing project that has GPUParticles in its main scene, edit
project.godot
with a text editor before opening the project in the editor to add the override by adding this at the bottom of the file:If there’s already a
[rendering]
section inproject.godot
, addrenderer/rendering_method.macos="forward_plus"
at the end of that section instead.Unfortunately Apple has been quite clear that they have no intention of supporting OpenGL/WebGL.
Apple’s interest in gaming only extends to gaming on devices that support Metal (and soon WebGPU for web gaming). The future for Apple devices appears like it is going to be Metal/WebGPU only.
Unfortunately, that means it is on us to find workarounds because we are the ones who care about supporting multi-platform and low-end devices.
Just an update on this issue. It’s something that we are looking into, but it looks like there will be no easy solution.
GPUParticles work fine on intel macs. On Apple silicon macs, they cause this crash (likely because Apple silicon devices don’t have OpenGL drivers, they instead of a layer that implements OpenGL over Metal and apparently that layer is missing support for transform feedback).
The typical solution would be to use ANGLE to translate OpenGL to Metal so we don’t have to rely on Apple’s broken automatic translation. Unfortunately, the ANGLE over Metal variant has significant performance problems and leaks memory rapidly making it unusable. The ANGLE over OpenGL variant works much better, but doesn’t solve this crash.
Our best option is to workaround the performance issues and leaks. We already have identified a workaround for the leak, but it requires significant changes and we aren’t sure why they are necessary (https://github.com/godotengine/godot-angle-static/pull/3). We need to investigate how to workaround the performance issues still.
Needless to say the Apple ecosystem is not friendly to devs who want to support multi-platform and/or older devices. 😦
I just confirmed. This bug is fixed in dev6/master. Reverting https://github.com/godotengine/godot/pull/88816 re-introduces the crash.
So I can happily report that this issue is fixed by https://github.com/godotengine/godot/pull/88816 😃
Still happening on 4.1.3 on MacOS Sonoma 14.1. Crash immediately when adding or editing GPUParticles node in compatibility mode. However it works normally on 4.2 beta 4.
I wonder if this PR https://github.com/godotengine/godot/pull/88816 is responsible. It aimed at resolving a crash for super low end android devices. But seeing as this was an odd driver bug anyway, its possible that they shared a common root
just stumbled upon this and it is fixed in 4.3.dev6
Adding a GPU particles node also crashes Godot 4.2.1-stable with Driver.macos set to “opengl3_angle” on M1 macOS 14.2.1 (minor version increase from prev commenter).
https://gist.github.com/danneu/8cbe6c9f399f37dbbf4d5742e70cf0e5
Still happening on 4.1.1 on MacOS Ventura 13.5.2 😦.
It might be worth checking if ANGLE fixes this issue: https://github.com/godotengine/godot/pull/72831
relevant traceback (copy-pasted from #77681 )
You can convert GPUParticles3D nodes to CPUParticles3D by selecting a GPUParticles3D node then using the GPUParticles3D menu at the top of the 3D editor viewport. This has some limitations though (no support for custom particle shaders, attractors, collision or turbulence).
This could be done at runtime automatically, but it would also break visuals in a lot of projects (to the point hiding particles entirely may be preferable in some scenarios).
I tried doing that but it still crashes the engine. (on 4.2.1_stable and 4.3_dev - master branch)
+ I don’t know if it would help, but here’s the error report from macOS error reporter.
For future reference, ANGLE does fix this issue but it’s no longer the default in 4.2.1 following https://github.com/godotengine/godot/pull/85785. (It was the default in 4.2 only.)
You can opt into using ANGLE in the Project Settings (Rendering Driver.macos). This may impact performance negatively though.
I suggest we use a similar workaround as proposed in https://github.com/godotengine/godot/issues/54052, where we convert GPUParticles nodes to CPUParticles at load-time on macOS. This will break many particle effects, but it’s better than crashing the engine or not having any particles show up.
In the editor, GPUParticles rendering will likely need to be disabled on macOS so you can still edit their properties (without affecting the saved scene file).