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
Large scale renderization
-
Topic authorReginadelletempeste
- Posts: 2
- Joined: 06.11.2007
- With us: 17 years
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.
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
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/
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/
-
Topic authorReginadelletempeste
- Posts: 2
- Joined: 06.11.2007
- With us: 17 years
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
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