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
Add Bake Mask to GPUParticlesCollisionHeightField3D, Collision Mask to GPUParticles3D and Collision Layer to GPUParticlesCollision3D & GPUParticlesAttractor3D. #91858
base: master
Are you sure you want to change the base?
Conversation
Change cull_mask in GPUParticleAttractor3D and GPUParticleCollision3D to collision layer. Add new layer type for 3d particle collision. Add collision_mask to GPUParticles3D.
Add missing DISABLE_DEPRECATED checks. Fix formatting.
I changed it temporarily to a draft till I get the checks to pass, then I will turn it to a pull request again as soon as possible. |
To handle the code style issues I'd suggest fixing it locally instead of relying on the CI, see here |
I would like to open a discussion about which set of layers should be used for particle collisions. Currently, this pull request adds a new set of layers specifically for 3D particle collision, but I wonder if this is the best option. I think there are 3 options and these are the pros and cons of each in my opinion.
Personally, I am more inclined towards either option 2 or 3. What do you think? |
This pull request mainly adds a
bake_mask
field forGPUParticlesCollisionHeightField3D
that functions similarly to thebake_mask
inGPUParticlesCollisionSDF3D
. It is used to filter which meshes are rendered in the height field texture.However, my goal was to have separate collisions that reacts to different meshes and affects separate
GPUParticles3D
nodes. The problem was that the fieldcull_mask
inGPUParticlesCollision3D
did not work as noted in this issue #61014 (comment)Looking at the code, the field
cull_mask
was not used anywhere, so I replaced it withcollision_layer
in bothGPUParticlesCollision3D
andGPUParticlesAttractor3D
which uses a new set of layers under the name"layer_names/3d_particle_collision"
. For backward compatibility, thecull_mask
property is kept as a deprecated alias to thecollision_layer
property. In theGPUParticles3D
class, a corresponding fieldcollision_mask
was added. I argue that this would be easier for the users than using the 3D render layers for both the rendering culling masks and the 3D particle collision masks.If any changes are needed or if you prefer that I split the
GPUParticlesCollisionHeightField3D.bake_mask
code to a separate pull request, please let me know.And thank you for your amazing work on this wonderful game engine.