A deep dive into the full pipeline for subdividing and deforming arbitrary 3D meshes, covering the challenges of maintaining correct normals for both shading and displacement. Topics include building a LinkedMesh (half-edge-inspired) data structure in Rust using slotmap, merging coincident vertices, computing angle-weighted vertex normals, implementing Blender-style smooth-by-angle shading, CPU-side noise-based displacement, and triplanar mapping for texturing deformed meshes without UV stretching. Practical tips address triangular shading artifacts, sharp edge preservation after deformation, and tradeoffs between interpolated vs. edge-normal methods for subdivision.
Table of contents
OverviewNaive SubdivisionDeformation + DisplacementNormalsLinked Mesh Data StructureComputing Separate Shading + Displacement Normals"Smooth by Angle" ShadingProcedural DisplacementOther Notes + ConsiderationsConclusionSort: