Complex three-dimensional (3D)-shaped particles could play unique roles in biotechnology, structural mechanics and self-assembly. Current methods of fabricating 3D-shaped particles such as 3D printing, injection moulding or photolithography are limited because of low-resolution, low-throughput or complicated/expensive procedures. Here, we present a novel method called optofluidic fabrication for the generation of complex 3D-shaped polymer particles based on two coupled processes: inertial flow shaping and ultraviolet (UV) light polymerization. Pillars within fluidic platforms are used to deterministically deform photosensitive precursor fluid streams. The channels are then illuminated with patterned UV light to polymerize the photosensitive fluid, creating particles with multi-scale 3D geometries. The fundamental advantages of optofluidic fabrication include high-resolution, multi-scalability, dynamic tunability, simple operation and great potential for bulk fabrication with full automation. Through different combinations of pillar configurations, flow rates and UV light patterns, an infinite set of 3D-shaped particles is available, and a variety are demonstrated.