Author Topic:   sky? water?
posted September 13, 1999 07:36 AM            
What do you use for the sky? is it just a flat bitmap painted in the background always parallel to the viewing direction (i.e. on the ZFar plane), or are you painting it on some solid (e.g. huge pyramid)?

And what about the water? Do you plan to do reflections? They're a pain in the a** to do without a stencil buffer... I think...


Chris C
posted September 13, 1999 03:07 PM         
If you take a look at the Art directory in Tread Marks, there is a subdirectory named 'SkyBox'. Sure enough, if you look closely enough, Seumas appears to have used a gigantic textured box to represent the sky.

Reflections aren't too hard to do without a stencil buffer, especially when rendered onto a continuous mesh, such as the Tread Marks landscape - you have to make sure you draw the reflected images onto the reflective surface (eg. water) before you draw the surrounding non-reflective polygons ie. the land surrounding the water. The incorrect sections of the reflections are then overwritten.

Anyway, these are just my thoughts - I'll let Seumas correct me if I'm wrong!


Chris Cookson
Computer Science Undergraduate, University of Warwick


LDA Seumas
posted September 13, 1999 04:52 PM           
I used to use a planar (essentially "scrolling") sky polygon positioned at the far plane, which was a hold over from the software rendered version of the engine I started with way back. Once OpenGL gave the camera some more freedom, I found it too limiting, and too incorrect looking, so I decided to switch over completely to sky boxes, as you noticed. They take a tad more texture ram (and they look best with 512x512 textures), but the overall effect is much more convincing.

As for water reflections, right now I'm only doing sky reflections, using a 512x512 spherical environment map generated from the current sky box. My water is already on the expensive side since you can see the river/lake bottom below the surface, and the water can optionally be two-pass with a reflective layer and a non-reflective layer.

Actually I just had a thought... I suppose I could do true landscape (and if I really wanted to kill frame rate, object as well) reflections using an OpenGL user clipping plane, rather than the stencil buffer. Since Quake3 uses a single user clipping plane for its portals and mirrors, the drivers must be optimized for it at this point. Still, I wonder if there would be problems... A perfectly mirrored water surface wouldn't be too hard, but making the reflections partly transparent over top of the normal lake bottom could be tricky, even with a stencil buffer.

-- Seumas McNally, Lead Programmer, Longbow Digital Arts