I made a cone mesh and placed it into In VFX Graph . Now i wants to Give a life to it by interacting with the walls and I need a technique to hide mesh going Outside the wall using Shader graph or VFX graph itself. @GabrielAguiar do you know any technique?
you need a script that will pass the distance to the collider to the material.
alternatively you can look into custom masking and feeding that into the material, Asher calls this Pizza Masking https://twitter.com/vuthric/status/1295773219186606081
I don’t know much about the technical stuff, but how can I make the smoke in the link in Unity?
Hey sorry for the late reply, in Unity exact output you can achieve with shuriken Particle system (Using Collisions). And let me know if you find anything similar without Collision?
If you like to use a Raycast solution, I’ve helped a user in the past on the Unity Forum.
It shows how to create a LazerBeam all using the VFX property binder. So it’s pretty codeless. You should be able to apply the same principle to what you want to achieve. It’s here.
To solve this you need:
- Material with custom shader that cut your texture opacity in the right place.
- Script to send where to cut to the material.
- Cut off all transparency behind the wall, taking into account the distance between the flashlight position and the wall.
Shader example:
You need to send distance to the material using your script with Raycast. This is the simplest example to explain the logic.
The more complicated way is to use stencil and depth buffer