Water droplet post effect

Started by
6 comments, last by superpig 18 years, 10 months ago
Recently I played the game Conker's Live and Reloaded for the xbox platform and noticed that they have a really cool water droplet post effect. Essentially it gives the illusion that water droplets are running down the camera lens during rain. Has anyone else seen this effect? Anyway I am wondering if anyone has any ideas on how I might be able to pull this effect off. Thanks. -TheDigga
Advertisement
I know the effect, but it might be quite difficult to pull off. I believe on the xbox you have access to the frame buffer, so you can distort it in such a way that it looks like droplets are refracting the light. On a pc however, you don't have access to the frame buffer. So you must render the entire scene to a texture, then render a single quad with that texture and some shader to distort it. The shader would probably need 2 textures, 1 being the rendered scene, and the other being a sort of distortion map which tells it where to look up the scene texture.
___________________________________________________David OlsenIf I've helped you, please vote for PigeonGrape!
Just for information, Half-Life 2 has this for it steams (shrinks everything behind), and many newer titles, especially PS2 ports have these effects, but commonly, it is a very expensive effect and can be quite troublesome to make it work good as corners etc must match exactly with the surrounding.

Either way, an easy way to do this without such things (not looking as good though) is to simply copy the backbuffer when you have finished drawing, and then use it for a texture which can be mapped onto "models" (raindrops) with different scale and coordinates to make it look like real raindrops, however, might need to be pretty hiresolution drops to make it not looked too jagged. But it is a very fast and simple illution of real distortion. (could be quite troublesome to get the right looking reflection angle I guess though)


Heh...I am actually a PS2 and Xbox dev so yes you are correct in that we get framebuffer access. I am mostly interested in the technique for our ps2 title and the ps2 has incredible fill rate for post effects :) Thanks for all the replies.
At a rough guess, something like rendering the scene as a texture using a grid of quads, and 'gravitate' vertices towards a set of known points to create a sort of pinching effect (should be simple with a VU program). Then render white-edged raindrop textures centered on each of those points. By moving the points around (i.e. moving them down the screen) you should be able to get the droplets moving.

That is just a guess though. Anyone got screenshots of the effect in Conker's Live and Reloaded?

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

In Raze's Hell (Xbox not PS2, sorry) we used the approach mentioned above. Render to texture, then render framebuffer with two textures, one a distortion texture, one the rendered scene.

The distortion texture is generated each frame. First we clear to 128,128,255 std. normal map Z axis blue. We then blend in small quads with normal maps for each droplet, and draw growing spheres with a normal map envmap for explosions. These are all blended with signed addition.

A ps.1.1 texm3x2 is used to multiply the quads's texture coordinates by the distortion map with _bx2 such that we multiply the original coordinate by blue (which will always be 1.0f), and the distortion map by a small maximum offset.
Superpig, I think you are on to something. This afternoon one of my co-workers is gonna go grab the game for me and I will run it through the xbox debug kit and grab a snap shot and post it here. Thanks for all the replies guys.

[EDIT]
Namethatnobodyelsetook, sorry I overlooked your post. I think I can pull that off on the ps2, I am gonna try that.
[END EDIT]
I've gotten the impression from my coworkers that one of the reasons the PS2 has fillrate coming out of its ears is because the pixel pipeline is extremely simple and more or less completely fixed. So I'll be surprised if you can get NTNET's approach working, though if you can, it should look better than mine.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

This topic is closed to new replies.

Advertisement