added code to compute correct partial derivatives for curves at shading point