Home Unreal Engine

I'm having problems with a ramp shader for toon shading...

Ok, it's been an absolute nightmare trying to learn about how to use gradient maps for toon shading, as I keep on seeing examples of people using it but never any explanation to how they've done it. I was lucky enough to come across polyphobia's TF2 shading tutorial ( http://www.moddb.com/games/unreal-tournament-3/tutorials/tf2-shading-in-ut3 ), which i'm currently following, but i'm running into problems.

At this stage ( http://media.moddb.com/images/articles/1/29/28341/auto/003.jpg ), polyphobia already has a working ramp shader. Mine however, seems to be broken. Not only is there still a dark shadow on the sphere, but the ramp seems to repeat itself. I have no idea what i'm doing wrong.

How it looks in the material editor: http://i.imgur.com/sDhQz.jpg
How it looks when applied to a mesh: http://i.imgur.com/269OM.jpg
And the gradient map itself: http://i.imgur.com/W6i7H.png

I'm using UDK version 9375 with DirectX 11 enabled. Oh, and if you're wondering why the blending mode is set to dithered, that's because when I have it set to Opaque the shading becomes solid black with glitchy transitions.

Help? Please? D:

Replies

  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Try connecting it to CustomDiffuse also and set ShadowBias to 1.
  • BishyT
    Options
    Offline / Send Message
    No, that didn't work. Shadow Bias seems to have no effect, and plugging it into custom diffuse (while also having it plugged into custom lighting) doesn't do much but make it slightly brighter.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Hmm, strange. Try putting a Constant Clamp after the Dot node, and use the values 0.01 and 0.99

    Honestly, it's weird, it should be working if you're following the tut.
  • BishyT
    Options
    Offline / Send Message
    Before I do anything else, i'm going to try updating to the latest version of UDK. You never know, perhaps it's a bug with the version i'm using.
  • BishyT
    Options
    Offline / Send Message
    Ace-Angel wrote: »
    Hmm, strange. Try putting a Constant Clamp after the Dot node, and use the values 0.01 and 0.99

    Honestly, it's weird, it should be working if you're following the tut.

    Oh my god it worked! The ramp now works fine!

    And as for the dark shadows, turns out that's the half lambert. Removing it gives me the look i'm after! :D

    Thank you so much you are lovely! I'll post screenshots once i've had a good play with this.

    EDIT:

    Here's a screenshot of my little toon setup. Managed to get the basic toon shading as well as a toon outline down. Of course it'd look better on a model that was actually intended for this kind of shader (an anime styled character preferably).

    Screenshot: http://i.imgur.com/JxR0Y.jpg

    Btw, is it possible to apply ambient occlusion on a single surface (without using a post processing shader), or would I have to bake some ambient occlusion into the texture?
Sign In or Register to comment.