Implements shading types 4-7