Sky Boxes, Space Backgrounds

Started by
10 comments, last by zedzeek 17 years, 11 months ago
Okay... I'm trying to create a 3D space simulator... Would I just create a sky box, centered around the camera in order to set up the background? Is that how it's done, or are there different methods?
Advertisement
Skyboxes are not very good for space simulators because there is usually not enough geometry to obscure them so it's easy to see the imperfections. You'll notice texture aliasing right away, but if you use very large textures (1024x1024) you may get away with it.

I think Descent Freespace or some of these other space games use a sphere box. It probably helps with aliasing because the distances are more or less constant, while in the skybox they are not.

I'm using a skybox for my space sim and it's doesn't look very good. The textures are only 512 x 512 though.
deathkrushPS3/Xbox360 Graphics Programmer, Mass Media.Completed Projects: Stuntman Ignition (PS3), Saints Row 2 (PS3), Darksiders(PS3, 360)
OK... so a skydome...

I've skimmed google, and nothing is really jumping out... do you have a site with a tutorial for that off the top of your head?

Don't bother going to search for it.. just wondering if you can save me some time :)

Thanks for the help anyway :)
http://www.flipcode.com/articles/article_skydomes.shtml
Dammit, I just found that too...

lol, sorry for wasting your time :(

Thanks :)
I disagree sky boxes can work just fine for space games. For example i just use a sky box here:

The only reasion i ever use domes is for when i plan to animate the sky.

A correctly made skybox accounts for the distance variation towards the corners.
That's a damn nice scene, skow. And you used a sky box for that? I suppose it might work for stars, but say I had like a nubula type thing going on... the edges would be much more visible than if I used stars, wouldn't they?

[Edited by - Erondial on May 13, 2006 1:32:27 PM]
Might it be possible to not have the nebula extend around any corners?
I use a skybox and to me it looks super fine, check the screens here... if the textures are generated properly with distortions, it works.


my proj
Quote:Original post by Erondial
Would I just create a sky box, centered around the camera in order to set up the background? Is that how it's done, or are there different methods?


Different methods to achieve the same thing :
- if you've got a cubemap (most hardwares support cubemap textures now) you can render a screen aligned quadrangle at max distance and you just specify the direction vector at corners.
- render a cube centered around the camera as you said. Of course if you do the calculation in your head you'll see that the only thing that matters is the orientation of your camera. So take your worldview matrix, strip the translation part of the matrix, strip the scaling part (it's easier to do if you just construct the matrix from your camera orientation information) and you'll end up with a matrix that can rotate a cube centered around zero. Then apply projection matrix on that, to project your cube on the screen. The real dimensions of your cube don't matter (because you're centered around zero and your projection center is also at zero, you're "scaling independant".. with the following caveat).

The second one can generate artefacts if you're not very careful (cube end up being clipped by far plane, or cube obstructs views of visible objects). You just need to make sure you write at a constant Z (the far Z).

Note that to save fillrate on some hardware, you can render your box last, after all opaque objects, your depth buffer will take care of occlusion. Then draw semi transparent objects on top as usual.

If you just need static nebulas and stars, skyboxes are fine. Make sure you generate the textures correctly of course (each face of the cube is a projected view of the environment).

LeGreg

This topic is closed to new replies.

Advertisement