Trying to recreate a Toon Shader from UDK in UE4

Hello. I’m having trouble recreating a toon shader in UE4 since light vectors can’t be used the same way anymore. I’ve been trying to find other shaders that would work as a post-process shader and recreating them, such as this one by JvtheWanderer. But I ran into a lot of problems with that shader. When I asked people for help they replied “Yeah I’ll help you” and then said nothing afterwards.

After troubleshooting for hours and googling for forum posts that might help me, I decided to start my own thread in hope that someone might help me recreate the toon shader I used in UDK instead. I found a nice shader made by Alex D which looks like this:

Here’s a screenshot of the effect it produces when combined with a diffuse map:

This material works by using a ramp texture to define how the shadow is rendered. I’m very new to shader programing and have learned most of what I know by trial and error. I mostly reverse-engineer other materials to figure out how they work and then use that to create my own.

When I tried to recreate this shader in UE4, but it said that I could only use light vectors if the material was a light function. I’ve yet to find a workaround for this and have tried numerous different ways of converting the shader into a post process.

Can anyone help me recreate this in UE4? Is there any way of creating post-process materials that can achieve cel-shaded shadows with ramp textures?

Thanks for your time.

Check out this thread, tons of cool ideas and experiments going on