Calculation procedure of the shading factor under complex boundary conditions