Welcome to Cafu

A game and graphics engine for multiplayer, cross-platform, real-time 3D action

The Cafu Engine is an all-purpose, modern 3D graphics engine and game development kit, feature complete to get you started quickly.

It can be used to create a variety of 3D applications, including games, simulations, and training and architectural software. Written in C++, the tools, libraries and framework have been designed to make the development of new games and other 3D applications easy. They are actively and continuously developed in order to provide the latest technology. Cafu is open-source software distributed under the very liberal MIT license. It may be used for any purpose, including commercial purposes, at absolutely no cost. Just download it and use it.

The main features include

  • high-quality, real-time 3D graphics with a very powerful and flexible material system,
  • cross-platform and cross-compiler portability,
  • very fast built-in network code for multi-player internet and LAN games,
  • dynamic per-pixel lighting and shadows, combined with physically correct Radiosity,
  • very large terrain rendering, skeleton based model rendering,
  • 3D sound effects with a powerful sound system,
  • uses the powerful Lua language for map scripting, entity scripting and GUI scripting,
  • distributed under the very liberal MIT license.

Source Code

The latest version of Cafu is always available from our Git repository.

See Getting Started with the Cafu Source Code for step-by-step instructions on how to compile the Cafu source code and run the binaries.

3D Rendering and Material System Features

feature image

feature image feature image

feature image

feature image feature image
  • New Cafu Material System that handles all rendering.
  • The main MatSys components are Renderers, Materials, and Shaders.
  • All material surface properties can be controlled by the mapper or texture artist via easy to understand material scripts.
    That is, even after a map or model is finished, the composition, translucency, filtering, modulation, blending, reflectiveness and all other properties of any material can be modified.
    This even works while the engine is running!
  • Designed to be implemented on virtually anything:
    • Operating Systems: Windows, Linux, MacOS, Pocket PC, Palm, DOS, ...
    • APIs: OpenGL 1.2 to 2.0, DirectX 7 to 9, Cg, GLSL, Mesa, software renderers, ...
    • Hardware: NVidia, ATI, 3Dlabs, consoles, ...
  • Cafu demo packages currently come with complete sets of renderers for Windows and Linux, each containing variants for:
    • OpenGL 1.2 (mostly used as fall-back renderer for the Cafu demo),
    • Cg with fp20/vp20 profile (for NV2X and higher GPUs),
    • Cg with arbvp1/arbfp1 profile (for NV3X and higher GPUs),
    • OpenGL 1.4+ extended with ARB vertex/fragment program (all modern GPUs from ATI, NVidia and others), and
    • a "Null" renderer that is useful e.g. for performance profiling or dedicated Cafu servers.
    On start-up, Cafu automatically determines and loads the best renderer that is supported on the current system, so that highest image quality is obtained without user query.
  • New special effects on the latest hardware can easily be exploited, while at the same time fall-back solutions for older hardware can always be provided.
  • Direct import of jpeg, bmp, tga and png image file formats.
  • Global resource management for efficient sharing of common textures and meshes.
  • Powerful Pre-Caching System of all rendering resources for stutter-free animations.

Multi-Player Network Support

feature image

feature image
  • Client/server architecture for multi-player support, implemented in very well designed C++ code.
  • The server can run on Windows or Linux (both client-integrated as well as dedicated servers are available).
  • The client is available both for Windows and Linux. Clients can also act as servers (e.g. for LAN games)!
  • New, amazingly fast internet network code!
  • Optimized for minimum bandwidth requirements.
  • Based on Berkeley Sockets (highly portable, and no unnecessary overhead of general-purpose network libraries).
  • Full client prediction (for movement, events, and weapons).
  • Delta compression for network packets.

Cross-Platform and Cross-Compiler Portability


supported 32-bit
supported 64-bit
Linux / Unix
Linux / Unix

supported 32-bit
supported 64-bit
Mac OS X
Mac OS X

  • Use the same source code on Windows, Linux, and (soon!) Mac OS X.
  • Full support for native 32- and 64-bit code on all platforms.
  • Supports the Microsoft Visual C++ 2005, 2008 and 2010 compilers on Windows, and the GCC 3.x and 4.x on Linux and Unix.
  • Carefully designed, easy to read, standards compliant, portable and well documented C++ source code.

State-of-the-Art Lighting Technology

feature image

feature image
  • First engine ever to combine light-maps with dynamic lighting effects!
  • Radiosity-based, physically correct lighting.
  • Dynamic, shader-driven, per-pixel lighting for both worlds and models.
  • Stencil buffer shadow volumes (everything casts shadows on everything!).
  • Support for diffuse-, normal-, bump-, specular-, and luminance-maps.
  • Support for ATI and NVidia programmable GPUs and shaders.
  • Smooth-Group support even for world brushes, easily controlled in the map editor!
  • Shader-driven, multi-textured or 2-pass LightMap rendering.
  • Spherical Harmonic Lighting as presented in my diploma thesis.
  • All this is implemented in the Cafu Material System.
feature image

feature image

3D Sound Effects and Audio Support

feature image
  • Employs fmod for all sound, audio and music effects.
  • 3D stereo sounds for all audio sources (e.g entities, explosions, etc.).
  • Doppler effects that distort all sounds according to the relative velocity of the listener.
  • Can play mp3 and ogg-vorbis music files.
  • Available on all currently and future supported platforms.

