How can a mesh be detected by shooting from Line Trace and hitting a WPO material?

Guys, what if the Line Trace + Break Hit Result ends up in the point where the material is currently located, which is shifted by the World Position Offset (y -4000px, for example), and not in the static mesh itself on which this material is applied. Does Break Hit Result recognize which mesh this material belongs to, which is located far from its real collision mesh? How do you think? :point_right:t2::point_left:t3:

let me add some illustration for my Q:

Screenshot_286
picture_1 we have 3 static tree grids (gray)

Screenshot_287
picture_2 I trace the lines to the left of center and find out that I will end up in tree A. No problem. This is true.

Screenshot_288
picture_3 for each tree we added a material (WPO animation, or Pivot Painter. Colored material on picture), which creates a β€œwind effect”. Now we have strong winds. (The grids remained in place)

I trace a line to the left of center (at the same point) and I WANT(!) to know that I hit tree B, and not tree A.
Because the player sees with his own eyes that I hit tree B.
But the trace line will say that this is a hit in tree A. This is not true.
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
I don’t know any way to solve this problem.
I will be glad to hear any crazy ideas, intuitions, advice! Please, help

2 Likes

We would all love WPO accurate collisions, but…

Conceptually, the fundamental issue here is that collision is handled on the cpu completely decoupled from rendering which is on the gpu. The collision shape use for line traces can be a simple capsule or the actual mesh. Within the scene, there is an optimized Bounding Volume Hierarchy (BVH) that the static shape is inserted into and queried against. This query (linetrace), is able quickly determines per triangle intersections because of being stored in the bvh.

On the other hand, WPO is processed on the GPU for each vertex. The vertex positions are modified (temporarily for this frame) before getting rasterized.

So the WPO deformation briefly exists only on the GPU while rendering this patch on this frame, with no mechanism to query.

If you were to apply the WPO on the cpu side, it would take a huge amount of time and memory. There are static caching techniques like Alembic which theoretically could be used to query collision for vertex deformation. But these are already typically much slower and more memory intensive than generalized WPO.

In the future, we may see the collision and physics moved to the GPU. In that scenario it might not be quite as difficult to query a gpu side cache of the wpo… will have to wait and see :slight_smile:

3 Likes

You answered very completely(!) and quickly. Thank you!! I was also sure that this was impossible now, but I had hope when I first saw how Niagara particles could stack with WPO. I couldn’t believe my eyes. Initially, I dreamed (and still believe) of finding a way to get collision data. Please see my previous question - LINK. Nobody answers me, you would really help me…

(this is the half brother of this question)