Geometry Terrain (Geometry Nodes)

by Alexander Filippov in Modifier Setups


Contents

  1. Introduction
  2. Installation
  3. Starting out
  4. Geometry Terrain Node
  5. Material
  6. Export
  7. Voxel Cut
  8. Unity Import

Documentation with images can be found here.

Introduction

Geometry Terrain was created as a replacement for traditional Terrain Systems for Games. Height displaced big terrains just simply lack the detail that players expect. Geometry Terrain can fully replace these terrain systems for smaller worlds or add more detail quickly with cliffs and rocks without the need to manually create many assets that will be reused many times.

It works by projecting a height map and displacing the mesh correctly without any visible seams. The results are very natural rock formations that can be achieved with minimal effort in minutes.

While the default settings and textures are better suited for smaller environments, Geometry Terrain can be tweaked to support large environments with big rock formations or individual assets like rocks and other structures.

Installation

Geometry Terrain

Geometry Terrain is a blend file. Download the Blend file store it somewhere you can easily find. The necessary content should be appended. The Blend file also serves as an example.

Voxel Cut

  1. Download the included add-on.
  2. Go to Edit > Preferences > Add-ons > Install.
  3. Select the downloaded file.

Starting out

Start by modeling a simple level. Make sure you do the following:

  • Use Edge Crease on some edges for more variation.
  • Set the shading to smooth.
  • Create 2 UV maps.
  • Turn on Auto Smooth and set it to 180 degrees.

First UV map

  1. Object Mode > File > Append.
  2. Select the included Blend file.
  3. Object > Terrain_triplanar_*. Select and append all 5 at same time
  4. Add a UV Project Modifier to your terrain.
    1. Set the Projectors Property to 4.
    2. Add all 4 Arrow Empties that represent the directions to the Object list.

This means 0.25 position world scale. This makes 1 unit 4 meters. This UV map will be used for cheaper non Triplanar shader variants.

Second UV map

UV Unwrap the model and optimize it however you like. This UV map will be used for lightmapping.

Geometry Terrain Node

Append the Node Tree

  1. Object Mode > File > Append.
  2. Select the included Blend file.
  3. NodeTree > Geometry Terrain.

Add the Modifier

  1. Select your terrain.
  2. Go to the the Modifier Properties and add Geometry Nodes.
  3. Select the GeometryTerrain Node Tree.

Inputs

Input Description
Resolution Represents Subdivision Surface Level and sets how many times the mesh is subdevided.
Stregth Represents displacement amount.
UV Scale Represents UV world scale. 0.25 position world scale makes 1 unit 4 meters.

Customization

A custom displacement texture can be set.

  1. Select the terrain.
  2. Go to the Texture Properties and set a custom heigth texture.
  3. Make sure the color space is not set to sRGB.

Material

Append the Material

  1. Object Mode > File > Append.
  2. Select the included Blend file.
  3. Material > Terrain.

Add the Material

  1. Select your terrain.
  2. Go to the the Material Properties and replace the Material.

Customization

You can replace the textures of the Material and change it to what you need. The example textures are packed. You obviously do not have to pack them the same way or pack them at all.

  • Red, Metallic
  • Green, Ambient Occlusion
  • Blue, Height
  • Alpha, Smoothness (1 - Roughness)

Cheap Variant

You can also append the additional cheap variant of the material. You can use the cheap material to preview how it would look on lower LOD levels that do not use the tri-planar shader.

Please keep in mind that the cheap Material uses offset and scaled UV settings.

Known Issues

Lighting in Eevee is calculated incorrectly. This causes seams that should not be there.

Export

Please check out the included Blend file. You can copy the example setup or come up with your own.

Optimization

It's generally not a good idea to just use the high resolution model that only has Geometry Terrain applied. Creating a duplicate with a Decimate Modifier and using the original as a reference only will decrease the vertex count and improve the results, because it will smooth the unintended jagged edges.

This means that you do not have to use the Resolution Property of Geometry Terrain to reduce the vertex count for your main model and lower LOD models. Decreasing the Ratio of the Decimate Modifier will respect the shape of original much better.

I would recommend adding a Data Transfer Modifier last to copy the normals from your high resolution Terrain.

Collider

In most cases your terrain needs a collider. To create a Mesh Collider, copy your terrain and set a low vertex count. Very low vertex counts are achived by combining a low Decimate ratio with a slightly lower Geometry Terrain resolution. Name it appropriately and include it when you export. It's better to use one big Mesh Collider. You will have less verticies and will not get glitches at the edges of seperate colliders.

Mesh Colliders generally do not use normals. They can be ignored.

File Export

  • Your terrain resolution should be set to the highest value your LODs use! This is needed for the Data Transfer Modifiers.
  • Make sure to limit what is exported. The original high resolution terrain should not be exported!
  • It's recommended to apply all Transforms when you export. All origins should be zero.

Voxel Cut

When you have finished your terrain Voxel Cut can help you optimize it for realtime applications. This involves multiple steps.

  1. Select your terrain.
  2. Determine the highest resolution you want to go with and select it.
  3. 3D View > Sidebar > Misc > Voxel Cut.
  4. Set group name.
  5. Press the Voxel Cut button.

This will create many Empties with the cut objects as children. Repeat this process. Select the terrain, lower it's resolution and change the group name to something that identifies it as lower detail.

Consider creating a copy of the Material or using the included cheap variant and setting it on the terrain for lower LOD objects. This will allow you to have cheaper shader variants for lower LOD objects that do not use Triplanar shading. You can save many texture samples, while making use of the box projected UV map. This will only work at large distances. There is a visual difference. You could do this in Blender or in the Engine you are importing into.

Empties will only be created the first time. Terrain pieces will be grouped together as children.

Inputs

Input Description
Voxel Size Determines the number of cuts the terrain will have. The size of each piece will be close to the size this sets.
Group Name This string will be appended to each terrain piece.
Cut on Z Axis Cut on the up axis? Cutting on z introduces unwanted cuts and might lead to import errors. Use with caution.

Unity Import

The following information likely also applies to other engines.

Box mapping is more complicated than simple Triplanar mapping. Unity Shader Graph comes with a tri-planar node that will not project correctly. You have to use a custom function. This shader projects UVs correctly in the TRIPLANAR_CORRECT_PROJECTED_U define. A reconstruction of the Blender shader for Unity HDRP can be found here.

In most cases LOD Groups should not be added to individual pieces. This is the biggest limitation of the entire system and and the reason it can not replace large terrains, because it will add visible gaps. If you want to try anyway, adding LOD Groups can be automated. Here is an example.

Only LOD 0 objects should be static. Other LOD level objects should only have Static Batching enabled. Otherwise Unity will create duplicate lightmaps that you do not need. Other LOD level object should copy the lightmap from LOD 0 objects.

When you copy lightmaps with very low resolutions from LOD 0 objects to other LOD level objects you will likely get visible seams. In practice this only means that you should not use Realtime Environment Lighting.


$20

Have questions before purchasing?
Login to message

Details
Sales 10+
Rating
1 ratings
Published about 3 years ago
Software Version 4.2, 2.93
License Royalty Free
Discover more products like this

geometrynodes terrain geometry nodes procedural