This paper proposes an optimal control-based method named the rapid-Gauss pseudospectral method (RGPM) to obtain a smooth time-optimal path for unmanned surface vehicles (USVs). It is a general global path planning method, improving the Gauss pseudospectral method (GPM) which cannot be applied to complex ocean scenarios. In addition, we optimize the representation of obstacles and add a Maklink algorithm to reduce the computaitonal cost. More specifically, a unified obstacle modeling approach is first introduced, then a continuous-time-optimal-control path planning problem considering USV kinematics is formulated. The orthogonal collocation method is used to discretize the continuous-time-optimal control problem into a nonlinear programming (NLP) problem. Furthermore, we introduce a mesh refinement technique to achieve collision avoidance between adjacent discrete points. To enhance computational efficiency, an initialization and iteration approach is further proposed. Herein, a MAKLINK graph is established to obtain a suboptimal path as the initial guess for the NLP problem. Obstacle-avoidance constraints are iteratively updated according to whether or not there are collisions in the current path. The proposed method was compared with the traditional GPM under two different scenarios. The simulation results show that the proposed method is superior to the traditional GPM in terms of path quality and convergence speed and can obtain quasi-time-optimal paths under complex conditions simultaneously. • We propose an optimal control-based time-optimal path planning method for unmanned surface vehicles in complex environments. • The path planning problem is solved with a new Rapid Gauss pseudospectral method (RGPM). • RGPM avoids possible collisions and has a faster convergence speed than the traditional GPM. • The obtained path is quasi-optimal and tested in realistic environment. [ABSTRACT FROM AUTHOR]