PDA

View Full Version : Steam effect



Alessandro_dup1
09-11-2002, 12:45 PM
If you take a look at the following screenshot, can you tell me how to achieve a similar steam effect in opengl ?
http://www.lo-mac.com/screens.php?id=395

PH
09-11-2002, 12:56 PM
Refraction. Humus has a nice demo of this effect.

Link: http://esprit.campus.luth.se/~humus/

The site appears to be down ?

[This message has been edited by PH (edited 09-11-2002).]

ribot
09-11-2002, 03:06 PM
I've checked googles cache and even that's blank.

Seemed like quite a popular site though with links from ati developer.

Really hope there's somewhere else that shows a nice way to create that jet engine haze effect!

zed
09-11-2002, 08:52 PM
i would do it first in software with glReadPixels in then find out a way to do that in hardware (though in such a case as the screenshot performance should be ok with doing it in software

Mazy
09-12-2002, 12:43 AM
Render all that should be affected to a Texture ( or the whole sceen) make billboarded polygons, map with teh texture, and apply a texture-shader ( an texture offset texture for example)

vincoof
09-12-2002, 04:49 AM
Texture shaders are good except the fact that it's not available on all hardware.

And instead of glReadPixels, I would rather use glCopyTexImage or glCopyTexSubImage as they have the ability to read pixels AND to write them in a ready-to-use texture AND is much faster AND uses less memory.

rIO
09-12-2002, 05:56 AM
Is it possible to achieve a similar effect with this method but the refracting fluid needs to be modeled (ok it's wrong but) :

1) Set a small viewport
2) Render the scene in that viewport
3) Get the scene back to a texture
4) Set the rendering viewport
5) Render the scene
6) Fill the stencil with the refracting object
7) Render a tesselated quad over the scne using stencil test and the previous render to texture result

Perturb the texture coords...

I did it once, the only problem is that the borders of the refracting fluid are too much sharp...

Anyway, just my 2 cents http://www.opengl.org/discussion_boards/ubb/smile.gif

vincoof
09-12-2002, 07:13 AM
Also you could render the refraction with polygon stippling over the stencil buffer :
1, 2, 3, 4, 5) idem rIO
6) Render the steam polygon into the stencil buffer, with polygon stipple enabled
7) Translate the small "background" texture and render it where stencil test succeeds

The trick is to set at each frame a different stipple in 6 and/or a different translation in 7 so that you have the feeling that the steam displaces the background.

There's a doubt, though, that polygon stippling is hardwired on all cards. Otherwise there's a similar trick with a noise black&white texture. It's just a bit slower.

Humus
09-12-2002, 10:19 AM
Originally posted by PH:
Refraction. Humus has a nice demo of this effect.

Link: http://esprit.campus.luth.se/~humus/

The site appears to be down ?

[This message has been edited by PH (edited 09-11-2002).]

Yes, it's currently down due to hardware rearrangements and software upgrades. There are still some tweaking left to be done before it'll go online again, we are also waiting on getting another stick of RAM delivered. I can post a temporary url later tonight, I'll just have to fix the database.

knackered
09-12-2002, 11:12 AM
'we'?

Humus
09-12-2002, 11:32 AM
Yes, me and my roommate. I use our server mainly for my website, he uses the server for other purposes. The server also hosts my brothers website.

Anyway, the database has been fixed now.
It's up at http://humus2.campus.luth.se/~humus/ for the time being.

Alessandro_dup1
09-12-2002, 01:23 PM
The tecnique of rendering the scene to a texture is interesting, but it would drop fps severely i suppose ...

vincoof
09-12-2002, 01:53 PM
It's not that much time-consuming if you're rendering a small viewport and if you're using glCopyTexSubImage2D (it's faster than glCopyTexImage2D ... see the red book that explains it very well somewhere like there (http://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/@Generic__BookTextView/18266;cs=fullhtml;pt=18266#X) . please read the explanation of glTexSubImage2D before all since it explains why and how it is faster than glTexImage2D)

[This message has been edited by vincoof (edited 09-12-2002).]