Thread: [Plib-devel] Q2: Water
Brought to you by:
sjbaker
From: Vallevand, M. K <Mar...@UN...> - 2000-05-08 15:50:31
|
Any suggestions for implementing water on a terrain using SSG? Right now, I have water implemented as textured triangle strips on a 'sea-level' plain, and also adjust the fog when the camera is underwater. The terrain and water are just allowed to intersect each other without any adjustments, cutouts, etc. This works pretty well except for some artifacting when viewed from a distance. Flying along the terrain is rather nice. But, there may be a better way to do this. Regards. Mark K Vallevand ma...@rs... Outside of a dog, a book is man's best friend. Inside of a dog, its too dark to read. - Groucho |
From: Steve B. <sjb...@ai...> - 2000-05-08 23:28:05
|
"Vallevand, Mark K" wrote: > > Any suggestions for implementing water on a terrain using SSG? > > Right now, I have water implemented as textured triangle strips on a > 'sea-level' plain, and also adjust the fog when the camera is underwater. Yep - that's more or less what I've done in Tux_AQFH - except that since I had plenty of pixel fill to spare, I just made the water one *HUGE* quadrilateral that runs under all of the terrain and only shows through where the terrain drops below zero altitude. It's not great for a couple of reasons: 1) You can look down into the water and see the bottom just as clearly as the sides. But once you are in the water, you can't see as far as you could from above. It's hard to fix that - but fortunately, nobody seems to notice! 2) Very gently sloping 'beaches' tend to Z-fight with the water surface. That would happen no matter what you did - but it's worse when the water runs under the ground. > The terrain and water are just allowed to intersect each other without > any adjustments, cutouts, etc. This works pretty well except for some > artifacting when viewed from a distance. Flying along the terrain is > rather nice. > > But, there may be a better way to do this. Bump-mapping looks really great on water - especially if you do some texture animation tricks to make fake waves in the bump map. -- Steve Baker http://web2.airmail.net/sjbaker1 sjb...@ai... (home) http://www.woodsoup.org/~sbaker sj...@ht... (work) |
From: Sam S. <sa...@sp...> - 2000-05-09 09:42:36
|
> 1) You can look down into the water and see the bottom just as clearly > as the sides. But once you are in the water, you can't see as far > as you could from above. It's hard to fix that - but fortunately, > nobody seems to notice! Couldn't you apply another "grey" texture on top on the water, with some half decent alpha values? Maybe the underwater caustic texture technique would work on top of water as well (http://reality.sgi.com/mjk/tips/caustics/) You could also reflect some of the surrounding objects in the water in a patchy fashion (http://reality.sgi.com/opengl/tips/puddles/). Should make the water look a lot less clear if you have the CPU/card usage to go around :) Sam |
From: Steve B. <sjb...@ai...> - 2000-05-10 02:50:18
|
Sam Stickland wrote: > > > 1) You can look down into the water and see the bottom just as clearly > > as the sides. But once you are in the water, you can't see as far > > as you could from above. It's hard to fix that - but fortunately, > > nobody seems to notice! > > Couldn't you apply another "grey" texture on top on the water, with some > half decent alpha values? Yes - but there is nothing you can do to the surface of the water that allows you the effect of being able to see through (say) 5 feet of water - but not through 50 feet. Once underwater, we can turn on murky blue/green/brown fog and get something like that effect. -- Steve Baker http://web2.airmail.net/sjbaker1 sjb...@ai... (home) http://www.woodsoup.org/~sbaker sj...@ht... (work) |
From: Owen C. <oc...@ec...> - 2000-05-10 03:24:49
|
> Sam Stickland wrote: > > > > > 1) You can look down into the water and see the bottom just as clearly > > > as the sides. But once you are in the water, you can't see as far > > > as you could from above. It's hard to fix that - but fortunately, > > > nobody seems to notice! > > > > Couldn't you apply another "grey" texture on top on the water, with some > > half decent alpha values? > > Yes - but there is nothing you can do to the surface of the water that > allows you the effect of being able to see through (say) 5 feet of > water - but not through 50 feet. you could a series of planes perpendicular to the surface of the water with a constant transparency set to somthing low. it would probably ook a bit wierd around the edges, but you would get a similar effect to the ground fog in Q3. probably not really worth it tho. owen |
From: Steve B. <sjb...@ai...> - 2000-05-10 03:38:12
|
Owen Cliffe wrote: > you could a series of planes perpendicular to the surface of the water > with a constant transparency set to somthing low. it would probably ook a > bit wierd around the edges, but you would get a similar effect to the > ground fog in Q3. I figured out a better way to do ground fog than multiple layers of polygons, but it requires two passes - with two maps applied via multitexture on the second path....and it's *insanely* complex. -- Steve Baker http://web2.airmail.net/sjbaker1 sjb...@ai... (home) http://www.woodsoup.org/~sbaker sj...@ht... (work) |
From: Chris P. <cj...@lo...> - 2000-05-14 15:22:44
|
On Mon, May 08, 2000 at 06:30:58PM -0500, Steve Baker wrote: > Yep - that's more or less what I've done in Tux_AQFH - except that since > I had plenty of pixel fill to spare, I just made the water one *HUGE* > quadrilateral that runs under all of the terrain and only shows > through where the terrain drops below zero altitude. > It's not great for a couple of reasons: > 1) You can look down into the water and see the bottom just as clearly > as the sides. But once you are in the water, you can't see as far > as you could from above. It's hard to fix that - but fortunately, > nobody seems to notice! People notice, they just don't say anything because commercial games are still doing this very badly. They are used to water that appears crystal clear from above then turns murky when entered. And the other extreme where it is hard to see what's below the surface but when you enter the water everything lights up a funny colour. They way I'd do it is by calcutaing how much water there is between the camera and the object on a per vertex basis. This would be easy for the configuation in tux_aqfh. I'd have a colourless surface texture and no changes in the way the scene is lit, coloured or fogged when the camera enters or leaves the water. -- Christopher John Purnell | I thought I'd found a reason to live http://www.lost.org.uk/ | Just like before when I was a child --------------------------| Only to find that dreams made of sand What gods do you pray to? | Would just fall apart and slip through my hands |
From: Steve B. <sjb...@ai...> - 2000-05-15 02:38:30
|
Chris Purnell wrote: > > On Mon, May 08, 2000 at 06:30:58PM -0500, Steve Baker wrote: > > > Yep - that's more or less what I've done in Tux_AQFH - except that since > > I had plenty of pixel fill to spare, I just made the water one *HUGE* > > quadrilateral that runs under all of the terrain and only shows > > through where the terrain drops below zero altitude. > > > It's not great for a couple of reasons: > > > 1) You can look down into the water and see the bottom just as clearly > > as the sides. But once you are in the water, you can't see as far > > as you could from above. It's hard to fix that - but fortunately, > > nobody seems to notice! > > People notice, they just don't say anything because commercial games > are still doing this very badly. They are used to water that appears > crystal clear from above then turns murky when entered. And the other > extreme where it is hard to see what's below the surface but when you > enter the water everything lights up a funny colour. > > They way I'd do it is by calcutaing how much water there is between > the camera and the object on a per vertex basis. This would be easy > for the configuation in tux_aqfh. I'd have a colourless surface > texture and no changes in the way the scene is lit, coloured or > fogged when the camera enters or leaves the water. There is a problem with that though. Even if you know how much fog is between the eye and the camera, it's hard to do anything about that unless your OpenGL supports the vertex-fog-range extension. Failing that, you need a multi-pass technique. -- Steve Baker http://web2.airmail.net/sjbaker1 sjb...@ai... (home) http://www.woodsoup.org/~sbaker sj...@ht... (work) |