Is it possible to make a stylized ground/dirt spatial shader?

Godot Version

4.4

Question

I am trying to create a fully procedural (voxel) world and I am currently looking into (spatial) shaders. I was wondering whether it is possible to make a shader to make a stylized ground/dirt material?

I want it to look something like this:

I am currently looking into a way to create the darker cracks, but I ended up with a voronoi shader that only produces ‘tiles’. Like this:

Is it even possible to make a shader which roughly produces something similiar? I don’t have any experience with shaders, so I don’t really know where to begin with this.

Any help or insights are very welcome.

I’d recommend using a PBR material. There a lot of free ones online.


You can also make your own in a number of ways.

Free program.

Paid program.

Paid class on making PBR materials in Blender that you can export:

First of all, if you take or create procedural shader material outside of Godot, it will be very difficult (practically impossible) to transfer it to the engine. This includes material created in Blender.

Therefore, it is recommended to use Material Maker created on the basis of Godot to create materials.

Well, I am using Godot shaders, so I am making the shader within Godot. Are there other ways of doing that? I understand from you that that is not really something someone should do?

My idea was to add the shader to different voxels (duh) and use their positions as an offset for a noise map which is then used by the shader to look differently for each voxel. Is that something that could be achieved with Material Maker?

Or is that a stupid idea from me that I should abandon?

I haven’t researched this in depth. Give it a try.

Or is that a stupid idea from me that I should abandon?

Almost all discoveries, especially great ones, seemed like silly ideas at first. Don’t be afraid of ideas that seem silly. Just give it a try.

If you haven’t had a lot of experience creating shaders, I suggest Useful code snippets - Godot Shaders and https://thebookofshaders.com/

If you haven’t done a lot with shaders before, a better approach might be to try to create a shader that takes images as parameters and places these in random positions based on a noise texture. Instead of creating the cracks purely procedurally, you could instead make them appear at random based on a noise texture.