- Home /
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.
Answer by Maylina · Oct 09, 2014 at 02:28 PM
Look at this one example. Seems there is no restrictions: http://kostiantyn-dvornik.blogspot.com/2014/10/unity-3d-anoxemia-heat-distort-tutorial.html
That still only works for Pro and with deferred lighting. :(
It works In Unity 5 as long as it is not on mobile. Do you know how to get it to run on mobile?
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 ins$$anonymous$$d 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!
Answer by EX_Darius · Dec 12, 2013 at 12:23 AM
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
http://docs.unity3d.com/Documentation/Components/SL-SurfaceShaders.html
I wish you the best of luck!
Answer by Kiloblargh · Dec 12, 2013 at 12:24 AM
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.
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.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Blurred texture on range 1 Answer
Why are my sprites being distorted? 1 Answer
UnityEngine.Input.GetMouseButton(1)) issue 1 Answer
Health Bar common effect 2 Answers