refactored shading from traceRay