Heat wave in 2D

Started by
16 comments, last by Mark53 14 years, 3 months ago
Hi everyone, I'm having much difficulty in finding an algorithm to render a heat wave in 2D (like when the background distorts under the effect of heat). I've implemented a simple algorithm that just shifts the lines of the picture alternatively but I'm not satisfied with it. Thanks in advance, Mark
Advertisement
Hi,

You can watch this video:



It's my implementation of heat wave from Render Monkey sample. It you like it, then you can download Render Monkey and have a look. Hope it helps.

Best,
Thank you very much, b_thangvn, but that is not really what I'm looking for.

Here is a video with the effect I'm interested in:

What are you using to render the background?
Anyway, I think that you just need a good algorithm for calculating how to shift each line - like "y = sin( time + y )". :D
That's a long video. Can you give the play time of the effect?
Imagine I just draw a static image and apply the heat distortion effect on it. I just need the algorithm, I'll adapt it to my needs. But I fear the effect is more complicated than a line shifting with a sinus (it's what I did but the result isn't good). Look at the effect on the video, the lines of the background are smoothly wrapping one another. Of course, you can see this kind of effect in many other games.

Sorry, I forgot to precise that the effect is visible after 31 sec in that video.
Take a look at this guys sin distortion.

Clicky

If you were to lower the scale of distortion, and have a smooth timestamp, it should look fine, how are you currently doing it?
Warp feedback looks pretty good, and is relatively cheap to do in a shader (you need to RTT to feed the image back into itself). Check out the demo from the fire section, you'll need a copy of DOS4GW to run it.
The effects showed in www.facewound.com are very interesting, I'll have to try some of them. But as regards the heat wave effect, I don't think a regular curve like sine would do the trick.

The warp map idea is very good. If I understood right, it consists in dividing the picture into squares, deforming the squares and then map the content of the deformed squares to the original squares. But it looks quite difficult to implement, maybe there's a way to use a transformation matrix. The fire effect was amazing.

Nice links!
A nice heat wave distortion can be achieved by using a 3D noise texture and animate the v-coordinate upwards, so it looks like rising hot air.

This topic is closed to new replies.

Advertisement