3D procedural generation in godot with perlin noise? (Are there guides?)

Godot Version

4.2

Question

I will describe the task: I want to generate a world of rather specific shapes, mostly square, according to principles similar to minecraft. However, the world will not be destructible, and will not consist of many small blocks (like in minecraft), but rather of segments with large blocks and sharp height differences (setting like in THE MAZE RUNNER, brutalism) I have some ideas on setting up noise for this, but that’s not the problem.

The problem is that I really know very little and the documentation sometimes is not very easy for me. Now i need to know two things: how to dynamically and “right way” generate a mesh from code (without 0 fps), and how to control the generation values with using noise parameters. I know that noise can be obtained using FastNoiseLite, and I have already studied some of its methods, but the practical application is still poorly understood by me

So, are there articles/textbooks/manuals that cover this topic in stages, or maybe there is other useful material? I am sure that I will figure out a lot on my own, if I can start from somewhere and understand the basic practical principles. I really want to figure out how it makes, and I’m especially concerned about the optimization part, since such things usually become a problem at late stages, when it’s “too late” to change something.

Thanks

RayTracingTheNextWeek by Peter Shirley may cover this.

https://raytracing.github.io/books/RayTracingTheNextWeek.html#perlinnoise/usingblocksofrandomnumbers

Good Luck!

1 Like

Meshes are points in 3d space. Point positions are represented by 3d vectors. A vector represents a length and direction from the origin. The origin is an arbitrary starting point in space that is zero <0,0,0>.

Points make triangles, the fundamental polygon of GPU rasterization. You need four points to make one square face consisting of two triangles. 8 points to make 12 triangles into the shape of a cube. But you can just use the pre-built box mesh in Godot. No need to draw your own. (Also Blender is better for learning how meshes work.)

Since you have your noise already, you simply sample your noise in the x and y 2D coordinates ( which become your x and z in 3d). The sampled value becomes height, with white being the highest 3d Y point and black being the lowest 3d Y point. You now have an <x,y,z> vector to translate into your world coordinates, then all that is left to do is instantiate a standard Godot box mesh at the vector position.

Repeat until you reach your desired draw distance that doesn’t tank your frame rate.

2 Likes

RachelfTech posted a project on itch.io last month that does exactly this and attached a video devlog that would at least save you some time on gotchas. RachelCraft by RachelfTech

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.