Could some of you tell me if it’s possible to reproduce the shader used on the characters in Team Fortress 2? I have posted this question over at my Unity Artist forum but haven’t gotten too many replies since we are mostly “artists” over there.
You can make a ramp shader quite simply by using a look up texture in your lighting function to ‘change’ the lighting based on the ‘brightness’ of the light at a point. If you modify the lighting function to be like this (this example uses the light prepass renderer):
This is a pretty simple example where it only supports white resultant light. What it does it is calculates the luminosity of the light at each pixel, samples from a texture lookup at this value of illumination (this will be your ramp texture for the light gradient). Then uses this remapped lighting for the surface illumination. You could remultiply the ramp by some normalized light color if you want coloured lighting.
Here is how the result looks on a simple sphere with a simple ramp: