Mesh doesn’t have albedo UVs

文章一般会先在我的自建博客发布,这边更新的会晚一些。
导入模型到Unity的时候,通常需要做一些导入设置,不然在烘培灯光的时候会出现一些错误。

选则Asset中导入的模型,勾选Inspector/Model面板下的Generate Lightmap UVs,并点击Apply:
Mesh doesn’t have albedo UVs
否则就会报图中所示错误:
Mesh doesn’t have UVs suitable for lightmapping. Consider enabling “Generate Lightmap UVs” in the model importer.
Mesh doesn’t have albedo UVs
这个问题网上一般都有说明,导入模型的时候注意一下即可,令我头痛的是下面这个错误:
Mesh doesn’t have albedo UVs
Mesh doesn’t have albedo UVs
在网上搜索之后,在Unity官方论坛里找到了解决方案,会出现这个错误因为Unity在烘焙光照贴图时需要准备UV贴图保存光照信息,要想解决的话,只需要在建模软件里为出错的模型添加一张UV贴图即可,由于我对于3ds Max的操作不太熟练,这里我就贴一下在Blender里的操作方法。
Mesh doesn’t have albedo UVs
首先将模型放置到场景中,勾选Static选项,打开Lighting选项卡,点击Build进行烘焙,这时可以看到Console里出现错误。
Mesh doesn’t have albedo UVs
接着点击Console里的报错,找到所有出现错误的模型,我这里出现了5个错误,说明整个模型里有5个子模型出现了该错误:
Mesh doesn’t have albedo UVs
打开Blender,默认场景Blender会自带一个Cube,一个灯光和摄像机,按A全选,按X删除:
Mesh doesn’t have albedo UVs
导入模型的Fbx文件:
Mesh doesn’t have albedo UVs
默认布局下,在右上角的结构视图里找到刚才在Unity中定位的那几个出错的部位,查看下面Properties/Data下添加UV Maps,这里可以看到正常的模型都会包含一个UV Maps,而出错的都没有UV Maps:
Mesh doesn’t have albedo UVs
Mesh doesn’t have albedo UVs
选中出错的部位之后,点击UV Maps右边的小加号添加一个UV Map,重复为所有出错的部位添加即可:
Mesh doesn’t have albedo UVs
最后导出Fbx文件,再重新导入Unity中:
Mesh doesn’t have albedo UVs
替换模型之后,重新烘培,没有再出现错误,不过使用Blender导出的Fbx文件都会比较大,最好还是在3dsMax中处理比较好。
Mesh doesn’t have albedo UVs