Games104 Modern Game Engine Study Notes 08

The rendering part is a bit confusing. Let’s go back to it after learning other graphics content.

Three challenges for game animation:
1. Real-time response to various changes based on interaction
2. Huge calculations in one frame
3. More realistic and natural performance

2D animation
sprite animation
draws each frame of sprites in a loop

2D technology achieves 3D effects
by taking a series of actions from various perspectives. Depending on the position of the camera, different sprite animations are played.
Insert image description here
The particle system is also a sprite animation.

Live2d
talks about dividing a picture into multiple small primitives.
By rotating, scaling and deforming each small primitive (using a frame for the picture set, stretching the frame will cause reflection transformation of the triangles/squares inside)
. Each picture element exists in the control grid, and control points can be randomly added to the grid.
Create the desired picture effect in each frame

DOF: degrees of freedom, that is, transformable dimensions.
A rigid body usually has 6 freedoms: translation x, y, z. And rotation around three axes,
Insert image description here
Rigid Hierarchical animation
divides the object into movable joints. Each mesh and joint binding.
The mesh at the joints will be interspersed

Per-vertex animation vertex animation
saves the data of each vertex in each frame. Changes in the vertices will cause changes in the normal direction. It is usually simulated with a physics engine and then stored as a vertext-animation texture
such as flag animation, water flow animation, etc. It is difficult to distinguish bones.

Morph Target animation
is also a vertex animation. Interpolate between vertices, setting different weights. Usually used for human faces

3D Skinned animation Skinned animation
Each vertex is affected by multiple bones

2D skinned animation works on the same principle as 3D

Physics-based animation: used for ragdoll systems, physical simulation, IK (inverse dynamics)

Insert image description here
Different coordinate systems:
world coordinate system world
model coordinate system model
local coordinate system local

Basic structure:
Humanoid model: The root is usually at the tail vertebrae of the spine.
Quadrupeds are another set of models.

What is actually stored in the game is joint data (joint), and a bone is formed between two joints.

The root bone is generally defined between the two feet. Used to express the position of the model, calculate displacement, height,

Bind animation
connects the binding points between two skeletal models. People ride horses, people drive cars, etc. It is not a simple matter of setting the binding points of the two models to the same position. Instead, the entire coordinate system attaches from one to the other.

The created skeletal model: initially a Bind Pose
animation with 9 degrees of freedom: translation, rotation, scaling

Two-dimensional space rotation matrix
Insert image description here
Euler angles
Insert image description here
Euler angles require strict order dependence on
universal joints

Quaternions
Insert image description here
Insert image description here
Don’t worry about the principles of quaternions, just use them.

Find local coordinates. Identities relative to bound model
Insert image description here
coordinates. The inverse of the matrix is ​​usually stored directly in the joint.

The calculation of coordinate interpolation affected by two joints requires converting the local coordinates of the two joints into model coordinates, and then calculating the weight interpolation
Insert image description here

Translation and scaling can usually be solved with linear interpolation .
Insert image description here
Rotation
Insert image description here
interpolation Rotation interpolation usually rotates the minimum angle. That is, angles greater than 180 degrees will rotate in the opposite direction

The problem with NLERP interpolation is: the rotation speed is fast at both ends and slow in the middle

Insert image description here
SLERP calculations are more expensive because of the operation of inverse trigonometric functions. And it will be unstable when the rotation angle is small.

Usually NIERP is used when the rotation angle is small, and SLERP is used when the rotation angle is large.

Insert image description here

CLIP will store each pose
to find the current frame and the next frame
, calculate the current pose, and
convert it into model coordinates according to the interpolation algorithm.

Animation compression:
Unchanged tracks are discarded.
In most cases,
scaling remains unchanged and can be discarded. Translation only needs to store one value, and there is no need to store the entire timeline.
Rotation is interpolated between key frames. When the error between the interpolated value and the actual value is greater than Within a certain range, set the previous frame as a key frame

Guess you like

Origin blog.csdn.net/Mhypnos/article/details/130715487