Archived

This topic is now archived and is closed to further replies.

Starry background

This topic is 5233 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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!"

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites