Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am creating a game using OpenGL and I want to render the effect of a night sky with a few stars in it.

I want to have a shiny black effect in the sky so that it looks good. Could some one help in how to proceed through it or give a link to a good tutorial?

share|improve this question
add comment

1 Answer 1

up vote 10 down vote accepted

Typical approaches are skyboxes or skydomes. Both techniques involve creating some simple geometry that is always rendered in a fixed position relative to the view, and applying a texture to it. The quality of the resulting effect can depend heavily on the quality of the texture artwork, so if you don't have great art skills you may want to opt for something else. Tools like Terragen can help produce decent art though, and this question has a set of links to other tools of a similar nature.

A less obviously art-dependent approach is to do the whole thing procedurally. You can create a vertex-color based skydome (links and information here) which will allow you to adjust the colors according to some empirical (or other) models for sky coloring -- Preetham and Shirley's model is particular nice, if I recall correctly.

You can then apply procedural starfield generation which you render near the sky dome (perhaps as a fixed particle system, or via texture splatting, or whatever).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.