可以通过 Mesh.SetVertexBufferParams 全局控制每个语义的格式与精度。

语义类型 默认精度 占用空间 特殊限制 平台差异 典型用途
TEXCOORDn float32 float2/3/4 某些平台压缩为half UV/法线/权重/自定义数据
COLORn UNorm8 float4 建议范围 [0,1] 移动端常为8位UNorm 顶点颜色/透明度
POSITION float32 float3/float4 一般为模型空间 顶点坐标输入
SV_POSITION float32 float4 必须为裁剪空间 + 齐次坐标 输出裁剪空间坐标
NORMAL float32 float3 某些平台自动归一化 (Metal) 移动端可能压缩为half 法线向量
TANGENT float32 float4 w分量存bitangent方向 (+1/-1) 切线空间
BINORMAL float32 float3 通常由 NORMAL+TANGENT 推导 常在片元阶段重建 副法线向量
BLENDWEIGHT float32 float4 权重需归一化 移动端可能压缩为half 骨骼动画权重
BLENDINDICES int / uint8 int4 索引值通常为整数 移动端为byte型 骨骼动画索引

版权声明

作者: Chaim

链接: https://chaim.eu.org/posts/%E8%AF%AD%E4%B9%89%E7%B1%BB%E5%9E%8B%E8%A1%A8/

许可证: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

开始搜索

输入关键词搜索文章内容

↑↓
ESC
⌘K 快捷键