关闭

【Unity 优化】Skinned-Mesh 能动态合并嘛?

标签: Skinnedmesh合并
919人阅读 评论(0) 收藏 举报
分类:

===================2017.9.16
I’v tryed to combine the skinned meshes today.
I can combine all the skinned meshes to one now.And they looks like at the right position and with the right uvs. However , It’s just a static mesh,it can not do any animation.I checked the API of Unity, I found that ,mybe it is not possible to combine all meshes with animation. The reseaon is here:
- Every mesh has huge vertices and boneWeights , one boneWeight per one vertex.The boneWeight contains up to 4 indexes and weights relative to the bindPose list.
- The bindPose list is a array of Matrixes , every Matrix means a trasformation relative to the skinned-mesh’s rootBone.
- The boneWeights are just used as weight-calculation of up to 4 bindPose matrixes , the result is one average matrix relative to the skinned-mesh’s rootBone.
At last , we can think out the calculation process of the vertex’s position.
vertex world transformation <= weight-calculated matrix to the rootBone <= rootBone’s transformation is animated by the animation
This is the relation process. Then, for example, one animation contains 5 bones, and 7 skinned-meshes , the 7 skinned-meshes are relative to diffrent bones, even we’ve combined the meshes ,we just got the static mesh, one mesh can’t rely on 5 rootBones, so it lost the animation feature.
So, I think maybe it is the result: we only can get the static mesh , with no animation.


===================2017.9.17
I’m glad to tell you that the baking does work now.And all problems are resolved.
I think there are 4 key points:
1、The rootBone is not important ,even maybe it is not need.
2、All mesh points all calculated relative to the bones,and when using the Unity’s Combination,it combine all the bones together to a new big bones set.
So, every thing is ok,bones are still work.
3、We juse need to collect all the bones in original skinned-meshes,and give the array of bones to the new created Skinned-Mesh(set the bones).
4、Before do out combination, we need to set all skinned-meshes to standard state (with no scal,tranlate or rotate), and move the animation node to world center, with no scal and rotation, then do the combination,when finished,we can take the animation node back to old state.
That’s it. I think it works now. I will update my plug-in tomorrow.


0
0
查看评论
发表评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场

unity3D研究之Skinned Mesh原理解析

讲述骨骼动画的资料很多,但大部分都是针对 DX8 或 DX9 的 SkinnedMesh 进行讲解。我觉得对于骨骼动画初学者增加了不必要的负担,还没有理解骨骼动画的实质就已被 DX 复杂的架构搞得晕头...
  • gamemonkey
  • gamemonkey
  • 2015-03-04 11:59
  • 9439

Unity3D优化之合并网格 整理

一、使用gameobject的static属性设置 注意的是,所谓静态就是静止的,你如果要改变它位置,就不是静态了,静态物体在脚本加载的时候就开始渲染,不随着update 每侦更新,你如果要移动物体...
  • fanglrui
  • fanglrui
  • 2015-03-17 09:50
  • 3440

Unity Mesh合并办法 – 实现换装 优化效率 模型合并

如标题所诉。mesh 分离。可以实现一个 人物 用很多不同形状的武器或者装备什么的。同时 分离可以优化效率。 那这里就有一个 mesh如何合并的问题。unity提供了 mesh合并的接口。 简单示...
  • cbbbc
  • cbbbc
  • 2016-11-28 21:02
  • 1282

unity优化 降低 drawcalls 合并 材质 Mesh Baker 2

  • 2015-08-14 10:03
  • 28.64MB
  • 下载

Skinned Mesh原理解析和一个最简单的实现示例

  • 2008-12-01 16:50
  • 172KB
  • 下载

关于骨骼动画及微软示例Skinned Mesh的解析

关于骨骼动画及微软示例Skinned Mesh的解析 骨骼动画是D3D的一个重要应用。尽管微软DXSDK提供了示例Skinned Mesh,但由于涉及众多概念和技术细节,示例相对于初学者非常复杂...
  • hopeztm
  • hopeztm
  • 2012-05-16 08:33
  • 1092

关于骨骼动画及微软示例Skinned Mesh的解析(一)

骨骼动画是D3D的一个重要应用。尽管微软DXSDK提供了示例Skinned Mesh,但由于涉及众多概念和技术细节,示例相对于初学者非常复杂,难以看懂。在此,提供一些重要问题评论,以使初学者走出迷局,...
  • xuqian6307
  • xuqian6307
  • 2011-05-11 18:04
  • 595

Skinned Mesh 原理解析和一个最简单的实现示例

Skinned Mesh 原理解析和一个最简单的实现示例作者:n5Email: happyfirecn@yahoo.com.cnBlog: http://blog.csdn.net/n52008-10...
  • xuqian6307
  • xuqian6307
  • 2011-05-11 18:08
  • 392

骨骼蒙皮动画(Skinned Mesh)的原理解析(二)

2)蒙皮信息和蒙皮过程   2-1)Skin info的定义 上文曾讨论过,Skinned Mesh中Mesh是作为皮肤使用,蒙在骨骼之上的。为了让普通的Mesh具有蒙皮的功能,必须...
  • a812073479
  • a812073479
  • 2017-04-13 14:43
  • 153

Skinned Mesh原理解析和一个最简单的实现示例

原作者链接 http://blog.csdn.net/n5/article/details/3105872
  • sunshine_flyeah
  • sunshine_flyeah
  • 2014-10-30 10:22
  • 445
    个人资料
    • 访问:87007次
    • 积分:1277
    • 等级:
    • 排名:千里之外
    • 原创:24篇
    • 转载:1篇
    • 译文:1篇
    • 评论:43条
    关于Andrew
    Unity游戏开发程序员,
    开源游戏引擎Cyclone2D作者,
    我最近在开发一款3D赛车游戏
    热爱图形学、物理学、架构等研究,
    有兴趣的同学加群:528266922。
    博客专栏
    最新评论