Hi, all!
Now hear me out- I know that a million different threads have been made on force Fields and such, but I needed to make my own because no one I could find is trying to get what I am after.
I am trying to create something that is invisible or has a slight falloff around the edges to denote its presence (maybe it can glitch every once in a while), but when it collides with something, a colored area will appear with falloff. Kind of like this:
Now this is much more complicated than what I am after, but I hope it gets my point across.
Anyone have tips / advice for me? Or even a shader? (that would be great as I have little to no shader writing experience so far).
P.S Of course, the only two instances I can think of where anyone would need this would be a flat plane or a sphere.
If you want a commercial solution, i have the exact same shader as seen in your 1st and 2nd photos in my Aubergines Shader Pack which is available in the assetstore.
If you dont want a commercial pack and just want tips on how to write your own, you basically calculate the collision position in object space and change colors (or whatever you prefer to show the force field) calculating the distance between vertex positions and this collision position (on a spherical object).
Your demo is very nice! And yes that is pretty much the effect I am going for. Could you point me in the correct direction for the aforementioned collision detection process?
I would assume it would be along the lines of:
Get transform of colliding object,
Subtract current position from colliding objects position to get vector
Somehow use this vector to display a full opacity area
animation as I see fit