This is the 2D lookup table I used in the composition below.Colours are looked up across the width (X-axis) of the table, based on the distance of the current fragment from a ‘light source’ (though no real lighting calculations are made). There’s a control to shift the position on the Y-axis of the lookup, allowing fading from one kind of shading gradient to another (ie negative to positive). The looked-up colour is then multiplied with the Color input to the shader to produce the final fragment colour.
The sixth strip is a noise texture. Not too useful on its own, but can give nice results in the transition-zone between it and the linear gradients above and below it. When I finally get around to working out how to do proper directional lighting, though, it might be nice to add a little noise to the colour of the mesh, for a kind of contour-like effect.
I’m thinking it might be nice to combine this simple shading with a basic directional lighting model, to make the mesh look as though it’s being lit from within. Not sure if the image in my head will correspond to the reality, if I ever get it working, but in theory it should look quite nice…
I’m also planning to add a control to alter the range and maybe the falloff curve of the shading effect. Might be a good opportunity to make use of the variable smoothstep-like function my friend Nick helped me work out last week.