问题很明显,着色器需要网格mesh的法线值。但是mesh的法线值为空。即mesh.normals是空的数组。如果mesh是代码实例化生成,则需手动给normals填充值:调用mesh.RecalculateNormals()就ok啦。此外,官方api的一句话需要注意:
After modifying the vertices it is often useful to update the normals to reflect the change
关于Shader wants normals, but the mesh doesn't have them的问题
最新推荐文章于 2024-06-03 14:51:24 发布