The default "toony-lighted" shader in Unity is great, but the problem is that objects are either entirely affected by the light, or not affected at all when they are not in the light's direct area.
Is there any way to make it so the object is gradually affected more and more by the light as it moves toward the source, rather than being an on/off type of thing? I don't know too much about writing shaders, I tried switching some of the light modes but that doesn't help.
EDIT: Apparently the toony lighting shader has been re-written in Unity 3.0, and this is no longer an issue. Kudos to the Unity team!
Answer by sean
May 12, 2010 at 02:29 PM
What a toon light shader does is basically take the normal illuminated brightness/color of an object and set a threshold (plus any fancy edge-detection / outlining). Where you'd normally get a smooth gradient, if the gradient is below a certain level, it's shaded flat-dim, above it's shaded flat-bright. It's possible to write a toon shader that has multiple thresholds/levels, you can possibly google for one in Cg and try to patch it into your own shader, possibly based on the stock toon shader. Likewise, you may be able to set how dim your dims are and how bright your brights are as some function of total illumination rather than fixed values. I know the ShaderLab/Cg/ATI source for all the stock shaders is available somewhere on the Unity site, but I didn't bookmark the location after grabbing them.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users post good questions and use the site effectively we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
No one has followed this question yet.
Toon effect combined with vertex lighting
Cel/Toon shading with multiple light sources on mobile
Problem with lighting in CG Shader
Shader light - Problem
Shader-Calculate lighting every x pixels