Jump to content
  • Advertisement
Sign in to follow this  
necrophilissimo

OpenGL WinQuake (Non-GL) underwater effect in OpenGL?

This topic is 4830 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Everyone remembers that cool underwater effect of original (non-GL) Quake. The one where the screen pixels were "waved" instead of wall/floor polys. How is this screen effect implemented to OpenGL? Tutorials, anyone? I've seen something similar in latest hi-end games, like Doom 3 (heat effect) and FEAR (shockwaves, Matrix bullet FX). What is the name of this trick?

Share this post


Link to post
Share on other sites
Advertisement
Newer games: Refraction


Older games: sin() functions... :)

I'm using a cheap sin hack for my game, I simple grab the frambuffer, slap it onto a grid and manipulates the vertexes using sin functions...

Share this post


Link to post
Share on other sites
I think the original quake just modified the texture coordinates using a sin function over time or something similar.

Doom 3 does a similar thing, but as a fullscreen post-processing effect. I'm guessing they render the texture to the screen and then render a screen-aligned mesh of quads with that texture and warp the vertices. Either that, or they render a single screen-aligned quad and do the warping in a fragment shader.

Share this post


Link to post
Share on other sites
The Quake software renderer distorted the framebuffer using some trig functions. It's actually the exact same thing as doing a "post process" effect using a pixel shader, as it's done in screen-space after rendering everything in the scene.

Share this post


Link to post
Share on other sites
Quote:
I'm using a cheap sin hack for my game, I simple grab the frambuffer, slap it onto a grid and manipulates the vertexes using sin functions...


Interesting approach - how did you implement that? I tried to do something similar in the past, using glCopyTexImage2D, but as there are severe restrictions of are size on that one, it didn't work out so well...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!