Page 1 of 4

Stars far from home

Posted: 12.03.2008, 20:40
by chris
Here's a view from a hypothetical planet at the edge of the Large Magellanic Cloud:

Image

This is all possible because of patch that eliminates the 16k light year distance limit for stars. So far, it's working without problems.

--Chris

Posted: 12.03.2008, 20:55
by t00fri
Not bad ;-)

What's the secret?

F.

Posted: 12.03.2008, 21:03
by ElChristou
Nice!

Posted: 12.03.2008, 21:06
by chris
t00fri wrote:Not bad ;-)

What's the secret?

F.


A surprisingly simple patch that I'm going to upload very soon. I realized that we can lift the limitation on star distance without actually changing the star octree structure. The only thing we need to do is calculate the difference between the observer position and the star at high precision, and everything works fine.

However, I think that we'll still want to eventually move to the scheme I mentioned in another thread in which star positions are stored as offsets from the octree node center. With my patch, star placement has an angular precision of about 1/10 of an arcsecond (as seen from Earth.) This is adequate for observationally derived data, but if you wanted to create a distant globular cluster, stars would end up getting stacked on top of each other because of the limited precision.

--Chris

Posted: 12.03.2008, 21:12
by t00fri
chris wrote:
t00fri wrote:Not bad ;-)

What's the secret?

F.

A surprisingly simple patch that I'm going to upload very soon. I realized that we can lift the limitation on star distance without actually changing the star octree structure. The only thing we need to do is calculate the difference between the observer position and the star at high precision, and everything works fine.

...indeed... What about an observer on Earth? Is that distance calculated in double?

However, I think that we'll still want to eventually move to the scheme I mentioned in another thread in which star positions are stored as offsets from the octree node center. With my patch, star placement has an angular precision of about 1/10 of an arcsecond (as seen from Earth.) This is adequate for observationally derived data, but if you wanted to create a distant globular cluster, stars would end up getting stacked on top of each other because of the limited precision.

--Chris


right.

anyway, looks VERY promising.

F.

Posted: 12.03.2008, 21:36
by chris
t00fri wrote:
chris wrote:
t00fri wrote:Not bad ;-)

What's the secret?

F.

A surprisingly simple patch that I'm going to upload very soon. I realized that we can lift the limitation on star distance without actually changing the star octree structure. The only thing we need to do is calculate the difference between the observer position and the star at high precision, and everything works fine.

...indeed... What about an observer on Earth? Is that distance calculated in double?

If a rough distance estimate determines that a star is within one light year of the observer, the observer position relative to that star is calculated using high-precision 128-bit fixed point math. Then, the relative position is reduced to double precision, which is used for almost all calculations within a solar system.

The patch affects just the stars that are further than one light from the observer. In the SVN code, the path for rendering these stars was strictly single precision. With the patch, a double precision subtraction is used to generate single precision viewer centered coordinates. This is the same trick employed throughout Celestia: calculate differences at high precision to produce single precision viewer relative coordinates.

t00fri wrote:
However, I think that we'll still want to eventually move to the scheme I mentioned in another thread in which star positions are stored as offsets from the octree node center. With my patch, star placement has an angular precision of about 1/10 of an arcsecond (as seen from Earth.) This is adequate for observationally derived data, but if you wanted to create a distant globular cluster, stars would end up getting stacked on top of each other because of the limited precision.

--Chris

right.

anyway, looks VERY promising.


Thanks! Now we need to find some data to exploit this new capability ;)

--Chris

Posted: 12.03.2008, 21:44
by t00fri
chris wrote:Thanks! Now we need to find some data to exploit this new capability ;)

--Chris


Chris,

don't you remember? We got quite a few:
here is my respective thread...

http://www.celestiaproject.net/forum/viewtopic.php?t=10921

F.

Posted: 12.03.2008, 22:09
by selden
And don't forget that the pulsar addons define stars that are far beyond the 16K limit. Previously they were only viewable by Marking their positions.

Posted: 12.03.2008, 22:13
by chris
t00fri wrote:
chris wrote:Thanks! Now we need to find some data to exploit this new capability ;)

--Chris

Chris,

don't you remember? We got quite a few:
here is my respective thread...

http://www.celestiaproject.net/forum/viewtopic.php?t=10921


I had forgotten. These eclipsing binary systems would indeed be interesting to see!

Here is the patch:

http://www.celestiaproject.net/~claurel/celest ... star.patch

