查看: 2529|回复: 4

[特效/Shader/技术美术] Unity3D使用烘焙贴图小教程

[复制链接]

36

主题

14

听众

201

积分

Rank: 2

升级   0.33%

发表于 2012-12-16 15:01 |显示全部楼层
共享资源获取更多积分!share your resources get more credits!
资源信息 Tutorial Information
教程名称: Unity3D使用烘焙贴图小教程(发布原创教程可获得更多积分哦!)
适用引擎: (资源适用引擎)
教程语种: English
教程等级: 小白(等级越高教程越难,但能学到的东西越多)
教程格式: 图文(请用IE9以上浏览器访问本版块)
教程作者: 转载自互联网 (如有问题请短消息联系作者或发表回复)
点击查看原图 --> 美丽分割线
请先回复
哇伊~ (((‵□′))回复太烦了,怒买VIP(充值金额将用于论坛采购更多资源)

--> 请先登录 --> 请先登录 --> 请先登录 --> 请先登录 --> 请先登录 --> 请先登录 -->

关于灯光贴图,烘焙贴图如何在unity3d中导入及使用的基本教程。很不错。

Hello. I just wanna share my way on doing Lightmap in 3dsmax to unity. I read many post asking how to do this, and I want to share with all of you. Please tell me if there is a better way.

1. When you finish uvw your model save it to .uvw file

2. Create new uvw and change it to channel 2. Load the uvw you created earlier. This give you better result than using automatic uvw.

3. hit (0) to open the render to texture window. Select "Use Existing Channel", change the Channel to "2", choose add "Lightingmap".

The image you see when rendering is not the real result. The real image was stored in your 3dsmax folder. usually it stored like this (My Documents/3dsmax/sceneassets/images) look for your model name with "LightingMap" on the back. Usually a TGA file like this.

4. The easier way is to "Pick Material from Object" and then copy the "Baked Material" to an empty slot. Because .fbx exporter currently doesn't support "Shell Material".

5. After you assign the new baked material to the model, export the model with fbx extension. Here I use cm, embed textures, convert to portable format (TIFF).

6. When you open your unity project, and Import the model, you will see it's only the diffuse texture that was exported from 3dsmax. And no LightMap texture. My way is to import the LightMap texture that 3dsmax stored in (My Documents/3dsmax/sceneassets/images). And then add it into fbm folder of your model.

7. After that done. Change your model material to a Lightmapped material. And add the Lightmap texture into the slot.

Hoorayyy..!!!

第二部分

"Here it is!! Lightmap with tilling textures"

First let me explain, I am using 2 different way of using Lightmap for this one. You know why later on.

1. Here I have 2 objects (interior, and sofa). I highlighted the texture so you can see them clearly. There are 8 textures (7 for interior and 1 for sofa).

2. Unwrap UVW set (ch 1) hit save.

3. Unwrap UVW set (ch 2) load from the first channel.

4. In Baked Material option, choose "Output into Source" and "Keep Baked Materials". This option will automatically update your original material without using a shell material again. Thanks to holmeren for the update ^^. Hit (0) for render to texture window.

--> result

5. Repeat the process for the sofa. (Explained on top of this page).

Hit M to and see your new baked material (Check it out! the "Self Illumination Slot" is now containing the Lighting Map texture.

6. Export to FBX

7. Open Unity and import the asset. Because in 3dsmax we use 8 texture for the model, so unity will assign them into 8 materials. As usual the lightmap textures aren't exported along with them.

Import manually the lightmap texture from your 3dsmax folder (MyDocuments/3dsmax/sceneassets/images) look for your model name with LightingMap on the back.

In this case I have 2 (sofaLightingMap.TGA, and wallLightingMap.TGA).

8. With all our texture assembled, we are now ready to change the default material into "Lightmapped" material. I choose Lighmapped/VertexLit. Assign the correct lightmap texture to the correct material model.


Yess!! The Lightmap placed correctly.

9. Time to "tilling" our interior textures.


Yes!! Finish!!

----------------------------------------------------
----------------------------------------------------

What if I want to use non tilling texture along with the tilling textures? Well I came across some error in exporting as well but I found a way to get that done.

<Different solution>

1. The uvw I use is the same as before. Only this time with different texture for the wall.

(1 for the wall, 1 for the floor, and 1 for the sofa).

The wall texture

2. Exporting as usual.

3. Import them into Unity and change the diffuse material to Lightmapped material.

4. Apply the Lightmap texture, and tile only the floor texture.

5. Finish!!

----------------------------------------------------
----------------------------------------------------

Conclusion...and problems

First method:

We will have lot of material in our mesh because we assign a lot of different texture in one model. Smaller textures but with sharper image, thanks to the tilling system. Add 30 kb.Mat

Second method:

We use less material and less texture, but with bigger resolution (my custom texture wall have 512x512 resolution). Add 11 kb .Mat

I don't know the performance difference between those two. So if anyone can share your opinion, I'd be most grateful.

So that finished my small lighting map tutorial.

Good Luck on your project, (mine too hehe) and Thank you very much to Unity3D team. Cheers.


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

楼主热帖
已有 1 人评分鲜花 收起 理由
hunt1727 + 1 赞一个!

总评分: 鲜花 + 1   查看全部评分

星期天 星期一 过度很痛苦

0

主题

10

听众

265

积分

Rank: 2

升级   21.67%

发表于 2012-12-17 13:04 |显示全部楼层
呵呵 谢谢分享 学习学习
回复

使用道具 举报

0

主题

10

听众

200

积分

Rank: 2

升级   0%

发表于 2012-12-17 19:28 |显示全部楼层
学习一下,谢谢分享!!
回复

使用道具 举报

0

主题

22

听众

441

积分

Rank: 2

升级   80.33%

发表于 2013-1-24 14:06 |显示全部楼层
哈哈室内的高手啊
回复

使用道具 举报

0

主题

19

听众

48

积分

Rank: 1

升级   24%

发表于 2014-11-4 17:06 |显示全部楼层
很好的教程学习了!~
回复

使用道具 举报

0

主题

10

听众

203

积分

Rank: 2

升级   1%

发表于 2017-2-24 13:31 |显示全部楼层
很不错
回复

使用道具 举报

1

主题

10

听众

203

积分

Rank: 2

升级   1%

发表于 2017-2-24 13:37 |显示全部楼层
楼主是超人
回复

使用道具 举报

0

主题

10

听众

200

积分

Rank: 2

升级   0%

发表于 2017-2-24 13:56 |显示全部楼层
真心顶
回复

使用道具 举报

0

主题

10

听众

204

积分

Rank: 2

升级   1.33%

发表于 2017-2-24 13:28 |显示全部楼层
说的非常好
回复

使用道具 举报

0

主题

10

听众

201

积分

Rank: 2

升级   0.33%

发表于 2017-2-24 14:27 |显示全部楼层
不错不错
回复

使用道具 举报

温馨提示:求助请到“Unity技术讨论”版块中发帖,便于集中解决!
您需要登录后才可以回帖 登录 | 立即注册

懒人模式:

关闭

站长推荐 上一条 /1 下一条

Unity3D游戏开发联盟(资源共享平台) -Unity3D,Unreal ( 苏ICP备12051100号 )   

GMT+8, 2019-10-19 15:28 , Processed in 0.229868 second(s), 82 queries .