• Register
Post news Report RSS Distortion With An Orthographic Camera

Art Development Updates - Diary Article detailing workarounds for distortion effects with an orthographic camera in UE4

Posted by on

We had been using refractive elements within the game from pretty much near the start of the project for the easy "+10 points" that refraction/distortion gives any game. The only problem was whilst the effects rendered great whilst in the editor (using a perspective based camera) when we moved to the orthographic camera in gameplay, any effects based on refraction were simply not rendered.

User Posted Image User Posted Image
Refractive Particles In Editor | Refractive Particles In Game

We carried on this way for a while, knowing of the problem and assuming that the orthographic camera might get an update at some point to support more of the effects that Unreal is capable of rendering but after a while it became clear a different approach might be needed. As we don't actually NEED physically correct refraction, we just want to have the cool effect of heat haze or water visually appearing to distort the world behind it, refraction is actually overkill for our needs anyway. We got to thinking all we really need is to be able to distort the final scene texture and apply it to the scene with bounds of our choosing, either by particle effect or sprites. I started looking through post process effects and how they are applied to the screen (the Unreal Wiki came in very useful here) looking to the custom depth pass to mask out areas of the scene. This quickly felt like too much for the effect we wanted, a bit overkill, and I felt there must be a simpler way to do it. There was!

By using the ScreenPosition node and distorting the scene texture via noise maps that are also panned and rotated on top of each other at mixed scales, we get a distorted, haze effect across the screen. We now only use this material on sprites or particles where we need the effect to happen and we quickly and easily get the intended effect on a orthographic camera in game, bringing our fires and watery effects to life, making the world feel more dynamic.

With this hurdle overcome, we can now have the fire haze we wanted, along with distortion when walking behind waterfalls or pools of water within the game. These effects are all ongoing, work in progress (and some are quite subtle in these small potato GIF's) but I figured the post might be useful to budding 2D Unreal developers. As usual, any criticism or feedback is appreciated.

User Posted Image


User Posted Image


User Posted Image


Post comment Comments
Gzegzolka
Gzegzolka - - 350 comments

Looks very promising, those pixels looks great.

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: