在 gltf 文件中存储法线的最有效方法?
Most efficient way to store normals in gltf files?
我正在寻找在 gltf 文件中存储法线的最有效方法,我们想将它们用于 webgl 1 平坦和平滑的着色。
是否支持不同的正常精度?
我们宁愿不复制所有顶点以获得法线,因为或网格很大。
我刚找到这个
KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes
NORMAL "VEC3" 5126 (FLOAT) 归一化 XYZ 顶点法线
所以我假设只有一种方法?
感谢您的帮助
平面法线:存储平面法线最有效的方法是完全省略它们。根据 glTF 规范,在 the Meshes section、
"When normals are not specified, client implementations should calculate flat normals."
平滑法线:你是对的,核心 glTF 规范要求法线使用 5126 / float32 精度。如果您需要其他选项,请启用 KHR_mesh_quantization
扩展(extension spec) on your model, which allows for additional types (int16 normalized or int8 normalized). The gltfpack 库可以自动应用这些优化,或者您可以直接修改模型。
我正在寻找在 gltf 文件中存储法线的最有效方法,我们想将它们用于 webgl 1 平坦和平滑的着色。 是否支持不同的正常精度? 我们宁愿不复制所有顶点以获得法线,因为或网格很大。
我刚找到这个 KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes
NORMAL "VEC3" 5126 (FLOAT) 归一化 XYZ 顶点法线
所以我假设只有一种方法?
感谢您的帮助
平面法线:存储平面法线最有效的方法是完全省略它们。根据 glTF 规范,在 the Meshes section、
"When normals are not specified, client implementations should calculate flat normals."
平滑法线:你是对的,核心 glTF 规范要求法线使用 5126 / float32 精度。如果您需要其他选项,请启用 KHR_mesh_quantization
扩展(extension spec) on your model, which allows for additional types (int16 normalized or int8 normalized). The gltfpack 库可以自动应用这些优化,或者您可以直接修改模型。