Large scale renderization

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Reginadelletempeste
Posts: 2
Joined: 06.11.2007
With us: 17 years

Large scale renderization

Post #1by Reginadelletempeste » 06.11.2007, 16:31

Hello everyone :)
I'm trying to understand how Celestia works, and I'm a bit stuck on how large scale renderization is handled. In my short career I understood that floating point numbers are not sufficient to render very large scenarios (like the entire universe...) and objects with very different scales (from 1e-6 to 1e20, for example), and I would like to understand how this problem is managed in Celestia.
Can someone explain the algorithm, tell me if there is any documentation, or draw me a scheme? Thank you in advance and keep on the good work! :)

Reginadelletempeste

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #2by selden » 06.11.2007, 18:08

I don't know the details: you'll have to read the source code on SourceForge.
http://celestia.cvs.sourceforge.net/celestia/celestia/
A somewhat obsolete overview of the program structure is at
http://celestia.cvs.sourceforge.net/cel ... vision=1.6

However, I do know that Celestia uses both128bit arithmetic (quad precision) for placing stars and changes the origin when drawing planetary systems. Even so, it's limited to drawing stars within 16KLY of the Sun.
Selden

Paolo
Posts: 502
Joined: 23.09.2002
With us: 22 years 2 months
Location: Pordenone/Italy

Post #3by Paolo » 06.11.2007, 18:11

Hi RdT
The magic is done by a custom number type. Browse celestia CVS and search for BigFix class.

http://celestia.cvs.sourceforge.net/cel ... c/celutil/
Remember: Time always flows, it is the most precious thing that we have.
My Celestia - Celui

Topic author
Reginadelletempeste
Posts: 2
Joined: 06.11.2007
With us: 17 years

Post #4by Reginadelletempeste » 08.11.2007, 13:45

Thank you very much :)
What I still cannot understand is: how Celestia convert these BigFix numbers to be used with OpenGL cards (which hardware is in 32 bit precision...) without losing precision?
Thank you again!

manu
Posts: 1
Joined: 14.11.2007
With us: 17 years

Post #5by manu » 14.11.2007, 13:46

Hello everyone!

I'm new of Celestia and I'm trying to survive in this jungle of code :)
I have some questions about the same topic.
I noticed that Celestia uses 128-bit fixed point (64.64) numbers for high-precision celestial coordinates (BigFix, good name for this class :) ).
The class UniversalCoord contains BigFix x,y,z and the struct RigidTransform contains both translation (UniversalCoord) both rotation (Quatd).
Observer.situation is a Rigidtransform which indicates camera position.

Is it right?

These are my questions:

-I can't understand the usage of FrameOfReference
-where does camera position (expressed in 128-bit) is converted in float for rendering?
-I read that "object positions are stored at two different scales--light years for stars, and kilometers for objects within a star system" to avoid using 128-bit. The position of the objects in a star system are expressed respect to the star in the centre of that star system? Where does this positions are converted in a unique reference system for rendering? Does we have multiple rendering steps in different scales? If so, how is managed the different scale between the rendering steps? I mean, if we have a star at 1 light year of distance from the camera and a planet at 1 kilometer from
the camera, why don't they seem in the same position (1 unit from camera in both cases)?

Thank you in advance for everyone will reply.
Bye


Return to “Development”