Posts

Showing posts with the label Animation

Simple morphing with material

Image
Morphing with material can reduce animation production costs. You can also take advantage of the unique feel. Let's make a simple example. Step 1. Material This is the material. The most important thing is how to construct 'the final shape'.  There are so many possibilities.  In other situations, you can replace it with 'local position' instead of 'world position'. At the middle step, add some noise to make it look magical. Step 2. Update Parameters This is the Blueprint of the Morphing Character. More... Consider these. You can not control details. So, this method may not be effective if it is slowly deformed. You must have the appropriate animation. It is better if the appropriate particle effect is used at the same time. Perhaps the material node graph will become very complex. Optimization is required. It may be better for a projectile than a character. (e.g. Ghost shape arrow)

Repeated animation with material usage tips.

Image
I have used it several times in the previous posting, many people may not think 'Repeated animation with material' is important. But it is very good for the following reasons. It makes users more immersed in the game world.  In most cases, it works at a low cost. Since the actual object does not move, it does not cause any related malfunctions. Implementation is very easy in Unreal Engine 4. Example usage in UE4 You can find a working example in the 'Soul Cave' example.  Many of the moving things have been implemented this way. Please download the implementation contents and open the material. Example usage in Game(from hitman) Hitman was not created using Unreal Engine 4, but it is well suited to look for examples for this post... and it's good to go around and observe too. Clothes shaking in the wind. TV or monitor screen. Smoke. If you don't need high quality, you can use it instead of particles.  Moving inse...

Look at the object by rotating head

Image
Step 0. If you move the character's head according to the environment change, the game quality will increase. It feels like there is a better AI and more animations. So we try bone rotation to see world actors. Step 1. Place NPC characters. You can substitute another class for testing. Step 2. Edit character blueprint. Add a vector that named 'InterestingLocation'. Add a function to find the nearest interesting location in the world space. Step 3. Find proper bone to use. We will use 'neck_01' here. Step 4. Edit AnimGraph. Add a 'Transform bone' node. Set the value as shown in the screenshot below. Step 5. This is animation event graph. Depending on character blueprint and bone rotation, 'Make Rot from Y' should be replaced with 'Make Rot from X' or something else. The remaining issue... - If you want smooth transition, you need to make more changes. - It shou...

Bone name based animation retargeting(C++ modification)

Image
Step 0. Unreal Engine 4 Animation retargeting  : https://docs.unrealengine.com/latest/INT/Engine/Animation/RetargetingDifferentSkeletons/index.html Animation retargeting system is useful but it's not a match based on a name, so sometimes it gets bad results. Step 1. Open this file. \Engine\Source\Editor\Persona\Private\BoneMappingHelper.cpp FBoneMappingHelper::CalculateNameScore() seems to be fixed, but there are a lot of things that need to be corrected due to the additional weighting and comparison of candidates. If you fix FBoneMappingHelper::TryMatch(), you can get the desired result. This is the code for a typical naming. You can make it better one. Step 2. This is the result screenshots.

Animation reuse for improved performance

Image
Step 0. A well-made game shows a lot of characters without losing the quality of the rendering. In general, fewer bone counts and proper LOD usage will help optimize character rendering performance. A closer look reveals that the animation is being reused. Undoubtedly it will be very helpful. This time, we will do a basic test for 'animation reuse' with Unreal engine 4. Step 1. 'Set Master Pose Component' is the blueprint we were looking for. I've used it before in another article. https://gameenginebread.blogspot.com/2017/09/render-skeletal-mesh-with-different.html Step 2. Create many characters for testing. I used 21 * 21 characters. Step 3. This is the result of reusing the animation. Type console command 'stat anim' to see detail. 'AnimGameThreadTime' : 2.91ms CPU i7 6700k and Geforce 1060 are installed in the test PC. Step 4. Remove link to 'Set Master Pose Component' node and test a...