Hi there!
I'm developing a 3D game and I'd like to have a Sable look and feel, with outlines and flat shaded on the 3d models, I got the outlines by using a post processing shader and I'm doing the flat shading direcly on Blender, by connecting a color directly to the output.

However, by doing that no projected shadow appears under the models. For instance, the player shadow is not projected on the ground, because the ground has a flat shaded as well.
So, what should I do to have the flat shading look and feel but keeping the projected shadows?

Btw, I'm using a single directional 3d light with default values to create the scene light.

Any help?

    fabianom well you can't have the cake and eat it too.
    shadows are the absence of light.

    if you want to keep the shadows and have a flat look, use a standard material with nothing special, then add an environment and change the way ambient lighting is applied, set it to color and set the color to white (or some stylistic choice).
    this will apply light to the model from all sides.
    https://docs.godotengine.org/en/stable/tutorials/3d/environment_and_post_processing.html#environment-options
    you could also disable reflected light and other options until you get the look you want.
    then disable specular in the material, and you could change the diffuse to either lambert or toon.

      fabianom Use second material pass and in shader's light() function discard pixels according to ATTENUATION value. This will let you catch shadows over otherwise flat/unshaded first pass. Note that godot will consider dark side of objects as being in cast shadow as well. No way around this afaik.

        xyz Thanks dude.
        Is it a shader to be applied to the material? If so, could you give me more hints to apply that please? My shader skill is horrible. xD

        • xyz replied to this.

          fabianom Yes, the shader material should be applied as the next pass material on the base material.

            xyz could you give me an sample code for that shader please?

            • xyz replied to this.

              fabianom could you give me an sample code for that shader please?

              You have chatgpt for making code samples.