Celestia 1.3.2 for MacOS X

The place to discuss creating, porting and modifying Celestia's source code.
Guest

Post #61by Guest » 18.11.2004, 05:15

dirkpitt wrote: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


Yeah, there's some funny stuff happening there in Apple's code. They've purposely made it crunch harder. I think they did that to make it easier and more obvious to bench(?). The proof is in the pudding, so to speak. I think we'll only really know once the optimizations are applied to a clean tree.

I'm starting clean with a fresh 1.3.2 code-base. I'm using Apple's macosx directory which has hooks for the frameworks and libs because it's the only one I have available (it shouldn't matter much, I hope).

BTW- do a search for 'warp' and you can see what gets enabled for each 'warp' setting:

Code: Select all

#define WARP1   gLimitDrawing=0; gThread=0; gApproxCos=0; gUnrollCos=0; gVForce=0; gAltivec=0; gSchedule=0; gG5=0
#define WARP2   gLimitDrawing=1; gThread=0; gApproxCos=0; gUnrollCos=0; gVForce=0; gAltivec=0; gSchedule=0; gG5=0
#define WARP3   gLimitDrawing=1; gThread=1; gApproxCos=0; gUnrollCos=0; gVForce=0; gAltivec=0; gSchedule=0; gG5=0
#define WARP4   gLimitDrawing=1; gThread=1; gApproxCos=0; gUnrollCos=0; gVForce=1; gAltivec=0; gSchedule=0; gG5=0
#define WARP5   gLimitDrawing=1; gThread=1; gApproxCos=1; gUnrollCos=0; gVForce=0; gAltivec=0; gSchedule=0; gG5=0
#define WARP6   gLimitDrawing=1; gThread=1; gApproxCos=0; gUnrollCos=1; gVForce=0; gAltivec=0; gSchedule=0; gG5=0
#define WARP7   gLimitDrawing=1; gThread=1; gApproxCos=0; gUnrollCos=1; gVForce=0; gAltivec=1; gSchedule=0; gG5=0
#define WARP8   gLimitDrawing=1; gThread=1; gApproxCos=0; gUnrollCos=1; gVForce=0; gAltivec=1; gSchedule=1; gG5=0
#define WARP9   gLimitDrawing=1; gThread=1; gApproxCos=0; gUnrollCos=1; gVForce=0; gAltivec=1; gSchedule=1; gG5=1


These variables are used to switch between different functions (Apple's vs. stock).

Options are disabled depending on the environment:

Code: Select all

   if(item==[optimizationButton itemWithTitle:@"Warp 3 - Thread"]) {
      return (HasMultipleProcessors());
   }   
   if(item==[optimizationButton itemWithTitle:@"Warp 4 - vForce Cos"]) {
      return (IsTigerOrBetter());
   }   
   if(item==[optimizationButton itemWithTitle:@"Warp 7 - AltiVec"]) {
      return IsAltiVecAvailable();
   }
   if(item==[optimizationButton itemWithTitle:@"Warp 8 - Scheduling"]) {
      return IsAltiVecAvailable();
   }
   if(item==[optimizationButton itemWithTitle:@"Warp 9 - G5"]) {
      return IsAltiVecAvailable() && Is64Bit();
   }



There are also general optimizations, like a structure change in star.h (I'm assuming this came from Apple. I didn't see it in 1.3.2.):

Code: Select all

private:
    // SKP - use a union to overlay a vector over
    // the scalar position and magnitude variables
    union {
   float f[4];
   vector float v;
    } posMag;
    uint32 catalogNumbers[CatalogCount];
//    Point3f position;
//    float absMag;


I've done just this change against 1.3.2 and it increased the FPS from 29 to 32 when looking at the Earth. (You also have to change where position and absMag are used to use the union instead, of course, or else it won't compile. I copied Apple's example.) I get about 27 with Hanks build, which is close to stock.

I'll continue to move over some of the other optimizations to see what they do.


-Phil

Guest

cel urls in Word

Post #62by Guest » 18.11.2004, 07:04

How can I get Microsoft Word to associate cel url calls to Celestia 1.3.2 in OS X. Each time I try to open a cel:// hyperlink in Word I get "The address of this site is not valid. Check the address and try again."

Thanks

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

Post #63by hank » 18.11.2004, 07:18

Performance comparisons are always tricky. I've experimented a little with a few of Apple's code changes and so far I haven't seen a significant performance improvement in my environment. But certainly this is something we should continue to look at.

- Hank

Matt McIrvin
Posts: 312
Joined: 04.03.2002
With us: 22 years 8 months

Re: cel urls in Word

Post #64by Matt McIrvin » 06.12.2004, 05:20

Guest wrote:How can I get Microsoft Word to associate cel url calls to Celestia 1.3.2 in OS X. Each time I try to open a cel:// hyperlink in Word I get "The address of this site is not valid. Check the address and try again."


Last I heard, there's still no way to use the Mac version of Celestia as a URL opener for links (someone please correct me if I missed something). However, you can drag and drop cel:// URLs onto the Celestia window, and it should be able to handle them that way.

Adreitz

Bump mapping fix

Post #65by Adreitz » 07.12.2004, 02:36

Is there any way someone could post a completed build with the new bump mapping fixes? I've never been very good at building apps myself, and thinking of dealing with CVS makes me feel sick. :P Thanks a lot for fixing this, by the way! It was one of my major gripes with Celestia. (I just hope it works with my Radeon 8500.)

Aaron

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

Re: Bump mapping fix

Post #66by dirkpitt » 07.12.2004, 09:02

Adreitz wrote:Is there any way someone could post a completed build with the new bump mapping fixes?


It's my understanding that Hank is a bit busy, and he's working on integrating his own fixes but we can expect a build soon. :D

Adreitz

Re: Bump mapping fix

Post #67by Adreitz » 08.12.2004, 04:58

dirkpitt wrote:
Adreitz wrote:Is there any way someone could post a completed build with the new bump mapping fixes?

It's my understanding that Hank is a bit busy, and he's working on integrating his own fixes but we can expect a build soon. :D


W00t!! Specular maps look great just by themselves, but with bump mapping the planets will look AWESOME.

Aaron

HarrieS

Post #68by HarrieS » 08.12.2004, 22:09

Hank, Chris, would it be possible to post a stable source tree for version 1.32 (or more recent) in the form of a disk image?

The CVS appears to be considerably out of date, even for version 1.31, see e.g. 3dsmesh.h. The most recent file in the macosx branch is from February.

I managed to get Celestia to build, based on the version 1.32 version of the CVS, but it needed considerable tweaking and the result is almost certainly not even close to the official version.

A disk image would also let more people tinker with the code, as not everybody is comfortable with the CVS system.

If it would help, I still have one system running Project Builder instead of XCode, so I could assist in cleaning up the project file, if necessary.

I hope I'm not imposing to much, I understand that these are busy days dor everybody,

Harrie S

P.S. I'm glad the forum is back online!

Adreitz

Quick question

Post #69by Adreitz » 10.12.2004, 07:01

Hey, guys. I haven't really looked around this forum much, but I just wanted to ask a question about a strange problem I've been seeing with Celestia 1.3.2 for OS X. Specifically, Celestia will refuse to load certain 4k textures, even though they are named correctly and everything. This seems to happen most often for asteroids, because I have a 4k Jupiter texture, a 4k Europa spec map, and a 4k Mercury texture that all work fine (though the Jupiter texture is slow to load and render). Has anyone else seen this? Anyone know what's going on? Is this just a limitation of my hardware or a bug in the program? If I go to one of these asteroids (I've tried to add most of the add-on textures from Celestia Motherload) at low res or medium res, it shows the corresponding texture (or just medium res if there is no low res texture). If I then switch to high res, Celestia beachballs for a few seconds, flashes the new texture and then shows the mesh as white or colored (depending on the object settings). I've got a Quicksilver 867 with a Radeon 8500 running 10.3.6. Thanks!

Aaron

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

Post #70by Cham » 10.12.2004, 07:07

That's just your video card. 4k textures are a lot of data for a 8500.
"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!"

Adreitz

4k textures

Post #71by Adreitz » 10.12.2004, 15:06

Hey, thanks for the reply. If this is true, I was just wondering why 4k textures work on some objects and not others. And I believe I've tried 8k textures before with success, though I'm not using any at the moment. The 64k VT Jestr's Earth Mark II works fine, though obviously the whole thing isn't loaded into memory at the same time.

Aaron

Matt McIrvin
Posts: 312
Joined: 04.03.2002
With us: 22 years 8 months

Post #72by Matt McIrvin » 10.12.2004, 15:32

There's a weird, persistent bug, seen by many people (with both ATI and NVIDIA cards, if I recall correctly), when running Mac Celestia with textures that are close to filling up the video card's memory: planetary textures appear blank or scrambled, and sometimes bits of the system desktop seem to be mapped to parts of the planet's surface! This last phenomenon strongly suggests that it's not a Celestia bug, but a buggy interaction between the video drivers and Apple's Quartz Extreme system for accelerating GUI interactions through the 3D hardware. It's been there ever since Quartz Extreme showed up a few Mac OS X versions ago.

In my experience, it only happens with textures that are loaded into the video card all at once (JPGs and PNGs, for instance). .DDS textures do not exhibit the problem, as far as I can tell, and you seem to have discovered that VTs don't either (though I haven't done any experiments with them). To me that seems to be further evidence that this is a result of pushing the video card's memory to the limit.

I'm on thin speculative ice here, but it looks as if Apple's Quartz Extreme code has a bug in the handling of error conditions in which the 3D card runs out of video RAM, such that it sometimes intrudes on normal use of the 3D hardware.

So that is a workaround: use only VTs or DDSs if you want a high-resolution texture. They're better anyway.

Adreitz

Post #73by Adreitz » 10.12.2004, 17:01

Hmm. Interesting. I haven't seen textures get messed up at all — just blank textures. Still, this may fit the bill.

As for DDS's...what's so great about them? I don't really like them too much — they only compress to about half- or quarter-size files and they do horrendous things to the colors in images (posterization, green casts, blocky artifacts, etc.). Does OpenGL actually handle them differently from other image types? Thanks for the info!

Aaron

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

Post #74by selden » 10.12.2004, 17:12

In most cases, DDS texture files are loaded directly into the graphics hardware and are decompressed on the fly as the screen is drawn. They don't have to be decompressed in advance by the PC's CPU as JPEG and PNG images do.

Some DDS file formats (e.g. DXT5) can include "mipmaps", versions of the surface texture image at several levels of resolution. This feature can be used to minimize the jaggies and posterization caused by hardware scaling.

There are many different DDS data formats. Some include no compression at all.

Of course, these advanced features have to be implemented by the person creating the DDS texture file.
Selden

rjcraig
Posts: 26
Joined: 09.03.2004
With us: 20 years 8 months
Location: Iwaki, Japan

3ds models in 1.3.2; dmg version of latest src?

Post #75by rjcraig » 17.12.2004, 16:34

I've gone through this thread and the included ChangeLog but haven't found any mention of this: Was there some change in the way the application renders 3ds models between 1.3.1 and 1.3.2?

The reason I ask is that several models which I built and used in 1.3.1 refuse to display now in 1.3.2. A new test model I made today also doesn't render. (All work as expected in 1.3.1.) All things being equal on this end...the reason must be on that. In the app, I mean.

Also, I know this has been raised previously, but would it be possible to get a copy of the latest version of the Mac OSX source by some means other than the SF CVS? I checked this out again the other night and get the same errors (not warnings, errors) as the last time I tried.

In the current version, Info.plist is missing; in the Xcode project, the utf8 and celx references are still to files in the directory of user bob (Bob Ippolito, I presume :) ), so it's necessary to delete the current refs and readd the files. Then there are these:

/Users/roncraig/celestia/src/celengine/3dsmesh.cpp:90: error: `Normals' undeclared (first use this function)
/Users/roncraig/celestia/src/celengine/3dsmesh.cpp:90: error: (Each undeclared identifier is reported only once for each function it appears in.)
/Users/roncraig/celestia/src/celengine/3dsmesh.cpp:90: error: `Colors' undeclared (first use this function)
/Users/roncraig/celestia/src/celengine/3dsmesh.cpp:109: error: `Multipass' undeclared (first use this function)
/Users/roncraig/celestia/src/celengine/3dsmesh.cpp:113: error: `VertexProgParams' undeclared (first use this function)

And lots more. So if the MacOSX branch in CVS isn't going to be kept current, could some other distribution channel be made available? (I have room on my iDisk, for example....)

