【Unity 优化】Skinned-Mesh 能动态合并嘛?
来源:互联网 发布:unity3d 游戏模型提取 编辑:程序博客网 时间:2024/06/03 20:24
===================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.
- 【Unity 优化】Skinned-Mesh 能动态合并嘛?
- Unity mesh 合并
- Unity mesh 合并
- Unity合并mesh
- unity mesh合并
- Unity Mesh合并
- 【Unity】Unity Mesh 网格合并
- 关于Unity中Skinned Mesh Renderer中Quality中的坑
- Unity Mesh合并办法 – 实现换装 优化效率 模型合并
- 深度探索Skinned Mesh
- Unity 动态创建mesh API
- Unity中创建自己的mesh以及动态修改mesh
- Unity中创建自己的mesh以及动态修改mesh
- unity中利用mesh动态创建墙体
- Unity动态绘制曲线Mesh的代码
- 骨骼动画及Skinned Mesh解析
- unity3D研究之Skinned Mesh原理解析
- Unity Mesh合并插件MeshBaker使用心得(一)
- Elasticsearch JAVA API开发记录
- post方式与get方式提交到Jsp页面中文乱码的处理
- 程序员编程生涯中常会犯的7个错误
- 使用nginx做负载均衡
- 泛型
- 【Unity 优化】Skinned-Mesh 能动态合并嘛?
- HDU6215【队列+双向链表维护】
- MVC+VUE.JS+MUSEUI
- javascript中this的四种用法
- Inno setup安装包中添加环境变量以及卸载时删除环境变量
- LIVE555再学习 -- OpenRTSP 源码分析
- android中添加自己的驱动
- Arduino使用蓝牙BLE模块
- xlistview配置