This is a preview! This is not the official Castle Game Engine website (official website is here). This is only a preview for developers, to see the next website before the release, and to see the documentation for the unstable engine version (from GitHub master).
We have an optimized renderer for OpenGL and OpenGLES2.
You can use any 3D modeler to design your 3D and 2D data.
Blender? 3DS Max? Anything else?
In part, that's because X3D (and it's predecessor, VRML) is an open and popular 3D format,
and decent exporters for it exist in practically every 3D authoring tool.
"placeholders" on levels you can configure the detection method to match your authoring tool.
Animations are supported,
in two flavors:
interactive animation interpolated at runtime,
or a "precalculated" animation (for fastest playback, but at the cost of using more memory).
We can save (aka "serialize") the current state of the world
to an X3D file, which can then be read back by our engine.
You can use it e.g. to make a full-featured 3D editor on top of our engine!
See TCastleSceneCore.Save and Save3D for basic methods
to do this.
Reading and writing of images in various formats, processing them
and using as OpenGL textures. Besides many common image formats
(PNG, JPG, PPM, BMP, and much more), included is also support for
Khronos KTX and DDS (textures
with compression, mipmaps, 3d, cube maps) and
RGBE format (Radiance HDR format).
Handling of fonts. We can read fonts in many formats (like .ttf)
using FreeType library, and render them at any size, with anti-aliasing
or not. Fonts can also be embedded inside a Pascal source code,
which allows us to provide default fonts (available as-is),
and to use fonts even when FreeType library is not available.
You can also use colorful fonts from a texture.
Font rendering allows international characters in UTF-8.
See manual about text and fonts and unit
4. Portable (standalone, mobile, console, web browser plugin)
You can compile and package your games for various platforms:
Any modern desktop operating system (Linux, Windows, macOS, FreeBSD, more...), with any CPU supported by FPC (like i386, x86_64, ARM, Aarch64...).
We have a build tool to make it easy to compile and package your games. Creating complete, ready-to-be-released Android and iOS applications is trivial. We automatically generate an Android apk or iOS XCode project.
Trivial to use integration with many services on Android: games (achievements, leaderboards), in-app purchases, ads, sound, vibrations, and much more. See Android Project Services documentation.
The engine can be compiled into a library useful from other programming languages.
This does not expose the complete engine API (for now), but it does expose a simple 3D model loading,
rendering, animation, interaction. So you can e.g. make your own VRML / X3D browser.
We have an example in engine sources examples/library/qt_library_tester/
that shows how the engine can be embedded in a C++ Qt application.
5. Graphic features and effects (shadows, mirrors, bump mapping...)
Scene manager is used for centralized 3D world handling,
with custom viewports possible.
We have developed special extensions to
composite shader effects,
to enable custom GLSL effects cooperate with each other and with
built-in shader effects.
We fully support rendering both in fixed-function
and programmable pipelines. In the latter case,
the whole shading is expressed through GLSL shaders
(that you can override with ComposedShader
or enhance with Effect, see links above).
compressed textures (supporting both desktop and mobile
compression formats, like S3TC, ATITC, PVRTC, ETC). The compressed and/or downscaled texture versions may be automatically generated and used,
you simply declare them in the material_properties.xml file
and use our build tool to regenerate all texures at building.
Anti-aliasing (by OpenGL multi-sampling),
see AntiAliasing property.
6. Scene manager and comfortable API
We have a comfortable and extensible implementation of scene manager and 3D objects. You have a ready implementation of levels, creatures (with AI), items, players and other things typical to 3D games.
You can extend it in many ways.
You can also make your own 3D objects (if your game 3D world doesn't fit in our idea of creatures/levels etc.) by descending from TCastleTransform.
3D and 2D. Not everything is about 3D. Our API is perfect for 2D games too, with flexible (and pixel-perfect) rendering of 2D images, movies, text and everything you can compose from them (like GUI controls). We also support Spine which is very cool for creating 2D animations.
view3dscene tool to view
and inspect your 3D models, before loading them in your game.
(buttons, panels, tooltips, on-screen menus etc.) are available.
Customizing their look is very easy.
Also creating your own 2D controls, using smartly stretched images and text,
is very easy.
Good for games, where making a custom-looking GUI (that fits with
your game theme) is important.
See CastleControls unit.
Although the main focus of the engine is real-time rendering,
we have also implemented a software ray-tracer, just to show that it's
possible! Two ray-tracing algorithms may be used:
deterministic (classic Whitted-style ray-tracer)
or Monte Carlo path tracing.
All the engine 3D formats are supported, with smooth normals, textures,
See the gallery and the
Playing movie files. This includes loading and saving
as image sequence or "real" movie files (ffmpeg
is needed to encode / decode movie files). While the implementation
is limited to a small movies for now (as memory consumption is large),
it's perfect for flame or smoke animation in games. We even have a simple
movie editor as an example program in engine sources.
TGLVideo2D and related classes.
You can read maps designed using
Tiled Map Editor.
A default visualization (as a 2D control) is included in the engine,
but you can also read the map information and display it on your own,
in 2D or 3D. See the examples/tiled/ in the engine code.
You can convert a spritesheet from Cocos2D or Starling formats into X3D.
See the program tools/sprite-sheet-to-x3d distributed
as part of the engine.
We have ready window classes (TCastleWindow)
and Lazarus components (TCastleControl) to make simple
X3D and other 3D models browser, on a Lazarus form or independent from Lazarus LCL.
The engine is integrated with Lazarus —
we have various Lazarus components.
Engine components are independent when possible.
For example, you can only take model loading and processing
code, and write the rendering yourself. Or you can use our OpenGL rendering,
but still initialize OpenGL context yourself (no requirement to do it
by our CastleWindow unit). And so on.
Of course, ultimately you can just use everything from our engine,
nicely integrated — but the point is that you don't have to.
Engine can be used to develop natively-looking tools, not just OpenGL games,
since our OpenGL controls integrate with any GUI library (Lazarus LCL, GTK,
You can embed the engine in a normal GUI program.
You can use multiple OpenGL controls and windows visualizing (the same
or different) game world.
There are also various classes for processing 3D data
without any rendering (like TCastleSceneCore), these are of course useful too
(e.g. to write ray-tracers).
The engine is developed for the Free Pascal Compiler, an open-source cross-platform compiler. We have Lazarus components for RAD development, although the core engine doesn't depend on Lazarus LCL and you can develop full games with pure FPC (we have our own OpenGL window management unit, if you want). The whole engine is 100% clean Object Pascal code.
Do you use our engine or view3dscene?
Please make us happy and tell us about it!
For example, post a a screenshot to our
We will happily use the best screenshots to showcase our engine here.
This is the time where you can show your cool work environment
(maybe a peek at your editor), or show us a glance of your
new game / tool you develop :)