The base octree node size is still only 1.5M ly (it's set in stardb.cpp). This is an arbitrary limit; you should be able to make it much larger, though some performance profiling is required before I'm willing to set the limit as large as the visible universe.

The patch is unfortunately not 'clean' . . . It's mixed in with some code reorganization, which currently has some side effects for orbit rendering with antialiased lines. This has nothing to do with the star rendering changes, and I will certainly not commit in this combined patch.

--Chris

Posted: 12.03.2008, 22:54
by selden
Applying the patch and recompiling was relatively painless ;)

Unfortunately, it's not so easy to go to one of the distant pulsars. They're quite dim, so even at maximum magnification and magnitude threshold they can't be seen to be selected. I had hoped that they might be visible after turning off galaxy rendering, but they're not.

Posted: 12.03.2008, 23:12
by chris
Here's the stc file for the system pictured in the first post of the thread:

Code: Select all

"Far from home"
{
        RA 82.0
        Dec -70
        Distance 140000
        SpectralType "K3V"
        AbsMag 5.4
}


...and the ssc file with the planet:

Code: Select all

"b" "Far from home"
{
        Texture "mercury.*"
        Radius 3440

        EllipticalOrbit {
        Period            0.2408
        SemiMajorAxis     0.3871
        Eccentricity      0.1056
        Inclination       7.0049
        AscendingNode    48.33167
        LongOfPericenter 77.456
        MeanLongitude   252.251
        }

        Albedo            0.06
}


--Chris

Posted: 14.03.2008, 23:02
by chris
The star distance patch is now in SVN, revision 4198. The distance limit is currently set to 10 million light years. I chose this size because it's large enough to contain the Local Group, but with more testing, it should be possible to further increase the distance limit by simply adjusting the STAR_OCTREE_ROOT_SIZE constant in stardb.cpp.

--Chris

Posted: 16.03.2008, 05:53
by Chuft-Captain
Good stuff! :)

I will test this with the CORE stars when the next pre-release is delivered.

Just a question about the Magnitude Limit:
It maxes out at about +15, so I assume that it's based on the apparent magnitude from the observer's position, rather than as viewed from Earth.
(ie. Most main-sequence stars at the core of the galaxy for example have AppMags in the range +15 - +30 as viewed from Earth).

CC

Posted: 16.03.2008, 20:14
by chris
Chuft-Captain wrote:Good stuff! :)

I will test this with the CORE stars when the next pre-release is delivered.

Just a question about the Magnitude Limit:
It maxes out at about +15, so I assume that it's based on the apparent magnitude from the observer's position, rather than as viewed from Earth.
(ie. Most main-sequence stars at the core of the galaxy for example have AppMags in the range +15 - +30 as viewed from Earth).



Yes, that's correct. The core stars will be visible to an observer close to the core.

--Chris

Posted: 16.03.2008, 23:41
by selden
chris wrote:Yes, that's correct. The core stars will be visible to an observer close to the core.

--Chris


It'd be really nice if they were observable from the Earth, i.e. if one could specify a much greater magnitude limit.

Posted: 17.03.2008, 05:54
by Spaceman
What 8O ? It?€™s now possible to put stars farther than 16.000 light years 8O ? Great :D :D !!
I open the link with the patch. What next? Downloading with the Notebook as a .data? :?

Posted: 17.03.2008, 11:16
by selden
At the moment you have to compile Celestia from source code to be able to use this feature.
I suspect it won't be available in packaged format until v1.6.0. (It looks like v1.5.1 will be strictly limited-impact bug fixes.)

Maybe someone can be persuaded to make Celestia development binaries available on a regular basis?

Posted: 17.03.2008, 13:00
by cartrite
selden wrote:
Maybe someone can be persuaded to make Celestia development binaries available on a regular basis?

Will an executable do? I can keep an ongoing updated executable that can replace the original from 1.5.0. If and when my website is accessible that is. It seems to be going down a lot again.
cartrite

Posted: 17.03.2008, 15:32
by BobHegwood
cartrite wrote:
Will an executable do? I can keep an ongoing updated executable that can replace the original from 1.5.0. If and when my website is accessible that is. It seems to be going down a lot again.
cartrite


That would be a GREAT idea for those of us too lazy (or dumb) to
compile the things. Would be much appreciated here my friend.

Thanks, Bob

Posted: 18.03.2008, 14:26
by Hungry4info
BobHegwood wrote:That would be a GREAT idea for those of us too lazy (or dumb) to compile the things.
I fall into the "Too Dumb" category. I know nothing about compiling Celestia. But if anyone is willing to write out how, I'll certainly give it a try.