Heat Distortion

Blitz3D Forums/Blitz3D Programming/Heat Distortion

Zeotrope(Posted 2008) [#1]
Hi All,

I am considering adding a "Heat Distortion" effect to my FPS and was wondering what the best approach may be.

I have a couple of Armoured tanks that leave their detroyed remains on the terrain for some time. I would like the remnants to show a refractive effect in the atmospehe just above the wreck (3 to 5 feet?)

My immediate thought is a Quad that always faces the cam. Beyond this, I need some suggestions. I am looking for a subtle distortion ....less is more etc.


Warner(Posted 2008) [#2]
This is a water distortion, maybe it helps somewhat:
http://www.blitzmax.com/codearcs/codearcs.php?code=1693


Ross C(Posted 2008) [#3]
Look up the fast extend library. This can do that effect alot quicker.


GIB3D(Posted 2008) [#4]
Woo somewhere to add this..

I found on Grand Theft Auto San Andreas that if you're at CJ's house (not sure if it's anywhere else) and are high up and look down at the street, you can see transparent squares (look like sprites) rising up to simulate a hot road effect.


Zeotrope(Posted 2008) [#5]
Warner; Thats a full screen distort and while nice, isnt practical for me as I need to isolate only a small part of the screen for the heat distort. (just above my tanks)

Ross; I sort of follow (fast extend library) but cant really see how to attack this. Do you know of any examples of partial screen distortion? Would it cause a real slowdown even if it works?

Anyhow Ross, if you have time, could you explain the principals (dumb it down a little) so I can get my head around the theory of what needs to be done to acheive this effect.


Perhaps some heat haze coming off a desert plane would be a better start. I am not sure. Surely someone has acheived this effect.


Kryzon(Posted 2008) [#6]
Hmm, there was once a thread of a guy that developed a quite simple Heat post-screen effect...

Ah! here it is, was searching on my HD. Just copy and paste this s*** and see if that's what you're looking for:





@Ross C: Boy you are sure advertising the hell out of fastlibs throughout the forums! are you getting something for it?...


Zeotrope(Posted 2008) [#7]
Cheers Rafael.

As I dont have those textures or *.X model, will take this home and have a squiz.

Thanks for the effort man!

HOW GOOD ARE FRIDAYS?


Kryzon(Posted 2008) [#8]
Holy damn, sorry man. Forgot about that :P

Here's the full Zipped source with the media it uses...

http://www.geocities.com/rafael_nvg/rl_heatdistortion.zip

Good luck...

PS: You could make only a certain spot of the screen to have this effect, by making the overlay plane (the one which you go and CopyRect to) have multiple segments, and then using Vertex Alpha to hide the vertices that are not "covering" the parts you don't want the effect to happen.


Ross C(Posted 2008) [#9]
I'm not getting anything for it :o) I just think it should be an essential add on for blitz3d. It has so many useful commands. Spped enhancements and seems to be very stable. I think alot of people would benefit from the lib. But not many people seem to be using it, so i'm trying to get word of it out.

People keep saying blitz3d is old tech, which is true, but the lib breathes some more life, graphically, into it.


Kryzon(Posted 2008) [#10]
Yeah I thought of that later on...it's just that I just wanted to pay for Blitz3D and do whatever I can with it, the rest, I can find in the Code Archives and\or generous Devils Child's engines.

People keep saying blitz3d is old tech, which is true, but the lib breathes some more life, graphically, into it.

Precisely, it gives more freedom to develop the game you really want.


bytecode77(Posted 2008) [#11]
try my shader engine at
http://stuff.dev-ch.de/




Zeotrope(Posted 2008) [#12]
Thanks to all who contributed to this post. However, I think providing me with links and suggetions to use this - use that, are valid, but are not going to teach me anything.

A good example is Devils Child's stuff. Amazing stuff to say the least. Your stuff in maxes out B3D..So much more advanced that anything I could produce at the moment... But way too complex! I wouldnt know where to start!

I am requesting the principal (or Theory) only. I am not asking for code or Zips etc. (perhaps a line or 2 of code would help)

So, I will start things rolling....(can we start again?)

Simple Heat Distortion: (Air Buckling effect)- Theory Of Operation;

1) Place a Quad in the area you want to distort. (Partial Screen Distort)

2) Grab that area of the screen (copy rect?)

3) Process (manipulate the pixels) the PARTIAL screen grab and send it to a texture? Buffer?

4) Display the final result over the heat source.

Thats all I have...any thoughts on this approach? I am sure there are DLL's and all sorts of solutions to this issue....but would rather tackle it myself from the perspective of understanding - and not speedy short-cuts....that can come later when I have my head around the basic principals themselves.

Phew!


Kryzon(Posted 2008) [#13]
What happens is that if you really really wanted to learn instead of us just giving you the answer, you would've looked inside the source in the Zip code I gave you, studied it, and then learned the answer to the question you made just now.

"Any thoughts on this approach" - Look the damn zip! it HAS a FUNCTIONAL version of what you want, using the steps you described. It would never be a shortcut, unless you simply Copy-"pasta" the thing into your game\engine. Rather, look at the code and go find out for yourself the answers - look what the code does, learn from it, improve it if you can, and then apply to whatever end. That's how we all learned ( as well as the guy who created the example in the first place! ).


Beaker(Posted 2008) [#14]
A DLL is probably the only way you will be able to do this effect at any speed.