Skyboxes in Unreal

Started by
5 comments, last by Crispy 21 years, 2 months ago
Hi, I''m implementing a skybox feature that is fairly similar to the one used in Unreal and its descendants - something that allows severals layers of "walls", "ceiling" and "floor" to exist. This is fine - everything''s nice. However I can''t really figure out how they solved the question of "infinity" - you can see the sky stretch as far as possibly possible. Implementing this, however, is tricky as drawing a humongous quad to really stretch so far that you can''t tell a difference will have a considerable performance hit. Does anyone here have a clue how they did it? Is it (the ceiling and the floor) sneakily "bent" to converge at the horizontal center point just some distance off (which should be visible, but it isn''t) or are there some other dark forces behind this? Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Advertisement
None of the sky-boxes in Unreal stretch to inifinity. Most of them are simply very large. A few use illusions. Most of the time the solve it by masking the horizon with a mountain range or something similar.

----
AIDS
----AIDS
Most skyboxes are smaller than you would think. They just draw the sky box before everything else with the depth writes off, and then you rotate it according to how the player is orientated, but you don''t translate it anywhere. Then draw the rest of the scene.
"...."
Unreal''s skyboxes are simply an area in the level (normally not connected to the main playable area) with a camera location inside.

From my experience, a pre-rendered skybox would be either 128^3 or 256^3; most skyboxes were less than 1024*1024*256 in Unreal units.

The view from the camera point, with the player''s current orientation, is drawn. The scene from the player''s actual location is then drawn on top. That way you don''t have to fake a sky with distant quads or other geometric effects.

This method is particularly flexible because you can make a ''standard'' skybox (i.e. cube with pre-rendered textures), or an actual scene (make polygonal mountains, or whatever), or have a combination.
You can also have movement, lighting, transparency, effects etc. to add whatever realism or eye candy you like.

Essentially, though, you''re just building an area of level as normal then rendering it before the scene. Just bear in mind that there is a fixed viewing point.
-Richard
Start Unreal, enable cheats, activate god and ghost mode, and fly high above the level. Look around, somewhere in the distance (generally not too far away from the level itself) you'll see the skybox(es). You can fly into them and inspect from every direction. At least, that used to work in Unreal I. Don't know about UT + U2, but I guess it's similar.


[edited by - Yann L on February 1, 2003 8:30:50 PM]
A thing in Unreal (the first Unreal) that I like to know is how those guys make the game lightmaps. I think that isn''t multitexturing bacause when someone flash something on dark faces, the dark faces be visible. And don''t seems vertex lighting... it seems like multitextures... but don''t seems like multitexturing... well... as you can see, i''m confused
Disabling depth testing - should''ve thought of this myself . Anyway - this brings along a couple of problems, be it as sneaky as it is - one of these is distortion between the skybox and the level itself. I''m personally implementing the skybox for an open level (a heightmap engine with no visible walls) and drawing the level and the skybox in different scales (a 512x512x128 skybox around a 1024x1024x256 level) greatly amplified the effect where the skybox seems physically nearer (yet appears behind everything else) than the level, thus moving considerably faster when you look at it on the background of the level itself and pan. Maybe indoor scenes can absorb this distortion...

As for lightmapping in Unreal - afaik lightmaps are used everywhere where dynamic lights need to be applied and speed is really an issue - they''re fast, versatile and don''t necessarily have to eat up a texture unit. Besides, Unreal is too old to use PPL (by default at least).

Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared

This topic is closed to new replies.

Advertisement