Celestia 1.3.2 for MacOS X

The place to discuss creating, porting and modifying Celestia's source code.
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #41by chris » 10.11.2004, 20:36

Excellent work on fixing bump mapping on the Mac OS X version Dirk! I'd like to incoporate your change as soon as possible. Could you send me the patches or changed files?

As Selden pointed out, the ring shadows on Saturn are not a bug.

--Chris

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #42by Cham » 10.11.2004, 21:18

dirkpitt wrote:I did a cvs checkout of Celestia yesterday and fixed the rainbow bumpmap problem on my machine. I have no idea if the rainbow issue is specific to the Mobility Radeon 9700 but I fixed it anyhow.

It turned out that the GL_EXT_texture_env_dot3 extension is not supported (on my system at least). This seemed ironic because GL_EXT_texture_env_dot3 is actually an ATI extension. The fix was to use GL_ARB_texture_env_dot3 instead.

I changed the ring shadow code a little too and Saturn now does not have the erroneous dark bands I reported earlier:
Before
After


PLEASE ! Can you tell HOW you made those change ?? I'm having HUGE troubles with my new ATI card, and I'm about to return it and ask for a complete refund ! :(
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Guest

Eros is Green!

Post #43by Guest » 11.11.2004, 01:31

First of all amazing work by everyone on Celestia, I was really happy when it ran under OS-X 10.3.5

But now under 10.3.6 the updates to OpenGL and ATI driver have messed up rendering of spacecraft etc to leave us with a very sick-looking Cassini with long tubes sticking out of it. And in this version of Celestia Eros is also green [PowerBook G4, ATI card].

:cry:

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #44by dirkpitt » 11.11.2004, 08:57

chris wrote:Excellent work on fixing bump mapping on the Mac OS X version Dirk! I'd like to incoporate your change as soon as possible. Could you send me the patches or changed files?

As Selden pointed out, the ring shadows on Saturn are not a bug.

--Chris


Chris, I sent you a mail with the modified render.cpp attached. I guess I was wrong about the ring shadows, so I changed that part back :D

I've actually almost finished an unofficial build, based on HankR's source in CVS, plus some other changes (most notably, nearly all preferences are saved now). If it is cool with HankR, I'd like to upload this (to sourceforge?) to let enterprising users test it out.

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #45by Cham » 11.11.2004, 14:46

dirkpitt,

I love you !! :D

Purr, purr, purr !
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #46by hank » 11.11.2004, 16:18

dirkpitt wrote:I've actually almost finished an unofficial build, based on HankR's source in CVS, plus some other changes (most notably, nearly all preferences are saved now). If it is cool with HankR, I'd like to upload this (to sourceforge?) to let enterprising users test it out.
Dirk,

Sounds great. Send me some email so we can coordinate.

- Hank

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #47by chris » 12.11.2004, 07:49

dirkpitt wrote:Chris, I sent you a mail with the modified render.cpp attached. I guess I was wrong about the ring shadows, so I changed that part back :D


Dirk,

I checked your DOT3 fixes into CVS already. Thanks again. I didn't get the GLSL #ifdefs in yet, though. It's too bad it's not yet supported on the Mac.

--Chris

Startyger
Posts: 39
Joined: 05.05.2002
With us: 22 years 6 months
Location: Hillside, New Jersey

Silently Waiting

Post #48by Startyger » 15.11.2004, 16:56

Don't think we're not out here... Just trying to be patient. Not naggy. I'm very appreciative for the efforts in compiling a Mac OSX version of Celestia. Yes, I'm looking forward to the day when the releases are parallel and quite equal. However, until then, i am patiently waiting on your much appreciated expertise.
"then He smiled at me...pa-rump-a-pum-pum..... me and my drum"

edelbrp
Posts: 4
Joined: 17.11.2004
With us: 20 years

Post #49by edelbrp » 17.11.2004, 03:10

I'm curious if anyone has taken a look at Apple's optimizations of Celestia using Shark? They used Celestia as a case study for performance optimization:

http://developer.apple.com/tools/sharkoptimize.html

I'm just beginning to play with it now. Optimizations (which you can switch on the fly while running Celestia) are:

    Baseline
    Limit Drawing
    Thread
    vForce cos
    Approx cos
    Unroll Cos
    Altivec
    Schedule
    G5


(labelled 'warp 1' through 9, respectively)

I couldn't find a reference to this on the forum, so I thought I would post it!


-Phil

alphap1us
Posts: 212
Joined: 17.12.2003
With us: 20 years 11 months
Location: Buenos Aires

Post #50by alphap1us » 17.11.2004, 04:28

Holy Crap!
It looks like the folks at Apple have built an optimized version of the app and posted it for anyone do download after registering. It's a lot bigger (31.8M) but it says that there are all kind of OS X optimizations built-in (including multi-threads!!) and the page that edelbrp linked to has instructions about how they performed those optimizations.

I can only hope that our nbole Mac deveopers will merge their files into the CVS so that we can have all these benefits together.

Cheers,
Joe

edelbrp
Posts: 4
Joined: 17.11.2004
With us: 20 years

Post #51by edelbrp » 17.11.2004, 05:10

I did a few tests tonight using Apple's source on my lowly G4 laptop, and here's what I get:

Baseline vs. 'Warp 8' (sadly I can't use the G5 optimizations in Warp 9), I get somewhere around 64 to 65 times the acceleration. It's hard because 'baseline' takes over 10 minutes (640+ seconds), and 'Warp 8' takes 10 seconds to get to the same point in the demo. Not the greatest to get a reasonable percentage number, but WOW. :')

Note: Be careful on making comparisons. Make sure things are cached, but don't let the demo have certain options 'stick' before doing a new time test, like displaying the universe (key U, which slows things down quite a bit). Also, the frame-rate display now shows a timing clock from demo start.

Props to Apple for helping to optimize Celestia! Shame to Apple for not working/communicating with the Celestia development group (if that's the case).


-Phil

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #52by hank » 17.11.2004, 06:29

edelbrp wrote:Props to Apple for helping to optimize Celestia! Shame to Apple for not working/communicating with the Celestia development group (if that's the case).

-Phil

I don't know a lot about it myself, but I believe we have had some contact with Apple about this. We are very excited about incorporating the Apple optimizations, but not sure how soon it will happen.

- Hank

Guest

Post #53by Guest » 17.11.2004, 18:49

hank wrote:I don't know a lot about it myself, but I believe we have had some contact with Apple about this. We are very excited about incorporating the Apple optimizations, but not sure how soon it will happen.


I was a little surprised that the optimized version was released for over a week without a mention of it here. ;')

Anyways, if I get some free time, maybe I can produce some patches to get the ball rolling. (Are patches the preferred method?)


-Phil

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #54by Cham » 17.11.2004, 18:55

Is there really a speed improvement over the actual 1.3.2 OS X made by Hank, from the version available at the Apple site ?

Anyone compiled and experimented the Apple version ? How is it ? Any comments ? I downloaded the files available from the Apple web site, but most of them are just code sources and standard textures. There's no compiled application available and I don't have a compiler.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

Post #55by Harry » 17.11.2004, 19:48

I find the Apple page a bit misleading - it sounds like they accelerated Celestia, but AFAICS the main optimizations were to enhance UI responsiveness (which is still a good thing). What does that benchmark do anyway? The speedup reported by edelbrp doesn't really make sense: it's certainly not rendering speedup :?:

I am sure some useful improvements have been made by the Apple guys, but this article sounds like marketing. Did they really need a profiler to find out that Celestia spends most of the time in draw()? Can somebody comment on what they really did in terms of performance enhancements?

Harald

edelbrp
Posts: 4
Joined: 17.11.2004
With us: 20 years

Post #56by edelbrp » 17.11.2004, 20:05

Cham wrote:Is there really a speed improvement over the actual 1.3.2 OS X made by Hank, from the version available at the Apple site ?

Anyone compiled and experimented the Apple version ? How is it ? Any comments ? I downloaded the files available from the Apple web site, but most of them are just code sources and standard textures. There's no compiled application available and I don't have a compiler.


Did you see my post above? On my G4 each minute of rendering was reduced to less than 10 seconds. The application is bit odd, though. It's been tinkered with to make it easier to bench. So, it basicly only does the Demo, and doesn't follow the timeline. (It renders as fast as it can.) So, with the optimizations on, the demo goes really fast. The FPS display has been replaced with a stop watch.

It's a modified version of 1.3.1, I think? Not sure how it fares against 1.3.2. Is this all just marketing hype? Possibly. :') I'm not claiming or defending anything, just reporting what I'm seeing.

For those interested, here's a built version of Apple's Celestia optimization demo:

http://secure.netroedge.com/~phil/apple-celestia.dmg

Remember, it's not really usable for much else other than benching. Those downloading this thinking they are getting a turbo-charged version of Celestia will be disappointed.


-Phil

Rich

I'm a lowly user trying to stay up-to-date....

Post #57by Rich » 17.11.2004, 20:46

Hi,
I've managed to become confused :?
Is the Apple-optimized version something a user like me should try to download and use, or should I wait to see how it all shakes out and download a user-version that you kindly folks direct me to in a post here...?

Thanks,
Rich

edelbrp
Posts: 4
Joined: 17.11.2004
With us: 20 years

Re: I'm a lowly user trying to stay up-to-date....

Post #58by edelbrp » 17.11.2004, 21:24

Rich wrote:Hi,
I've managed to become confused :?
Is the Apple-optimized version something a user like me should try to download and use, or should I wait to see how it all shakes out and download a user-version that you kindly folks direct me to in a post here...?


Sorry, I'm not explaining things well. :')

Don't download it if you want a usable app. The interface has been tailored for benchmarking. It's also a 40+ MB dmg I posted, so it's not an easy download anyway. (Don't crash my company's connection, please! ;')

While scarfing down lunch, I did some diff's against the stock 1.3.1 tree. Lots of differences, and mostly not from Apple. It looks like it might be a CVS snapshot that they've based their code on. (Do you guys change the version in CVS before or after a release?)

The good news is they've clearly marked the blocks where they've made their changes! Not too surprising since they want folks to download the source and see what the optimizations are.

Look through the files for "APPLE MODIFIED CODE BEGIN". I see 10 of those in these files: celestiacore.cpp, octree.cpp, render.cpp, selection.cpp, simulation.cpp, stardb.cpp, vsop87.cpp, and CelestiaController.m


-Phil

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #59by Cham » 17.11.2004, 22:14

I just tried the Apple demo. The window frame is the metal theme one (I hate this). The menu appears to be exactly the same as Celestia 1.3.1 and the about box (in the Finder) says it's 1.3.1. The CelestiaRessources folder lies INSIDE the app itself, not in the Library/applications support or elsewhere. I didn't saw any speed differences, as my system is already pretty fast and the ressources used in the Apple version are the basic (standard) textures.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #60by dirkpitt » 18.11.2004, 03:28

For me, the Celestia Apple demo runs significantly slower than Hank's build. I chose Warp 8.

I believe there is a combination of several reasons for this:
1) I do not have dual processors, so threaded animation actually slows things down
2) I have a G4, not a G5
3) I am not running Tiger
4) The demo is in fact deliberately slowed down in code when "Time Demo" is checked
5) The Apple optimizations do not actually cause much speedup

