# Terrain improvements

**URL:** https://forum.castle-engine.io/t/terrain-improvements/1357
**Category:** News
**Created:** [September 20, 2024, 5:06pm UTC](https://forum.castle-engine.io/t/terrain-improvements/1357 "2024-09-20T17:06:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [September 20, 2024, 5:06pm UTC](https://forum.castle-engine.io/t/terrain-improvements/1357/1 "2024-09-20T17:06:07Z")

</div>

| [![Terrain](https://forum.castle-engine.io/uploads/default/original/2X/7/7ff892c7249c846a2db6df5da659146c72911e1f.jpeg)](https://castle-engine.io/wp/wp-content/uploads/2024/09/screenshot-with-diffuse.jpeg "Terrain") |
| [![Terrain patches seamlessly connect](https://forum.castle-engine.io/uploads/default/original/2X/b/baac9791de8d994386465491ca5125e1e36fc8c3.png)](https://castle-engine.io/wp/wp-content/uploads/2024/09/terrain_normals_match.png "Terrain patches seamlessly connect") |
| [![New TCastleTerrain subdivisions meaning](https://forum.castle-engine.io/uploads/default/original/2X/2/2714c91f09e21a2c69d760edc087a31506e606ce.png)](https://castle-engine.io/wp/wp-content/uploads/2024/09/terrain_subdivisions_new.png "New TCastleTerrain subdivisions meaning") |
| [![Blender subdivisions meaning](https://forum.castle-engine.io/uploads/default/original/2X/0/0787ea6542f4bd9e203e8aea97b42b8ae8ce063e.png)](https://castle-engine.io/wp/wp-content/uploads/2024/09/blender_subdivisions.png "Blender subdivisions meaning") |

We did a few updates to our terrains, set up by the `TCastleTerrain` component. You can play with them e.g. by exploring the [examples/terrain](https://github.com/castle-engine/castle-engine/tree/master/examples/terrain) or separate demo [test-high-precision-terrains](https://github.com/castle-engine/test-high-precision-terrains).

1. The code is simpler and more efficient by internally using the `TIndexedTriangleSetNode` node for rendering.

This means always using 1 draw call to render entire terrain (unlike previous `TIndexedTriangleStripSetNode` rendering mode when `Triangulate=true` where each strip took 1 draw call; we considered using an OpenGL trick to connect multiple strips into one draw call by using degenerate triangles at strip start/end, but the `TIndexedTriangleSetNode` seemed more straightforward solution).

The `TIndexedTriangleSetNode` also maps directly to GPU (unlike `TIndexedFaceSetNode` that needs triangulation, unlike `TElevationGridNode` that needs a proxy).

The code is also simpler: we have just one rendering path. Previously, we had 2 approaches, and deprecated `Triangulate` was choosing which one we use.

2. Normals are calculated fast and are good for connected terrain patches.

3. New `TCastleTerrain.TriangulationIgnoreHeights` property. This determines how we split quads into triangles.

4. `Triangulate` is now a deprecated alias to `TCastleTerrain.TriangulationIgnoreHeights`. If you used this to request consistent ordering — then new `TCastleTerrain.TriangulationIgnoreHeights` is just as good. If you used `Triangulate` for anything else — then it is probably not needed anymore, new rendering takes the best from previous 2 algorithms.

5. `TCastleTerrain.Subdivisions` meaning changed.

_Note: This post details changed done last month, even before [7.0-alpha.3](https://castle-engine.io/release_7.0-alpha.3) release._ Yeah, we have a backlog of announcements 🙂

Next steps in terrains: synchronize, review and merge [Base terrain editing tools for Castle Engine Editor](https://github.com/castle-engine/castle-engine/pull/612) pull request from _Andrzej Kilijański_ to introduce a big new feature – terrain editing! Stay tuned and please [support us on Patreon](https://www.patreon.com/castleengine)!
