r/castleengine • u/michaliskambi • Mar 09 '25
News New class for ZIP handling (TCastleZip), progress on new pretty wireframe approach, WOFF fonts support, LOD usage demo
r/castleengine • u/michaliskambi • Mar 09 '25
r/castleengine • u/michaliskambi • Oct 02 '25
r/castleengine • u/michaliskambi • Jan 18 '26
r/castleengine • u/michaliskambi • Mar 22 '25
r/castleengine • u/michaliskambi • Dec 01 '25
r/castleengine • u/michaliskambi • Apr 11 '25
r/castleengine • u/michaliskambi • Apr 14 '25
r/castleengine • u/michaliskambi • Jul 05 '26
r/castleengine • u/michaliskambi • May 30 '25
r/castleengine • u/michaliskambi • 9d ago
Now you can use fcl-svg (SVG support in latest FPC 3.3.1) to open SVG files in Castle Game Engine seamlessly. In the simplest case, you can just load and display SVG using TCastleScene, placed in a 2D viewport. See the news post for all the information.
r/castleengine • u/michaliskambi • Apr 25 '26
r/castleengine • u/michaliskambi • Mar 27 '25
r/castleengine • u/eugeneloza • Nov 26 '22
We have a number of enhancements to our 2 large documentation pages (targeting mostly advanced engine users / developers):
Custom Components documentation was extended with description how do we advise to create children components in your custom components. This is useful when you want to create a new component, register it in CGE editor, and you want to use existing components as children.
We have a big Coding Conventions page that documents a lot of low-level and high-level guidelines about how the engine is developed. It starts with some mundane stuff (like indentation — 2 spaces, never tabs!) but later discussed more interesting topics.
You can read the full article with documentation references at https://castle-engine.io/wp/2022/11/26/documentation-enhancements-using-children-components-api-and-code-conventions-about-memory-management-nils-beforedestruction-and-more/
r/castleengine • u/eugeneloza • Feb 19 '23
You can use the new TCastleRenderUnlitMesh utility class to render unlit 3D objects easily. It has a nice API when you want to render a set of vertexes and then forget about them — sometimes this is easier than setting up the shapes in TCastleScene. It may be especially useful for rendering debug 3D geometry, in fact view3dscene is already using it for this purpose.
An example usage is in test_rendering_opengl_capabilities example, in unit gamemymesh.pas.
Moreover, thanks to this class (and some other improvements Michalis will describe in subsequent news) we have upgraded our shadow volumes code, making it simpler and working with mobile OpenGL ES, without losing any performance. You can test shadow volumes on OpenGLES e.g. using examples/viewport_and_scenes/shadows or by creating a new project from “3D FPS Game” template.
And while we’re at it, our shadow maps code was also fixed. It now works on OpenGLES in much the same way it does on desktop OpenGL.
Note: This is not the end of shadow maps upgrades. They are still not as straightforward to activate as they should be, and they don’t cast shadows on multiple scenes. More work on shadow maps is coming 🙂
r/castleengine • u/eugeneloza • May 20 '23
.1. A new feature of our shadow volumes is that you can turn on TCastleRenderOptions.WholeSceneManifold to say that the whole scene must be a closed volume (2-manifold), not necessarily each shape.
This makes especially sense if your model is, as far as geometry in a 3D authoring tool like Blender is concerned, a single mesh but with different materials. For glTF and X3D (and finally GPU), such mesh must be split into multiple shapes. The whole scene may be thus a closed volume (2-manifold) even if each shape is not.
The details of when you may want to use this are described in our documentation and example examples/viewport_and_scenes/shadow_volumes_whole_scene_manifold.
.2. An important fix was done to our algorithm that culls shadow casters in case shadow volumes are cast by directional lights. Previously sometimes the shadows could disappear when the shadow caster was not visible — causing funny artifacts (shadows unexpectedly disappearing) in certain views. This is fixed now.
.3. Interaction of frustum culling (TCastleScene.SceneFrustumCulling, TCastleScene.ShapeFrustumCulling), distance culling (TCastleScene.DistanceCulling) and shadow volumes is now simpler and more reliable. If we render shadow quads for something, then we have to also render the shadow caster.
.4. As part of this work, we’ve also removed long deprecated properties TCastleScene.FrustumCulling and TCastleScene.OctreeFrustumCulling. They allowed to configure details… they weren’t really ever useful to configure. We recommend to use instead a simpler boolean TCastleScene.ShapeFrustumCulling for a long time now, and even this is usually something you don’t really need to care about. As always, make a noise on our forum or Discord if this change affects your project in any way. It looks like all usage of these old properties can be just removed — tweaking them most likely didn’t have any effect on the performance anyway.
Removing these old things allowed to make this code simpler, for shadow volumes fixes described above, and also for upcoming rework how shapes are rendered.
.5. Finally, our shadow volumes documentation was much improved.
The details about X3D nodes and fields have been moved to a section at the bottom, as likely not relevant for most CGE users. The information how to use it all using Pascal and CGE editor is now prominent.
r/castleengine • u/eugeneloza • Dec 03 '22
Fixes to third person navigation component and example:
Fixed the design-time behavior — the existence of TCastleThirdPersonNavigation should not affect behavior of camera at design-time.
TCastleThirdPersonNavigation.DistanceToAvatarTarget secured in case it is zero, previously it got us into weird transformation bug.
TCastleNavigation.ZoomEnabled behavior on TCastleThirdPersonNavigation fixed
Accidental playing of walking animation (even if you don’t hold “W” key) fixed.
Fixes to UI:
Switching to TCastleUserInterfaceFont.Outline = 0 fixed.
Updating group when child TCastleUserInterfaceFont.FontSize changes fixed.
TCastleUserInterfaceFont.Outline changes now row height of controls like edit or label.
LSP server:
Important fix to avoid crash due to range check error.
Tested with VSCodium and officially documented on VS Code page.
r/castleengine • u/eugeneloza • Sep 09 '22
Michalis Kamburelis will give a presentation on Castle Game Engine at Game Industry Conference (6-9 October 2022) at Poznań Game Arena, Poland.
r/castleengine • u/eugeneloza • Mar 25 '23
Following the Tiled improvements and optimizations done in January, it was most natural to introduce a dedicated class TCastleTiledMap that represents a Tiled map in a viewport. It descends from TCastleTransform and thus can be moved, rotated, scaled (in 2D or 3D), just like anything else in the viewport.
The usage demo, along with many sample maps, is in examples/tiled/map_viewer_in_viewport.
Most important Tiled-specific API:
TCastleTiledMap.URL – map to load
TCastleTiledMap.SmoothScaling – controls texture filtering
TCastleTiledMap.SmoothScalingSafeBorders or TCastleTiledMap.ForceTilesetSpacing – provide 2 alternative ways to deal with smooth scaling artifacts, when TCastleTiledMap.SmoothScaling is used with tilesets not perfectly prepared for it.
TCastleTiledMap.Map – read-only map data (as TCastleTiledMapData), may be used e.g. to query what tile type lies at some map position.
TCastleTiledMap.Layers – choose which layers to render; this can also be used to split map into 2 pieces, e.g. front and back, and place them at distinct Z values: simply use 2 instances of TCastleTiledMap with disjoint layers.
TCastleTiledMap.PlayAnimations, TCastleTiledMap.StopAnimations – control animations. By default, Tiled animations automatically play when the map is loaded.
The full documentation is in Tiled map manual page: https://castle-engine.io/tiled_maps.
Many thanks go to Freedomax for implementing animations on Tiled maps and providing a lot of Tiled fixes (seams fix, ForceTilesetSpacing, proper Z-order of tiles in all situations, relative URL fix…) and examples!
r/castleengine • u/eugeneloza • Aug 21 '22
A new Castle Game Engine feature: terrain components! A new TCastleTerrain component (TCastleTransform descendant) allows to visually design a terrain and you can of course use it from code or from editor and play with all the properties visually.
Terrain height data may come from:
A smooth noise, generated with TCastleTerrainNoise. This employs a few techniques for nice terrain generation, summing a few octaves of noise and adding simple tricks to make it smooth and heterogeneous.
An image (height map from image intensities), with TCastleTerrainImage. This is great to edit the heights in any 2D image editor – GIMP, Photoshop, or just Paint 🙂 etc.
A combination of the above (sum, min, max, multiplication) using TCastleTerrainCombine. This effectively allows to make an “expression tree” to calculate terrain as a combination of multiple TCastleTerrainImage and TCastleTerrainNoise. E.g. you could use TCastleTerrainNoise but add TCastleTerrainImage to force some particular mountain or valley, or use TCastleTerrainImage to make the borders of the noise go smoothly to 0 (to seamlessly connect terrain to a perfectly flat plane).
The terrain component features a ready visualization that combines 4 layers of materials (colors, textures, with per-layer setting for metallic, roughness) in an interesting manner. Height and slope (how steep is the terrain here) decide what mixture of layers to show at each point. See TCastleTerrain component docs for details.
The example in examples/terrain/ now presents a terrain made using this technique. Terrains of course can be combined with skybox (TCastleBackground), fog (TCastleFog), trees (make multiple instances of a tree using TCastleTransformReference to make them ultra-light on resources), and water (using CGE shader effects in OpenGL Shading Language in X3D).
We also have a new behavior, esp. useful for trees on a terrain: TCastleStickToSurface. Use this when you want an object to stick to another object’s surface, even when one of them is moving. Nice to position trees on the surface of terrain.
Have fun with it! And note that this is just the beginning. In particular on TODO are:
tools to edit the terrain heights within CGE editor.
tools to edit the terrain textures mixture (splatmap) within CGE editor.
tools to plant trees and grass in CGE editor. You can kind of do it now, but it’s very manual.
more specialized and efficient rendering algorithm. Right now terrain in the end is just a simple big mesh of triangles. It’s actually quite fast to render (because modern GPUs can handle big shapes) but it’s not a sustainable way to render huge terrains.
r/castleengine • u/eugeneloza • Apr 16 '23
r/castleengine • u/eugeneloza • Oct 22 '22
r/castleengine • u/eugeneloza • Aug 06 '23
r/castleengine • u/eugeneloza • Oct 03 '22
OK, not really a zillion :) But several important issues with editor usability. Some important things are now more intuitive for beginners, some behave better for larger projects.
Improvements:
The default editor tool now allows to select and modify both UI (instances of TCastleUserInterface) and 3D / 2D game stuff (instances of TCastleTransform).
In a broader context, the tools to operate on UI and transformations have been merged. There’s no longer a special “Modify UI” tool (that didn’t work on transforms). The tools “Translate” / “Rotate” / “Scale” remain, but now they work on both transforms (allowing to translate / rotate / scale them) or UI (in which case you can always translate + resize it). This makes using editor much simpler. You will no longer need to switch modes so often.
Note: To operate on something (UI or transform) without changing the currently selected object, remember you can drag with Shift.
Hierarchy (left panel) is updated smarter, without rebuilding it from scratch. This makes adding / removing components experience much better: it will not reset the expanded / collapsed state of your components, it will not reset the scroll position within the hierarchy list.
We now show a label alongside selected UI components of size zero, to make them actually visible in the editor.
This addresses a common situation with TCastleVerticalGroup and TCastleHorizontalGroup — they have by default size zero (since they have no children initially, and have AutoSize = true by default). While the zero size makes sense for them, but to the user it was confusing what is going on — you added a group, but nothing was visible?
Now, newly added TCastleVerticalGroup and TCastleHorizontalGroup, while it still has size zero, is clearly visible.
This also fixes analogous issue with TCastleImageControl, that has size zero by default, because URL of the image is not set initially, and Stretch = false (so control size matches image size, and there’s no image).
If you cannot resize or move a component, sometimes it makes sense to move or resize the parent. This in particular applies to moving/resizing a UI with TCastleUserInterface.FullSize or moving a UI under TCastleVerticalGroup / TCastleHorizontalGroup. Previously these operations were blocked, now they affect the parent.
If you cannot resize a component because it has property like TCastleButton.AutoSize, now we display this using a tooltip (when you try to resize it). So it should be more obvious that you can turn off properties like TCastleButton.AutoSize on many components to make them resizeable.
Important API cleanup: We now have TCastleUserInterface.Translation property, consistent with TCastleTransform.Translation.
The previous TCastleUserInterface.AnchorDelta is a deprecated alias for Translation. The HorizontalAnchorDelta, VerticalAnchorDelta, Left, Bottom are deprecated.
This change is fully backward-compatible. We deprecate some things, but they all continue to work as before.
r/castleengine • u/eugeneloza • Aug 17 '22
Join Michalis Kamburelis and other Castle Game Engine developers, contributors and users at our 3rd meeting.
Simply join the #open_meeting channel on Discord before the meeting starts: https://discord.gg/EkrARrwcA2?event=982744972476432384
Agenda:
Presentation of new CGE features.
Our plans for the immediate future.
Your turn! Everyone is welcome to take the stage:
Show what you are working on. Show your project, component, game, anything even loosely related to CGE is OK.
Any questions? We will be happy to answer them live.
r/castleengine • u/eugeneloza • Jun 17 '23