You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GPUParticles3D collide with their gizmo icon, which can make them appear to not move at all if using the Point emission mode.
I bisected the regression to #91174. This likely occurs because making the gizmo material use alpha scissor means it's now taken into account by the heightfield collision generator. We can probably fix this by changing the cull mask of the GPUParticlesCollisionHeightField3D to exclude the editor-only gizmo layers (Node3DEditorViewport::GIZMO_EDIT_LAYER).
This is further proven by the collision's shape matching the GPUParticles3D gizmo icon. You can see this by using a sphere emission shape and greatly increasing the particle count:
I've tried playing around with the VisualInstance3D layers property (which determines what the GPUParticlesCollisionHeightField3D takes into account when generating its collision shape). However, all collisions still occur as soon as layers is not equal to 0. If it's equal to 0, then all collision is disabled.
Changing cull_mask doesn't impact the collisions in any way (it's used to make different particles collide with different shapes instead; here, we want to exclude specific objects from the generated collision). Note that since cull_mask defaults to 0xFFFFFFFF and only the first 20 layers are visible in the editor, you'll need to set cull_mask = 0 in a @tool script to actually disable all layers (including the editor-specific layers that are otherwise hidden).
For reference, this happens now because the alpha-scissor gizmos are written to the depth buffer. GPUParticlesCollisionHeightField3D works by having its own viewport from a top-down view and reads the depth buffer. This is why you see the gizmos in a fixed orientation in the particle collision: they are still billboarded, but they are facing the camera used for the depth buffer generation.
Adding icon->set_depth_draw_mode(StandardMaterial3D::DEPTH_DRAW_DISABLED); to EditorNode3DGizmoPlugin::create_icon_material() fixes the issue, but it reintroduces the issues that #91174 resolved (such as gizmos not appearing behind refractive materials anymore).
Tested versions
System information
Godot v4.4.beta (7b1ed52) - Fedora Linux 41 (KDE Plasma) on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (nvidia; 565.77) - 13th Gen Intel(R) Core(TM) i9-13900K (32 threads)
Issue description
GPUParticles3D collide with their gizmo icon, which can make them appear to not move at all if using the Point emission mode.
I bisected the regression to #91174. This likely occurs because making the gizmo material use alpha scissor means it's now taken into account by the heightfield collision generator. We can probably fix this by changing the cull mask of the GPUParticlesCollisionHeightField3D to exclude the editor-only gizmo layers (
Node3DEditorViewport::GIZMO_EDIT_LAYER
).This is further proven by the collision's shape matching the GPUParticles3D gizmo icon. You can see this by using a sphere emission shape and greatly increasing the particle count:
Relevant code:
godot/editor/plugins/node_3d_editor_gizmos.cpp
Lines 831 to 837 in 7b1ed52
https://github.com/godotengine/godot/blob/7b1ed520bdcca21d36e25e2094802b9b33dae2c6/scene/3d/gpu_particles_collision_3d.cpp
Steps to reproduce
Minimal reproduction project (MRP)
test_particle_collision_gizmo.zip
The text was updated successfully, but these errors were encountered: