Crystal Space: an Open-Source 3-D Graphics Engine
Want to make a 3-D graphics game or application? First, you will need a 3-D graphics software engine on which to build it. Traditionally, your choices have been limited to programming your own from scratch or paying a high licensing fee to use another company's, which can restrict what you do with your final product commercially.
However, a third alternative exists: Crystal Space, an open-source 3-D graphics engine created by 31-year-old Belgian programmer, Jorrit Tyberghein.
Tyberghein created Crystal Space in 1997 after seeing games like Doom and Quake and wondering how they were made. With no prior experience in graphics coding, he researched the Internet on 3-D graphics programming and put together the first version of Crystal Space in two months. Tyberghein released the code as open source, and the Crystal Space development community soon was born. The graphics engine has since been ported from its original Linux code to UNIX, Windows 32-bit and NT and other OSes.
Most of the software currently being made with Crystal Space are role-playing games. The fact that the engine includes full control of one or more camera perspectives and has built-in support for networking makes it easier to develop multiplayer games, like role players. There are also flight simulators, real-time strategy games and first-person shooters, similar to Doom or Quake, under development using the engine.
As for how Crystal Space compares to commercial 3-D graphics engines, specifically those that power games like Quake III and Unreal Tournament, presently it is comparable in terms of specific graphics features but not in regard to code readiness and performance speed. But in general, Crystal Space is much richer because it is not just a game-specific engine. It is also a general-purpose graphics API, and it is being put to use to drive applications like a multimedia internet browser, a sound-editing program and an image viewer.
Andrew Zabolotny, a 28-year-old programmer from St. Petersburg, Russia, who has been contributing to Crystal Space's high-level coding says: “We have lots of things Quake or Unreal will never need because a first-person shooter is a very specific type of game that needs just a limited set of features.”
Developers who have been working with Crystal Space cite the engine's stability (it rarely crashes) and the completeness of its 3-D-rendering features as reasons for using it and contributing to its development.
Yet how necessary is a 3-D graphics engine these days, considering the advanced and powerful 3-D graphics chipsets that have become a standard feature in most PCs? The simple answer is that even with the best 3-D technology, you still need a software engine to manage what the hardware is doing.
“There is always a limit to what hardware can do”, says Tyberghein, Crystal Space's creator. “Even the best hardware cannot handle millions or more polygons just by rendering them all. So an engine still has to do some optimization to limit what is sent to the hardware.”
For example, a software engine like Crystal Space is needed to determine quickly which parts of a game's virtual environment are visible to the user. This helps to maximize the performance of the 3-D chipset by not wasting its resources in making it render an object that will not actually appear on the monitor, even if it is supposed to exist (though off-camera, away from the user's point of view) within the virtual environment.
Crystal Space is free under LGPL. This 3-D game development kit written in C++ supports numerous graphics features and fancy effects: true six degrees of freedom; colored lighting; mipmapping; portals; mirrors; alpha transparency; reflective surfaces; frame-based and skeletal-animated 3-D sprites; procedural textures; radiosity; particle systems; halos; volumetric fog; scripting using Python or other languages; 8-bit, 16-bit and 32-bit display support; Direct3D, OpenGL and software graphics rendering; font support; and hierarchical transformations, to list only a few.
Although it cannot match graphics engines like Quake III's or Unreal Tournament's in performance, Crystal Space has its own advantages over them: for one, it is cross-platform, so you can write code that will run equally well on Linux, UNIX, Windows 32-bit, Windows NT and seven other OSes to which the engine has been ported.
Crystal Space has a flexible plugin system so that a single executable works with various renderers like OpenGL, Direct3D and Glide. Since the first release of the engine, the OpenGL renderer in particular has been rewritten and runs a lot faster than in its previous incarnation.
Also important is that Crystal Space can read many 3-D graphics file formats automatically. There are several importers supporting various 3-D formats (such as 3DS, OBJ, MDL, MD2, LWO and ASE). Inversely, the engine has a set of Python scripts so that environments and models can be exported to Crystal Space from within Blender.
Although the primary purpose of the engine is to produce 3-D graphics, it even has a 2-D API to go along with its 3-D API. “I wrote a full-blown windowing GUI based entirely on the Crystal Space low-level API”, says Zabolotny.
Pieces of separate code even can be used outside of Crystal Space in projects unrelated to game or multimedia development. These include a csIniFile class (for .ini file management), an SCF (shared class facility) subsystem, a csArchive class (which deals with .zip files) and a VFS (virtual filesystem) subsystem.
The most significant weakness of Crystal Space is its lack of good collision detection programming. Thomas Hieber, who has been developing Crystal Shooter, a first-person shooter, with Crystal Space, has been spending most of his time improving the engine's capabilities in this area. “There is some support in it, but it is not very useful for games”, says the 30-year-old software engineer from Germany. “There is only static testing of object-against-object that basically will return information about where the collision occurs, if any. But there is no good support for fast-moving objects.”
Another complicated issue is how Crystal Space handles lighting. It supports colored static and dynamic lighting with soft shadows, but getting these to work fast under all possible game processing circumstances is a challenge and one which Crystal Space currently does not totally meet.
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
|Non-Linux FOSS: Seashore||May 10, 2013|
|Trying to Tame the Tablet||May 08, 2013|
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Download the Free Red Hat White Paper "Using an Open Source Framework to Catch the Bad Guy"
- Tech Tip: Really Simple HTTP Server with Python
- Home, My Backup Data Center
- Android is Linux -- why no better inter-operation
56 min 52 sec ago
- Connecting Android device to desktop Linux via USB
1 hour 25 min ago
- Find new cell phone and tablet pc
2 hours 23 min ago
3 hours 52 min ago
- Automatically updating Guest Additions
5 hours 53 sec ago
- I like your topic on android
5 hours 47 min ago
- Reply to comment | Linux Journal
6 hours 8 min ago
- This is the easiest tutorial
12 hours 23 min ago
- Ahh, the Koolaid.
18 hours 1 min ago
- git-annex assistant
1 day 1 min ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.