The realization method of bone pinch face function

Source: Internet
Author: User

This is the 132th piece of UWA technical knowledge sharing push. Today we continue to select a number of people and development, optimization related issues, recommended reading time 10 minutes, read carefully must have a harvest.

UWA Quiz Community: answer.uwa4d.com
UWA QQ Group: 465082844 (Technical exchange only)

Skeletal animation

Q1: The skeleton specification for my project has been determined, and the CS skeleton and bone bones add up to 60. It is now investigating the face-pinching scheme, which is basically determined by adding facial bones to pinch the face. First of all, describe my understanding of facial bones, if there are errors please correct me.

The added bones are also exported to the original bone to make avatar for skeletal animation, but skeletal animations do not control these bones. The data of the player after pinching the face, that is, the bone scaling and rotation, applied directly to these facial bones, complete the facial customization. Practical application to the project, there are several questions :

1, the existing project, the import Optimize Game object option is checked, so that the C # layer can not get skeleton information, expose out the skeleton is "read-only", there is no way to pinch face data directly applied to the skeleton on the run. For the time being, you can only bypass the "dynamically generate target mesh using the extra open optimized Avatar" method, and don't know if there are any more direct methods?
2, the existing skeleton specifications do not have the face of the skeleton, if you want to add, you need to re-export all the animation.
Is there a plan for not modifying existing bones?

The head is separated from the body, but may be worn at the seams.
There's also a brain-hole scenario: a GPU Skin specifically for the head. When the model is imported, the bones and weights of the head are added to the mesh's Uv2 and Uv3 (the code distinguishes between the head bones, the body part is all 0), and is saved as asset. Then each frame passes through the skeleton matrix into shader and modifies the vertex coordinates in VS. However, this consumes extra bandwidth.
Thanks to the CEOs @uwa question and answer community for providing answers

Next upstairs, head and body separation, qualitysettings->blend weights changed to 4, can solve most of the seam wear help. In fact, in the game, most of the hair will also have animation, so the hair will also be separated. The mesh after pinching the face is preserved, in the game and the body splicing, with the saved mesh (most of the game face no action). In the actual game, we do not need the bones when we pinch the face.
Thanks to the Zheng @uwa question and answer community for providing answers

Offline bone sampling does not require a tick to optimize Game Object. After the integration of the face and then, put the face back. Or only the bones of the face can be read and written.
Thanks to the Magus @uwa question and answer community for providing answers

This question and answer is from the UWA community, and you are welcome to move to Community exchange:
https://answer.uwa4d.com/question/5bbc2dba17780b3478091926

UI

Q2: In the profiler, can we see which meshes are being rebuilt? At present, I can only use the size of VB uploads to determine whether it caused the mesh reconstruction, but do not know which elements in an interface will cause mesh reconstruction.
Here I have a test case, the image is put into the dynamic canvas and not put into the canvas, this upload of the drawing content will be a great change, but specifically what if everything is tested once, it feels very time-consuming.


The use of VB uploads to judge the reconstruction may be less intuitive, because the skinnedmesh and particle systems should also cause this change.
In Ugui, grid reconstruction is divided into two parts: Rebuild and Rebatch. Where rebuild is a UI element, such as the color of an image is changed, then this image will occur rebuild operation, The overhead is included in the canvas.sendwillrendercanvases, as long as the action that changes the vertex property of the UI element will cause sendwill overhead. As for which UI element has rebuild, it is really invisible from the profiler.
And Rebatch is a canvas, as long as any one UI element in the canvas changes (also includes the position change), then this canvas will be rebatch, The overhead is contained in functions such as Canvas.sortjob, Canvas.geometryjob, and so on in Canvas.buildbatch and child threads. As to which Canvas has rebatch, You can use the Canvas.buildbatch function to determine, select Canvas.buildbatch in the profiler, and then display the relevant object on the right, which lists the name of the canvas in which the current frame is rebatch, but what UI elements are changed by this Rebatch is not visible in the profiler.

The answer is provided by UWA, and you are welcome to move to Community exchange:
Https://answer.uwa4d.com/question/5bbb2aa217780b34780918ed

Rendering

Q3: There are some problems with how the illumination map distribution is found inside unity. Many objects of the same material, because the light map is assigned to different Atlas, resulting in the inability to merge batches.
For example, the following three consecutive drawcall, the actual meshrenderer material is exactly the same, but because the illumination map on several different atlas, but can not achieve the merger.



It has been observed that the draw call consumption of a scenario can be reduced by more than 1/3 if the object in this case can be merged.
Therefore, it is now desirable to have a way to optimize the distribution of light maps to achieve the same material objects as possible to be assigned to the same atlas.

There are two ways of doing this:
1) Custom lightmapparameters, by setting bake tag, the same tag object will be baked into the same lightmap. Terrain_1_1 is the newly created lightmapparameters, replacing the default pamameters.

2) from the renderer UV, get the corresponding map from the full lightmap map, and then merge the maps to create a new Lightmap map (you can read and write EXR with TINYEXR in conjunction with the STB Library).

Thank you to the Jiangnan @uwa community for answers, welcome to the Community Exchange:
Https://answer.uwa4d.com/question/5bbc460690b1a8347db6dd46

Memory Management

Q4: When I was optimizing my project, I found that when I deleted the character model, its material and grid and texture2d still exist in memory. The deletion method used is (destroyimmediate). To view texture2d references

found that it was referenced by an instantiated material, and after further searching,

Why are there so many quoted items? Or did I find the wrong way? How can I release this part of memory? (The character model confirmation was deleted)

Materials and textures If you want to release immediately, you have to manually destroy, otherwise, when there is no other reference, Call Resources.unloadunusedassets, but resources.unloadunusedassets will cause stuttering, and it is recommended to manually manage materials and textures.

Thanks to the Asahi Army @uwa Quiz community to provide answers, welcome to the Community Exchange:
https://answer.uwa4d.com/question/5bbc6bb290b1a8347db6dd4a

Serialization of

Q5:scriptableobject loading speed, with the plug-in Messagepack, or the general JSON plug-in deserialization of the speed compared to about what level? Now the results of their own tests, unity directly with C # serialization/text read and then Parse/messagepack plug-ins, the three load the same heap of hashed configuration file time ratio is probably 10:4:3.
But even the fastest messagepack plug-in read time is unsatisfactory. So, I want to know if Scriptableobject or SQLite can load configuration files faster than Messagepack.

SQLite actually reads the data is the fastest, but the focus is the data structure, you can use reflection to deserialize, but the efficiency is not messagepack high. The individual thinks or solves the problem from the design, uses the space to change the time, resolves the data in advance, occupies the memory, uses the direct reading memory data to be reasonable.

Thanks to the Zheng Xiao @uwa community for answers, welcome to Community Exchange:
Https://answer.uwa4d.com/question/5bb8a578afd2174f6fe946b1

Today's share is here. Of course, it is boundless to have a life. During the long development cycle, the questions you see may be just the tip of the iceberg, and we've already prepared more technical topics for you to explore and share on the UWA quiz site. Welcome to love the progress of you to join, perhaps your method just can solve other people's urgent, and his mountain "stone" can also attack your "jade".

The realization method of bone pinch face function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.