Physical expressions that are linked to the terrain and objects in the game, such as sparks bouncing on the floor and bullets bouncing off walls, greatly improve the visual persuasiveness. VFX Graph has very good collision detection (collider) nodes such as "Collide with Plane" and "Collide with AABB" to achieve this. However, have you ever had the problem of Even though you have configured the collision settings correctly, some fast-moving particles or some particles slip through the floor and sink to the bottom? In this article, we will thoroughly explain the technical mechanism that causes this collider tunneling phenomenon, which is unique to GPU particles, as well as an analogy that is easy to understand even for beginners, and a parameter tuning method to completely prevent collider tunneling.
1. Understanding with an analogy: ``A thin plywood board'' and ``a teleporting tennis ball''
In order to understand the phenomenon of high-speed particles passing through the collision detection system, let's use the example of ``throwing a ball (particle) at extremely high speeds'' at a ``very thin veneer board (floor)''.
1.
The ball is flying at a tremendous speed of 100 meters per second. The game's collision detection system does not "always follow the ball's trajectory" like in the real world. The system only examines the position of the ``points in the still image'', such as ``where the ball is in the first frame'' and ``where the ball is in the second frame''.
The ball's speed was so fast that in the first frame, the ball's dot was reflected ``1 meter in front of the floor (in the air),'' and in the second frame, the ball's dot was reflected ``2 meters behind the floor (underground).''
The collision detection computer (GPU) compares only these two points and concludes, "The first frame is in the foreground, and the second frame is in the back. Yes, there is no 'moment of overlap' with the floor plank. Therefore, no collision has occurred!" As a result, the ball slips through the board and falls underground. This is the "tunneling phenomenon". In order to prevent this from happening, it is necessary to cover the back side of the plywood board with ``extremely thick urethane sponge (thickness of the collider)'' and set up a trap so that no matter how much the ball point moves instantaneously, it will always get caught in that thickness.
2. Root Cause: Discrete Collision Detection Limitations and GPU Update Limits
Technically speaking, VFX Graph's Collision Detection node employs Discrete Collision Detection to reduce computational costs. This is a method that uses a formula to evaluate only whether the "current position" of each frame is inside or outside the collision surface.
If the following conditions overlap, the probability of jumping over the collision calculation boundary increases.
- Particle movement speed (velocity) is extremely fast: When the amount of movement per frame calculated by $Velocity imes DeltaTime$ exceeds the collider's judgment range (radius of the sphere and thickness of the plane).
- Colliding target has zero thickness: Planar collider such as `Collide with Plane` is mathematically "infinitely thin (zero)" and can easily be passed through in a split second frame.
- Insufficient resolution of GPU depth buffer: When using `Collide with World (Depth)`, due to the resolution of the depth texture drawn by the camera (especially near/far clip distance), the depth accuracy per pixel becomes coarse, causing a phenomenon where the collision surface is omitted from the judgment and slips through.
3. Three solution approaches that should be adopted in practice
Optimize the following settings according to the speed and requirements of the effect.
Solution A: Optimize Thickness and Radius (most basic)
Adjust the settings of the node used for collision detection (e.g. Collide with Plane or Collide with Sphere) in the inspector.
- Thickness: Raise it from the default
0to around `0.5` - `1.0` (meters). This creates a virtual thick judgment zone on the back side of the plane, and particles that penetrate through and reach the back side are considered to have "collided" and are pulled back to the front side. - Radius: Slightly expands the radius of the sphere for collision detection from
0.01(very small) to `0.05` ~ `0.1`. By increasing only the judgment size without changing the visual texture size, the contact detection rate is dramatically improved.
Solution B: Apply Sub-stepping in the Update stage
If particles are physically moving too fast, improve the time division (simulation accuracy) of the entire VFX Graph.
- Select the Update context block in the VFX Graph editor.
- Check the Delta Time settings in the Inspector and enable the `Sub-stepping` option.
- Set Sub-stepping Count to
2or3.
*As a result, the time update of one frame is internally divided into smaller parts (for example, into 3 parts) and position and collision calculations are repeated, so the amount of movement per time is reduced, and even high-speed particles can be completely prevented from slipping through (although the processing load will increase slightly).
Solution C: Velocity vector maximum clamp (C# optimization possible without interlocking)
In the node graph, monitor the Velocity of the particles just before they collide, and limit the maximum movement in one frame to not exceed the physical floor thickness. By using the Clamp Vector node and Absolute node to limit the maximum velocity magnitude to around $10.0$ to $15.0$, you can prevent tunneling without sacrificing the visual exhilaration.
4. Collision Debugging Checklist
If the punch-through problem is not resolved, check the following items.
- Bounce Attenuation Rate (Bounce): If the `Bounce` parameter is greater than `1.0`, the reflection speed will accelerate at the moment of collision, and in the next frame it will crash into the opposing wall or floor at a tremendous speed. As a general rule, set it in the range of `0.2` to `0.8`.
- Friction (friction coefficient) settings: If particles are set to slide on the floor, set the friction coefficient (Friction) of the floor collider appropriately and configure it so that the velocity in the forward direction is appropriately attenuated upon collision.