using System.Numerics; namespace AcDream.Core.Terrain; /// /// Per-vertex terrain geometry + blend data. Terrain uses a cell-based /// layout: 64 cells per landblock, 6 vertices per cell (two triangles), /// 384 vertices per landblock total. All 6 vertices in a cell carry /// identical Data0..3 (the cell's blend recipe from /// ); the vertex shader derives /// which of the 4 cell corners a given vertex represents from /// gl_VertexID % 6 plus the split direction bit. /// /// Normal is stored per vertex via Phase 3b's central-difference scheme on /// the 9×9 heightmap — this lets the fragment shader interpolate a smooth /// normal across triangles (softer than WorldBuilder's dFdx/dFdy /// flat-shaded approach). UVs are derived from the corner index in the /// vertex shader — not stored here. /// /// Size: 12 (position) + 12 (normal) + 4*4 (Data0..3) = 40 bytes. /// public readonly record struct TerrainVertex( Vector3 Position, Vector3 Normal, uint Data0, uint Data1, uint Data2, uint Data3);