Well, here it is. After two days of getting the open source code from Linden Lab to compile under XCode, I’ve managed to raise up to Zen Linden’s challenge and compiled the WindLight First Look Viewer for my Mac.
Zen Linden hinted that the next version of the WindLight FL will be under development (based on the input from a tremendous number of users who tested it) “for a few weeks”. For those of you that can’t wait until Christmas or 2010 for a new version, I’ve compiled my own from the sources.
Compiling the Linden Lab source code is fun. Obviously, as you might have expected, this is not your regular download-click-on-a-button-it-compiles-fine-yay-install type of software. It’s way too complex for that. Although a whole lot of procedures are (thankfully!) automated, some things really have to be done manually (I’ve added as much documentation as possible on my own “challenge” on the Second Life Open Source Wiki, and I’m pretty sure most of it are basic things. Of course, when it comes into figuring out why the headers for the OpenGL helper modules for Nvidia cards do not compile correctly, I’m at a loss — I just commented out the C++-uncompliant code, and let the compile finish. With God knows how many billion lines the source code has, who knows how many bugs have suddenly popped in because of that 🙂
Reading LL’s source code is a pain, there are almost zero comments, and even with a “grand plan”, it’s hard to figure out what goes where. If you’re an open source code fanatic, used to extremely well documented code, you’ll be very disappointed. More recent bugs that have been figured out are commented here and there. The style, however, is fortunately pretty much consistent across most files, although one can notice a difference in style from the old veterans and the newer generation. It’s like reading the Bible in the original Hebraic/Aramaic, with all pages loose, and trying to figure out who wrote what, or in which sequence the books are supposed to be placed together. And no, you won’t see any comments like “Hey Andrew, found a bug here on Havok, please fix it — Philip, 20020112” or something like that. The younger programmers still leave comments like “HACK — Can’t figure out what parameters to pass on the constructor”. Uh-oh. Now we know why we’re missing items in inventory 😀
Jokes aside, it was fun seeing that at last this even managed to compile fine, and the number of “hacks” was really minimal: the major thing to deal with were missing files and a weird directory structure. The code, by itself, doesn’t give a single error when compiling (congrats LL!). It takes close to two hours of compiling, though, which has been very likely the slowest compilation in my live (I guess I’m used to “simple” things like MySQL databases, Apache webservers, and about half a thousand hand-compiled utilities that is part of my job as an IT consultant to compile when installing FreeBSD servers for customers — it usually takes two hours to compile them all together). But it works. Hooray 🙂
I was half expecting nothing to work either. And indeed, I got a crash-on-login! Then I remembered that I usually clean the cache every time I install a new version of SL. I did that and… logged in flawlessly with the home-brewn compiled version of SL… without a glitch! And after 5 hours online without a single crash, I think I beat some world record or something 🙂
Now the bad news.
The open source version of Second Life uses a proprietary, closed-source, and no-distributable commercial JPEG2000 decoding library. It is ultrafast, and this is very likely the major reason why LL still bundles it with their own in-house-compiled SL viewer. For us mortals, it means using a regular open source library, which has perhaps a third of the performance or worse. This means that the home-brewn variety of Second Life is painfully slow. On my reference sim, where I’ve got 30 fps with my iMac (2 GHz Intel Core 2 Duo, 1 GB RAM, ATI Radeon X1600), I had about 15 fps under LL’s own WindLight First Look Viewer, and… only 5-7 fps under the open source version. It’s pretty much unusable, except, obviously, if you really, really wish to take a picture using the WindLight weather system and “forgot” to take it when LL’s own WindLight FL client still connected to the main grid — and can’t afford to wait until Christmas or so for the next release (LL will be too busy with the voice FL client now).
The second bad thing I immediately noticed was that the eyes didn’t render! I don’t know why this is happening. I suspect that something weird is going on with the way WindLight interferes with the eyes “glowing”. Full-bright also seems to be exaggerated. These quirks were visible on the “regular”, official WindLight FL client, but they’re far worse on the open source client, and having “blind avatars” is also not fun 🙂
Sadly, I can’t afford to pay Amazon S3 to host files there (I have an account, though!…), so, unlike LL, the downloads here will be painfully slow. To cut the size of the download, I did two things: first, strip out the debugging code from the executable (I wonder why LL doesn’t do the same on the Deployment version, it saves you 25 MBytes of precious RAM — perhaps it’s used in some way by the CrashReporter or something). Secondly, I’ve just managed to get the Intel version compiling correctly for some reason. Sorry — I’ve also got an old PowerBook G4 pretty much able to run SL, but really, 0.5 FPS with this home-brewn version is really not worth the effort 🙂 Although I imagine that the latest batch of G5 Macs might be able to run it with a handful of FPS; so if you pester me for it, I might be able to compile a PowerPPC version as well, if it’s worth the trouble.
(And don’t ask for the Windows/Linux version; even if I had a working development environment under Windows/Linux, I have no time to figure out how the compile works under those environments. I’m sure some nice open source enthusiast might already have placed a copy of their own compiled versions online somewhere for you to download)
Thirdly, don’t complain if this doesn’t work for you. This compiled build of SL is provided “as-is”. If it works for you, fine. If it crashes, I don’t have the slightest idea why. If you lose all your money and your inventory, and LL says that they can’t do anything about it because you’ve been using a non-supported compiled version of SL, it’s your bad luck. I can’t help you either.
It was fun compiling it a a “proof of concept”, but that’s all there is to it 🙂
Enjoy… or not, if you’re too used to the superfast “regular” viewer…