Physics Question for UE5

Started by
2 comments, last by RLLewellyn 1 year, 10 months ago

While researching how physics worked in UE5, I came across a video of a workaround that allowed Nanite meshes to be attached to a skeletal mesh, allowing the skeletal frame to take on the appearance of a Nanite mesh, without actually being one (which, if I’m being honest, I personally find pretty impressive). Anyway, this got me thinking about how Nanite only draws the triangles that are visible to the player and become less detailed (larger triangles) the farther away a player is from the object (at least as far as I currently understand it), and I wondered if physics worked the same way. For example, lets assume that the player is close to a large sphere sitting in a river. The physics of the river would need to take each little triangle (that makes the object appear as a sphere) into account to determine direction of flow. However, if the player moved away from the sphere, is it possible to reduce the number of triangles in the “sphere” that need to be accounted for when determining movement of the river? For simplicity’s sake, let us assume that we wanted to reduce the physics quality of the sphere all the way down to a simple cube, similar to how a Nanite mesh would reduce the quality of image with distance. Is that even possible? If it is, would the potential increase in CPU processing time be worth it, or would it be negligible? A lot of questions, I know, but I appreciate any thoughts you all can offer. (Of course, if my initial understanding / assumptions are way off base, please let me know that as well, as that would be at least as helpful.) Thank you.

Rob LLewellyn

Advertisement

RLLewellyn said:
While researching how physics worked in UE5, I came across a video of a workaround that allowed Nanite meshes to be attached to a skeletal mesh, allowing the skeletal frame to take on the appearance of a Nanite mesh, without actually being one

You probably mean the interactive demo where they showed a big robot. The robot used rigid Nanite meshes per limb, exactly like older games did for all characters (e.g. the first Tomb Raider).
It works because there is no deformation happening to the limb. The upper arm remains rigid, the lower arm too, no matter how we bend the elbow.
That's unlike skinning which we usually use nowadays for characters, causing deformation by affecting vertices from multiple bones transforms.
The limitation of Nanite preventing it to be used for regular, skinned characters is that it does not support such deformations.

RLLewellyn said:
and I wondered if physics worked the same way. For example, lets assume that the player is close to a large sphere sitting in a river. The physics of the river would need to take each little triangle (that makes the object appear as a sphere) into account to determine direction of flow. However, if the player moved away from the sphere, is it possible to reduce the number of triangles in the “sphere” that need to be accounted for when determining movement of the river?

Nobody has ever implemented LOD for physics yet. There is not even a related discussion.
The problem is, imagine we have a stack of boxes. Or better, a stack of Nanite Rocks. The stack is stable and at rest, and because no external forces apply to it, it is expected to stay stable and at rest.
If the player moves away from the stable stack, and the objects change their shape by reducing their detail, this would cause perturbations to the contact forces. The stack would become unstable and the rocks would tumble down, without anybody affecting them.
That's why we have no LOD for physics yet: The idea of dynamic LOD conflicts with the requirement to use rigid bodies for physics simulation.
Even if we use soft bodies instead rigid bodies, we would still see the same issue. The change of shape does not agree with the assumption that physical objects do not change their shape out of nothing.

RLLewellyn said:
If it is, would the potential increase in CPU processing time be worth it, or would it be negligible?

We surely want a form of LOD for physics. One common approach is to use variable timesteps, which i've seen to be used only in fluid simulations til yet. Maybe that's an option.
Dynamic resolution as you proposed is used in fluid sim too, e.g. her some image i've found showing more detail on the surface than on the interior:

But for rigid body simulation that's just much harder, as that's driven from discontinuous events such as collision impulses. Fluids are smooth, making such ideas much easier to implement.

At the moment, the only practical LOD for rigid body physics i see is to replace simulation with procedural animation at some distance. E.g. simulated vehicle traffic vs. rule based traffic.

Notice, we already use the bare minimum of detail to model physics, e.g. by using capsules to represent characters, and physical meshes at much lower resolution than graphics, so ther is no true option to reduce this further at all.

@JoeJ That was both detailed and direct, which is greatly appreciated. That actually did answer my questions, so thank you for your response.

Rob LLewellyn

This topic is closed to new replies.

Advertisement