Search Unity

Shader that clamps final rendered values

Discussion in 'Shaders' started by S37H, Mar 20, 2013.

  1. S37H

    S37H

    Joined:
    Apr 1, 2012
    Posts:
    25


    I'm working with the lighted toon shader and would like to know if there's any way to eliminate the lights adding their values together when they overlap. The middle and right diagrams are what I would ideally want, but at least just one of them would be helpful. Also, I don't have to have fall off for this. It could be solid black (un-lit parts) and then a solid color where lit (or texture).

    Seems like I need some kind of value clamp on the final render.

    Thanks!
     
  2. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
  3. S37H

    S37H

    Joined:
    Apr 1, 2012
    Posts:
    25
    Thanks for the response!

    I've spent a few hours trying to read over blending and how I might incorporate BlendOp Max into my shader but I don't have much experience working with them. I'm going to keep poking at it but if you have an idea of how I might incorporate it that would be awesome. I'm wondering if this only applies to the color values, not necessarily the "light" values, which might mean this wouldn't clamp a maximum for light blending. I could be wrong of course. Here's the basic lit toon shader I'm trying to incorporate BlendOp Max into.

    Any direction would be great. Or if there's somewhere I can pay to have a shader made would be good too :)

     
  4. S37H

    S37H

    Joined:
    Apr 1, 2012
    Posts:
    25
    Nevermind! Finally got this working the way I need it once I added a texture into the shader - *palm face* Turns out I didn't need to modify the shader at all.

    Thank you again : )