How can I apply a meshing shader to the vicinity of a ball collision?

Include the following details (edit as applicable):

  • Issue category: Meshing Shaders
  • Device type & OS version: Android
  • Host machine & OS version: Windows
  • Issue Environment : On device
  • ARDK version: Latest
  • Unity version: 2021

Description of the issue: I’d like to know how can I throw a ball and apply a meshing shader to the vicinity of where the ball hit the real world, to make it “dirty”. Similar to this video. In fact, even the meshing shader should be similar if possible.

Thanks!

Hello Marcus,

In order to achieve a similar effect, you can use the Unity OnCollisionEnter callback. The callback would go in a script on the GameObject that would be colliding with the mesh.

In the callback you want to grab the Renderer component of the gameObject that was collided with and set its material to your custom material. I also recommend you check out our documentation on Meshing to get familiar with all the tools at your disposal.

The ball will be colliding with the real world, like a wall, chair, etc. But I want the meshing shader effect to apply only to the vicinity of where it hit, like on the video, not a meshing shader that covers the whole room like this tutorial explains.

Just a friendly bump.

Hi @Marcus, Jesus is away for the holidays at the moment, so I will be taking a look into this request on his behalf. I know it will require some custom shader work, and I’ll report my findings here once we have more information.

1 Like

Thanks, I appreciate it!