Jump to content


Skybox vs skysphere in a space sim?


14 replies to this topic

#1 Grotius

    New Member

  • Members
  • Pip
  • 8 posts

Posted 13 January 2007 - 09:10 PM

I'm fairly new to 3D, so forgive me a relatively newbish question. I'm making a little space sim in XNA/Game Studio Express, and I'm wondering whether a skysphere is too resource-hungry. Right now the ship flies in all three dimensions with the camera locked right behind it, so I'll need to see the stars in the distant background in all directions, not just "up". But does a sphere require too many polygons? And is it going to be too huge to map a single texture to?

Also, I note that EVE online and other games sometimes implement "space dust" as one moves to create an illusion of movement. How is this sort of thing done? A particle effect around the ship?

#2 dave_

    Senior Member

  • Members
  • PipPipPipPip
  • 584 posts

Posted 13 January 2007 - 09:27 PM

No its a prefectly reasonable question. I'd recommend going for a sky box, its just easier to make, and easy to make the textures for it too.

I'd guess you're right about the particle effect around the ship.
You could probably get away with static particles places randomly round your environment.

I did the same thing for rain, its like the rain cloud is following you round!

#3 Reedbeta

    DevMaster Staff

  • Administrators
  • 5305 posts
  • LocationBellevue, WA

Posted 13 January 2007 - 11:41 PM

The only problem with a skybox is you might be able to see where the edges come together because of the texels being noticeably smaller near the edges. A skydome or sphere would alleviate this. But it's a minor artifact, I wouldn't worry about it unless it becomes really noticeable.
reedbeta.com - developer blog, OpenGL demos, and other projects

#4 Grotius

    New Member

  • Members
  • Pip
  • 8 posts

Posted 14 January 2007 - 12:54 AM

Thanks for your replies. A follow-up question: what size skybox and solar system is reasonable? Is it feasible to put sun and planets and tiny spaceship all in the same scene, within the same skybox?

I imagine the size of such a scene is limited by stretching of the texture, not to mention memory. I'm using 3Ds Max to make my scene, and I'm trying to figure out how much of a solar system I can depict in one scene.

#5 dave_

    Senior Member

  • Members
  • PipPipPipPip
  • 584 posts

Posted 14 January 2007 - 01:26 AM

You dont need to draw the sky box to any particular scale.
I would draw it first with Z off so that it gets drawn over by anything else, no matter how far away it is.

Here's a article I found http://gpwiki.org/index.php/Sky_Box although its OpenGL not XNA

The texture really needs to be quite big, probably a similar size to your screen res.

#6 Sol_HSA

    Senior Member

  • Members
  • PipPipPipPip
  • 510 posts
  • LocationNowhere whenever

Posted 14 January 2007 - 08:52 AM

re: is sky sphere too expensive compared to sky box..

If you're only talking about the amount of polygons rendered, the cost of the sky sphere is neglible compared to the sky box. I'd wager that a couple thousand polygons here or there won't make much of a difference.

#7 dave_

    Senior Member

  • Members
  • PipPipPipPip
  • 584 posts

Posted 14 January 2007 - 12:55 PM

Sol_HSA said:

re: is sky sphere too expensive compared to sky box..

Who wrote that?

#8 Sol_HSA

    Senior Member

  • Members
  • PipPipPipPip
  • 510 posts
  • LocationNowhere whenever

Posted 14 January 2007 - 12:57 PM

dave_ said:

Who wrote that?

Original post, "I'm wondering whether a skysphere is too resource-hungry"
http://iki.fi/sol - my schtuphh

#9 Grotius

    New Member

  • Members
  • Pip
  • 8 posts

Posted 14 January 2007 - 03:30 PM

Yup, being new to 3D, I had wondered whether the extra polygons to draw a sphere would make any difference. Sounds like not.

#10 TheNut

    Senior Member

  • Moderators
  • 1696 posts
  • LocationThornhill, ON

Posted 14 January 2007 - 04:38 PM

For a space sim, ask yourself if you even need a skybox. Take a look at celestia (http://www.shatters....ia/gallery.html). Very nice looking and it doesn't use skyboxes. If you plan on supporting navigation between universes, skyboxes would be out of the question too.
http://www.nutty.ca - Being a nut has its advantages.

#11 Grotius

    New Member

  • Members
  • Pip
  • 8 posts

Posted 15 January 2007 - 02:32 AM

Many thanks for the link. Wow, Celestia is fantastic! Um, how can I get my universe to work like that?

Looking at Celestia's files, I see just a couple of dozen models of significant objects -- mostly regular things like asteroids, Mir and Hubbell. So they probably just have one or two spheroid models for planets and suns, and textures to put on them. I can certainly handle just making a couple dozen models for a space scene, and I can handle making textures. But how to render all the tiny points of light you see until you get close to them?

#12 TheNut

    Senior Member

  • Moderators
  • 1696 posts
  • LocationThornhill, ON

Posted 15 January 2007 - 11:57 AM

Are you familiar with spatial division? The idea is to divide your scene into smaller parts. Each sector will have a set of particles representing the stars. You don't even need to texture them, their bright emissive colour will be convincing enough. Secondly, all the stars in a given sector are placed in a vertex array, for quick and efficient rendering. As you get close to one, don't even bother removing it. Keep rendering it, but then overlap it with the real star/texture/planet/etc...
http://www.nutty.ca - Being a nut has its advantages.

#13 Grotius

    New Member

  • Members
  • Pip
  • 8 posts

Posted 15 January 2007 - 04:19 PM

Thanks, TheNut. Nope, I'm pretty new to 3D, so I am not familiar with spatial division. That sounds like what I have in mind, though. So if I wanted to make a game with, say, 25 solar systems, how large would each 'sector' be?

#14 dave_

    Senior Member

  • Members
  • PipPipPipPip
  • 584 posts

Posted 15 January 2007 - 04:23 PM

You'd probably need to test to find an optimal size.

#15 Icon57

    New Member

  • Members
  • Pip
  • 1 posts

Posted 15 January 2007 - 04:56 PM

Hey all, brand-new here myself and this is my first post. Be honoured B)

I was under the impression that skybox and sky sphere (I'll use the term "sky dome" in this post) are two different technologies.

A sky dome is actual geometry that surrounds a level. Therefore, you either end up with a lot of polygons in your sphere or really large geometry that shows seams, especially if you use a cube.

A skybox is when you have a separate area in a map--like a little room--with only a camera and the sky elements in it. When the player's camera rotates, so too does the camera in the skybox. The view in the skybox is composited with the view from the level--just added into the background. That way the player will never bump up against the geometry that makes up the sky dome, only against the geometry of the level--because there IS no geometry making up the sky, only a masked-in image that's been rendered somewhere else.

That's lifted pretty much verbatim from Luke Ahearn's book 3D GAME TEXTURES.

IMO, you'll get a much better effect--especially for your space sim which requires lots and lots of, well, space--if you use the skybox technique I mentioned here, and not a sky dome or sky sphere.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users