Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Shader Graph for toon shading not working once plugged in

Discussion in 'Shader Graph' started by chiupee, May 27, 2023.

  1. chiupee

    chiupee

    Joined:
    Jul 24, 2022
    Posts:
    4
    I'm sorry if this was raised or solved elsewhere, I've tried searching for a solution for days, and have not found anything that can resolve my problem.

    I am using Unity 2022.2.20, with the built in renderer pipeline. I am in linear color space (because it was one of the fixes recommended).

    In my shader graph, I connect a light direction node (negated), together with a normal vector node, to a dot product node. Then, I change the value range to 0 - 1, followed by multiplying by 5, connecting a floor node, then multiplying again by a range of 0 - 1. In each of these steps, I can see in the node 3d previews that what I am trying to achieve is correct. However, the moment I plug that all in to the base color, the main preview, as well as any materials I use the shader graph on, only displays on shade of color. I can turn the color lighter or darker depending on the value of my last multiplier node, but it does not show the gradient. can anyone figure out why? I have attached a picture of my shader graph:

    Toon Shader problem.png

    Any help will be greatly appreciated, thanks
     
  2. chiupee

    chiupee

    Joined:
    Jul 24, 2022
    Posts:
    4
    Sorry I forgot to mention, I'm trying to create a toon shading shader graph, so the stepped gradient is correct up until I plug it in to the base color, where it becomes a single shade.
     
    Last edited: May 27, 2023