Infinite Terrain in Godot 4 - The 'Wandering' Clipmap Terrain Technique (with LOD)

preview_player
Показать описание
Hi all, today I want to demonstrate an infinite terrain generation technique in Godot 4 (which also works for Godot 3.x of course) that uses a 'wandering' clipmap mesh and UV offsetting to control the projection of the terrain onto said mesh. The ground mesh is 'attached' to the player and moves around the world while the vertex shader that deforms it into a terrain offsets the UVs to counter each movement the player makes, thus causing the deformation to stay in place whilst its 'base' (ie, the ground mesh) is moving. I have heard of a few projects using this technique although I'm not sure how popular it is. It seems to be performing pretty well, offers lots of room for easy optimisation and is very easy to set up and manipulate.

I am using Godot 4 Alpha 8 for this one.

Clips I used that weren't mine:
- Death Stranding gameplay
- Red Dead Redemption II teaser

Music by Airtone

#MadeinGodot #GodotEngine #Godotterrain
Рекомендации по теме
Комментарии
Автор

OK I just realized (after uploading the vid) that you can easily optimize this even further by splitting the clipmap mesh into pieces before exporting to Godot. That way you can get frustrum culling to work for you. Just make sure to switch off Godot 4's auto LoD for the individual pieces to avoid cracking at the seams.

actualdevmar
Автор

This is a damn clever solution to a problem I feel needs more resources in GODOT. It also makes me think of the Futurama episode where they said their ship moves the universe around it instead of them flying around the universe. really cool!

riisezz
Автор

The problem is the popping as you can observe in 4:49. The sudden increase or decrease in geometry detail bring popping, the geometry popps out and in suddenly, which looks discontinuous and ugly. The counter this, you need to create transition regions near in the finer mesh, which starts 3/4 form its center, to the end. The idea is that the transition region slowly removes geomtery from finer region as it moves away to coarser one. So the height in the region will be (1-alpha)*finerHeight + alpha*coarserHeight, where alpha is between 0 to 1 and becomes 1 at end of the ring. This creates a smooth transition rather than sudden one, removing popping artifacts.

mpvrgbd
Автор

Mmm interesting, I used the first method but marked the outter edges of every terrain chunk as "Sharp edges" in blender so that the auto LOD in godot woldn't mess the seams.

raiseledwards
Автор

As you said yourself, you are sure that we'd like to use fragment shaders to texture the terrain. A tutorial on setting those up would be lovely.

gaeson
Автор

I don't use Godot, but the information provided by the video could be extremely helpful in the future, thank you so much!

lucasfarias
Автор

Looks amazing. One thing you should try with the vegetation is to make it fade in instead of just suddenly appearing they way its more smooth looking.

qubitx
Автор

Amazing video, very smart technique, thanks a lot for sharing these tips

SamFX
Автор

Nice, I'm using this technique as well for my terrain, though it is subdivided into several meshes to make it easier. I aslo added skirt vertices to blend the seams nicely.

WindBendsSteel
Автор

This is amazing and i have no understanding of the rocket science behind it. Even after the explanation. Incredible.

nopens
Автор

I was just about to install unity and I saw this. Godot 4 all the way! This engine might be the future.

ianrhys
Автор

Honestly, this is genius. Well done man, and thanks for making this available. It's going to help me with a similar issue and it's such a simple solution!

rje
Автор

Of all the big brain moves, this has to be one of the biggest brainiest moves I have seen. Thanks for sharing this technique

tekhiun
Автор

Using a premade clipmap like that is pretty brilliant, never thought of it that way. Lots you can do further with this, I think I'll definitely be using this technique for one of my projects.

rot_studios
Автор

Your project has the best graphics I've seen made with Godot so far. I think only developer with huge experience and programming skills can achive this by now. I'll keep with 2D hahaha

torrescle
Автор

Really liking the progress. The infinite terrain feature is spot on and looks super kool. That is really impressive. Keep it up! :)

KamranWali
Автор

I'm blown away by this technique. Honestly, this is one of the best things I've ever seen. It's so simple!

Quick Question: Why did you use nested square shapes for the clipmap? Wouldn't circles be preferable so that you get a more convincing horizon? (I'm assuming that the outermost square that makes up the level is also part of the clipmap. Sorry if I've misunderstood)

Oh, and what if you used many layers in the clipmap technique so that you could get a smoother gradient of LOD?

jaredjones
Автор

Hey, if you're recording screencasts for your videos I recommend that you disable subpixel AA for system font rendering - it will make the screencast text cleaner. Video compression butchers the colored pixels and makes them look messy.

unfa
Автор

BEAUTIFUL work!
Fabulous presentation and discourse; excellent video.

NOPerative
Автор

This is a interesting approach and is good in the way it is easy to setup. However a quad tree approach is far more performant with a chunking system due to only having to recalculate the terrain heights on a subdivision which do not occur very often, whereas this method requires you to recalculate the whole thing which includes many more vertices than a single chunk and it occurs every movement frame.

duelsoldier