Reasons (4) and (5) require some elaboration. Looking at the code, when the "Time Demo" checkbox is checked the program reduces the time step to something like 0.002 seconds so that's like a x500 slowdown. I suspect that was done because if the program runs too fast then Shark (the Apple profiling tool) can sometimes drop samples.

As for (5), I "sharked" (ie., profiled using Shark) my own unofficial build of Celestia and it turns out that most (>10%) of the program's time is spent on OpenGL drawing functions, and about 5-6% on math (areas that Apple optimized). Sharking the Apple build (with the x500 slowdown code removed) does show some impressive 2x and 5x speed gains in math operations, but that totals out to only a 2-3% gain in overall program time.

What that means is Altivec and PowerPC assembly only made certain parts of the program faster, but those parts aren't really time-critical.

As for limiting drawing to 30fps, I'd have thought that would have made a big difference but apparently that optimization is already being performed somewhere in Quartz (at the OS level) so I see no difference.

Now obviously YMMV. I expect G5 users to see different results, and turning on/off Quartz Extreme probably makes a big difference too. Also, an interesting thing to try might be a huge star database (say, 1,000,000+ stars) so that the math optimizations can really shine. But honestly, as other users of the demo have pointed out, the stock Celestia is already pretty fast and the optimizations seem to offer little in terms of further improvement.

My system: PB G4 17" 1.33Ghz, 768M, Mobility Radeon 9700, OS X 10.3.6, Xcode Tools 1.5, Shark 4


Return to “Development”