-----
Machine showing model problem (haven't tried on the others yet):
PBG4, 10.3.3, 1GHz PPC G4, 1MB L3 cache, 1GM SDRAM, ATI 64MB VRAM
Models built using Cheetah3D 1.0 & 2.0 (today)

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

Post #76by selden » 17.12.2004, 16:55

rjcraig,

Please provide screenshots so Chris can see the symptoms you are seeing. A zip file would be even more helpful, if it contains just the minimal models and catalogs that are needed to reproduce the problems. That would make it easier for Chris to fix them.

There were major changes in 1.3.2's model rendering. Some of them were to add support for Celestia's new proprietary CMOD model format.

Also, a bug was introduced in the viewport clipping algorithm while trying to improve it. This bug causes some objects to be clipped within the viewable volume. In other words, holes are cut in objects that are "too near" the viewpoint. Unfortunately, the amount of clipping seems to vary from one model of graphics card to another.

There also were some major performance improvements (more than 2x for complex models) which introduced bugs in how transparent areas are drawn. Most, but apparently not all, of those bugs were fixed before the final release of 1.3.2.
Selden

rjcraig
Posts: 26
Joined: 09.03.2004
With us: 20 years 8 months
Location: Iwaki, Japan

Post in haste...

Post #77by rjcraig » 17.12.2004, 17:52

Repent at leisure, right? :?

Selden,

Thanks for the quick response.

After posting my message I decided to fire up Celestia again and discovered that one of my models was now visible, albeit with some of the textures missing...?!? I was just starting to look into this when notice of your reply came in. I'll check out the others and get back to you. (If it isn't some snafu on my part, I'll make screenshots, zip the models and textures and upload them to my iDisk and post the links here, per your suggestion.)

(Also, I forgot to mention that even when the models weren't rendering, if I moved sufficiently far away from the object, a white dot would appear, indicating light reflecting off it.)

I've seen mention of CMOD but haven't looked into it yet; I assuming there will be utilities to convert 3ds and other formats over?

Re the Mac source: I realize that everything is being done in C++ to maintain cross-platform compatibility, but I was wondering if anyone has thought of doing a rewrite in Obj-C? I have only a passing familiarity with C++; is there anything in the code that you know of that requires it be written in it?

Finally, about Preferences: I can't understand how the app is referring to them. Before launching Celestia I edited the preferences plist but still had to open the prefs panel and turn atmospheres on, set stars to points, etc. But there were some other things that had changed...I'm assuming as a result of my edit. Curiouser and curiouser....

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

Post #78by selden » 17.12.2004, 18:03

rjcraig,

Sorry: I can't help with your Mac specific questions. Maybe HankR can comment.

However, another cause of similar problems is having more Addons installed than will fit into your graphics card.

When an object comes into view, Celestia loads its models and textures into your graphics card. While Celestia is running, the models and textures that it has loaded stay in the card's memory. When it's full, strange drawing errors start happening when Celestia tries to load a new object. Celestia does not really have any memory overflow error recovery and does not try to delete "old" models and textures to make room for new ones.
Selden

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

Post #79by selden » 17.12.2004, 18:18

Sorry: I didn't answer a few of your questions that aren't Mac specific.

White dots are drawn when an object is too far away for its model to be rendered. You'll see them whether or not the associated models are usable.

There are conversion utilities for 3DS to CMOD and between ASCII CMOD and Binary CMOD formats. Their source code is on SourceForge. I seem to recall a post from someone who's providing binaries for Macs, but I don't recall the details.

I know nothing about Objective-C. Celestia is a rather large program. If someone translates it, they'd have to commit to maintaining their version. Chris does almost all of Celestia's software development under Windows. Other people in the developer crew provide the platform-specific code for other types of systems.

I know less than nothing about how preferences are maintained under MacOS, so I can't help with that at all.
Selden

rjcraig
Posts: 26
Joined: 09.03.2004
With us: 20 years 8 months
Location: Iwaki, Japan

Thanks!

Post #80by rjcraig » 17.12.2004, 18:35

Selden,

I knew HankR is the main MacOS developer, but wasn't sure what you know about Macs.

I don't think excessive AddOns are the problem at this point, since at the moment I have only three of my models in the resources (I removed the others), and they're not overly large or involved and use only one or two textures each, most shared; I never had problems like you mention in 1.3.1, even with everything loaded.

I realize an Obj-C version would be a major undertaking, one I'm not able to commit to at present, even without the linguistic handicap. Maybe someday. :wink:

Thanks again!


Return to “Development”