简体   繁体   English

如何在 unity3d 中创建 3d 对象的纹理图集

[英]how to create an texture atlas of a 3d object in unity3d

I am working on a 3D game and it has lots of game objects in a scene.我正在开发一个 3D 游戏,它在一个场景中有很多游戏对象。 So I'm working on reducing draw calls .所以我正在努力减少绘制调用 I'v used mesh combining on my static game objects.我在我的静态游戏对象上使用了网格组合 But my player is'n static and I can't use mesh combining on it.但是我的播放器不是静态的,我不能在它上面使用网格组合。 My player is nothing but combination of some cubes which uses the standard shader and some different color Materials on different parts.我的播放器只不过是一些立方体的组合,这些立方体在不同的部分使用标准着色器和一些不同的颜色材料 So I'm guessing, I can use texture atlasing on my player to reduce darw calls.所以我猜,我可以在我的播放器上使用纹理图集来减少 darw 调用。 But I don't know how to do it.但我不知道该怎么做。

Is my theory of work right?我的工作理论对吗? If I'm right please help me with atlasing, and if I'm wrong please point out my fault.如果我是对的,请帮助我进行图集,如果我错了,请指出我的错。 Thanks in advance.提前致谢。

Put all the required images into the same texture.将所有需要的图像放入同一个纹理中。 Create a material from that texture.从该纹理创建材质。 Apply the same material to all of the cubes making up you character.将相同的材料应用于构成您角色的所有立方体。 UV map all cubes to the relevant part of the texture (use UV offset in the Unity editor if the UV blocks are quite simple, otherwise you'll need to move the UV elements in your 3D modelling program). UV 将所有立方体映射到纹理的相关部分(如果 UV 块非常简单,则在 Unity 编辑器中使用 UV 偏移,否则您需要在 3D 建模程序中移动 UV 元素)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM