A different kind of cel shader

An advanced realtime cel shader project. Questions and suggestions welcome.

Standalone shader project and presents can be found at : https://.com/antidamage/CelShader
Quick start

  • Migrate the CelShader folder from the sample to your target content folder.
  • In your project create a global (unbound) post-processing object.
  • Go to the Misc tab and add the CelShader instance as a blendable.

It’s that easy.

Right here: http://skull.co.nz/cel-shader-introduction/


**Debug your shader here. You can enable/disable the shader entirely, or force it to only draw lines. This in itself is a neat effect.
**Cel Detail Shading
****This manages the lines drawn when detail in the scene and in textures are outlined. These lines default to light. Cel detail always shades near to the camera and you can control the falloff as distance increases.

**Cel Outline Shading
These are the lines drawn around objects based on differences in screen-space depth. These lines default to heavy and can have a mask texture applied to roughen the edges. Cel outlines have a band in the scene depth that can be targeted for shading. Offset is the distance from the camera. Ramp is the linear fade-in and fade-out distance.

**Distance overbright
********This controls a blend_overlay fog that is useful for colour-grading the scene. In the screenshot above it’s used to give distant objects a warm desert-feeling glow.

**Shadow Shading
**********This controls the cross-hatching on your scene. The cross-hatching will target areas with AO shadows. You can also posterize your AO to give it a more cartoony feel. The values in this section have a quite narrow window where they look good, I’d recommend only adjusting them by a tiny bit at a time.

Print dots
Passes the colour channel through a filter that simulates web offset printing, allowing you to set the paper colour and the ink density.


Posterizes the colour channel to a specified number of colours.

**Final tip
**If you’re getting too many lines drawn, try either lowering the resolution of your textures or go into photoshop and apply a smart blur. The cel shader will pick up even tiny amounts of detail with the right settings, so go nuts and blur it a lot. If you’re after a kind of water-colour fill effect, then smart blur is the way to go.


Anime shader

Anime shader

Newsprint shader

Sumi shader

Coloured pencil shader

Oil painting shader

May just be a cel shader, but I’d love to see it in a game. Cuz I want to go there. Really really cool original look!

Oh it’s gonna be. :slight_smile: Thanks for the feedback!

I’ve figured out some of the steps in my mesh texturing and export and so it was time to try meshes at various sizes and in various positions:

Water accidentally looks great. It’s actually 100% opaque but the cel shader draws the lines as if the water wasn’t there while maintaining the surface colour of the water. End result: stuff under water looks really cartoony.

Looks great, love it when things accidently work out.

Looking good, man.

looks great

I’ve been working on mastering a workflow for rigged meshes, etc. MakeHuman is pretty darn cool.

Very nice shader effect, reminds me a fair amount of Borderlands.

Beautifful, thanks for this great contribution.

Yeah that looks very good

That shader looks fantastic Antidamage! As many people have already stated, it definitely has that Borderlands feel to it. Nevertheless, keep up the great work and be sure to keep us updated as you progress with your project.

Hehe, I reckon it’s better than Borderlands! Thanks. :slight_smile:

Have you guys tried speedtree yet? It’s freakin’ amazing. Everything you do with it automatically looks great!

Sweet man! That looks fantastic!

Don’t you love those happy accidents? :wink:

Made a huge number of improvements today. Discovered the Sky Light object, so got rid of my second fill sun, which basically doubled the framerate. Fixed up all the trees, added some objects to help the flow of the arena and optimised the way I’d done the foliage. Lost the entire level a couple of times due to foliage/editor bugs, thank goodness for Git. Remembered that I wanted to try grass instead of sand and it turned out rather nice; looks less good in stills than the sand but feels nicer when it’s in motion.

If I can get it to package, I’d really like to throw up a demo for people to try. There’s no gameplay yet, but it’s still kinda fun to walk around.

Here’s the download link if anyone would like to try it: MEGA

Thanks! And it looks very good!

Some more cel shader improvements. As you get closer to pretty much everything in the game, AO becomes subtle lines. I also got the IK sample working with my model, so his feet stay on the ground. I also added a quick and dirty depth blur for fun as the default UE effect is a bit overkill for my needs, but it’s probably not going to be that useful apart from as a menu effect.

Howdy Antidamage,

Really loving this cel shader. I think that your model may need a pair of pants though. Keep up the great work!

Pants are technically challenging at the moment, but facing away from the camera is in scope. :wink: