The Source for Java Technology Collaboration
User: Password:



Chris Campbell's Blog

Games Archives


And This One Is Better Than Ever!

Posted by campbell on September 18, 2003 at 05:08 PM | Permalink | Comments (7)

Do not expect any order or rhyme or reason for the content that follows. I've been away from the blogging game for several weeks, so I have a lot of random thoughts waiting to jump out of my dome (in typical fashion, none of them are well formed). Chet and Hans have been cranking out new blogs left and right, so I feel compelled to keep up with my end-of-the-hall-mates.

On the new OpenGL-based Java 2D pipeline: Work on this exciting new pipeline doth proceed apace. We've been making some excellent performance improvements over the past few days, and we're working with video board manufacturers to increase reliability, compatibility, and performance. I think desktop developers should be pleasantly surprised with the improvements offered by this pipeline, and I look forward to your feedback when 1.5 beta ships in a few months.

This new pipeline has been getting some publicity on various forums like Java Gaming and JavaLobby in recent weeks (check out those threads for some more detailed information; the JL thread was interesting until it devolved into a discussion on open sourcing Java, which seems to be par for the course). Now might be a good time to answer some frequently asked questions regarding the new OGL pipeline:

Q: You suck. Why isn't this pipeline being developed for Windows too (Sun is evil)? Why aren't you using a shared code base? Is it because you're dumb?
A: I'm rubber, you're glue... But seriously, we would very much like to offer this pipeline as an alternate implementation on Windows, but it won't make it in for 1.5... Hopefully we'll enable it in a future release, because it could really open some doors for interoperability with JOGL, and various other factors. The reality is that we have hundreds of video boards and driver combinations to support on Windows, and our effort is best concentrated right now on making our DirectX pipeline even more stable and performant. Driver flakiness is a big concern (just ask Chet and Dmitri!), so making sure that the OGL pipeline works on all Windows configurations will be a challenging task. We'd rather concentrate right now on making the OGL pipeline rock on Linux and Solaris, where graphics acceleration has traditionally been more dismal. (And yes, we do have a shared code base, with small platform-dependent modules to support GLX and WGL. It's a nice streamlined design, in my obviously biased opinion.)

Q: Why aren't you making use of UMD's Agile2D project? Is it because Sun sucks and hates open source software?
A: Agile2D is another interesting project out of UMD, but the downside is that it sits outside the guts of Java 2D and Swing, so you have to "port" your application to use Agile2D. Writing the OGL pipeline from the ground up allowed for much tighter integration with Java 2D internals, so you reap all sorts of benefits like using texture memory for caching glyphs and "managed images", in addition to all the performance gains reported by the Agile2D guys. If you tried out Agile2D, you should get all the same benefits and many more just by using core Java 2D and Swing in 1.5...

On the new "Sun Java Desktop System" branding strategy: Okay, so this one is taking a while to sink in, I'll admit. Some folks on JavaLobby are complaining that Java doesn't play a large enough role to warrant the name. Granted, a majority of the apps are not written in Java, but the biggies like Mozilla and StarOffice surely are Java-enabled. The important thing to keep in mind is that this is just the first release; prepare to see many more pure Java apps added to the package as time marches on.

I'm glad that the name doesn't mention the word Linux or Solaris... There's no reason for it. We're at an important cusp in the software world where the underlying OS has become irrelevant. Application developers and end-users alike no longer care what operating system they're using (yes, yes, gross generalization) as long as it runs their favorite cross-platform apps that help them get their job done, whether they are written in Java (NetBeans, Limewire) or not-Java (Mozilla, Evolution). If Sun decided tomorrow to base the Java Desktop System on OS/2 or FreeBSD or whatever, it wouldn't make a lick of difference to end-users (gross generalizations are fun). This general trend in the industry towards platform-agnosticism is really cool, and it's only going to accelerate.

On the state of the "Mu" project: I haven't had much time for Mu this summer, but that hasn't stopped others like Mr. Rob Ross from adding cool new features, like video playback. I made some minor enhancements to the "lite" client to improve ease-of-use (i.e. act more like iTunes), but those haven't yet been committed to CVS. Soon we'll be ripping out some of the internals and replacing them with an exciting new media content/metadata system about which I've been conversing with the Gas/JRec/Ptarmigan author. There's also talk about adding new pure Java codecs, live TV viewing, TV listings, and even some video conferencing functionality. Hopefully we'll make some more progress this autumn... Help from interested parties is always appreciated!

On Giants/A's playoff tickets: Should I stay or should I go? I could stay here and get some work done, or I could go sit in line at the ballpark with the rest of San Francisco. It's a beautiful day in the city, but I wonder if they have wireless down there? Better yet, I could bribe my sickly roommate into sitting outside all night for tickets. Yes, that sounds like a fantastic idea to me (hint hint nudge nudge)...

On Maven: I still haven't had a chance to play with Maven yet (beyond the few articles I've read), but it sure seems cool. Anything to eliminate the drudgery of build/doc/test systems is fine with me. And I used to think Ant was high-level...

On the genius of Bob Pollard: November 4th brings us a definitive box set from legendary lo-fi drunk-rockers Guided By Voices, entitled "Hardcore UFOs". Whenever I drop money on GbV, I come closer to understanding how crack addicts feel when they make their purchase -- 2% guilt and 98% elation. How can you not admire song titles like "I Invented The Moonwalk (And The Pencil Sharpener)"? The energetic, start-stop, repetitive-F-chord mania that is "Postal Blowfish"? The buzzing-guitar-string simplicity and effortless crooning of "Goldheart Mountaintop Queen Directory"?

On the virtues of vacationing (or "how to boost your debugging effectiveness"): This was a great summer. I took various long breaks (well, a few days at a time) away from work to visit with nature, friends, and family. My personal rule number one on these trips was "do not under any circumstances think about work", and then a funny thing happened. I'd be sweating my way up Half Dome or just plain sweating on a beach somewhere, and then I'd have a vision. No, it wasn't Yeti (what an odd assumption on your part)... It was the design flaw that's been nagging me for months, but this time it came with a solution. It's that old psychological notion of receiving inspiration when you least expect it. So there you go, next time you're working on some tough project, tell your boss you'll be taking a few days off to work-but-not-really on that important project.

On a related note, I was just reading James Gosling's latest blog entry about trusting (or better put, not trusting) yourself when debugging. I do this to myself all the time, and I never seem to learn my lesson. Just yesterday I was reading an old email I sent about the OGL pipeline, where I said something to the effect of "Q doesn't work even though I know that we're definitely doing Z, which should enable Q". So for months I built up this notion that the bug couldn't possibly be related to Z. And then what happens? I go revisit Z to discover a subtle flaw that had been there all along, and now of course when I fixed the bug in Z, Q is working just as I had always expected! Damnation! I could smite myself! (In fact, I just did that just to add a little drama...) Moral of the story? Don't trust yourself, but do listen to James, he's a smart guy.

On the coolness of iPods and iSights: I broke down and bought one of each, after hemming and hawing for months. The iSight is great, and the ease of iChat is unparalleled. Yet it just kills me that I'm able to video/voice chat with all of two people (Mac owners of course). So, good for Apple, they'll convince a couple more percent of the earth to buy their machines, and meanwhile everyone else (Windows/Linux users) is missing out on a fantastic hardware/software solution. Everytime a company ties people into a specific OS with some custom built application, the industry takes one step backwards. Argh like Charlie Brown.

I haven't yet received my iPod. I've been making all the necessary preparations, like converting my entire CD collection, encoded in the FLAC format, to MP3. I updated an old tagging/converting Java app that I had sitting around to handle the conversion, and it seems to be working like a charm. Yay Java. Note that by purchasing this iPod, I've admitted to myself that maybe the world isn't quite ready (yet!) for my idea of always-on, instant media transcoding/streaming from your home media server to your MIDP2-enabled cell/PDA (running a mobile version of Mu). But mark my words, this will be the future of personal, mobile entertainment! You just wait!

In my ears: The Super Friendz, "Love Energy" and Neil Young, "On The Beach"
In my eyes: Haruki Murakami, "The Wind-up Bird Chronicle"



Co-existence of Java 2D, Java3D, JOGL, and Mac-n-Cheese

Posted by campbell on July 28, 2003 at 09:46 PM | Permalink | Comments (6)

[I was going to reply to Chris's excellent weblog in the talkback section, but I started rambling and it touched on some other thoughts I've had, so I decided to ramble here instead... Keep in mind that I'm only half-wearing my Sun cap right now (kind of like one of those green and brown, half A's, half Giants caps that were popular in the '89 Series), so I'm not speaking entirely on behalf of the company.]

In response to Chris Adamson's recent blog entry, The End (of Java3D) and the Beginning (of JOGL):

I'd just like to point out that JOGL is not an all-out replacement for Java3D. The two can co-exist, and one could potentially rewrite the platform-specific layer of J3D to sit atop JOGL. Java3D does indeed act as an "isolation layer" for the underlying platform when a developer uses its "immediate mode" APIs, but more importantly Java3D offers a high-level scene graph API. Many educational and corporate institutions have chosen Java3D because of its scene graph offerings, in addition to the appeal of its cross-platform nature.

On the other side of the coin you have the traditional game shops, who want to get as close to the graphics platforms/hardware as possible. Many of these folks are finding JOGL a better fit because it's a lower-level API, and they can make use of their existing OpenGL knowledge/code base. So I think it depends on the type of application you're developing which API best suits your needs. The gaming community has been clamoring for official Java bindings for OpenGL for quite some time, so that's where Sun's efforts seem to be heading, but don't count Java3D out for good; it still serves its purpose quite well as a higher level 3D graphics library.

Related to this discussion, we're also starting to see some folks on the javagaming.org forums asking whether JOGL would be a better fit than Java 2D for their apps/games. Again, JOGL is not the end-all and be-all Java graphics library. Many people don't realize that OpenGL is actually an expressive 2D library, despite its tight association with the 3D world. However, there's so much more to 2D graphics than rendering lines and sprites really fast (think medical imaging, complete support for any image format or color/sample model, printing, text rendering, stable offscreen rendering, etc). This is where Java 2D really blows the proverbial socks off all the other 2D libraries out there.

My answer to those folks on javagaming.org is the same as my J3D response: Java 2D is a higher-level, easier-to-use, more robust, more full-featured 2D rendering API than JOGL. Like J3D, the two technologies can play well together (if we do our job correctly, there should be no reason why the two API's couldn't be used in the same application). Also like J3D, we use hardware-accelerated graphics libraries (such as Direct3D and OpenGL) under the hood, so for many applications, performance should be virtually the same whether you use Java 2D or JOGL. As I mentioned earlier for J3D, we could also port our OpenGL-based Java 2D pipeline to sit atop JOGL (in fact, we're exploring this idea for a future release, which should further decrease our dependence on native C code). If you want to access the very latest in hardware technology, such as programmable shaders, or if you have large data sets of vertices and you're comfortable with the increased complexity of OpenGL, then JOGL would certainly be a better fit.

So the choice is yours... Each API has its benefits; it's up to you to evaluate which one is best-suited for your next project!

You Can't Do That With Java

Posted by campbell on June 24, 2003 at 04:23 PM | Permalink | Comments (9)

[We had some difficulty setting up my blog account; this entry was actually written early last week...]

This is my first-ever blog. Yep, I'm selling out to the blog gods, even though I once said I would never blog. I even gave up writing in my own journal a couple years back once I realized that each entry sounded exactly like the last - a basic recap of the days events and nothing further. So if my blogging devolves into a similar style, I'll give it up. But for now, I think these weblogs give us a chance to have more "face time" with the community. Many developers have complained that Sun isn't open enough, and I'd really like to dispell that myth by offering some news and thoughts from the inside. Making Java better is a community effort, and we're just one small part of that community. Hopefully you'll come to understand that the folks in the Java Client Group really (really really) care deeply about the concerns of all our customers, and we all really want to see Java succeed everywhere.

Anyway, on with the program. I feel obliged to do the standard JavaOne recap... Let's just say that it was 400 times better than last year's JavaOne. This year, the mood was brighter, the products were cooler, and everyone I talked to was incredibly stoked about Java again (must be the new logo). The sessions all seemed to go well, and we had a lot of good interaction with folks at our booth and at the client group BOFs. On top of all that, we finally launched the javadesktop.org community site, which gave me a release vehicle for the project I've been hacking on recently, known quite unaffectionately as "Mu".

Possibly the greatest news we've had in a while was last week's announcement of the Game Technologies Group at Sun. I've had various lunchtime conversations with members of the new team, and believe me, this is one sharp group. Their charter is to find the deficiencies in the Java platform that prevent developers from writing leading edge games entirely in Java, and then plug those holes. One thing that really makes me cringe is when someone says, "You can't do that with Java". Well, have you seen "Alien Flux"? Did you see the High Dynamic Range OpenGL demos presented by Ken Russell and Chris Klein at JavaOne? With the GTG's release of open source Java bindings for OpenGL, OpenAL, and input controllers, I think you'll be hearing that "you can't do that" statement a lot less. [Ahh, I'm overcome with memories of a certain Canadian children's televsion program.]

Another complaint we've received in the past is that we have many great media technologies (Java 2D, Java 3D, JMF, JavaSound, JAI, Swing, and so on), but they don't work all that well together. It's great to know that we now have this team dedicated to making all these components fit together into one coherent layer. If all goes well, developers should no longer worry about mixing heavyweight components with lightweights, playing back video in a 3D application, or using the flexibility of Swing to create an interactive heads-up display in a 3D game.

Well, this first blog entry was all over the map, eh? Next time I'll pick one topic and stick to it like maple syrup.

In my ears: "Electric Version", The New Pornographers
In my eyes: "Blindness", Jose Saramago





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds