A new wave-vegetation model is implemented in an open-source code, SWASH (Simulating WAves till SHore). The governing equations are the nonlinear shallow water equations, including non-hydrostatic pressure. Besides the commonly considered drag force induced by vertical vegetation cylinders, drag force induced by horizontal vegetation cylinders in complex mangrove root systems, as well as porosity and inertia effects, are included in the vegetation model, providing a logical supplement to the existing models. The vegetation model is tested against lab measurements and existing models. Good model performance is found in simulating wave height distribution and maximum water level in vegetation fields. The relevance of including the additional effects is demonstrated by illustrative model runs. We show that the difference between vertical and horizontal vegetation cylinders in wave dissipation is larger when exposed to shorter waves, because in these wave conditions the vertical component of orbital velocity is more prominent. Both porosity and inertia effects are more pronounced with higher vegetation density. Porosity effects can cause wave reflection and lead to reduced wave height in and behind vegetation fields, while inertia force leads to negative energy dissipation that reduces the wavedamping capacity of vegetation. Overall, the inclusion of both effects leads to greater wave reduction compared to common modeling practice that ignores these effects, but the maximum water level is increased due to porosity. With good model performance and extended functions, the new vegetation model in SWASH code is a solid advancement toward refined simulation of wave propagation over vegetation fields.