Flat shading Godot 4

Godot Version

4.2.1

Question

Hello. I want to make all models in my scene flat shaded. I managed to archive this effect with a terrain which I constructed procedurally by calling SurfaceTool.set_smooth_group(-1)
Here is a screenshot of the terrain:

image

Besides procedural terrain I have several models composed of Godot built-in primitive shapes. And I can’t make them to look the same style. Toon shading gives somewhat similar result but not exactly. Toon makes faces either lighted or shadowed, only two colors.

I heard that shaders can do all kinds of magic and tried to research the topic. I found a mentioning about interpolation qualifiers, but given that I’ve never programmed shaders myself, I gave up on this one.

I think I will be able to archive the result by running my terrain generation script over all meshes in the scene, but this solution seem ugly. Please, help me with this one. :pray:

Flat shading vs smooth shading is a decision you make when you author your meshes. Godot’s primitive shapes are always smooth shaded.

If you want to continue using primitive shapes, then you will have to write a script that converts them to use flat shading. However, I strongly recommend instead creating your meshes in a tool that is made for creating meshes (like Blender) instead. Blender will allow you to easily switch between flat shading and smooth shading.

2 Likes

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