Ray-tracer improvements (aka “Did you know our engine has ray-tracer?”)

Posted on

ray_tracer_textures
ray_tracer_smooth_1
ray_tracer_smooth_normals

I was playing with the ray-tracer inside Castle Game Engine this weekend. Although the focus of our engine is real-time rendering (not a software ray-tracer), but there is a distinct pleasure when you’re able to generate pretty images without the help of OpenGL:)

New ray-tracer features:

  • It can now use smooth normal vectors.
  • Classic ray-tracer supports now 2D textures, with bilinear or nearest filtering.
  • It looks at Background.skyColor.

You can try it out e.g. using view3dscene Ctrl + R (“Display -> RayTrace!” menu item). From code, you can use the CastleRayTracer unit.

The ray-tracer in CGE is still just a toy subproject for me. Our ray-tracer does not try to compete with professional, full-featured ray-tracing renderers existing today. But it is a nice demo that, using Castle Game Engine API, you can take a scene and create a decent ray-tracer, because

  1. All the necessary information about the 3D scene is available,
  2. You have a fast structure (octree) to perform ray collisions.

I hope that you enjoy it!:) If anyone here is interested in putting more work into this way of rendering (we have classic ray-tracer and a path-tracer), if you dream about creating a real, full-featured physically-based solution, than please join the development of CGE! I would happily see someone extend the CGE ray-tracer to render some really cool stuff! 🙂

An old gallery of images is here.

Comments on the forum ➤

CommonSurfaceShader in view3dscene and Castle Game Engine implemented:)

Posted on

CommonSurfaceShader with bump mapping
CommonSurfaceShader with steep parallax bump mapping and self-shadowing
CommonSurfaceShader defining a mirror for ray-tracer

I’m proud to announce an initial implementation of CommonSurfaceShader in Castle Game Engine and view3dscene! CommonSurfaceShader acts as a powerful “material on steroids” X3D node, in particular with support for normal maps (bump mapping).

1. The documentation

2. The demos

3. To try this *now*, you can use view3dscene from our “nightly builds”. Or you can compile any of the engine tools (like examples/3d_rendering_processing/view_3d_model_basic ) using the engine code from GitHub.

This is happening thanks to the support on Patreon (https://www.patreon.com/castleengine). Robert Daniel Murphy sponsored improving the Blender exporter to be able to export normalmaps (and specular maps and similar) from Blender to Castle Game Engine easily. I took the idea a little further, and implemented it by adding the CommonSurfaceShader node to the engine, and then the Blender exporter will export an X3D file with the CommonSurfaceShader.

This way the Blender exporter will be improved for everyone, e.g. Instant Reality / X3DOM users will also benefit by having an exporter that can write CommonSurfaceShader.

More work is yet ahead (the Blender exporter, and the specular maps are not done yet). But the CommonSurfaceShader, with many basic fields, and normal maps, is supported now!

The CommonSurfaceShader works both for interactive rendering, and for our toy raytracer. It is also understood when editing materials in view3dscene (Edit->Edit Material->… menu items).

P.S. If you like view3dscene, or you’d like to request more view3dscene features like that, please support me on Patreon !:)

Comments on the forum ➤

fpcupdeluxe and Castle Game Engine

Posted on

fpcupdeluxe

Recently I’ve been playing with fpcupdeluxe, a great tool to install FPC/Lazarus (stable, unstable…), with cross-compilers. I’m very impressed by it, and I wrote a wiki page documenting how to use it (in the context of Castle Game Engine, although contains some general notes too):

https://github.com/castle-engine/castle-engine/wiki/fpcupdeluxe

In another news: Ten Square Games is helping us by lending Apple hardware with the latest Mac OS X! This is a great help towards the upcoming improvents of iOS in the Castle Game Engine (integrating it with the build tool better). Thousand thanks!

Comments on the forum ➤

Support for the STL format for 3D models (commonly used for 3D printing)

Posted on

Knocker in STL format, by Shira, www.thingiverse.com/thing:1458545
Robot woman in the STL format, by Shira, see http://www.thingiverse.com/thing:614366
Moonkin Bust in the STL format, by bardiir, see http://www.thingiverse.com/thing:2211053

Castle Game Engine and view3dscene support now the STL format for 3D models, commonly used for 3D printing. This means that you can open these models using view3dscene, or the engine API (TCastleScene.Load), and you can convert STL files to X3D.

It’s a really simple 3D format (just vertexes with normals), and I think that the current loader (in file x3dloadinternalstl.pas) nicely serves as an example 3D file loader in our engine. It shows how to read binary and text files from a TStream instance using some helpers in our engine.

More information about the STL format is available in Wikipedia. We support both the text (ASCII) and binary formats.

Blender includes an exporter to this format.

Many sample models in the STL format, ready for 3D printing, can be downloaded e.g. from Thingiverse.

If you’d like to try it NOW in Castle Game Engine, you can download the view3dscene from snapshots. Or you can grab the source code of the engine and view3dscene from GitHub: https://github.com/castle-engine/castle-engine/ , https://github.com/castle-engine/view3dscene/.

Comments on the forum ➤

Castle Game Engine 6.0.2 release!

Posted on

Test local (international) characters

We’re happy to announce Castle Game Engine 6.0.2 release!

Download it from our webpage.

This is a small, mostly-bugfix release. So we only have 6 new features:)

New features:

  1. sprite-sheet-to-x3d tool: The animations duration is now calculated looking at the number of animation frames and the FramesPerSecond value. FramesPerSecond is by default 4, but it can be changed by the –fps= command-line option.
  2. New test_local_characters testcase (inside examples/fonts/test_local_characters/), testing reading and rendering of international characters (Chinese, Russian, Greek…).
  3. LoadAnimatedGifs, see an example GIF player🙂 It requires having ffmpeg installed, though, for now.
  4. Better API around TextureProperties X3D node.
  5. Automatic gzip extension recognition for URLReadXML / URLWriteXML (by Eugene Loza, thanks!).
  6. Unix manpages for utilities can be generated (see doc/man/man1/ in sources). All utilities support now –help and –version options.

Bugfixes:

  1. OpenGLES (mobile) fixes for Color and ColorRGBA nodes handling.
  2. Removed the proprietary Chartboost and Heyzap jar files from the distribution. They were packaged by accident in our zip and tar.gz archives. Users should download them on their own, following links from Android components page.
  3. Fix reading X3D files with IMPORT.
  4. Fix UI in examples/fonts/html_text.lpr.
  5. Various fixes for switching font at runtime. The test_local_characters demo shows that now everything works.
  6. Remove the warnings from FPC 3.x around WideString convertions when dealing with XML units (by Eugene Loza).

Please check the downloaded file correctness!

Downloading the files from SourceForge may be unreliable now, in my tests. After downloading, please double-check the correctness of the downloaded castle_game_engine-6.0.2-src.zip file:

  • the size should be precisely 126164527 ,
  • the md5sum should be 7f6ccd3f4d6a2547299ea4dc9ef0ad15 .

I’m talking with SourceForge to have it fixed. Eventually, we may move our downloads to another server.

Comments on the forum ➤

view3dscene 3.16.1 release

Posted on

View3dscene

We have just released view3dscene 3.16.1. This is a bugfix release for an important bug that slipped in view3dscene 3.16.0 (most files using the IMPORT keyword failed to load with “Invalid type cast” message).

view3dscene is our open-source cross-platform X3D and VRML browser (and a viewer for other 3D formats). It is quite powerful tool on it’s own, to inspect 3D models in various formats — it can play animations, you can work in 3D worlds with collisions and gravity, it can play X3D scripts and more:)

All the comments are welcome, as always!

Comments on the forum (2) ➤

API Reference improvements

Posted on

API Reference search

I improved our API reference. It now has a search box, and a navigation toolbar, making it look more like a normal part of the Castle Game Engine website.

Hint: I’m the maintainer of both Castle Game Engine, and PasDoc — an open-source documentation tool for Pascal 🙂 I actually enhanced PasDoc to make it possible. PasDoc has now three new command-line options and produces nice HTML5 output. If you use PasDoc in your own projects, you benefit too — you can now style the PasDoc output to fit your webpage! If you’d like to try PasDoc, go to https://github.com/pasdoc/pasdoc/wiki .

Comments on the forum ➤

Plans, thank yous, and improvements to “Getting Started”

Posted on

castle_base package: Compile

A week ago we have launched our Patreon campaign https://www.patreon.com/castleengine, and we already reached 25% of our first goal! I wanted to thank everyone who decided to support the engine, and please keep it coming! This really matters a lot to the engine future — it essentially allows me to focus all my (computer) life on the engine, and I think that I can do some amazing things with this:)

Plans for the next releases:

  • Release 6.2: Easy iOS recompilation
  • Release 6.4: Delphi compatibility (after many encouraging comments I got from the Delphi community on FB and G+)
  • Release 6.6: Physics, or Visual designing (like GLScene) (depending on YOUR feedback!)

More details about the above features, and more plans, are here. I plan to maintain this “Planned features” page forever, adding there stuff (and removing stuff, too, as it gets implemented:). So be sure to check it often.

Getting started improvements:

Our “Getting started” page was much improved, with screenshots showing the Lazarus installation process. See also a movie (thanks to Eugene Loza!)

Comments on the forum ➤

New engine logo

Posted on

New engine icon

We have a new engine logo! You’re welcome to use it in your own games, with a title like “Made using Castle Game Engine”, to help promote our engine! It is available in doc/pasdoc/logo subdirectory of the release:

The logo is made by Paweł Wojciechowicz. Just like some other pretty stuff you see in the engine demos (black & white dragon on our banner).

Once we reach our first goal on Patreon (please support us!), Paweł promised to make a set of cool engine-themed wallpapers for patrons. So, more pretty stuff is coming:)

Comments on the forum ➤

view3dscene and glViewImage for Mac OS X

Posted on

view3dscene on Mac OS X, with native UI (menu, open dialog...)

Remember to check out the latest Castle Game Engine 6.0 release ! And check our page on Patreon — it has a cool movie showcasing the engine possibilities:)

Since the release this weekend, we already did more stuff:

  • view3dscene and glViewImage released also for Mac OS X (initially were only for Windows and Linux). Highly advised to check your game assets and images.
  • Workaround in engine on GitHub for a small FPC 3.1.1 bug.
  • And improvements to our news pages.
Comments on the forum ➤