Some of the shaders (Threshold Style) have already seen action in a published game Sword Glory for iOS and Android. Check out gameplay videos.
Also include THE CONTRAPTION, an object of no sensible use with both sharp and rounded corners, high and lowpoly curves and a moving part! (I use it to test and to demonstrate materials…)
If you have a particular toon style you’d wish to be included, a modification in mind, a combination of effects or other ideas, I’d be happy to hear you out! And don’t hesitate to ask for help if you have problems with the pack, or to give feedback of any kind.
Outlines add some overhead, but are really dependent on the amount of polygons. Avoid use on huge meshes, and you should be alright.
All Diffuse variants are quite fast, and should be safe to use on mobile platforms.
Details variants are slowest of the bunch. Use sparingly.
SimpleFluid shaders are quite slow as well, but only if you throw dozens of them at the screen at once. Use only a few fluid objects and you’ll be alright.
On 200 draw calls and 152k tris, shaders that had 30 fps or more were:
Threshold/Diffuse
Contrast/Diffuse
Contrast/Transparent
Contrast/Cutoff
LevelsA/Diffuse
LevelsA/Transparent
LevelsA/Cutoff
LevelsB/Diffuse
See the linked document for more details. The actual performance will of course depend on what else is on the project and how the shaders are used, but so as not to give a weasel answer, I’ll say that diffuse shaders for Threshold, Contrast, Levels A and Levels B styles are well optimized for mobile, and the others are less optimized, but work.
what is the secret to making ramps for the lookup shader? whenever I try to make my own it is just blown out white and hard to control. I am using the ones there as a template but just changing the colors.
A bit hard to say what’s wrong without seeing your ramps and the material settings, but here’s a couple of thoughts:
If the result is too white, you either have a ramp that has too much white in it, or the problem is not in your ramp texture.
Set Offset to 0 and Scale to 1 in the material inspector to see the “full” effect of the ramp.
Make sure the lighting in your scene isn’t too dim or too powerful.
You can test your ramp in the Ramps demo scene by replacing one of the ramps with your own.
Remember that Lookup replaces the color in the texture while ColorRamp multiplies it.
A nice looking Lookup ramp usually has a lot of contrasts.
The left hand side of the ramp texture is the color that replaces the darker parts on the model, and the right hand side is the color that replaces the brighter parts of the model. So a ramp that has a gradient going from white on the left to black on the right would color the model so that the poorly lit parts would be white, and the parts that are well lit would be black.
Awesome pack, should deserve much more attention! As soon as I saw it, I bought it.
Love the fact that you give us the source, I’m learning shaders and this is really helpful.
I noticed that the outline is a separate shader. Doesn’t having 2 shader on the same mesh affect performance? Woudln’t be better to merge the outline code into one shader ?
Cool stuff man.
Can You add only edge type of effects in next update (objects are temperance and only outer line visible but not overlap with anther objects)