Download

Heat distortion. What is the best approach

Hi,

I want to create a heat distortion effect. Not on a big landscape scale, but more like exhaust pipes or airco ducts.
In theory I know of two ways of doing it. Im just not sure which would be the better approach or what the pros and cons are.

A)
Creating a particle effect with a transparent material that does some fresnel trickery.

B)
Creating a small cone shaped static mesh without collison and also put a fresnel material on it, this time panner style animated.
Maybe even adding displacement mapping…

How would you solve it :confused:

Any suggestions are appreciated :smiley:
Cheers,
Klaus

Particle effect, for sure. You can use a ribbon particle with the refraction setup. Keep in mind the component that goes into “Refraction” on the material should simply be a Fresnel lerped between 1 and your index of refraction (1.05 - 1.1 is good), and all your bent refraction comes from the strength of the normal map, NOT the opacity! Make sure your material is set up so when the particle alpha goes down to 0, the normal gets reset as well. I also use a second normal map that tiles over the first one in order to distort it.

Thanks for all the suggestions :slight_smile:
Ill tried a bit with some setups today, but so far I have little expierience with Cascade and the ribbon stuff is totally new to me.
I guess I have to watch the tutorial series on that :smiley:
At the moment it looks more like vertical water :stuck_out_tongue:

Haha, it was very tricky to figure out my first time, too! Some tips to help you out:

The material for the ribbon is a bit different than other particles: the entire material gets stretched and tiled along the length of the ribbon. This means your textures need to be very long (think 256x32 pixels), and tile from left to right. Whatever size you use, all of your distortion cannot exceed the bounds of that texture size, otherwise you’ll be distorting a perfectly sharp rectangle.

For a good heat distortion effect, it’s a nice effect to actually use a panning, tiling, secondary normal to distort the UVs of the first normals. Mask the RG values from the second normals, multiply the strength down by 0.05, then add them to a texture coordinate and plug that into the UVs of the first normals. It looks very cool! :slight_smile: But make sure you’re not distorting the normals too much, otherwise you’ll get very unnatural effects or exceed the bounds of the texture.

To fade out distortion particles, lerp between the distortion normals and a 0,0,1 constant (blue): Drive the lerp with the alpha channel from the particle color. This makes sure that as the particle fades out, the normal is softened until the refraction effect disappears. I can’t stress this enough: the refraction effect is totally dependent on the strength of your normals, not your opacity! This makes sense because if you just want heat distortion you don’t want the particle to show up as a color, but at the same time you need to see what’s going on with the distortion.

The only nodes you should plug into the Refraction input are a Fresnel function lerped between 1 and your index of refraction. The IOR value will control the strength of the refraction, but for some reason it didn’t work the way I had hoped in order to fade out the distortion effect, so make sure you just leave it at a constant value.

Ribbons themselves are a little tricky, but once you get the hang of it they’re really useful for things like smoke and distortion. What you’re doing is spawning points, and then between those points a spline curve is made. The particle exists along that spline curve between the particles. Typically you want to make sure the points don’t stretch out too much, otherwise the ribbon will look like a bunch of silly string, and you should definitely use tessellation to smooth out the ribbon trail from one point to another. For my smoke material, I set the spawn rate to 2.5 and the initial velocity is uniform (but not too wide) to simulate wind. In the ribbon data, I set the tiling distance to 120, checked on tessellation, and set the distance tessellation step size to 4, which gives you a fairly smooth-looking stream of smoke (but these numbers will change depending on the size of your ribbon. Mine was 25). I also made the size larger over time to simulate heat dispersing. This method looks better than any other I’ve used for heat distortion.

The upside to ribbons performance-wise is you’re not drawing a bunch of particles on top of each other in order to cover an area with distortion. The effect is fully connected and completely streamlined, so it looks and behaves more like a connected fluid (think the distortion and smoke from a candle or small fire). The downside is you need to cover a large area with transparency in order to see the ribbon, and last I checked turning on collision crashed the editor. So, no collision, and large transparency, but less overdraw and more realistic distortion effect.

I’ll see if I can post a video of it sometime.

hi KVogler… you may have already found/solved this, but there a heat distortion Particle Emitter in the fire particle from the Starter Content – P_Fire.

I think the effect is fairly subtle in this application, but you could probably amp it up.

I’m not sure, but think the very same Emitter is also discussed somewhere in the official Unreal YouTube channel in this particle playlist:

Heat distortion.jpg