Chat History About bone animation and bump textures

Source: Internet
Author: User

Is there a friend who has made a bone animation and a bump texture?
Is it because I am away from vertex coloring?
Inverse Matrix for world Matrix
Then, calculate the inverse matrix for each skeleton matrix.
Then, use these matrices to find the location of the light source relative to the model space.
And then convert the tangent space,
Convert the light source to the direction of the bump texture space
Then, the space is transferred to the pixel shader.

Are you sure you want to do this?

Smart (517377672) 21:32:22
Shader steps:
1. Obtain the global coordinates of each vertex in the mesh.
2. Obtain the representation of the texture space base in the world space based on the vertex world coordinates and texture coordinates.
3. Change the light to the bump space.
4. Illumination
Smart (517377672) 21:34:15
1. Obtain the global coordinates of each vertex in the mesh.
Static mesh and skeletal emsh differ in this step.
 
Smart (517377672) 21:34:24
Others are the same
(249974072) 21:35:06
For the skeleton animation, it is no difference between calculating the transformed vertex and static vertex...

Aru Feng (20024675) 21:35:13
"Converting light into a bump space"
How can this be changed? Is it very complicated? We need to perform a inverse matrix for each skeleton.
It would be a little effort-consuming to change the skeleton in the GPU, but it would be easy to do with the CPU. And common static models ..
Smart (517377672) 21:36:28
The key is to find the basis of the bump space.
(249974072) 21:36:50
U, V, n can determine its rotation matrix...
Aru Feng (20024675) 21:36:05
"Converting light into a bump space"
How should we do this?
Aru Feng (20024675) 21:38:17
Do u, v, and N use the points of the original model, or do they use the points after the world transformation and the mixing of bones?
Smart (517377672) 21:36:28
The key is to find the basis of the bump space.

If the basis of the space is obtained, the transformation matrix can be obtained directly, and then the light is multiplied by the pear of the matrix.
(249974072) 21:39:11
Knows the vectors of normal (N), tangent (T), and subnormal (BN ..
The rotating matrix structure that transforms light into this space is
T. x, t. Y, T. Z
N. X, N. Y, N. Z
BN. X, BN. Y, BN. Z
(249974072) 21:39:18
I hope I am correct ..

Date: 2010-1-8
Smart (517377672) 21:39:25
Aru Feng (20024675) 21:38:17
Do u, v, and N use the points of the original model, or do they use the points after the world transformation and the mixing of bones?

The world transformation will not change the coordinates of U, V, n
(249974072) 21:41:24
Here, U, V, and n are not texture coordinates, normal, but vectors of the three coordinate axes in their local coordinate space...

(249974072) 21:42:39
Next, the rotation operation that just knows that the local coordinates are transferred to the world coordinates .. For details, refer to the university Graphics Course...
(249974072) 21:43:06
U, V, and N must be unitized. This is very important ~
(249974072) 21:43:38
If you have studied the implementation of physical engines, you will be very familiar with these things ...~
(249974072) 21:44:59
Are you playing games of the next age ???
Aru Feng (20024675) 21:45:10
I am not very clear about this theory, but I can calculate the U, V, N in the reference code.
Now I want to know if I can calculate the correct direction of light relative to the texture in the vertex coloring tool without using a CPU-mixed skeleton?
Smart (517377672) 21:46:02
Yes
(249974072) 21:47:12
That would be impossible...

Because the relative position of the vertex will be modified, the calculation of the colleague's normal and subnormal must be in the plane before calculation...
(249974072) 21:47:38
You can refer to the normal to see the calculation process of the subnormal...
Aru Feng (20024675) 21:48:10
If you want to use the bump texture, you must mix the bones in the CPU.
(249974072) 21:48:42
Come on, let's wait. I think clearly and don't want to tell you what you mean by mistake ~
Smart (517377672) 21:48:53
Yes.

Aru Feng (20024675) 21:49:46
How can this problem be solved? Now I want to convert the space coordinates of vertices from the light source.
(249974072) 21:50:11
Yes, but I am thinking about it...
We can mix the pre-processed tangent and subnormal with the vertex sample, but I am not quite clear about the effect .. You can try it ..
Aru Feng (20024675) 21:51:05
That's why I'm not considering bump.
I want to calculate the position of the light source in the original model relative to the vertex in the shadow.
Aru Feng (20024675) 21:51:05
That's why I'm not considering bump.
I want to calculate the position of the light source in the original model relative to the vertex in the shadow.
(249974072) 21:52:07
That is to say, the blend operations are (VPOs, normal, tangent, bnormal )~
(249974072) 21:52:47
I have never tried it, and the effect is probably worrying ....

Arufeng
Tangent, bnormal
Is it necessary to mix the two parts?
(249974072) 21:53:54
En ~

To be honest, I think it's strange to use blend ..~
Smart (517377672) 21:54:15
Aru Feng (20024675) 21:51:05
That's why I'm not considering bump.
I want to calculate the position of the light source in the original model relative to the vertex in the shadow.

Tangent and bnormal can be calculated based on vertex coordinates and texture coordinates.
(249974072) 21:54:56
My current processing is to calculate the static model under the CPU, then re-calculate normal, bn, T, and then render it like the static model

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.