Skip to main content
GameDev.net gamedev.net
🔒 Locked

Starry background

Started by DangerDave Aug 10, 2003 at 6:36 PM 6 replies 1k views
Original Post
DangerDave
DangerDave
How would I go about putting a background of stars in a 3d space sim? Would I need to have a huge spherical mesh encompassing what the user sees and then texture it with a starfield? That seems a bit heavy for a simple background texture effect... Any ideas? Dave.
Dave.
UltimaX
UltimaX
If it''s just a background, why not use a skybox?

-UltimaX-

"You wished for a white christmas... Now go shovel your wishes!"
DangerDave
DangerDave
why not a skybox indeed... whats a skybox? Any links or more info would be great, cheers.

Dave.
Dave.
UltimaX
UltimaX
A skybox is juat a big box around your world. Then you add textures to each side of the box.

Heres a nice tutorial/demo/source for skyboxs. Good luck Dave.

-UltimaX-

"You wished for a white christmas... Now go shovel your wishes!"
Cipher3D
Cipher3D
or just do a simple pixel (or particle/sprite) starfield that you draw behind all your 3d objects. therefore you don''t have to worry about skyboxes or (in your case) big large spheres.
I eat heart attacks
Donavon Keithley
Donavon Keithley
The problem with using a skybox for a starfield is that the textures have to be huge in order to provide the fine detail that you want. The smallest a star could be is one texel and ideally you''d want that texel to project to one screen pixel or pretty close to it. So at a screen res of 1280x1024 you''d need 2048x2048 textures and a horizontal FOV of about 57 degrees to achieve this. Make that a 1024x1024 texture and the texel is obviously going to project to around four pixels. If you went up to 1600x1200 then even 2048x2048 isn''t ideally big enough but it might still look okay.

You could use texture wrapping to get by with smaller textures but that precludes painting larger features into the skybox like nebulae and galaxies. And it''s still a lot of fill-rate for drawing mostly black pixels.

I would suggest point sprites as one alternative. On Freelancer we actually drew line primitives when the camera was rotating to get a motion blur effect.
Etnu
Etnu
I''d just scatter a few particles in the background (make sure they''re done so that all other objects'' z value will over write them).

A skybox is simply a box with all the faces facing inward, drawn so that the camera is always in the center of it (i.e. it uses a world matrix equivilent to the camera''s location), and rendered so that all z values over write it.
---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.
DangerDave
DangerDave
Bit of a late thankyou but here it is nevertheless. Thanks guys, that should help a lot.
(P.S. Freelancer kicks ass!)

Dave.
Dave.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.