关于Shader wants normals, but the mesh doesn't have them的问题

问题很明显,着色器需要网格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

猜你喜欢

转载自blog.csdn.net/leohijack/article/details/8674376