WinQuake (Non-GL) underwater effect in OpenGL?
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?
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...
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...
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.
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.
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.
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...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement