IP Library Granted Patent US 12675953
Granted Patent B2
US 12675953 · App. 18/792,396 · Granted Jul 7, 2026

Method and apparatus of hair processing for virtual object, device, storage medium, and program product

Inventor: Fan Yang (Shenzhen, CN)
Assignee: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
G06T17/20G06T13/40
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12675953
App. No.
18/792,396
Granted
Jul 7, 2026
Kind
B2
Abstract

This application provides a method of processing hair for a virtual object performed by an electronic device. The method includes: obtaining an initial position of each of hair particles of virtual hair of a virtual object; obtaining a physically simulated position of the hair particle by performing physical simulation on a movement of the hair particle in a physical movement based on the initial position of the hair particle; fusing the initial position and the physically simulated position of the hair particle, to obtain a fused position of the hair particle; and rendering the virtual hair of the virtual object based on the fused positions of the hair particles, to obtain rendered virtual hair.

Claims (73)

1 . A method of processing hair for a virtual object performed by an electronic device, the method comprising:

obtaining, by the electronic device, an initial position of each of hair particles of virtual hair of a virtual object;

obtaining, by the electronic device, a physically simulated position of the hair particle by performing physical simulation on a movement of the hair particle in a physical movement based on the initial position of the hair particle;

fusing, by the electronic device, the initial position and the physically simulated position of the hair particle, to obtain a fused position of the hair particle; and

rendering, by the electronic device, the virtual hair of the virtual object based on the fused positions of the hair particles, to obtain rendered virtual hair.

2 . The method according to claim 1 , wherein the obtaining, by the electronic device, an initial position of each of hair particles of virtual hair of a virtual object comprises:

obtaining, by the electronic device, a hair particle model created for the virtual hair of the virtual object; and

determining, by the electronic device, for each of the hair particles, a model position of the hair particle using the hair particle model as the initial position of the hair particle.

3 . The method according to claim 1 , wherein the obtaining, by the electronic device, an initial position of each of hair particles of virtual hair of a virtual object comprises:

obtaining, by the electronic device, a hair particle model, a hair mesh model, and a hair skeleton of the virtual hair of the virtual object;

determining, by the electronic device, for each of the hair particles, a hair particle position of the hair particle in a model coordinate system of the hair mesh model, determining at least one target skeletal joint related to the hair particle from a plurality of skeletal joints, and determining a target rigging weight of each of the at least one target skeletal joint; and

determining, by the electronic device, for each of the hair particles, an animation position of the hair particle in a skinned skeletal animation based on the hair particle position and the target rigging weight of each of the at least one target skeletal joint, and using the animation position of the hair particle as the initial position of the hair particle.

4 . The method according to claim 3 , wherein the determining, by the electronic device, a hair particle position of the hair particle in a model coordinate system of the hair mesh model comprises:

moving, by the electronic device, the hair particle model, the moved hair particle model being aligned with the hair mesh model;

obtaining, by the electronic device, coordinate transformation information generated during the movement and an initial hair particle position of each of the hair particles in the hair particle model; and

determining, by the electronic device, the hair particle position of the hair particle in the model coordinate system of the hair mesh model based on the initial hair particle position and the coordinate transformation information.

5 . The method according to claim 3 , wherein the determining, by the electronic device, at least one target skeletal joint corresponding to the hair particle from the plurality of skeletal joints, and determining a target rigging weight of each of the at least one target skeletal joint comprises:

determining, by the electronic device, a target mesh vertex closest to the hair particle from the plurality of mesh vertexes; and

determining, by the electronic device, at least one skeletal joint related to the target mesh vertex as the at least one target skeletal joint related to the hair particle, and determining a rigging weight of each of the at least one skeletal joint related to the target mesh vertex as the target rigging weight corresponding to each of the at least one target skeletal joint.

6 . The method according to claim 3 , wherein the determining, by the electronic device, an animation position of the hair particle in the skinned skeletal animation based on the hair particle position and the target rigging weight of each of the at least one target skeletal joint comprises:

separately performing, by the electronic device, the following processing for each of the at least one target skeletal joint: multiplying the hair particle position and the target rigging weight of the target skeletal joint, to obtain an intermediate particle position of the hair particle relative to the target skeletal joint; obtaining a skinning matrix of the target skeletal joint, and multiplying the intermediate particle position and the skinning matrix, to obtain an intermediate animation position; and

adding, by the electronic device, intermediate animation positions corresponding to the at least one target skeletal joint, to obtain the animation position of the hair particle in the skinned skeletal animation.

7 . The method according to claim 1 , wherein the obtaining, by the electronic device, a physically simulated position of the hair particle comprises:

obtaining, by the electronic device, a boundary restriction parameter and a movement parameter of the hair particle, the boundary restriction parameter being a farthest position reachable by the hair particle during the movement, and the movement parameter comprising a movement speed and a movement direction of the hair particle; and

adjusting, by the electronic device, the initial position of the hair particle based on the boundary restriction parameter and the movement parameter, to obtain the physically simulated position of the hair particle.

8 . The method according to claim 1 , wherein the fusing, by the electronic device, the initial position and the physically simulated position of the hair particle, to obtain a fused position of the hair particle comprises:

obtaining, by the electronic device, a first weight of the initial position of the hair particle and a second weight of the physically simulated position of the hair particle; and

weighting, by the electronic device, the initial position and the physically simulated position based on the first weight and the second weight, to obtain the fused position of the hair particle.

9 . The method according to claim 1 , wherein the fusing, by the electronic device, the initial position and the physically simulated position of the hair particle, to obtain a fused position of the hair particle comprises:

determining, by the electronic device, a fusion manner between the initial position and the physically simulated position, the fusion manner comprising at least one of a linear interpolation fusion manner or a spherical interpolation fusion manner; and

fusing, by the electronic device, for each of the hair particles, the initial position and the physically simulated position of the hair particle in the fusion manner, to obtain the fused position of the hair particle.

10 . An electronic device, comprising:

a processor;

a memory; and

a plurality of computer-executable instructions stored in the memory, wherein the computer-executable instructions, when executed by the processor, cause the electronic device to implement a method of processing hair for a virtual object including:

obtaining an initial position of each of hair particles of virtual hair of a virtual object;

obtaining a physically simulated position of the hair particle by performing physical simulation on a movement of the hair particle in a physical movement based on the initial position of the hair particle;

fusing the initial position and the physically simulated position of the hair particle, to obtain a fused position of the hair particle; and

rendering the virtual hair of the virtual object based on the fused positions of the hair particles, to obtain rendered virtual hair.

11 . The electronic device according to claim 10 , wherein the obtaining an initial position of each of hair particles of virtual hair of a virtual object comprises:

obtaining a hair particle model created for the virtual hair of the virtual object; and

determining, for each of the hair particles, a model position of the hair particle using the hair particle model as the initial position of the hair particle.

12 . The electronic device according to claim 10 , wherein the obtaining an initial position of each of hair particles of virtual hair of a virtual object comprises:

obtaining a hair particle model, a hair mesh model, and a hair skeleton of the virtual hair of the virtual object;

determining, for each of the hair particles, a hair particle position of the hair particle in a model coordinate system of the hair mesh model, determining at least one target skeletal joint related to the hair particle from a plurality of skeletal joints, and determining a target rigging weight of each of the at least one target skeletal joint; and

determining, for each of the hair particles, an animation position of the hair particle in a skinned skeletal animation based on the hair particle position and the target rigging weight of each of the at least one target skeletal joint, and using the animation position of the hair particle as the initial position of the hair particle.

13 . The electronic device according to claim 12 , wherein the determining a hair particle position of the hair particle in a model coordinate system of the hair mesh model comprises:

moving the hair particle model, the moved hair particle model being aligned with the hair mesh model;

obtaining coordinate transformation information generated during the movement and an initial hair particle position of each of the hair particles in the hair particle model; and

determining the hair particle position of the hair particle in the model coordinate system of the hair mesh model based on the initial hair particle position and the coordinate transformation information.

14 . The electronic device according to claim 12 , wherein the determining at least one target skeletal joint corresponding to the hair particle from the plurality of skeletal joints, and determining a target rigging weight of each of the at least one target skeletal joint comprises:

determining a target mesh vertex closest to the hair particle from the plurality of mesh vertexes; and

determining at least one skeletal joint related to the target mesh vertex as the at least one target skeletal joint related to the hair particle, and determining a rigging weight of each of the at least one skeletal joint related to the target mesh vertex as the target rigging weight corresponding to each of the at least one target skeletal joint.

15 . The electronic device according to claim 12 , wherein the determining an animation position of the hair particle in the skinned skeletal animation based on the hair particle position and the target rigging weight of each of the at least one target skeletal joint comprises:

separately performing the following processing for each of the at least one target skeletal joint: multiplying the hair particle position and the target rigging weight of the target skeletal joint, to obtain an intermediate particle position of the hair particle relative to the target skeletal joint; obtaining a skinning matrix of the target skeletal joint, and multiplying the intermediate particle position and the skinning matrix, to obtain an intermediate animation position; and

adding intermediate animation positions corresponding to the at least one target skeletal joint, to obtain the animation position of the hair particle in the skinned skeletal animation.

16 . The electronic device according to claim 10 , wherein the obtaining a physically simulated position of the hair particle comprises:

obtaining a boundary restriction parameter and a movement parameter of the hair particle, the boundary restriction parameter being a farthest position reachable by the hair particle during the movement, and the movement parameter comprising a movement speed and a movement direction of the hair particle; and

adjusting the initial position of the hair particle based on the boundary restriction parameter and the movement parameter, to obtain the physically simulated position of the hair particle.

17 . The electronic device according to claim 10 , wherein the fusing the initial position and the physically simulated position of the hair particle, to obtain a fused position of the hair particle comprises:

obtaining a first weight of the initial position of the hair particle and a second weight of the physically simulated position of the hair particle; and

weighting the initial position and the physically simulated position based on the first weight and the second weight, to obtain the fused position of the hair particle.

18 . The electronic device according to claim 10 , wherein the fusing the initial position and the physically simulated position of the hair particle, to obtain a fused position of the hair particle comprises:

determining a fusion manner between the initial position and the physically simulated position, the fusion manner comprising at least one of a linear interpolation fusion manner or a spherical interpolation fusion manner; and

fusing, for each of the hair particles, the initial position and the physically simulated position of the hair particle in the fusion manner, to obtain the fused position of the hair particle.

19 . A non-transitory computer-readable storage medium, having a plurality of computer-executable instructions stored therein, the computer-executable instructions, when executed by a processor of an electronic device, causing the electronic device to implement a method of processing hair for a virtual object including:

obtaining an initial position of each of hair particles of virtual hair of a virtual object;

obtaining a physically simulated position of the hair particle by performing physical simulation on a movement of the hair particle in a physical movement based on the initial position of the hair particle;

fusing the initial position and the physically simulated position of the hair particle, to obtain a fused position of the hair particle; and

rendering the virtual hair of the virtual object based on the fused positions of the hair particles, to obtain rendered virtual hair.

20 . The non-transitory computer-readable storage medium according to claim 19 , wherein the fusing the initial position and the physically simulated position of the hair particle, to obtain a fused position of the hair particle comprises:

obtaining a first weight of the initial position of the hair particle and a second weight of the physically simulated position of the hair particle; and

weighting the initial position and the physically simulated position based on the first weight and the second weight, to obtain the fused position of the hair particle.