Unity VFX Graph: Collision Improvements and Features in Unity 6
Welcome to our discussion on the recent upgrades to the VFX Graph in Unity 6. This topic focuses on the new collision improvements and features. Let’s break down the key enhancements.
Collision enhancements:
-
URP Depth Buffer Collision
URP projects can now access the Depth Buffer to collide against it. This is very useful to allow
thousands of particles to collide dynamically with the environment.In this VFX sequence, all particles interact with the dynamic environment using the depth buffer. These
interactions help to ground the effects and add an extra touch of realism. -
Improved Stability and Accuracy of Collision
Previously, particles often struggled to reach a rest state, particularly when constant forces such as
gravity were applied. This issue required complex workarounds that could be time-consuming and
challenging. However, with Unity 6, these concerns are a thing of the past. The collision algorithms have been significantly enhanced, ensuring more reliable and precise collision detection. These
improvements result in smoother, more realistic interactions, providing a much more stable simulation
environment.
Overall, collisions in Unity 6 are not only more accurate but can also adapt dynamically to the size of the particles being animated.
-
Collision Behavior Options
Collision Behavior allows VFX artists to choose how particles respond to collisions with options such as:
- Collide: Standard behavior where particles bounce or react on impact.
- Trigger: Register collision events.
- Kill: Particles are reaped upon collision
-
Collision Shapes
As part of our ongoing UX/UI enhancements, we have consolidated all the different Collision Shape
blocks into a single, unified block. This improvement allows users to switch between available shapes, making the design process more intuitive.
Available collider shapes: Sphere/ Box/ Cone / Tube/ Plane / SDF -
Collision Behavior Options
You can now access the collision information by storing it in custom attributes:
-
Collision Position: The exact point of impact.
-
Collision Normal: The Collision Surface Normal.
-
Collision Event: A true/false indication of whether a collision event has occurred
-
Collision Event Count: The number of times a particle has collided.
By default, collision information is not stored to conserve GPU memory. However, there are two modes available for collision attribute: “punctual” and “write always.”
-
Punctual Mode: This mode is used for specific, single-point collisions.
-
Write Always Mode: This mode is useful for registering continuous collisions.
Additionally, you can find in the inspector a “bounce threshold” setting that allows for finer control
over collision convergence and punctual collision detection.
All of these collision attributes can be utilized and combined to craft intriguing and complex effects.
In this example, we use the Collision Count attribute to drive the mesh index value. This creates the impression of the mesh breaking upon collision.
In this example, the collision Event and collision normal attributes are used to stick and orient the particle mesh on the rolling sphere. -
-
Trigger Event on Collide
You can now trigger an event on Collision to spawn new particles when a collision occurs, adding layers of complexity and interactivity.
With the collision attribute set to “write always,” each sphere spawns a particle strip upon collision
Conclusion and Future Prospects
The collision improvements in Unity 6 offer a more intuitive and user-friendly experience. The new features unlock numerous possibilities and enable VFX artists to be more creative with the interactions between particles and the scene.
Looking ahead, we aim to explore ray-traced collision, rolling upon collision, and the implementation of non-spherical particle collider shapes.
Join the Discussion
We encourage you to share your thoughts, feedback, questions, and experiences with the new collision enhancement of Unity 6 VFX Graph. How have these improvements impacted your projects? What innovative effects have you been able to create?
Feel free to contribute to the discussion below!
Thank you for participating in this Unity community discussion! Happy VFX !