Home Technical Talk

Shader development question

Musetatron
polycounter lvl 8
Offline / Send Message
Musetatron polycounter lvl 8
core_shadows.jpg

I want the shader to behave like in the diagram above.

Is it possible to make shader that bias core shadows towards the shadow side of forms? I don't know anything about how to write a shader nor what program to use though. I just wanna know if someone has done something like this in UE4 or other engine. As I think if I can manipulate how the core shadow will behave, it would really make great toon shader.

Replies

  • Farfarer
    Options
    Offline / Send Message
    This is pretty easy to do if you're on about simple diffuse shading (i.e. moving the light terminator further back). It's a bit trickier if you mean the actual shadow itself.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Yeah, its just a modified lambertian term.
    Standard lambertian is L dot N which goes to 0 at 90 degrees from the light, to get a single core shadow with a hard edge like that the lighting term goes something like
    Saturate(dot(l,n)+c) where c is some number between 0 and 1 that controls how far back the shadow goes.

    Really good toon shading however can get far more technical, but something like this would be an ok start.
  • Musetatron
    Options
    Offline / Send Message
    Musetatron polycounter lvl 8
    core_shadows2.jpg

    Thanks for the answers.

    Another question...Can I manipulate the shader to do per-face or per UV maps basis light terminator adjustment like in the picture? by some means of maps or something?

    If I want to do a toon shader of human head , I want the ability to manipulate with part of face can have more or less core shadows e.g. nose would produce less core shadows, eye sockets would produce more core shadows,ETC.
Sign In or Register to comment.