The shadows in the shader are blue

For some reason every object I have has a bllue shadow underneath that ignores the cel shading:

Preview:

Scene:

Hello there @Whyskash!

From your screenshots, the material preview looks fine, and the blue spot only shows up in the level, so that points to something coming from the scene’s lighting or reflections, rather than from the cel shading effect itself.

I would test the following, one by one, to find the possible cause:

  • Select the SkyLight in your level, and temporarily disable it, or set its Intensity to 0. If the blue goes away, it’s the sky’s ambient light tinting the shadow side

  • Select a Post Process Volume (or add one if there’s none), enable Infinite Extent (Unbound), and set Reflection Method to None. If the blue spot disappears, then it’s a reflection of the sky

  • In your material, set Specular to 0 and Roughness to 1, and check again. This should remove any shiny reflection directly on the object

  • In the viewport, go to View Mode > Buffer Visualization, and compare Base Color, Diffuse Color and Specular Color, to see in which one the blue shows up

If all these fail to pinpoint the issue, then test by creating a new, empty level between your project. Then, add only a Directional Light, a post process volume, your cel shading material, and one of your spheres. If the blue spot doesn’t show up there, then the cause is a particular element only present in your original level.

I found where the issue lies but I’m not sure how to fix it…

This part right here is the one I have for the lighting, so it’s changes the color inside the Cel shading, if I just ignore it, the blue shade disappears

Hello again!

Checking with my peers on that latest find of yours, we think the problem could be the Normalize node. That node is usually used with direction vectors, not colors. It scales the value to a length of 1, no matter how bright or dark the pixel is. And that works fine in lit areas, but on the shadow side, the scene color is almost black, with a very faint blue from the sky light. Normalize takes that faint blue and pushes it to full strength, so a nearly black pixel turns bright blue. The Multiply by 1.5 after it boosts it as well.

There would be two approaches to fix the problem, depending on the needs of your scene.

The first one and easiest one, is to delete that whole chain, PostProcessInput0 > Normalize > Multiply (1.5). After that, pick the LightColor parameter (which you have established, as seen in your screenshot from the first post), and connect it to the B input of the Multiply connected to Desaturation. This should give you full control over the tint, and it won’t change with the scene’s lighting.

The second method, would be to kept the tint, but only make it work in lit areas. To do that, let’s break it down in steps:

  • Keep the PostProcessInput0, Normalize and Multiply (1.5) nodes as they are

  • Add a Desaturation node, connected to the PostProcessInput0 color, to get the brightness of each pixel. Then add a Saturate node after it, so the value stays between 0 and 1

  • Add a Constant3Vector, and set it to white (1,1,1)

  • Add a Lerp, with the white Constant3Vector in A, the Multiply (1.5) result in B, and the Saturate result in Alpha

  • Connect the Lerp to the B input of the Multiply that goes into the If node, finishing the chain

This way, the darker a pixel is, the closer the tint stays to white, so the shadows don’t get the blue boost, while the lit areas should keep their color from the scene.

(post deleted by author)

I’m specially interested in the second method since I want to have light sources in different colors, but it’s giving me an error and I’m not sure how to work around it, I tried adding a mask component but with no avail

That “float3 and float4” error is SceneTexture having 4 channels, and the Constant 1.1.1 having 3, so the Lerp can’t resolve how to blend them. I’m not sure where you tested the component mask, as you screen as none in that branch, so here’s how I would do it from scratch:

  • Add the mask node, and connect the SceneTexture color output to it

  • In the mask details, enable RGB, and leave A disabled

  • Now, connect the mask output to both the Normalize and Desaturation nodes, replacing their previous connections

  • If you added a mask somewhere else, remove it

  • Hit Apply, and the errors should clear

If there are any problems in other parts of the material (like the If chain), please share them so we can continue investigating.