best way to store sky background

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Posts: 5
Joined: 21.06.2003
With us: 17 years 10 months
Location: Palo Alto, CA

best way to store sky background

Post #1by florin » 24.02.2008, 22:20

I'm building an open source specialized 3D ray tracer to explore relativistic phenomena (general relativity, not special). The end result may look superficially similar to Celestia, but may be quite different "under the hood". The program will be a simulator - the images will be physically realistic and accurate. I'm in the initial phase - planning.

The ray tracer needs to be able to render images up to HD (1080p) resolution. Maybe beyond that too. It needs to be as fast as possible, ideally real time NTSC/PAL frame rates for most resolutions on good hardware (PS3, high performance PC).

Because of that, I need to pre-render as a bitmap the whole sky background, which looks quite similar to Celestia - mostly black, with some stars. The resolution of the pre-rendered sky needs to be higher than the resolution of the screen, of course.

So that's my dilemma - due to the extremely high resolution, I cannot simply store the whole sky in a regular matrix, or I'll need many GB of RAM. (or I may use 8bit graphics for the sky and still end up with 100MB of live data in RAM - which is suboptimal in more than one way)

One way around that would be something like a sparse matrix. But that too has its issues (the suitesparse library, for example, is not good for random access, according to its author).

How does Celestia store / represent the sky background? Is it rendered dynamically, or pre-rendered and stored as bitmap? Or something else?

Is Celestia essentially a ray tracer, or not? What's the Celestia 3D engine like?

(I guess I could spend some time reading the source myself, but time is the least abundant resource that I have, so I would very much appreciate just a few words of clarification.)

Any comments are welcome.

Thank you!

Posts: 296
Joined: 15.07.2003
With us: 17 years 9 months
Location: Bellows Falls, VT

Post #2by Brendan » 26.02.2008, 20:45

The stars are individual objects you can go to. They are rendered with some kind of culling mechanism, either a BSP or octree. Some others here would know.
Specs: 3500 AMD 64, 1GB RAM, PCI Express GeForce 7600 GS with 256MB, Debian Lenny on 250 GB drive, Windows XP Media Center on 250 GB drive

Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 19 years 3 months
Location: Seattle, Washington, USA

Post #3by chris » 26.02.2008, 21:12

Brendan wrote:The stars are individual objects you can go to. They are rendered with some kind of culling mechanism, either a BSP or octree. Some others here would know.

Correct: Celestia uses an octree for storing stars. Deep sky objects are stored in their own octree. For fast visibility testing of solar system objects, Celestia uses a tree of bounding spheres.

The rendering isn't done with raytracing. Celestia uses OpenGL, which generally means that final rendering is done with triangle rasterizing / z-buffering hardware.


Return to “Development”

Who is online