Upcoming Debian conference CGE talk, video from Web3D 2020 talk, engine improvements: new 2D geometry primitives, no more libGLU

Posted on

Michalis Kamburelis talking at Web3D 2020
  1. I’ll give a presentation about Castle Game Engine at MiniDebConf Online #2 “Gaming Edition”, an online Debian conference devoted to game development. The presentation is already recorded :), and I hope it is good. I focus on Castle Game Engine editor. I create a 3D level in Blender and put it in a 3D CGE game, I do some code editing, and I build a 2D game for Android too — all in 38 minutes. I hope it will serve as a nice introduction to CGE, from scratch, going over the core engine/editor features and showing how to use it in practice.

    Afterwards there will be ~7 minutes for live questions.

    My presentation starts on Sunday, 22 November, 13:30 UTC, see schedule.

    You’re most welcome to attend 🙂

  2. As a teaser, see the presentation about CGE + view3dscene for Web3D 2020 that was this Wednesday. This is 21 minutes, and focuses on graphic features we offer in view3dscene (I mention there CGE, but don’t go into details how to use it from developer perspective).

  3. I implemented some additional X3D nodes to describe 2D geometry: Disk2D, Polyline2D, Polypoint2D, TriangleSet2D.

  4. We no longer depend on libGLU, even on desktops where we use OpenGL (not mobile OpenGLES) by default. This was a long-time coming move. The remaining usage of libGLU in CGE eliminated:

    1. You can use TCastleScene with X3D geometric primitives (like TSphereNode, TDisk2DNode and more) to render “quadrics” (previously, 2 old CGE examples used libGLU for this).

    2. We have own routine to generate mipmaps for ancient GPUs (on modern GPUs, we use glGenerateMipmaps since a long time of course).

Comment on this post ➤

Various improvements (blending documentation, AvoidNavigationCollisions fix, buttonXxx renames, CastleXMLUtils example…)

Posted on

Ship in the bottle - Model by Loïc Norgeot from https://sketchfab.com/3d-models/ship-in-a-bottle-9ddbc5b32da94bafbfdb56e1f6be9a38 (Creative Commons Attribution-NonCommercial)

I’m happy to be swamped with things to announce about the engine! 🙂 So, after previous announcements this weekend, one more list of new stuff 🙂

  • We have an extensive documentation how blending (partial-transparency) works. While the engine tries its best, it’s not always possible to make blending automatically “just work”. This documentation should help you understand what and why you can tweak.

  • We have important fixes for edge-cases when handling MessageOK, progress bars or TCastleViewport.AvoidNavigationCollisions by Andrzej Kilijański.

    Moreover, Andrzej submitted a big PR that introduces a huge upgrade to handling sprite sheets in CGE. It is under review now (i.e., waiting for Michalis 🙂 ), stay tuned!

  • We have renamed mouse button names/types to buttonXxx and TCastleMouseButton. This way they do not conflict with LCL. The old names mbXxx still remain, but are now deprecated, and we will be able to remove them in later CGE (7.2?). Thanks to Eugene Loza!

  • In the editor, we now expose “Scene (Optimal Blending for 2D Models)”, which is just TCastleScene with Setup2D performed.

    It is better than the now-deprecated TCastle2DScene. Dealing with TCastle2DScene was sometimes uncomfortable: when you wanted to derive descendants and mix 2D and 3D models in your game. And existence of TCastle2DScene was not really justified: in the end, it is a completely trivial variant of TCastleScene, the Setup2D just sets "RenderOptions.BlendingSort := bs2D" (really, that’s it! nothing more needed for 2D scene).

  • I added an example of using CastleXMLUtils unit in examples/short_api_samples/xml_utils/.

  • Our Jenkins (see wiki docs) is now integrated with GitHub, and it sets “build status” on GitHub. This means we can quickly recognize failing commits, branches, PRs etc.

    ( It’s not always the fault of the branch/PR author, so don’t worry — I’m diagnosing all fails and will let you know if this is something you need to take care in your PR. )

Comment on this post ➤

Screen Space Reflections effect, enhancements to GLSL API for effects

Posted on

scene_outline_ssr
90320562-8e97da80-df6c-11ea-8aee-a37195f4fbcc
90325816-a1c99b00-dfaa-11ea-9195-b15bac7ec4eb
90325645-54e4c500-dfa8-11ea-860a-cc7949262dca
90320557-8b045380-df6c-11ea-8133-a04edb399c17

With many thanks to Kagamma (Trung Le), we now support screen-space reflections in Castle Game Engine! It is a cool technique that generates reflections completely in screen-space, using color and depth buffer information to look for the reflected color.

It is trivially easy to use, just toggle TCastleViewport.ScreenSpaceReflections boolean. As we don’t have material information available in screen space (yet, because we do not have deferred rendering), so everything in the whole viewport is reflective now. That said, the effect is extra pretty and just works “out of the box” on various scenes, so I’m sure it will find it’s use even in current “everything is reflective” form 🙂 You can configure glossiness for the entire viewport by TCastleViewport.ScreenSpaceReflectionsSurfaceGlossiness (in 0..1 range, by default 0.5).

You can also test it with view3dscene, just toggle menu item View -> Screen Effects -> Screen Space Reflections.

Our screeen effects GLSL API also got a small upgrade by the way. We now expose screenf_01_position varying and functions screenf_01_get_color(...) and screenf_01_get_depth(...) to quickly query the screen.

More upgrades to screen effects are coming. I would like to wrap screen effects in components, designable in CGE editor!

Comment on this post ➤

Render options configurable in editor

Posted on

Roseanne from "The Unholy Society", https://unholy-society.com/
render_options_1
render_options_2

You can now configure RenderOptions of every TCastleScene. Simply access it like MyScene.RenderOptions.OcclusionQuery := true. It is available also in the editor, as you can see on the screenshots 🙂 All the features are documented in TCastleRenderOptions class, in particular you can:

This mechanism replaces (and deprecates) previous Scene.Attributes.

As part of this rework, we also deprecate or even remove some stuff that had very low usage.

In particular, Scene.Attributes.OnRadianceTransfer and Scene.Attributes.OnVertexColor are now removed. They were causing quite a complication throughout the renderer, and were never ready for “production” usage due to being inherently slow (doing per-vertex work on CPU). Their effect can still be achieved by a simple utility that maintains the X3D Color node, updating it every frame. So if you need this (and can accept the slowness of per-vertex processing on CPU) you can still do it, our sceneutilities.pas example unit demonstrates this in practice, and is used by dynamic_ambient_occlusion and radiance_transfer examples. Feel free to reuse SceneUtilities in your projects in you need an upgrade path from the OnVertexColor and OnRadianceTransfer.

Comment on this post ➤