Graphical User Interface System

feature image

  • A powerful Graphical User Interface (GUI) System (or short: GuiSys) is integrated with the engine.
  • GUIs can be 2D (regular GUIs for game menus etc.) as well as 3D for world (entity) GUIs. This provides a maximum of flexibility in functionality and design for all in-game interactive elements like for example call-lift buttons, doors with access control, computer displays of all kinds, etc.
  • GUIs can fully be scripted by the Lua-based Scripting system!
  • The GuiSys C++ interfaces can also be accessed from the game code directly, e.g. in order to implement all kinds of HUDs (Head-Up Displays) for the player.
  • An easy-to-use tool for creating own fonts for use with the Gui System is included with the SDK.
  • As examples, the current SDK implements the in-game console, the chat input, the "Really Quit?" dialog, the HUD and a world (entity) GUI all with the GuiSys.

Model Features

Player Models Player Models Player Models
  • Animation blending allows smooth transitions from one animation sequence to the next.
  • With animation channels you can play different animation sequences on different parts of the model (e.g. head, torso, legs).
  • Multiple skins: Re-use the same mesh with different surface materials.
  • Submodels: Each player is easily combined with any weapon.
  • Level-of-Detail: Automatically switch to lower-res meshes when the model gets farther away from the player.
  • Full integration with the Cafu Material System for per-pixel lighting and shadows.

Model Editor

The CaWE Model Editor The CaWE Model Editor The CaWE Model Editor
  • Use the graphical Model Editor to import many model file formats.
  • A complete toolbox for inspecting, transforming and texturing your models.
  • Adjust and tweak any Cafu-specific model feature to prepare your models for use in the Cafu Engine.
  • Attach graphical, interactive GUIs to any model.
  • Check out the Gallery.
  • Learn more at the Documentation.

Very Large Terrains

feature image

feature image
  • Implements the excellent SOAR algorithm by Peter Lindstrom and Valerio Pascucci.
  • Provides continuous-level-of-detail, permitting very large out-door scenes.
  • Employs geo-morphing for perfectly smooth transitions between levels of detail.
  • View-frustrum culling yields an optimal terrain approximation.
  • Can directly load terrains from Terragen (ter) and portable graymap (pgm) files in full 16 bit precision or from any bmp, tga, png or jpeg image file in 8 BPP precision.
  • Integrates fully into the rest of Cafu (i.e. terrains are in the PVS, use optimized code for collision detection and physics, etc.).
  • Even all compile tools are aware of terrains, and act accordingly.
  • There are no restrictions in combining terrains with other elements of Cafu worlds.
  • Full integration with the new Cafu Material System - you can apply arbitrary materials to terrains (e.g. with detail-maps and so on).
  • Direct terrain support and terrain preview in the Cafu world editor CaWE.
  • A terrain (pre-)viewer is included with the SDK.

Easy Extensibility and Great Flexibility

feature image

feature image
  • Supports Scripting based on the Lua programming language!
  • Several forms of scripting are supported by the Cafu engine (e.g. cmat material definition files), the most important of which are GUI scripting and entity (map) scripting. For example, a lift that stops at several floors with each floor having a call button can completely be implemented by GUI and map scripts.
  • Many relevant interfaces are available to (have bindings to) both the C++ game code as well as the Lua scripts.
  • Dynamic Link Libraries (DLLs) control the engine.
  • Simple to use C++ code interfaces make it easy to create entirely new games or applications (MODs) with Cafu.
  • Also the Material System can easily be augmented with new effects, or ported to new platforms via clean and well-documented C++ interfaces.
  • An example: the United States Air Force, Research Labs for Human Effectiveness employ the Cafu engine in warfighter simulation experiments to study the visuo-spatial working memory of their pilots.

Software Development Kit

feature image

feature image
  • The live demos include all binaries for developing new worlds or entirely new games.
  • Includes the sample source-code of the Cafu DeathMatch game.
  • Includes CaWE, the Cafu World Editor, a comfortable editor for editing worlds for Cafu.
    • CaWE is included both in the Windows and the Linux packages!
    • The user interface is intuitive and easy to learn for beginners. For experts, it has powerful features for fast and comfortable editing.
    • Real-time preview of all models and Material System effects.
    • Auto-save and recovery feature for crash-safe editing.
    • Can import Doom 3 and Half-Life 1+2 maps.
  • Includes all binary tools that are required for Cafu game development: CaWE, CaBSP, CaPVS, CaLight, CaSHL, Model Viewer, Material Viewer, Terrain Viewer.
  • Exhaustive documentation and support is available online.

Special Features

feature image
  • Full support for curved surfaces (Bezier Patches) as seen in Doom 3, from the CaWE editor through preprocessing to dynamic lighting and shadows.
  • The vegetation of large eco-systems as implemented in one of my university projects is soon to be integrated.
  • In-game command console. For example, the display resolution and mode (full-screen or windowed) can be changed "in-game".
  • Realistic physics modeling for all world entities: natural player movement, accurate collision detection, 6 degrees of freedom, acceleration, friction, gravity, water, ladders, ...
    In addition, the Bullet Physics Engine has been integrated.
  • Particle Effect Engine (for explosions, smoke, muzzle flashes, fog, rain, snow, blood, ...)
  • BSP, PVS and Portal-based rendering.