changed a shadow ray generation logic