Distortion Effect (Free Unity)

Been looking this up for sometime now, and I found a lot of other post on this like how to
Heat Distortion or Distortion Ripple, but with no luck on how would one make this. I know that you need to make a Shader and I’m slower learning this. What I need help with is this.

(1) Can anyone point me in the right direction on how would one do this.

(2) What shader code would I need, (not asking for the code) just want to know a start.

(3) Would I need anything else to make this effect?

Plz help, I been really wanting to make this and I just can’t make it work.

3 Answers

3

Look at this one example. Seems there is no restrictions:

That still only works for Pro and with deferred lighting. :(

In Unity 5 (free) it seems to be working fine. To use the effect you'll want to grab the Distort.shader file and create new materials with it. I also recommend looking at the project sample. Which explains almost everything you need to know by inspecting the scene's objects.

Crap. I can't get this to work. When I view it in hte editor, it looks perfect, but in play mode everythign behind the particle, is flipped vertically :(

@cadpeople play mode was rendering this upside down for me as well. It appears to me that this happens when it's rendered using directX. I don't know enough about how this shader works to provide a directX fix, but forcing the Unity editor to run Open GL instead seems to be a work-around. Add -force-glcore to the target path to do this. e.g., my target path is below: "D:\Unity 5.3\Editor\Unity.exe" -force-glcore I assume the target platform needs to run Open GL too, of course. Any help on fixing this shader for directX would be appreciated!

Programming shaders is pretty hard, you can take a look at the following guides:

http://docs.unity3d.com/Documentation/Manual/ShaderTut1.html
http://docs.unity3d.com/Documentation/Manual/ShaderTut2.html

I wish you the best of luck!

Look into cubemap-based refraction. It may not give you the exact effect you were hoping for but it’s a good place to start.

Shader programming is hard. It will take you some time to learn, but is worth it.

This is a good reference that I found helpful….

I gave it a little more thought, and I think a cubemap refraction shader, with the refraction amount modified by time-based perlin noise, that fades out at steep view angles (like an inverted rim-light shader) would give you pretty good looking heat ripples.

I will look into that. ty!