- Home /
Toon/Cel Shading with Orthographic Camera
Pretty simple question... the Toon Shader (aka Cel Shading) doesn't work with an Orthographic camera... is there some shader that does? I'm really not versed in creating shaders myself, so I'd appreciate any help. Thanks.
Out of curiosity, is the Toon Shader a Pro-feature? I don't see it in the manual, or the Basic drop-down (or the name Cel). And I saw a reference to Toon-Basic on the Wiki Shader section, but no actual shader: http://www.unifycommunity.com/wiki/index.php?title=Shaders
It's not part of the standard assets, it's a separate option when you create a new Unity project. There's Basic and Lighting, and each of those has an "Outline" version that reverses the mesh and fills it in black, making a cel-shading-like effect. -- Really though, noone has any idea about how to do this for orthographic cameras? :(
Huh... I never even paid attention to that checkbox at project creation... How about that? :)
@SpikeX, can you clarify what you mean by doesn't work? Out of curiousity, once I imported the Toon package, I changed the Camera to Orthographic, and the four sample Spheres (Basic/Outline/Lighted/Lighted Outline) all showed up fine. Are you having problems applying the shaders to a user-generated object?
Bah, I figured out a solution. I just stuck a LineRenderer around the edge of the object. With an orthographic camera, it looks just like an Outline Toon shader (in fact, even better).
Answer by qJake · Apr 29, 2010 at 09:50 PM
I just decided to use a LineRenderer as the border for the object. This actually turned out looking better than I thought it would, plus I still have control over color and thickness, and I can even texture the border if I want to.
Answer by LeoCeballos · Aug 14, 2012 at 06:36 AM
In case anyone still wants this, I just figured it out tonight, current with Unity 3.5
In the shader, find the line:
o.pos.xy += offset * o.pos.z * _Outline;
It should be line 33 or so in the Basic Outline shader. Take out "o.pos.z". It should read:
o.pos.xy += offset * _Outline;
This disables the "thicker with distance" feature of the outlines, but allows the shader to work with the ortho camera.
thanks! i did that, but the outline is very small. And if i change Outline Width, its destroy the Outline :/
Answer by Bob 3 · Nov 12, 2010 at 01:33 AM
@Spikex How did you add a border to an object? I've been playing around with LineRenderer but can't see how this is done.
many thanks
Your answer
Follow this Question
Related Questions
How can I ToonLitOutline shader transparent? 0 Answers
Toon shader to approximate engineering line drawing 0 Answers
Cel Shading Possible In Unity Free Version? 2 Answers
Explain Toon Shading Please 1 Answer