Foundation 施工笔记 【4】- 网格数据量化及压缩
Preface 对网格数据而言,顶点数可以很多很多:如果存储每个顶点的开销能够减少,显然对GPU显存和磁盘存储压力而言是非常好的事情。以下介绍目前Editor内存在的一些量化操作。glTF中的顶点可以有以下属性(参见 Spec): Name Accessor Type(s) Component Type(s) Description POSITION VEC3 float Unitless XYZ vertex positions NORMAL VEC3 float Normalized XYZ vertex normals TANGENT VEC4 float XYZW vertex tangents where the XYZ portion is normalized, and the W component is a sign value (-1 or +1) indicating handedness of the tangent basis TEXCOORD_n VEC2 float unsigned byte normalized unsigned short normalized ST texture coordinates COLOR_n VEC3 VEC4 float unsigned byte normalized unsigned short normalized RGB or RGBA vertex color linear multiplier JOINTS_n VEC4 unsigned byte unsigned short See Skinned Mesh Attributes WEIGHTS_n VEC4 float unsigned byte normalized unsigned short normalized See Skinned Mesh Attributes 下面为完整精度的顶点struct,足矣表示glTF标准中的任何非蒙皮(不看JOINTS, WEIGHTS)网格(vertex color暂时忽略)。...