SlideShare a Scribd company logo
Advanced
Castle Game Engine
Forms, 3D generation, shaders,
customizing the editor (and more)
Michalis Kamburelis
2023
CGE
+
FMX / VCL
Engine on FMX form
(Windows, Linux; other Delphi platforms coming)
BTW, Delphi Linux (on FMX)
P.S. WSL rocks for Delphi+Linux (lightweight, comfortable Linux inside Windows), thanks Jim McKeeth
Engine on VCL
Editor or not?
● You can design things in CGE editor. Or not,
create all by code.
● You can use TCastleControl (FMX, VCL, LCL) or
TCastleWindow.
● These are independent decisions.
○ All 4 combinations make sense :)
Use CGE API from FMX events
Docs
https://castle-engine.io/control_on_form
2023
Generate (or modify) 3D worlds
Build or modify worlds
● build (or modify)
● 3D or 2D content
● using Pascal code
● use-cases?
○ visualize some external data (like a real-life 3D machinery
or statistical data)
○ procedurally generate 3D worlds
○ fix / enhance existing 3D models
Example code
https://castle-engine.io/viewport_and_scenes_fro
m_code#_building_a_mesh_using_code
Mazer
https://decoherence.itch.io/mazer
(by Eugene Loza)
From where, to where?
● You can start from:
○ nothing (just create empty TX3DRootNode)
○ or any imported model (X3D, glTF
, Collada, STL, …)
○ (you can combine multiple models too)
● Do what you want on nodes' graph in memory
○ Build and modify
○ Render
○ Process animations, interactions (touch sensors)
● You can save to:
○ X3D file (perfect representation, no loss!)
○ (Coming soon: also save to glTF)
Docs
https://castle-engine.io/vrml_x3d.php
2023
Shader e ects
Enhance the look of
● Shapes
● Groups of shapes (maybe whole model from glTF
,
X3D etc.)
● Lights
● Textures (maybe write reusable texture generated
in shader)
● Screen (post-processing effects)
using your own GLSL (OpenGL Shading Language)
code.
Examples
● Volumetric fog
● Water
● Screen effects
○ Escape from the Universe, on Nintendo Switch:
https://www.nintendo.com/us/store/products/escape-fro
m-the-universe-switch/
Volumetric fog
(sample 3D texture with noise)
Water
● render texture for mirror https://castle-engine.io/x3d_extensions_mirror_plane.php
● perturb normals from animated noise
Chromatic aberration screen e ect
(aka post-processing e ect)
Advanced Castle Game Engine features - forms, 3D generation, shaders, customizing editor
Advanced Castle Game Engine features - forms, 3D generation, shaders, customizing editor
Advanced Castle Game Engine features - forms, 3D generation, shaders, customizing editor
Docs
https://castle-engine.io/compositing_shaders.php
2023
Custom components
Custom components
● Specific to your project
● Reuse some necessary graphical designs and
logic
○ E.g. a button for consistent game UI, with key on PC, with
keypad on consoles
○ E.g. a 3D object, like a machinery part, with configurable
size / layout / attachments etc.
○ Maybe model with a shader effect from previous section
○ Maybe 3D thing procedurally-generated from previous
section
Design-time
Special design-time operations:
● Use component editors, as in Delphi (context
menu on component)
● Use property editors, as in Delphi (special
editors for some properties, even with
dedicated forms)
● Override CGE editor special methods to
enable extra design-time in CGE editor, like
mesh editing
Simple demo
examples/advanced_editor/custom_component
Example: Castle Lines 2D
https://github.com/KumurTash/CastleLines2D
(by Korchazhkin Sergey)
Design-time lines and polygons editor!
Note: use version from branch,
https://github.com/KumurTash/CastleLines2D/p
ull/3
Advanced Castle Game Engine features - forms, 3D generation, shaders, customizing editor
Docs
https://castle-engine.io/custom_components
2023
Anything I forgot
Designs (reusable component
arrangements)
Delphi versions supported
● All Delphi versions >= 10.2.1
○ These are Windows and (to be confirmed) Linux requirements
○ For mobile, a bit stricter requirements: Delphi >= 10.4
○ Always recommended latest Delphi stable, so 11.3 now
○ Tested with Delphi 12 beta of course :)
● Delphi Community Edition is OK too, we specifically test it
○ Note the need to build from Delphi in this case, F9 from CGE editor cannot
work as Community Edition doesn't have command-line compiler.
● https://castle-engine.io/delphi
Engine can optionally scale UI.
● It can follow DPI scaling.
● Or it can follow some hard-coded window size (like 1600x900)
"fit" or "enclose" your screen.
○ This is like Unity UI scaling, easy to use and effective for cross-platform
games (where UI size doesn't have to match other apps).
● To make it work OK, you must use anchors.
● Effectively, you can pretend that you always have the same
window size (like 1600x900), hardcode all the positions and
sizes, set proper anchors, and you're good.
UI Scaling
Thank you!
https://castle-engine.io
michalis@castle-engine.io
https://github.com/
castle-engine/
conference-itdevcon-2023/

More Related Content

PDF
From an idea to a release on Steam: everything about making your game using C...
PDF
Creating 3D games and applications using Castle Game Engine
PDF
Castle Game Engine - highlights, features, plans as of July 2024
PDF
Developing mobile games and applications using Castle Game Engine
PDF
Castle Game Engine and the joy of making and using a custom game engine
PDF
Let's make games using Delphi! Presentation from Delphi Day 2025 at Piacenza.
PDF
Developing games and graphic visualizations in Pascal
PDF
Castle Game Engine: intro, web, IFC, 3D scanning, mORMot
From an idea to a release on Steam: everything about making your game using C...
Creating 3D games and applications using Castle Game Engine
Castle Game Engine - highlights, features, plans as of July 2024
Developing mobile games and applications using Castle Game Engine
Castle Game Engine and the joy of making and using a custom game engine
Let's make games using Delphi! Presentation from Delphi Day 2025 at Piacenza.
Developing games and graphic visualizations in Pascal
Castle Game Engine: intro, web, IFC, 3D scanning, mORMot

Similar to Advanced Castle Game Engine features - forms, 3D generation, shaders, customizing editor (20)

PPTX
Scene Graphs & Component Based Game Engines
PDF
Sephy engine development document
PPTX
Soc research
PDF
Using FireMonkey as a game engine
PDF
Making A Game Engine Is Easier Than You Think
PPT
Game Engine Design: Anatomy of a game engine
PDF
Tools for developing Android Games
PDF
GameProgramming for college students DMAD
PPT
3.4 game architecture
PPTX
Introduction to Game Engine: Concepts & Components
PDF
The Ring programming language version 1.5.4 book - Part 50 of 185
PPT
BitSquid Tech: Benefits of a data-driven renderer
PDF
Designing an Objective-C Framework about 3D
PDF
main.pdf java programming practice for programs
PDF
The Ring programming language version 1.10 book - Part 61 of 212
PPTX
The next generation of GPU APIs for Game Engines
PPTX
.net for fun: write a Christmas videogame
PPT
Gdc09 Minigames
PPTX
PRESENTATION ON Game Engine
PDF
a data driven game object system
Scene Graphs & Component Based Game Engines
Sephy engine development document
Soc research
Using FireMonkey as a game engine
Making A Game Engine Is Easier Than You Think
Game Engine Design: Anatomy of a game engine
Tools for developing Android Games
GameProgramming for college students DMAD
3.4 game architecture
Introduction to Game Engine: Concepts & Components
The Ring programming language version 1.5.4 book - Part 50 of 185
BitSquid Tech: Benefits of a data-driven renderer
Designing an Objective-C Framework about 3D
main.pdf java programming practice for programs
The Ring programming language version 1.10 book - Part 61 of 212
The next generation of GPU APIs for Game Engines
.net for fun: write a Christmas videogame
Gdc09 Minigames
PRESENTATION ON Game Engine
a data driven game object system
Ad

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Machine Learning_overview_presentation.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
Teaching material agriculture food technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Big Data Technologies - Introduction.pptx
Programs and apps: productivity, graphics, security and other tools
Machine Learning_overview_presentation.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Unlocking AI with Model Context Protocol (MCP)
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
20250228 LYD VKU AI Blended-Learning.pptx
A comparative analysis of optical character recognition models for extracting...
Review of recent advances in non-invasive hemoglobin estimation
Diabetes mellitus diagnosis method based random forest with bat algorithm
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Teaching material agriculture food technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
MYSQL Presentation for SQL database connectivity
Dropbox Q2 2025 Financial Results & Investor Presentation
MIND Revenue Release Quarter 2 2025 Press Release
Per capita expenditure prediction using model stacking based on satellite ima...
Chapter 3 Spatial Domain Image Processing.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Big Data Technologies - Introduction.pptx
Ad

Advanced Castle Game Engine features - forms, 3D generation, shaders, customizing editor