|
Author Topic:   Sky question
TheGecko
New Member
posted February 19, 2000 06:48 PM            
Ok,the next phase of my terrain program is to add sky.Now I was wondering how sky is done (like that in the Oxygen demo) It looks like a flat plane that is continuously being repeated and translated.If so,then how do you programatically do that? I mean,I could create a quad out of two triangles and texturemap it with a sky texture,but my question is: how do you make it repeat itself?

(I could use a skydome,but I would verymuch prefer to know how this method is being done. I might apply it to my terrain so that my terrain is also being repeated.)

Thanx for your help!

IP:

Sam K
Member
posted February 19, 2000 10:11 PM            
I'm pretty sure oxygen just uses 1 big polygon (as you say). Use a tile-able texture, and set the vertex u/v's beyond 0.0f and 1.0f (So it repeats across the polygon). Make sure the polygon is set to wrap the texture, not clamp it.

sam

IP:

TheGecko
New Member
posted February 20, 2000 02:21 AM            
whoa...keep talking...can you actually have UV coordinates greater than 1.0? You got my interest...but could you elaborate a little furthur?

IP:

Sam K
Member
posted February 20, 2000 08:36 PM            
Thats all really, you can have texture coordinates greater than 1.0 and less than 0.0!

Setting texture coordinates at the vertices of the polygon to say:

-2.0,-2.0
2.0,-2.0
2.0,2.0
-2.0,2.0

will tile the texture 4 times over that one polygon (in both directions).

sam

IP:

TheGecko
New Member
posted February 20, 2000 09:11 PM            
Oh wow! I didn't know that...thanx Sam.I'll be working on that tonight. Hopefully I'll have a good sky running.Thanx for the tip!

IP:

Tim
Member
posted February 21, 2000 03:49 AM            
Sky 'domes' are a waste of polygons.

Use a 'Skybox', much easier to wrangle.
The skybox is a cube that is always centered on the camera. each face of the cube has on it a 90 degree field of view shot to the center of the face from the center of the cube. QTVR uses this technique, as does Quake2 et al. If you do a search for 'skybox' you'll even come up with a tool from wasabi software to paint them.
(I'd recommend using bryce or something similar to produce each 'face' though.


IP:

Klaus Hartmann
Member
posted February 21, 2000 10:30 AM            
Tim -- True, a sky dome has more polygons than a skybox, but this doesn't really mean that sky domes are a waste of polygons. It really depends on what you are doing.
Quake is mainly an indoor game, whereas TheGecko writes an outdoor engine. In an outdoor scene I would prefer a dome, whereas I'd say that a box would be good enough for indoor games.
In an outdoor scene (like in the tree demo from nVidia), a dome results in a sky that looks bent. In my opinion, this is one of those factors that makes the scene look huge, even though it isn't.

IP:

henryj
New Member
posted February 23, 2000 06:08 PM            
Or...
you can use a sky box and map the texture co-ords onto it using spherical mapping. You get the best of both worlds. Plus a head ache from the math!!
Check out the Aftershock site for an example. http://www.planetquake.com/aftershock/

IP:

Tim
Member
posted February 24, 2000 02:58 AM            
Well, it all ends up being the same anyways.

As for the skybox, the idea is to have six 90 degree FOV renderings of the 'sky' in each direction. not a tiled texture.

When rendered properly, the effect is indistinguishible from the Real Thing (tm).
Perspective is maintained. If one uses high rez texture maps, it's even better.

"Skybox" is really just John Carmacks term for an old old graphics trick formally called a cubic environment map.

IP: