0
101 Oct 09, 2007 at 15:19

Hi :-)!
I’m working on Elite clone for a school project, with Opengl and Glut.
How can i make a static background with star?
I have thought to use a skybox, but i have some questions.
I have found some images for texture, for example: http://img409.imageshack.us/img409/64/starsbknh1.jpg
- The size of box around the camera.
- The size and the numbers of texture (the same texture for all face or one different texture for every face).
- The box must be transparent (How?).
- How can i obtain an lighting effect of the star?
Too many questions, sorry :-(!
Thanks!!

#### 7 Replies

0
101 Oct 10, 2007 at 11:07

I don’t exactly understand all your questions, but for the skybox size you can make it “infinity”.
Since the position coordinates are homogenous, you can set the w value of the position to 0, which will send it to infinity.
Then after you multiply the position by WVP matrix, you need to set the the z and w coordinates so that z/w will be between 0 and 1.
I never tried this, so I am not sure if it will work exactly this way.

0
165 Oct 10, 2007 at 16:04

Yes you can make it infinitely large. Or you can turn off depth writes, draw the skybox, then turn on depth writes and resume, which will ensure the skybox appears behind everything. Then the actual size of the skybox is irrelevant.

I’m not sure what you mean by making it transparent. Surely you don’t want to see “through” the blackness of space to something behind it? :)

As for the textures, for star textures you can probably get away with using the same one for all six cube faces, unless you want there to appear a nebula or galaxy or something like that in the distance.

0
101 Oct 12, 2007 at 08:57

Hi! Thanks to all!
I have positioned the camera in (0,0,0), then i have made a box around the camera, the box size is 2x2x2 (i’ve turned off the depth test) . I have applied the texture, the same texture for all face, but the result is not very nice…
Example: http://img353.imageshack.us/img353/8256/screenshotho8.png
I’ve made the texture with GIMP, black background and “SuperNova” filter with radius 1.
- The problem is the texture?
- Other?
Thanks!!!

0
118 Oct 12, 2007 at 09:44

Making a good-looking space environment is quite difficult by using only a skybox, as the texture resolution is quite limited - even if you use 1k * 1k skybox, the texel resolution is not sufficient when viewed in, say, 1024x768 resolution.. (naturally this depends on the camera settings as well).

So I’d probably do some kind of space cloud thingy with the skybox and would drop in several hundred particles for the stars etc.

0
101 Oct 16, 2007 at 16:59

Thanks!
In my mind i wanted to obtain a similar effect to this: http://oolite.aegidian.org/screenshots/images14/oolite_002.jpg
Is nice…

0
165 Oct 16, 2007 at 17:11

Those dark blue cloud things could probably be done nicely with a skybox (wouldn’t have to be too high-res either), while the actual stars would be best done by particles as Sol_HSA mentioned.

0
101 Oct 16, 2007 at 18:15

@enigma

Thanks!
In my mind i wanted to obtain a similar effect to this: http://oolite.aegidian.org/screenshots/images14/oolite_002.jpg
Is nice…

I would use some real reference pictures instead. Searching for nasa starfield on images.google.com give some pretty good results.