This is what I’d like to happen: I’d like to know how one should write a shader that would make blue ripples on it on impact. In a sense I want to simulate vibration. Say there is a cube that collides with another cube and the impact force is x. Starting from the point of collision both objects get sort of a ripple kind of rings on them. To picture this imagine a pond - you drop something in it and it ripples in circles. Now this is black ground, dropping something on it would make same kind of ripples, but blue and flat. Now, imagine that this is not a pond, but a cube, a sphere or some other completely irregular shape object. Depending on how hard they collided the ripples would appear. The force would influence the speed of the ripples, their intensity and after how much time they will disappear and stop.
Now, I’ve spent more than a few hours today reading about shaders and trying to make my own, which worked out pretty fine, but the shader I’m talking about now is a bit more complex and I have no idea how to approach it.
Not to repeat myself, but so things would be clear - I’d like to have shader that calculates the force an object was hit and at what point - it would then produce a blue ring ripple effect accordingly.
Thank you in advance.
I dont think you can do that as a shader; Check out the unity Procedural Examples. You will have to implement the ripple effect inside OnCollisionEnter, whose parameter Collision contains all relevant data like contact point etc. There are many ripple shaders and algorithms around for unity3d, you can just implement one of them in the OnCollisionEnter function.