What is ramp shading or lighting and how does it work? Is it different than toon shading or is it the same concept? How is specularity calculated differently for ramp shading versus blinn-phong or lambert?
In traditional Blinn/Phong shading, you calculate the diffuse term for a pixel by measuring the cosine of the angle between the normal at the surface and the direction of the light. So, in this case, a simple shader would look something like this:
In ramp shading, the idea is to modulate the diffuse coefficient by a 1D lookup texture. Depending on what you put in this texture you can generate different effects. Hence, our shader function to compute the diffuse coefficient becomes:
For example, if we wanted to implement a cell shader, what we could do is generate a ramp texture that emulates a step function:
You can use the same idea to generate different effects for the specular lighting as well. "Ramp" shading really only refers to the idea of modulating a shading value by a texture.
EDIT: Team Fortress 2 uses a ramp shader in their rendering. You can check out the details in this paper:
Look under Section 5, at the subsection entitled "Diffuse Warping Function"