Service processing method and apparatus, and computer device and storage medium
By sampling and processing the root point cloud of virtual hair and separating simulated and interpolated virtual hair, only physical simulation of simulated virtual hair is solved, and the problem of low simulation efficiency of dynamic effect of virtual hair in the existing technology is achieved, and efficient and real-time Simulation effect.
Patent Information
- Application Number
- PCT/CN2024/078223
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-23
- Filing Date
- 2024-02-23
- Publication Date
- 2024-12-19
AI Technical Summary
The prior art is difficult to efficiently simulate the dynamic effects of virtual hair in real-time scenarios, resulting in low efficiency and high overhead, which cannot meet the real-time requirements of high precision.
By obtaining the root point cloud and sampling control information of the business role, the sampling process obtains the sampling point, which is divided into simulated virtual hair and interpolated virtual hair. Only physical simulation strategies are used for dynamic effect simulation, interpolated virtual hair follow Simulate virtual hair movement.
It improves the efficiency and authenticity of virtual hair dynamic effect simulation, reduces overhead, and realizes real-time scenario requirements under high-precision conditions.
Smart Images

Figure CN2024078223_19122024_PF_FP_ABST
Abstract
Description
Business processing method, device, computer equipment, and storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 23, 2023, with application number 202310439600.7 and application name “A business processing method, device, computer equipment, and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to business processing technology. Background Art
[0003] With the rapid development of computer technology, the demand for real-time virtual hair dynamic effects in businesses (for example, games, film and television special effects production, etc.) has become increasingly urgent. Real-time virtual hair dynamic effects refer to simulating the dynamic effects of virtual hair of business roles in the business (for example, game characters, film and television production characters, etc.) in real-time scenes (for example, scenes with more than 30 frames per second), so that they can be as close as possible to the dynamic effects of real hair in real scenes. This places high demands on the authenticity and real-time performance of the simulation of virtual hair dynamic effects.
[0004] At present, physical simulation strategies can be used to simulate the dynamic effects of virtual hair. However, high-precision simulation of virtual hair dynamic effects through physical simulation strategies is inefficient and costly, and is difficult to achieve with current hardware levels. Therefore, how to effectively improve the efficiency of virtual hair dynamic effect simulation and reduce the cost of virtual hair dynamic effect simulation has become a current research hotspot.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a business processing method, apparatus, computer equipment, and storage medium, which can effectively improve the efficiency of virtual hair dynamic effect simulation and reduce the overhead of virtual hair dynamic effect simulation.
[0007] In one aspect, an embodiment of the present application provides a service processing method, which is executed by a computer device and includes:
[0008] Obtaining a hair root point cloud of a business character in the business, where the hair root point cloud includes the hair root points corresponding to multiple virtual hairs of the business character;
[0009] Acquire sampling control information, which is used to control the distance between sampling points during the sampling process of the rooting point cloud;
[0010] According to the sampling control information, the root point cloud is sampled and processed to obtain the sampling points;
[0011] The virtual hair corresponding to the sampling point is determined as the simulated virtual hair, and the virtual hair corresponding to other hair root points in the hair root point cloud except the sampling point is determined as the interpolated virtual hair;
[0012] Among them, the simulated virtual hair adopts a physical simulation strategy to simulate dynamic effects during the execution of the business, and the simulated virtual hair is used to control the interpolated virtual hair to follow the movement of the simulated virtual hair during the execution of the business.
[0013] Accordingly, an embodiment of the present application provides a service processing device, which is deployed on a computer device and includes:
[0014] An acquisition unit, configured to acquire a hair root point cloud of a business character in a business, wherein the hair root point cloud includes hair root points corresponding to multiple virtual hairs of the business character;
[0015] The acquisition unit is further used to acquire sampling control information, where the sampling control information is used to control the distance between sampling points during the sampling process of the rooting point cloud;
[0016] A processing unit, configured to perform sampling processing on the rooting point cloud according to the sampling control information to obtain sampling points;
[0017] The processing unit is further configured to determine the virtual hair corresponding to the sampling point as simulated virtual hair, and determine the virtual hair corresponding to other hair root points in the hair root point cloud except the sampling point as interpolated virtual hair;
[0018] Among them, the simulated virtual hair adopts a physical simulation strategy to simulate dynamic effects during the execution of the business, and the simulated virtual hair is used to control the interpolated virtual hair to follow the movement of the simulated virtual hair during the execution of the business.
[0019] Accordingly, an embodiment of the present application provides a computer device, comprising:
[0020] a processor suitable for implementing a computer program;
[0021] Computer-readable storage medium, the computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the above-mentioned business processing method.
[0022] Accordingly, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is read and executed by a processor of a computer device, the computer device executes the above-mentioned business processing method.
[0023] Accordingly, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the above-mentioned service processing method.
[0024] In an embodiment of the present application, the sampling of virtual hair is converted into the sampling of root points corresponding to the virtual hair. The root point cloud of the business role in the business can be sampled to obtain sampling points. The virtual hair corresponding to the sampling points can be used as simulated virtual hair, and the virtual hair corresponding to other root points in the root point cloud except the sampling points can be used as interpolated virtual hair. The simulated virtual hair can use a physical simulation strategy to simulate dynamic effects during the execution of the business. The simulated virtual hair can be used to control the interpolated virtual hair to follow the movement of the simulated virtual hair during the execution of the business; that is, a part of the virtual hair (simulated virtual hair) can be sampled from the virtual hair and a physical simulation strategy can be used to simulate dynamic effects. The remaining virtual hair (interpolated virtual hair) follows the simulated virtual hair to move. There is no need to use a physical simulation strategy to simulate dynamic effects for all virtual hair. This can improve the efficiency of virtual hair dynamic effect simulation and reduce the overhead of virtual hair dynamic effect simulation. Moreover, during the sampling process of the hair root point cloud, the distance between the sampling points is controlled by the sampling control information, so that the sampling points can be evenly distributed in the hair root point cloud, so that the sampling points can more accurately reflect the original hair root point cloud, and the hair root points corresponding to the simulated virtual hair can be reasonably sampled from the hair root point cloud. In other words, the simulated virtual hair can be reasonably sampled from the virtual hair, which can effectively improve the realism of the simulation of the virtual hair dynamic effect, thereby achieving the improvement of the efficiency of the virtual hair dynamic effect simulation and the reduction of the overhead of the virtual hair dynamic effect simulation on the premise of improving the realism of the virtual hair dynamic effect simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0026] FIG1 is a schematic diagram of virtual hair provided in an embodiment of the present application;
[0027] FIG2 is a schematic diagram of the structure of a business processing system provided in an embodiment of the present application;
[0028] FIG3 is a flow chart of a business processing method provided in an embodiment of the present application;
[0029] FIG4 is a schematic diagram of a voxel grid set provided in an embodiment of the present application;
[0030] FIG5 is a schematic diagram of a mapping between a voxel grid and a rooting point provided by an embodiment of the present application;
[0031] FIG6 is a schematic diagram of a sampling process provided in an embodiment of the present application;
[0032] FIG7 is a schematic diagram of a sampling result provided in an embodiment of the present application;
[0033] FIG8 is a flow chart of another service processing method provided in an embodiment of the present application;
[0034] FIG9 is a schematic diagram of determining a matching simulated virtual hair according to an embodiment of the present application;
[0035] FIG10 is a schematic diagram of a process for determining a matching hair segment for a hair point provided by an embodiment of the present application;
[0036] FIG11 is a schematic diagram of the projection of a hair point in a matching hair segment provided by an embodiment of the present application;
[0037] FIG12 is a schematic diagram of an interface of a debugging tool provided in an embodiment of the present application;
[0038] FIG13 is a schematic diagram showing a comparison of sampling results provided in an embodiment of the present application;
[0039] FIG14 is a schematic diagram showing a comparison of interpolation results provided in an embodiment of the present application;
[0040] FIG15 is a schematic structural diagram of a service processing device provided in an embodiment of the present application;
[0041] FIG16 is a schematic structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0043] The embodiments of the present application relate to the simulation of dynamic effects of virtual hair of business characters in business.
[0044] The business may refer to a business scenario that requires simulation of virtual hair dynamic effects, for example, the business may include games, digital humans, or film and television special effects production.
[0045] A business character can refer to a virtual object in a business scenario that requires dynamic virtual hair effects simulation. A business character can be a modeled virtual character model. Based on the modeling dimension, a business character can include three-dimensional characters, 2.5-dimensional characters, or two-dimensional characters, etc. This embodiment of the application does not limit the dimensions of a business character. Based on the business scenario type, a business character can include game characters, digital human characters, or film and television production characters. Based on the business character type, a business character can include people or animals, etc.
[0046] The virtual hair may be a hair model obtained through modeling. As shown in FIG1 , the virtual hair may be composed of a plurality of hair points 101 and hair segments 102 between the hair points. The hair points connected to the scalp among the plurality of hair points may be called hair root points.
[0047] Virtual hair dynamic effect simulation may refer to simulating the dynamic effect of the virtual hair of the business character in the business during the execution of the business, so that it can be as close as possible to the dynamic effect of the real hair in the real scene. The execution process of the business is usually a real-time scene. For example, in a real-time game match, in the process of real-time film and television special effects production, the real-time scene usually needs to meet the requirement of more than 30 frames per second. In other words, the simulation of virtual hair dynamic effects has very high requirements for real-time and authenticity. Based on this, an embodiment of the present application proposes a business processing method, which is used to simulate the dynamic effects of virtual hair. The simulation of virtual hair dynamic effects can be implemented based on a sampling-interpolation framework. Among them:
[0048] ① For the sampling process of the sampling-interpolation framework, a portion of virtual hair can be sampled from the virtual hair as simulated virtual hair (or it can be called solved virtual hair), and the remaining virtual hair is used as interpolated virtual hair. ② For the interpolation process of the sampling-interpolation framework, the simulated virtual hair can simulate dynamic effects through a physical simulation strategy. Simulating dynamic effects through a physical simulation strategy can be understood as assigning physical parameters and kinematic properties to each hair point in the virtual hair, calculating the interaction forces such as expansion, contraction, bending, twisting, and collision between the hair points, and ultimately deriving their kinematic properties (for example, speed, position, etc.) for the next frame. There are many common physical simulation strategies, such as UE (Unreal Engine)'s Groom (a physical simulation strategy) and TressFX (a physical simulation strategy) based on AMD (a graphics card). The advantage of simulating dynamic effects through physical simulation strategies is that the simulated dynamic effects are very realistic and can interact with other physical systems (for example, water, snow, collision bodies, etc.). However, there is a disadvantage of slow simulation calculation speed, especially for high-precision virtual hair, where the number of hair points can often reach hundreds of thousands or even millions. Current hardware conditions cannot meet the standard of more than 30 frames per second required by real-time scenes. Interpolated virtual hair can be driven by simulated virtual hair, and the position of the interpolated virtual hair can be calculated based on the position of the simulated virtual hair. In other words, during the execution of the business, the simulated virtual hair can be used to control the interpolated virtual hair to follow the movement of the simulated virtual hair.
[0049] During the sampling process, the business processing method can convert the sampling of virtual hair into the sampling of the root points corresponding to the virtual hair. The root points corresponding to the virtual hair can be sampled according to the sampling control information to obtain the sampling points. The virtual hair corresponding to the sampling points can be used as simulated virtual hair, and the virtual hair corresponding to the root points other than the sampling points in the root point cloud can be used as interpolated virtual hair. The sampling process can control the distance between the sampling points during the sampling process of the root points corresponding to the virtual hair through the sampling control information, so that the sampling points can be evenly distributed in the root points corresponding to the virtual hair. The sampling points can more accurately and comprehensively describe the root points corresponding to the virtual hair. Therefore, the root points corresponding to the simulated virtual hair can be reasonably sampled from the root points corresponding to the virtual hair. In other words, the simulated virtual hair can be reasonably sampled from the virtual hair.
[0050] The interpolation process of the business processing method may include an interpolation classification process and an interpolation calculation process. In the interpolation classification process, the matching degree between the simulated virtual hair and the interpolated virtual hair may be comprehensively considered from multiple angles (for example, the distance between the root point corresponding to the simulated virtual hair and the root point corresponding to the interpolated virtual hair, the similarity between the orientation of the simulated virtual hair and the orientation of the interpolated virtual hair, and the similarity between the hair length of the simulated virtual hair and the hair length of the interpolated virtual hair, etc.), and then the simulated virtual hair with a higher matching degree may be selected as the matching simulated virtual hair for the interpolated virtual hair to follow. In the interpolation calculation process, the matching simulated virtual hair of the interpolated virtual hair may be simulated for dynamic effects through a physical simulation strategy, and the interpolated virtual hair may follow the matching simulated virtual hair to move. That is to say, only the simulated virtual hair needs to be simulated for dynamic effects through the physical simulation strategy, rather than all virtual hair needing to be simulated for dynamic effects through the physical simulation strategy, which can improve the efficiency of virtual hair dynamic effect simulation, and the interpolated virtual hair can use the matching simulated virtual hair with a higher degree of matching with the interpolated virtual hair as the following simulated virtual hair, which can improve the realism of the dynamic effect simulation of the interpolated virtual hair.
[0051] It should be noted that when the embodiments of the present application mention that the business is a game, the game may refer to an electronic game product, and the electronic game may refer to an interactive game that relies on an electronic device platform. Electronic games may include stand-alone games and network games. Among them, network games can also be called online games, which generally refer to sustainable individual multi-player online games that use the Internet as a communication medium, game servers (Game Server) and player terminals as game processing devices, and game clients (Game Client) running in the player terminals as information interaction windows, aiming to achieve entertainment, leisure, communication and virtual achievements; game clients refer to programs that correspond to game servers and provide local game services to players participating in online games; game servers refer to service devices that provide data calculation, verification, storage and forwarding functions for game clients. Stand-alone games refer to electronic games that can be run independently using a computer or other game platform. Stand-alone games do not require a game server to run normally.
[0052] For online games, the embodiments of the present application do not limit the game types of online games. For example, online games can be cloud games, or online games can be ordinary online games. Among them, ordinary online games refer to games that are run directly in the game client installed in the player terminal. Cloud gaming (Cloud Gaming), also known as gaming on demand (Gaming on Demand), refers to games that are run in the game server. That is to say, in the cloud gaming scenario, all cloud games are not run in the game client of the player terminal, but in the game server. The game server compresses and encodes the game screen and game audio in the cloud game into a media stream, and then transmits the media stream to the game client in the player terminal through the network for image display and audio playback. It can be seen that the game client does not need to have powerful graphics processing and data computing capabilities, but only needs to have basic streaming media playback capabilities, and the ability to obtain the operation instructions entered by the game player and send the operation instructions entered by the game player to the game server. When a game player performs various operations in the game client's game interface, the game client reports the operation data generated by these operations to the game server. The game server then refreshes the game screen of the cloud game based on the operation data in the corresponding cloud game, and then returns the refreshed game screen to the game client for display, thus enabling cloud gaming. In other words, the difference between ordinary online games and cloud games is that ordinary online games run on the game client installed on the player's terminal, while cloud games run on the game server. The game client is responsible for presenting the game screen, playing the game audio, and receiving the operation commands input by the game player.
[0053] The following introduces a business processing system suitable for implementing the business processing method provided in the embodiment of the present application.
[0054] As shown in Figure 2, the business processing system may include a terminal 201 and a server 202; the terminal 201 may run a business client (e.g., business software, business applications, business web pages, business applets, etc.). The server 202 may be a data processing server for the business client. The terminal 201 and the server 202 may establish a direct communication connection via wired communication, or an indirect communication connection via wireless communication. The terminal 201 may include, but is not limited to, any of the following: a smartphone, a tablet computer, a laptop computer, a desktop computer, a smartwatch, a smart home appliance, a smart car terminal, an aircraft, etc. The server 202 may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0055] As can be seen from the foregoing, the business processing method proposed in the embodiment of the present application may include a sampling process and an interpolation process, and the interpolation process may include an interpolation classification process and an interpolation calculation process. Among them, the sampling process can sample simulated virtual hair from the virtual hair of the business role in the business, and the interpolated virtual hair is other virtual hair in the virtual hair except the simulated virtual hair. The interpolation classification process can select matching simulated virtual hair with a higher degree of matching with the interpolated virtual hair from the sampled simulated virtual hair. The interpolation calculation process can simulate the dynamic effect of the matching simulated virtual hair through a physical simulation strategy, determine the position of the matching simulated virtual hair at different times (for example, different frames), and can calculate the position of the interpolated virtual hair at different times based on the position of the matching simulated virtual hair at different times to simulate the dynamic effect of the interpolated virtual hair.
[0056] Based on this, in a business processing system consisting of terminal 201 and server 202, the general processing flow of the business processing method can be described as follows: When a business client running in terminal 201 has a need to simulate a dynamic effect of virtual hair for a business character (for example, a game match is started in the business client, or film and television special effects production is started in the business client), the business client can send a simulation request for the dynamic effect of virtual hair for the business character to server 202 via terminal 201. After receiving the simulation request, server 202 can perform a sampling process, an interpolation classification process, and an interpolation calculation process on the first frame to obtain the position of the matched simulated virtual hair in the first frame (specifically, the position of each hair point in the matched simulated virtual hair in the first frame) and the interpolated virtual hair position in the first frame (specifically, the position of each hair point in the interpolated virtual hair in the first frame). Server 202 can then send the position of the matched simulated virtual hair in the first frame and the interpolated virtual hair position in the first frame to terminal 201. The service client in the terminal 201 can render the matched simulated virtual hair and the interpolated virtual hair in the first frame according to the position of the matched simulated virtual hair in the first frame and the position of the interpolated virtual hair in the first frame.
[0057] After that, the server 202 can perform an interpolation calculation process on the subsequent frames of the first frame (frame by frame) to obtain the position of the matching simulated virtual hair in the subsequent frames, and the position of the interpolated virtual hair in the subsequent frames. The server 202 can send the position of the matching simulated virtual hair in the subsequent frames, and the position of the interpolated virtual hair in the subsequent frames to the terminal 201. The business client in the terminal 201 can render the matching simulated virtual hair and the interpolated virtual hair in the subsequent frames according to the position of the matching simulated virtual hair in the subsequent frames, and the position of the interpolated virtual hair in the subsequent frames. And so on, until the business client running in the terminal 201 terminates the simulation demand for the dynamic effect of the virtual hair of the business character (for example, the game match in the business client ends, and the film and television special effects production in the business client ends).
[0058] The above content introduces the general process of the business processing method in the business processing system, which can be applied to ordinary online games, film and television special effects production and other businesses. In particular, for the cloud game business, there are some differences between the process of the business processing method in the business processing system and the above process, as follows: in the above general process, according to the position of the matching simulated virtual hair in each frame and the position of the interpolated virtual hair in each frame, the matching simulated virtual hair and the interpolated virtual hair are rendered in the picture of each frame, which is executed by the business client running in the terminal 201. In the cloud game business, according to the position of the matching simulated virtual hair in each frame and the position of the interpolated virtual hair in each frame, the matching simulated virtual hair and the interpolated virtual hair are rendered in the picture of each frame, which is executed by the server 202. The server 202 can send the rendered frames to the business client in the terminal 201 for presentation.
[0059] The business processing system shown in FIG2 is only used as an example. In some businesses, the business processing system may also have other situations. For example, in the business of a single-player game, the business processing system may include a terminal 201 but not a server 202. When the business client running in the terminal 201 has a simulation requirement for the dynamic effect of the virtual hair of the business character (for example, a game match is started in the business client, or a film and television special effects production is started in the business client), the sampling process, the interpolation classification process, and the interpolation calculation process are all executed by the terminal 201. The business client in the terminal 201 can directly render the matching simulated virtual hair and the interpolated virtual hair in each frame according to the position of the matching simulated virtual hair in each frame and the position of the interpolated virtual hair in each frame.
[0060] It should also be noted that a business can include different business phases, and the sampling process, interpolation classification process, and interpolation calculation process can be executed in different business phases of the business. More specifically, a business can include a business initialization phase and a business execution phase. The business initialization phase refers to the phase in which the business resources required for the business execution phase are loaded, and the business execution phase refers to the formal execution phase of the business. The sampling process and interpolation classification process can be executed in the business initialization phase, and the interpolation calculation process can be executed in the business execution phase. For example, for a gaming business, the business initialization phase is the game resource loading phase for a game match. The sampling process and interpolation classification process can be executed during the resource loading phase of the game match. The business execution phase is the formal game match phase, and the interpolation calculation process can be executed during the formal game match phase. Alternatively, a business can include a business character creation phase, a business initialization phase, and a business execution phase. The sampling process can be executed in the business character creation phase, the interpolation classification process can be executed in the business initialization phase, and the interpolation calculation process can be executed in the business execution phase. For example, for gaming business, the business role production stage is the business role modeling stage, the sampling process can be performed in the business role modeling stage, the business initialization stage is the game resource loading stage of the game match, the interpolation classification process can be performed in the resource loading stage of the game match, the business execution stage is the formal game stage of the game match, and the interpolation calculation process can be performed in the formal game stage of the game match.
[0061] The business processing system provided in the embodiment of the present application can reasonably sample simulated virtual hair from virtual hair, and the interpolated virtual hair can select a matching simulated virtual hair with a higher degree of match with itself from the sampled simulated virtual hair to follow, which can improve the realism of the dynamic effect simulation of the interpolated virtual hair. It is understandable that the business processing system described in the embodiment of the present application is for the purpose of more clearly illustrating the technical solution of the embodiment of the present application and does not constitute a limitation of the technical solution provided in the embodiment of the present application. Those skilled in the art will appreciate that with the evolution of system architecture and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.
[0062] The present application provides a service processing method. The service processing method mainly introduces a sampling process (i.e., a process of sampling a hair root point cloud of a virtual hair). The service processing method can be executed by a computer device, which can be a terminal or a server. As shown in FIG3 , the service processing method can include but is not limited to the following steps:
[0063] S301, obtaining a root point cloud of a business role in the business.
[0064] From the above content, it can be seen that virtual hair can be composed of multiple hair points and hair segments between hair points. The hair points connected to the scalp among the multiple hair points can be called hair root points. The hair root point cloud can be composed of the hair root points corresponding to multiple virtual hairs of the business character. In other words, the hair root point cloud can include the hair root points corresponding to multiple virtual hairs of the business character.
[0065] S302: Acquire sampling control information.
[0066] The sampling control information can be used to control the distance between sampling points during the sampling process of the rooting point cloud. The distance between any two sampling points must be greater than the sampling control information. In one possible implementation, the sampling control information can refer to a control radius or a control distance. The sampling control information can be determined by any of the following methods:
[0067] ① The sampling control information can be set by the virtual hair modeler based on the hair modeling experience. The virtual hair modeler has rich hair modeling experience and can clearly understand the relationship between the sampling control information and the simulation effect of the virtual hair dynamic effect after sampling. Therefore, based on the sampling control information set by the virtual hair modeler, the root point cloud can be reasonably sampled; ② The sampling control information can be determined based on the number of root points contained in the root point cloud. For example, when the number of root points contained in the root point cloud is large, the value of the determined sampling control information is large. When the number of root points contained in the root point cloud is small, the number of the determined sampling control information is small. Small, so that the sampling control information can be adapted to the number of rooting points contained in the rooting point cloud. Based on the sampling control information adapted to the number of rooting points contained in the rooting point cloud, the rooting point cloud can be reasonably sampled; ③ The sampling control information can be determined according to the distribution information of the rooting points in the rooting point cloud. For example, when the rooting points in the rooting point cloud are densely distributed, the value of the determined sampling control information is small. When the rooting points in the rooting point cloud are sparsely distributed, the value of the determined sampling control information is large. In this way, the sampling control information can be adapted to the distribution of the rooting points in the rooting point cloud. Based on the sampling control information adapted to the distribution of the rooting points in the rooting point cloud, the rooting point cloud can be reasonably sampled.
[0068] S303: Sampling the rooting point cloud according to the sampling control information to obtain sampling points.
[0069] After obtaining the root point cloud and sampling control information of the business role, the root point cloud can be sampled according to the sampling control information to obtain sampling points. The sampling process of the root point cloud can specifically include the following sub-steps:
[0070] s11, generate a voxel grid set based on the sampling control information and the position range information of the root point cloud.
[0071] The position range information of the root point cloud can be used to indicate the position range of each root point in the root point cloud, and the position of any root point in the root point cloud is within the position range indicated by the position range information of the root point cloud. Taking the case where the business role is a three-dimensional role as an example, the root point cloud is in three-dimensional space, and the position of the root point can be determined by the coordinate values in each coordinate direction (for example, X direction, Y direction and Z direction) in the three-dimensional space coordinate system; the position range of the root point cloud can be determined by the minimum coordinate value and the maximum coordinate value of the root point in each coordinate direction in the root point cloud. For example, based on the minimum coordinate value and the maximum coordinate value of each root point in the root point cloud in the X direction, the position range of the root point cloud in the X direction can be determined, based on the minimum coordinate value and the maximum coordinate value of each root point in the root point cloud in the Y direction, the position range of the root point cloud in the Y direction can be determined, and based on the minimum coordinate value and the maximum coordinate value of each root point in the root point cloud in the Z direction, the position range of the root point cloud in the Z direction can be determined. The position information range of the rooting point cloud can be used to determine the enclosing range of the voxel grid set, and the generated voxel grid set can enclose each rooting point in the rooting point cloud.
[0072] The generated voxel grid set may include multiple voxel grids, and the size of each voxel grid is the same. When the business role is a three-dimensional role, the root point cloud is in a three-dimensional space, and the voxel grid can be a cube in the three-dimensional space. When the business role is a two-dimensional role, the root point cloud is in a two-dimensional space, and the voxel grid can be a square in the two-dimensional space. The reason for using a cube or a square as a voxel grid is that the cube or the square has spatial uniformity, which helps the sampling points in each voxel grid to be evenly distributed in the root point cloud. The sampling control information can be used to determine the size of each voxel grid in the voxel grid set. For example, the sampling control information can be used to determine the side length of the voxel grid, the sampling control information can be used to determine the distance between the center of the voxel grid and the vertex of the voxel grid, or the sampling control information can be used to determine the distance between the diagonal vertices of the voxel grid. The embodiment of the present application does not limit the way in which the sampling control information determines the size of the voxel grid.
[0073] FIG4(a) shows a voxel grid set generated based on the sampling control information and the position range information of the two-dimensional rooting point cloud. The voxel grid set can surround each rooting point in the two-dimensional rooting point cloud. In other words, each rooting point in the two-dimensional rooting point cloud is within the range of the generated voxel grid set. FIG4(b) shows a voxel grid set generated based on the sampling control information and the position range information of the three-dimensional rooting point cloud. The voxel grid set can surround each rooting point in the three-dimensional rooting point cloud. In other words, the generated voxel grid set has full encirclement and can surround all rooting points in the rooting point cloud. In this way, outlier rooting points in the rooting point cloud can be sampled during the sampling process, making the sampling of the rooting point cloud more comprehensive.
[0074] s12, establish a mapping between the root point cloud and the voxel grid set.
[0075] In s11, a voxel grid set can be generated based on the sampling control information and the position range information of the root point cloud. However, the ownership relationship between each voxel grid in the generated voxel grid set and each root point in the root point cloud is unclear. Therefore, it is necessary to establish a mapping between the root point cloud and the voxel grid set, that is, to establish a mapping between each root point in the root point cloud and each voxel grid in the voxel grid set. The mapping can be used to indicate the ownership relationship between the root point in the root point cloud and the voxel grid in the voxel grid set. In other words, the mapping is established to determine to which voxel grid in the voxel grid set each root point in the root point cloud belongs.
[0076] Establishing a mapping between a rooting point cloud and a voxel grid set may specifically include: first, selecting a reference point in the space where the rooting point cloud and the voxel grid set are located, and establishing a coordinate system with the reference point as the coordinate origin; then, determining the position range information of each voxel grid in the coordinate system and the position information of each rooting point in the coordinate system; for any rooting point, determining the voxel grid corresponding to the position range information to which the position information of the rooting point belongs, and establishing a mapping between the determined voxel grid and the rooting point. Taking the two-dimensional rooting point as an example, as shown in Figure 5, the side length of each voxel grid is the sampling control information 1, and the position range information of the voxel grid 501 in the coordinate system includes the position range information [2, 3) in the X direction and the position range information [4, 5) in the Y direction. The position information of the rooting point in the coordinate system is the coordinates (2.5, 4.7). It can be seen that the coordinate value of the rooting point in the X direction belongs to the position range information of the voxel grid 501 in the X direction, and the coordinate value of the rooting point in the Y direction belongs to the position range information of the voxel grid 501 in the Y direction. The rooting point is located in the voxel grid 501, and the rooting point belongs to the voxel grid 501. A mapping between the rooting point and the voxel grid 501 can be established.
[0077] s13, in each voxel grid, determining the rooting point belonging to the voxel grid according to the mapping, and sampling the rooting point belonging to the voxel grid according to the sampling control information to obtain the sampling point of the voxel grid.
[0078] Specifically, each voxel grid in the voxel grid set can be sampled in sequence according to the sampling order. When the sampled voxel grid is the current voxel grid, the root point belonging to the current voxel grid can be determined in the current voxel grid according to the mapping, and the root point belonging to the current voxel grid can be randomly sampled according to the sampling control information. Random sampling can refer to randomly sampling a root point from the root point belonging to the current voxel grid. If the distance between the randomly sampled root point and the existing sampling point is greater than the sampling control information, the randomly sampled root point can be determined as the new sampling point. If the number of random samplings of the current voxel grid reaches the sampling number threshold, the root point of the next voxel grid belonging to the current voxel grid can be determined according to the mapping, and the root point belonging to the next voxel grid can be randomly sampled according to the sampling control information until all voxel grids in the voxel grid set are traversed. In the above sampling process, the following points need to be paid attention to:
[0079] ① Existing sampling points can refer to sampling points located in the current voxel grid and the surrounding voxel grids of the current voxel grid. The surrounding voxel grids of the current voxel grid can refer to the voxel grids in the voxel grid set that are located in the spatial range surrounding the current voxel grid, excluding the current voxel grid. Taking a two-dimensional rooting point cloud as an example, as shown in Figure 6, the squares in the dashed box 601 are sampled voxel grids, the rooting points in the sampled voxel grids are sampling points, the squares in the dashed box 602 are unsampled voxel grids, and the squares in the dashed box 603 are the current voxel grid. The surrounding voxel grids are the eight voxel grids within the 3×3 spatial range surrounding the current voxel grid (as shown in the dashed box 604 in Figure 6), excluding the current voxel grid. Taking a three-dimensional rooting point cloud as an example, the surrounding voxel grids are the sampling points in the 26 voxel grids within the 3×3×3 spatial range surrounding the current voxel grid, excluding the current voxel grid. In this way, the randomly sampled root point in the current voxel grid does not need to be calculated with all sampling points, but only with existing sampling points within a certain range, which can improve overall sampling efficiency. Furthermore, the number of existing sampling points can be multiple, and the distance compared with the sampling control information can be the minimum distance between the randomly sampled root point in the current voxel grid and each existing sampling point. Using this minimum distance for comparison with the sampling control information ensures that the distance between the randomly sampled root point in the current voxel grid and any existing sampling point is greater than the sampling control information.
[0080] ② In the process of randomly sampling the hair root points belonging to the current voxel grid, the random probability of each hair root point in the current voxel grid can be obtained. Based on the random probability of each hair root point and the sampling control information, the hair root points belonging to the current voxel grid are randomly sampled. The random probability of each hair root point is positively correlated with the length of the virtual hair corresponding to each hair root point. That is, the longer the hair length of the virtual hair corresponding to the hair root point, the greater the random probability of the hair root point and the higher the probability of the hair root point being sampled. The shorter the hair length of the virtual hair corresponding to the hair root point, the smaller the random probability of the hair root point and the lower the probability of the hair root point being sampled. This is because the virtual hair corresponding to the sampling point is used as simulated virtual hair. When the interpolated virtual hair with short hair length follows the simulated virtual hair with long hair length, the dynamic effect of the simulated interpolated virtual hair is better. When the interpolated virtual hair with long hair length follows the simulated virtual hair with short hair length, the dynamic effect of the simulated interpolated virtual hair is poor. Therefore, a higher random probability can be given to the virtual hair with longer hair length. This can ensure that the sampled simulated virtual hair is virtual hair with longer hair length, which is conducive to improving the authenticity of the dynamic effect simulation of the interpolated virtual hair.
[0081] ③ Generally, the sampling number threshold can reflect the possibility of randomly sampling a sampling point within the voxel grid. The higher the sampling number threshold, the higher the possibility of randomly sampling a sampling point within the voxel grid. Methods for determining the sampling number threshold may include: the sampling number threshold may be set by the virtual hair modeler based on hair modeling experience. The virtual hair modeler can relatively clearly understand the impact of the sampling number threshold on the simulation effect of the virtual hair dynamic effect after sampling. Therefore, based on the sampling number set by the virtual hair modeler, the root point cloud can be reasonably sampled; or, the sampling number threshold corresponding to the current voxel grid may be determined based on the number of root points contained in the current voxel grid. The more root points contained in the current voxel grid, the larger the sampling number threshold corresponding to the current voxel grid is determined, and the fewer root points contained in the current voxel grid, the smaller the sampling number threshold corresponding to the current voxel grid is determined. In this way, the sampling number threshold corresponding to the current voxel grid can be adapted to the number of root points contained in the current voxel grid. Based on the sampling number threshold adapted to the number of root points contained in the current voxel grid, the root points in the current voxel grid can be reasonably sampled.
[0082] ④ Before comparing the distance between the randomly sampled root point and the existing sampling point with the sampling control information, the sampling control information for controlling the distance between sampling points in the current voxel grid may be adjusted based on the number of root points in the current voxel grid. On this basis, if the distance between the randomly sampled root point and the existing sampling point is greater than the sampling control information, the randomly sampled root point may be determined as a new sampling point. For the randomly sampled root point in the current voxel grid, if the distance between the randomly sampled root point and the existing sampling point is greater than the adjusted sampling control information, the randomly sampled root point may be determined as a new existing sampling point.
[0083] That is, basic sampling control information can be first determined (i.e., the sampling control information set by the virtual hair modeler based on hair modeling experience as mentioned in S301 above, the sampling control information determined based on the number of root points contained in the root point cloud, or the sampling control information determined based on the distribution information of the root points in the root point cloud). During the actual sampling process, the basic sampling control information can be dynamically adjusted based on the number of root points in each voxel grid, so that the adjusted sampling control information can better match the number of root points in each voxel grid, thereby allowing the root points in each voxel grid to be reasonably sampled based on the adjusted sampling control information. Furthermore, the number of root points in a voxel grid can reflect the root point density in the voxel grid. By dynamically adjusting the basic sampling control information, the adjusted sampling control information can be better matched to the root point density in each voxel grid. In this way, the density distribution of the sampling points can more accurately reflect the density distribution of the original root point cloud. In other words, regions with a higher root point density in the original root point cloud will also have a higher sampling point density.
[0084] The embodiments of the present application do not limit the adjustment method of the sampling control information. For example, an exemplary adjustment method can be described as follows: the basic sampling control information can correspond to the basic number of rooting points, and the adjustment amount of the sampling control information and the adjustment direction of the sampling control information (for example, increase, decrease) can be determined based on the difference between the number of rooting points in the current voxel grid and the basic number of rooting points. Then, the sampling control information corresponding to the current voxel grid can be adjusted according to the adjustment direction of the sampling control information and the adjustment amount of the sampling control information to obtain the adjusted sampling control information. In more detail, the difference between the number of rooting points in the current voxel grid and the number of rooting points in the base refers to the difference in the number of rooting points between the number of rooting points in the current voxel grid and the number of rooting points in the base; if the difference in the number of rooting points is greater than the difference threshold (for example, it can be 0), it can be determined that the adjustment direction of the sampling control information is an increasing direction; if the difference in the number of rooting points is less than the difference threshold (for example, it can be 0), it can be determined that the adjustment direction of the sampling control information is a decreasing direction; the adjustment amount of the sampling control information can be determined based on the absolute value of the difference in the number of rooting points (that is, the change in the number of rooting points), and there is a mapping relationship between the change in the number of rooting points and the adjustment amount of the sampling control information. The change in the number of rooting points can be mapped to the adjustment amount of the sampling control information based on the mapping relationship, and then, according to the adjustment direction of the sampling control information and the adjustment amount of the sampling control information, the sampling control information corresponding to the current voxel grid can be adjusted to obtain the adjusted sampling control information.
[0085] For example, if the number of rooting points in the current voxel grid is 20, the basic number of rooting points is 16, and the difference in the number of rooting points is 20-16=4, which is greater than the difference threshold of 0, the sampling control information needs to be adjusted to increase (i.e., the sampling control information is adjusted in an increasing direction). The change in the number of rooting points is 4. The mapping relationship between the change in the number of rooting points and the adjustment amount of the sampling control information can be: the adjustment amount of the sampling control information = the change in the number of rooting points / the basic number of rooting points = 4 / 16 = 0.25. In other words, the basic sampling control information needs to be increased by 0.25 to obtain the adjusted sampling control information. Based on this, for a randomly sampled target rooting point in the current voxel grid, if the distance between the randomly sampled target rooting point and the existing sampling point is greater than the adjusted sampling control information, the randomly sampled rooting point can be determined as a new existing sampling point.
[0086] The above s11-s13 introduce the sampling process of the rooting point cloud. Taking the two-dimensional rooting point cloud as an example, Figure 7 shows the sampling result of the two-dimensional rooting point cloud. The rooting point cloud is represented as P, any rooting point in the rooting point cloud is represented as p, the voxel grid set is represented as G, any voxel grid in the voxel grid set is represented as g, the current voxel grid is represented as g', any rooting point in the current voxel grid is represented as p', the sampling control information is represented as R, the mapping between the rooting point cloud before sampling and the voxel grid set is represented as Map, the mapping between the existing sampling points and the voxel grid set is represented as MapS, the sampling result is represented as Ps, and any existing sampling point is represented as ps. The sampling process of the rooting point cloud can be seen in the following pseudo code:
[0087] In the sampling process of the rooting point cloud, assuming that there are N rooting points in the rooting point cloud P and there are S existing sampling points in the sampling result Ps, then in the sampling process of the rooting point cloud shown in the pseudo code above, the time complexity of step (1) (i.e., calculating the voxel grid to which the rooting point in the rooting point cloud belongs) and step (2) (i.e., establishing the mapping between the rooting point cloud and the voxel grid set) are both O(N), and the space complexity is both O(N). Since the number of voxel grids in the voxel grid set G is less than N, the time complexity of step (3) (i.e., randomly sampling a rooting point from the current voxel grid) does not exceed O(kN), where k is the sampling number threshold and k is a constant. Then the time complexity O(kN) is equivalent to O(N). For steps (4)(5)(6) (i.e., calculating whether the distance between the randomly sampled rooting point and the existing sampling point is greater than the sampling control information, and if so, determining the randomly sampled rooting point as the new sampling point), the time complexity and space complexity are both O(N). This is because the voxel grid size is fixed to R and the distance between two sampling points must be greater than R. Therefore, taking the voxel grid in three-dimensional space as an example, the number of sampling points in each voxel grid has a constant upper bound of 8 (that is, the maximum number of sampling points in each voxel grid is 8), so the time complexity is O(3×3×3×8kN)=O(kN)=O(N). In other words, the time complexity of the sampling method of the root point cloud proposed in the embodiment of the present application is O(N). Compared with the farthest point sampling method (which refers to first randomly selecting a sampling point from the root point cloud, and then selecting the point farthest from the existing sampling point as a new sampling point each time until the number of sampling points or the farthest distance meets the requirements), when the number of sampling points obtained by sampling from N root points using the farthest point sampling method is S, the sampling time complexity is O(NS). In comparison, the sampling process of the embodiment of the present application has higher sampling efficiency.
[0088] S304: Determine the virtual hair corresponding to the sampling point as simulated virtual hair, and determine the virtual hair corresponding to other hair root points in the hair root point cloud except the sampling point as interpolated virtual hair.
[0089] After sampling the hair root point cloud based on the sampling control information and obtaining the sampling points, the virtual hair corresponding to the sampling points can be determined as simulated virtual hair, and the virtual hair corresponding to the hair root points other than the sampling points in the hair root point cloud can be determined as interpolated virtual hair. During the execution of the service, the simulated virtual hair can use a physical simulation strategy to simulate dynamic effects. The simulated virtual hair can be used to control the interpolated virtual hair to follow the movement of the simulated virtual hair during the execution of the service. In other words, the dynamic effect simulation of the interpolated virtual hair depends on the simulated virtual hair.
[0090] In the embodiments of the present application, sampling control is performed using sampling control information. The minimum distance between any two sampling points in the sampling point cloud is greater than the sampling control information, and the sampling of the root point cloud exhibits the minimum distance property. By generating a voxel grid set, sampling using each voxel grid in the voxel grid set as a sampling unit, and controlling the sampling during the sampling process using the sampling control information, relatively uniform sampling in spatial distribution can be achieved. The sampling points are relatively evenly distributed in the root point cloud, and the sampling of the root point cloud exhibits spatial uniformity. The generated voxel grid set can include all root points in the root point cloud, so that outlier root points in the root point cloud can be sampled, and the sampling of the root point cloud exhibits the full sampling property.
[0091] In an embodiment of the present application, the sampling of virtual hair is converted into the sampling of root points corresponding to the virtual hair. The root point cloud of the business role in the business can be sampled to obtain sampling points. The virtual hair corresponding to the sampling points can be used as simulated virtual hair, and the virtual hair corresponding to other root points in the root point cloud except the sampling points can be used as interpolated virtual hair. The simulated virtual hair can use a physical simulation strategy to simulate dynamic effects during the execution of the business. The simulated virtual hair can be used to control the interpolated virtual hair to follow the movement of the simulated virtual hair during the execution of the business; that is, a part of the virtual hair (simulated virtual hair) can be sampled from the virtual hair and a physical simulation strategy can be used to simulate dynamic effects. The remaining virtual hair (interpolated virtual hair) follows the simulated virtual hair to move. There is no need to use a physical simulation strategy to simulate dynamic effects for all virtual hair. This can improve the efficiency of virtual hair dynamic effect simulation and reduce the overhead of virtual hair dynamic effect simulation. Moreover, during the sampling process of the hair root point cloud, the distance between the sampling points is controlled by the sampling control information, so that the sampling points can be evenly distributed in the hair root point cloud, so that the sampling points can more accurately reflect the original hair root point cloud, and the hair root points corresponding to the simulated virtual hair can be reasonably sampled from the hair root point cloud. In other words, the simulated virtual hair can be reasonably sampled from the virtual hair, which can effectively improve the realism of the simulation of the virtual hair dynamic effect, thereby achieving the improvement of the efficiency of the virtual hair dynamic effect simulation and the reduction of the overhead of the virtual hair dynamic effect simulation on the premise of improving the realism of the virtual hair dynamic effect simulation.
[0092] The present application provides a service processing method. The service processing method mainly introduces an interpolation classification process (i.e., determining matching simulated virtual hair of interpolated virtual hair) and an interpolation calculation process. The service processing method can be executed by a computer device, which can be a terminal or a server. As shown in FIG8 , the service processing method can include but is not limited to the following steps:
[0093] S801: Obtain the root point cloud of the business role in the business.
[0094] S802: Acquire sampling control information.
[0095] S803: Sampling the rooting point cloud according to the sampling control information to obtain sampling points.
[0096] S804: Determine the virtual hair corresponding to the sampling point as simulated virtual hair, and determine the virtual hair corresponding to other points in the hair root point cloud except the sampling point as interpolated virtual hair.
[0097] In the embodiment of the present application, the execution process of S801 is the same as the execution process of S301 in the embodiment shown in Figure 3 above, the execution process of S802 is the same as the execution process of S302 in the embodiment shown in Figure 3 above, the execution process of S803 is the same as the execution process of S303 in the embodiment shown in Figure 3 above, and the execution process of S804 is the same as the execution process of S304 in the embodiment shown in Figure 3 above. For the specific execution process, please refer to the description of the embodiment shown in Figure 3 above, and will not be repeated here.
[0098] S805: Obtain matching simulated virtual hair of the interpolated virtual hair, and obtain the influence weight of the matching simulated virtual hair on the interpolated virtual hair.
[0099] The matching simulated virtual hair of the interpolated virtual hair may be the simulated virtual hair that matches the interpolated virtual hair in the simulated virtual hair corresponding to the sampling point. In one possible implementation, the degree of matching between the simulated virtual hair and the interpolated virtual hair may reflect whether the simulated virtual hair matches the interpolated virtual hair. The higher the degree of matching between the simulated virtual hair and the interpolated virtual hair, the more likely the simulated virtual hair is the matching simulated virtual hair of the interpolated virtual hair. Based on this, the process of obtaining the matching simulated virtual hair of the interpolated virtual hair may specifically include:
[0100] For any interpolated virtual hair, the degree of matching between the simulated virtual hair and the interpolated virtual hair can be determined based on the hair features of the simulated virtual hair and the hair features of the interpolated virtual hair; then, based on the degree of matching between the simulated virtual hair and the interpolated virtual hair, a matching simulated virtual hair of the interpolated virtual hair can be selected from the simulated virtual hair.
[0101] It is understood that, based on practical experience, some simulated virtual hair is located around the interpolated virtual hair and may be the matching simulated virtual hair of the interpolated virtual hair, while some simulated virtual hair is located relatively far from the interpolated virtual hair and is unlikely to match the interpolated virtual hair, i.e., is unlikely to be the matching simulated virtual hair of the interpolated virtual hair. In this case, to avoid unnecessary matching calculations and speed up the matching calculation process, the matching degree between some of the simulated virtual hair and the interpolated virtual hair can be calculated. Specifically, the matching degree between the simulated virtual hair and the interpolated virtual hair can be determined by determining the surrounding simulated virtual hair of the interpolated virtual hair from the simulated virtual hair, and then determining the matching degree between the surrounding simulated virtual hair and the interpolated virtual hair based on the hair characteristics of the surrounding simulated virtual hair and the hair characteristics of the interpolated virtual hair. The surrounding simulated virtual hair is the portion of the simulated virtual hair for which the matching degree is to be calculated.
[0102] The simulated virtual hair surrounding the interpolated virtual hair may refer to the voxel grid where the root point corresponding to the interpolated virtual hair is located, and the simulated virtual hair corresponding to the sampling points in the voxel grids surrounding the voxel grid. The surrounding voxel grids of the voxel grid may refer to the other voxel grids in the voxel grid set that are located within the surrounding spatial range of the voxel grid (for example, a 3×3 surrounding spatial range in two-dimensional space, a 3×3×3 surrounding spatial range in three-dimensional space), excluding the voxel grid itself.
[0103] In this way, the interpolated virtual hair does not need to be matched with all the simulated virtual hairs. The interpolated virtual hair only needs to be matched with the simulated virtual hairs around the interpolated virtual hairs, which can avoid unnecessary matching calculations and speed up the matching calculation process.
[0104] It should be noted that the hair features of any virtual hair may include the position information of the root point corresponding to the virtual hair and the attribute information of the virtual hair. Based on the hair features of the surrounding simulated virtual hair and the hair features of the interpolated virtual hair, the degree of matching between the surrounding simulated virtual hair and the interpolated virtual hair may be determined by determining the root distance information between the surrounding simulated virtual hair and the interpolated virtual hair based on the position information of the root point corresponding to the surrounding simulated virtual hair and the position information of the root point corresponding to the interpolated virtual hair; and determining the attribute similarity between the surrounding simulated virtual hair and the interpolated virtual hair based on the attribute information of the surrounding simulated virtual hair and the attribute information of the interpolated virtual hair. Subsequently, the degree of matching between the surrounding simulated virtual hair and the interpolated virtual hair may be determined based on the root distance information and the attribute similarity.
[0105] In one possible implementation, the attribute information may include at least one of orientation information and length information. The orientation information may refer to the direction from the root point of the virtual hair to a specific position point of the virtual hair. The specific position point may refer to a position point in the virtual hair that is a certain length away from the root point (for example, the certain length may be 1 / 3 of the length of the virtual hair). The matching degree between any simulated virtual hair and the interpolated virtual hair refers to the feature similarity between the hair features of the simulated virtual hair and the hair features of the interpolated virtual hair, that is, the degree of similarity between the simulated virtual hair and the interpolated virtual hair in terms of features such as the root point position, hair orientation, and hair length. Taking the example of the attribute information including orientation information, the method for determining the matching degree between any simulated virtual hair and the interpolated virtual hair can be referred to the following formula 1:
[0106] As shown in Formula 1 above, T represents the simulated virtual hair, G represents the interpolated virtual hair, D(T) represents the positional information of the root point corresponding to the simulated virtual hair, D(G) represents the positional information of the root point corresponding to the interpolated virtual hair, R(T) represents the orientation information of the simulated virtual hair, and R(G) represents the orientation information of the interpolated virtual hair. The design of the method for calculating the degree of match between the simulated virtual hair and the interpolated virtual hair shown in Formula 1 has the property that the closer the distance between the root point corresponding to the simulated virtual hair and the root point corresponding to the interpolated virtual hair, the more similar the orientation, and the higher the degree of match.
[0107] On this basis, the process of selecting matching simulated virtual hairs for the interpolated virtual hairs from the simulated virtual hairs based on the degree of match between the simulated virtual hairs and the interpolated virtual hairs may specifically include: selecting matching simulated virtual hairs for the interpolated virtual hairs from the surrounding simulated virtual hairs based on a principle of prioritizing selection with higher degrees of match, wherein the number of matching simulated virtual hairs is M, where M is an integer greater than or equal to 2, for example, the number of matching simulated virtual hairs is 3. The influence weight of the matching simulated virtual hairs on the interpolated virtual hairs may be obtained by determining the influence weight of each matching simulated virtual hair based on the proportion of the matching degree of each matching simulated virtual hair in the overall matching degree of each matching simulated virtual hair; the overall matching degree of each matching simulated virtual hair may refer to the sum of the matching degrees of each matching simulated virtual hair.
[0108] That is to say, the embodiments of the present application can comprehensively consider the matching degree between the simulated virtual hair and the interpolated virtual hair from multiple angles (for example, the distance between the root point corresponding to the simulated virtual hair and the root point corresponding to the interpolated virtual hair, the similarity of the attributes (at least one of the orientation and hair length) between the simulated virtual hair and the interpolated virtual hair, etc.). The higher the matching degree, the closer the distance between the simulated virtual hair and the interpolated virtual hair, and the higher the similarity of the attributes (at least one of the orientation and hair length) between the simulated virtual hair and the interpolated virtual hair. Then, the simulated virtual hair with a higher matching degree can be selected from the simulated virtual hair as the matching simulated virtual hair to simulate the dynamic effect of the interpolated virtual hair. The matching simulated virtual hair and the interpolated virtual hair have a closer distance, and their attribute information such as orientation and hair length are similar. When the matching simulated virtual hair is used to simulate the dynamic effect of the interpolated virtual hair, the simulation authenticity of the dynamic effect of the interpolated virtual hair can be improved. In addition, the selection of matching simulated virtual hair takes into account virtual hair forms such as direction and length, and the dynamic effects of more complex virtual hair shapes such as middle parting are simulated with high realism.
[0109] As shown in FIG9 , the simulated virtual hairs are represented by solid lines, and the dots connected to the simulated virtual hairs are the corresponding root points of the simulated virtual hairs. The interpolated virtual hairs are represented by dashed lines, and the dots connected to the interpolated virtual hairs are the corresponding root points of the interpolated virtual hairs. Among the simulated virtual hairs surrounding interpolated virtual hair 901, simulated virtual hairs 902, 903, and 904, which are closer to interpolated virtual hair 901 and have similar orientations to interpolated virtual hair 901, are selected as matching simulated virtual hairs for interpolated virtual hair 901. The lines connecting the root points corresponding to the interpolated virtual hair 901 and the root points corresponding to the simulated virtual hair 902, the root points corresponding to the simulated virtual hair 903 and the root points corresponding to the simulated virtual hair 904 respectively represent the driving relationship between the interpolated virtual hair 901 and the simulated virtual hair 902, the simulated virtual hair 903 and the simulated virtual hair 904. The interpolated virtual hair 901 is driven by the simulated virtual hair 902, the simulated virtual hair 903 and the simulated virtual hair 904.
[0110] In one possible implementation, when the number of surrounding simulated virtual hairs is less than M, or the degree of match between the surrounding simulated virtual hairs and the interpolated virtual hairs is low (for example, the degree of match is lower than a matching threshold, which can be set by the virtual hair modeler based on hair modeling experience), and it is insufficient to select M matching simulated virtual hairs, the selection range of the surrounding simulated virtual hairs can be expanded, that is, the surrounding space range of the voxel grid can be expanded (for example, in two-dimensional space, from a 3×3 surrounding space range to a 4×4 surrounding space range, in three-dimensional space, from a 3×3×3 surrounding space range to a 4×4×4 surrounding space range), so as to select a sufficient number of matching simulated virtual hairs.
[0111] S806 , controlling the interpolated virtual hair to follow the movement of the matched simulated virtual hair according to the matched simulated virtual hair and the influence weight of the matched simulated virtual hair on the interpolated virtual hair.
[0112] After obtaining the matching simulated virtual hair of the interpolated virtual hair and the influence weight of the matching simulated virtual hair on the interpolated virtual hair, the interpolated virtual hair can be controlled to follow the movement of the matching simulated virtual hair according to the matching simulated virtual hair and the influence weight of the matching simulated virtual hair. Controlling the interpolated virtual hair to follow the movement of the matching simulated virtual hair can specifically mean: in the first frame, the initial interpolated position information of each hair point in the interpolated virtual hair can be calculated according to the position information of the relevant hair points in the matching simulated virtual hair and the influence weight of the matching simulated virtual hair; in each frame after the first frame, the initial interpolated position information of each hair point in the interpolated virtual hair can be updated according to the updated position information of the relevant hair points in the matching simulated virtual hair and the influence weight of the matching simulated virtual hair.
[0113] In order to more clearly understand the process of matching simulated virtual hair to control interpolated virtual hair, the number of matched simulated virtual hairs of any interpolated virtual hair can be expressed as M roots. Here, taking any hair point in the interpolated virtual hair (which can be expressed as a hair point to be processed) as an example, the process of M matching simulated virtual hairs controlling the movement of the hair point to be processed is introduced. It should be noted that in the actual execution of the business, the calculation process of each hair point in the same interpolated virtual hair can be parallel, and the calculation process of each interpolated virtual hair can also be parallel, which can improve the overall efficiency of the dynamic effect simulation of the interpolated virtual hair and improve the real-time performance of the dynamic effect simulation of the interpolated virtual hair. The process of M matching simulated virtual hairs controlling the movement of the hair point to be processed can specifically include the following sub-steps:
[0114] s21. Determine, in each of the M matching simulated virtual hairs, a matching hair segment that matches the hair point to be processed in the interpolated virtual hair.
[0115] Any virtual hair is composed of multiple hair points and hair segments between two adjacent hair points. A matching hair segment can be determined from one matching simulated virtual hair that matches the hair point to be processed. That is, a total of M matching hair segments can be determined from M matching simulated virtual hairs. Matching a hair point to be processed and a matching hair segment can mean that the distance between the hair point to be processed and the root point is close to the distance between the hair points at both ends of the matching hair segment and the root point. It can be understood that the distances between the hair points at both ends of the matching hair segment and the root point constitute the distance range between the matching hair segment and the root point. If the distance between the hair point to be processed and the root point falls within the distance range corresponding to the matching hair segment, the hair point to be processed and the matching hair segment can be considered matched. As shown in Figure 10, the matching simulated virtual hair is represented by a solid line, and the dots in the matching simulated virtual hair include the root point and other hair points corresponding to the matching simulated virtual hair. The interpolated virtual hair is represented by a dotted line, and the dots in the interpolated virtual hair include the root point and other hair points corresponding to the interpolated virtual hair. The distance between the unprocessed hair point p2 in the interpolated virtual hair and the root point p0 corresponding to the interpolated virtual hair is 27, and the distance range corresponding to the hair segment a2a3 in the matching simulated virtual hair is [20, 30). The distance between the unprocessed hair point p2 and the root point p0 falls within the distance range corresponding to the hair segment a2a3. Therefore, the hair segment a2a3 in the matching simulated virtual hair can be determined as the matching hair segment that matches the unprocessed hair point p2.
[0116] s22, calculating the initial interpolation position information of the hair point to be processed based on the influence weights of the M matching simulated virtual hairs and the position information of the M matching hair segments.
[0117] Specifically, the interpolation position component information of the hair point to be processed under the corresponding matching hair segment can be calculated based on the position information of each matching hair segment in the M matching hair segments, and the position information of the matching hair segment may include the position information of the hair points at both ends of the matching hair segment; according to the influence weights of the M matching simulated virtual hairs, the interpolation position component information of the hair point to be processed under the M matching hair segments is weighted and summed to obtain the initial interpolation position information of the hair point to be processed, wherein the influence weight of any matching simulated virtual hair is used to perform weighted processing on the interpolation position component information under the matching hair segment in the matching simulated virtual hair.
[0118] Taking any one of the M matching hair segments (which may be represented as a hair segment to be processed) as an example, the process of calculating the interpolated position information component of the hair point to be processed under the hair segment to be processed based on the position information of the hair segment to be processed may include:
[0119] First, a hair point to be processed can be projected onto a hair segment to be processed. The hair points at either end of the hair segment to be processed are designated as a first hair point and a second hair point. A first distance between the first hair point and the projected point of the hair point to be processed, as well as a second distance between the second hair point and the projected point of the hair point to be processed, can be determined. As shown in Figure 11, hair point p2 to be processed is projected onto hair segment a2a3, with the projected point designated as pa. The distance along line segment a2pa (i.e., the distance between hair point a2 and projected point pa) is the first distance, and the distance along line segment a3pa (i.e., the distance between hair point a3 and projected point pa) is the second distance. Secondly, a first weight corresponding to the first hair point can be determined based on the proportion of the first distance in the length of the hair segment to be processed. The first weight can be used to weight the position information of the first hair point. Furthermore, a second weight corresponding to the second hair point can be determined based on the proportion of the second distance in the length of the hair segment to be processed. The second weight can be used to weight the position information of the second hair point. Then, the position information of the first hair point and the position information of the second hair point may be weighted and summed according to the first weight and the second weight to obtain the interpolated position component information of the hair point to be processed under the hair segment to be processed.
[0120] To facilitate understanding of the calculation process of the initial interpolation position information of the hair point to be processed, the hair point to be processed in the interpolated virtual hair can be represented as p. The number of matching simulated virtual hairs of the interpolated virtual hair is 3, namely matching simulated virtual hair a, matching simulated virtual hair b and matching simulated virtual hair c. The matching hair segment of the hair point to be processed p in the matching simulated virtual hair a is matching hair segment a. i a i+1 , the matching hair segment of the hair point to be processed p in the matching simulated virtual hair b is the matching hair segment b i b i+1 , the matching hair segment of the hair point to be processed p in the matching simulated virtual hair c is the matching hair segment c i c i+1 The calculation process of the initial interpolation position information of the hair point p to be processed can be referred to the following formula 2:
[0121] As shown in the above formula 2: w W represents the initial interpolation position information of the hair point p to be processed; x , x∈{a,b,c} represents the influence weight of each matching simulated virtual hair, W a Indicates the influence weight of the matching simulation virtual hair a, W b Represents the influence weight of the matching simulated virtual hair b, W c represents the influence weight of the matching simulated virtual hair c, and Wa +W b +W c =1;x i and x i+1 , x∈{a,b,c} represents the matching hair segment x i x i+1 The position information of the hair points at both ends, Indicates the position information x for the hair point i The first weight for weighted processing, Indicates the position information x for the hair point i+1 A second weight for weighted processing, and
[0122] s23, updating the initial interpolation position information of the hair point to be processed based on the influence weights of the M matching simulated virtual hairs and the updated position information of the M matching hair segments.
[0123] The influence weight of the matched simulated virtual hair comprehensively considers factors such as the distance between the root point corresponding to the matched simulated virtual hair and the root point of the interpolated virtual hair, as well as the attribute similarity between the matched simulated virtual hair and the interpolated virtual hair. Therefore, the initial interpolated position information of the hair point to be processed is usually different from the original position information of the hair point to be processed. The original position information of the hair point to be processed is the position information carried by the hair point to be processed when it is loaded into the business. Based on this, the principle of updating the initial interpolated position information of the hair point to be processed in the embodiment of the present application can be roughly described as follows: in the first frame, the offset information between the initial interpolated position information of the hair point to be processed and the original position information of the hair point to be processed is recorded; in each frame after the first frame, the new interpolated position information of the hair point to be processed is calculated, and the offset information is corrected. According to the corrected offset information and the new interpolated position information, the final interpolated position information of the hair point to be processed is calculated. Specifically, the updating process of the initial interpolated position information of the hair point to be processed can include the following ①-④:
[0124] ① The offset information of the hair point to be processed can be determined based on the difference between the initial interpolated position information of the hair point to be processed and the original position information of the hair point to be processed. For details, please refer to the following formula 3: w =pp w Formula 3
[0125] As shown in formula 3 above: w represents the offset information, p represents the original position information of the hair point to be processed, and p w Indicates the initial interpolated position information of the hair point to be processed.
[0126] ② The reference interpolation position information of the hair point to be processed can be calculated based on the influence weights of the M matching simulated virtual hairs and the updated position information of the M matching hair segments. The calculation process of the reference interpolation position information of the hair point to be processed is similar to the calculation process of the initial interpolation position information of the hair point to be processed. For details, please refer to the calculation process of the initial interpolation position information of the hair point to be processed. The calculation process of the reference interpolation position information of the hair point to be processed can be expressed as the following formula 4:
[0127] As shown in the above formula 4: ′ w W represents the reference interpolation position information of the hair point to be processed; x , x∈{a,b,c} represents the influence weight of each matching simulated virtual hair, W a Indicates the influence weight of the matching simulation virtual hair a, W b Represents the influence weight of the matching simulated virtual hair b, W c represents the influence weight of the matching simulated virtual hair c, and W a +W b +W c =1; x′ i and x′ i+1 , x′∈{a′,b′,c′} represents the updated matching hair segment x′ i x′ i+1 The position information of the hair points at both ends (i.e., the updated position information of the hair segment to be processed), a′ represents the updated matching simulated virtual hair a, b′ represents the updated matching simulated virtual hair b, and c′ represents the updated matching simulated virtual hair c; Represents the position information x' for the hair point i The first weight for weighted processing, Represents the position information x' for the hair point i+1 A second weight for weighted processing, and
[0128] ③ The position transformation information can be determined based on the difference between the position information of the M matching hair segments after the update and the position information of the M matching hair segments before the update. The process of determining the position transformation information can include: calculating the change in the first position information of the hair points at both ends of each matching hair segment before the update, and calculating the change in the second position information of the hair points at both ends of each matching hair segment after the update; determining the transformation matrix of the corresponding matching hair segment based on the difference between the first position information change and the second position information change of each matching hair segment; determining the transformation matrix of the reference hair segment among the M matching hair segments as the position transformation information; wherein the reference hair segment is the matching hair segment among the matching simulated virtual hairs with the greatest influence weight among the M matching simulated virtual hairs.
[0129] It can be understood that the position information change of the hair points at both ends of each matching hair segment before and after the update can be calculated, and for each matching hair segment, the transformation matrix that transforms the position information change before the update into the position change information after the update can be calculated. Then, the transformation matrix corresponding to the matching hair segment in the matching simulated virtual hair with the largest influence weight among multiple matching simulated virtual hairs can be determined as the position transformation information. For example, d x =x i+1 -x i , x∈{a,b,c} represents the position information change of the matching hair segment before updating (i.e., the first position information change), d x′ =x′ i+1 -x′ i ,x∈{a′,b′,c′} represents the updated position information change of the matching hair segment (i.e., the second position information change), which is obtained by the transformation matrix R′ x Can make d x Transformed to d x′ ; The embodiment of this application can adopt x * =argmax x∈{a,b,c} W x The corresponding transformation matrix is used as the position transformation information R′ w ,Right now
[0130] ④ Based on the position transformation information, the offset information of the hair point to be processed can be corrected to obtain the corrected offset information. For details, see the following formula 5. Then, the reference interpolated position information of the hair point to be processed and the corrected offset information can be summed to obtain the updated interpolated position information of the hair point to be processed. For details, see the following formula 6. w =R′ w e w Formula 5 p′=p′ w +e′w Formula 6
[0131] As shown in the above formula 5: e′ w Indicates the corrected offset information, e w Indicates the offset information before correction, R′ w Represents position transformation information. As shown in the above formula 6: p′ w Represents the reference interpolation position information of the hair point to be processed, e′ w represents the corrected offset information, and p′ represents the updated interpolated position information of the hair point to be processed.
[0132] The above s21-s23 introduces the process of controlling the interpolated virtual hair to follow the movement of the matched simulated virtual hair according to the influence weight of the matched simulated virtual hair and the matched simulated virtual hair. In this process, for the hair points in the interpolated virtual hair, the matching hair segments are determined in each matched simulated virtual hair to calculate the interpolated position information, which can improve the accuracy of the calculation of the interpolated position information of the hair points in the interpolated virtual hair, thereby improving the realism of the dynamic effect simulation of the hair points in the interpolated virtual hair; and, after the dynamic effect of the matched simulated virtual hair is updated, in addition to calculating the new interpolated position information of the hair points in the interpolated virtual hair, offset information is also introduced to correct the calculated new interpolated position information, thereby further improving the accuracy of the calculation of the interpolated position information of the hair points in the interpolated virtual hair, thereby further improving the realism of the dynamic effect simulation of the hair points in the interpolated virtual hair.
[0133] In addition, the process introduced in s21-s23 of controlling the interpolated virtual hair to follow the movement of the matched simulated virtual hair according to the influence weight of the matched simulated virtual hair and the matched simulated virtual hair, in addition to being applicable to the sampling-interpolation framework, can also be applied to the interpolated virtual hair and the matched simulated virtual hair of the interpolated virtual hair determined by other methods: for example, the existing virtual hair can be used as the interpolated virtual hair, and the matching simulated virtual hair of the interpolated virtual hair and the influence weight of the matched simulated virtual hair on the interpolated virtual hair are additionally generated; then, according to the influence weight of the matched simulated virtual hair and the matched simulated virtual hair, the interpolated virtual hair is controlled to follow the movement of the matched simulated virtual hair; this method can be used for any virtual hair, and can effectively solve the problem of uneven virtual hair morphology, which leads to low simulation authenticity of the dynamic effect of the interpolated virtual hair. For another example, existing virtual hair can be used as simulated virtual hair, and interpolated virtual hair of the simulated virtual hair and the influence weight of the simulated virtual hair on the interpolated virtual hair can be additionally generated. Then, based on the simulated virtual hair and the influence weight of the simulated virtual hair, the interpolated virtual hair is controlled to follow the movement of the simulated virtual hair. This method can be used for any virtual hair, and can effectively solve the problem of uneven virtual hair shapes, which leads to low simulation authenticity of the dynamic effect of the interpolated virtual hair.
[0134] It should be noted that the contents described in s21 and s22 of S805 and S806 in the embodiment of the present application belong to the interpolation classification process, and the contents described in s23 belong to the interpolation calculation process. In the interpolation calculation process described in s23, the influence weight of each matching simulated virtual hair on the interpolated virtual hair is fixed. Optionally, the influence weight of each matching simulated virtual hair on the interpolated virtual hair can be dynamically changed in each frame. Specifically:
[0135] In one implementation, the weight of the influence of the matched simulated virtual hair on the interpolated virtual hair in each frame can be recalculated based on the degree of match between the matched simulated virtual hair and the interpolated virtual hair. More specifically, after simulating the dynamic effects of the matched simulated virtual hair using a physical simulation strategy in the current frame, the degree of match between each matched simulated virtual hair and the interpolated virtual hair can be recalculated. Based on the recalculated degree of match between each matched simulated virtual hair and the interpolated virtual hair, the weight of the influence of each matched simulated virtual hair on the interpolated virtual hair can be calculated. For the calculation method of the influence weight, please refer to the relevant content described in S805. In this way, the weight of the influence of the matched simulated virtual hair on the interpolated virtual hair is more closely matched to the current form of the matched simulated virtual hair, thereby improving the realism of the dynamic effect simulation of the interpolated virtual hair.
[0136] In another implementation, the influence weight of the matched simulated virtual hair on the interpolated virtual hair in each frame can be predicted using a neural network model. More specifically, during the model training process, the neural network model can be trained using a large amount of simulated virtual hair as training sample data. This simulated virtual hair can come from virtual hair of different shapes. This allows the trained neural network model to be applicable to virtual hair of different shapes and accurately predicts the influence weight for each type of virtual hair. During the model prediction process, after simulating the dynamic effects of the matched simulated virtual hair in the current frame using a physical simulation strategy, the matched simulated virtual hair and the interpolated virtual hair can be input into the neural network model for influence weight prediction, resulting in the influence weight of the matched simulated virtual hair on the interpolated virtual hair. In this way, the influence weight of the matched simulated virtual hair on the interpolated virtual hair is more closely aligned with the current shape of the matched simulated virtual hair, and the neural network model can retain the influence weight, thereby improving the realism of the dynamic effect simulation of the interpolated virtual hair. In particular, in addition to predicting the influence weight of the matched simulated virtual hair, the neural network model also predicts the interpolation calculation process. This means that after using a physical simulation strategy to simulate the dynamic effects of the matched simulated virtual hair in the current frame, the matched simulated virtual hair and the interpolated virtual hair can be input into the neural network model, which can directly predict the interpolated position information of each hair point in the interpolated virtual hair in the current frame. In this way, the model training method can learn more morphological features of the matched simulated virtual hair, retaining more details and layers, thereby improving the realism of the dynamic effect simulation of the interpolated virtual hair.
[0137] In an embodiment of the present application, the matching degree between the simulated virtual hair and the interpolated virtual hair can be comprehensively considered from multiple angles (for example, the distance between the root point corresponding to the simulated virtual hair and the root point corresponding to the interpolated virtual hair, the similarity of the attributes (at least one of the orientation and hair length) between the simulated virtual hair and the interpolated virtual hair, etc.). Then, the simulated virtual hair with a higher matching degree can be selected from the simulated virtual hair as the matching simulated virtual hair to simulate the dynamic effect of the interpolated virtual hair. The matching simulated virtual hair and the interpolated virtual hair are close in distance, and their attribute information such as orientation and hair length are similar. When the matching simulated virtual hair is used to simulate the dynamic effect of the interpolated virtual hair, the simulation authenticity of the dynamic effect of the interpolated virtual hair can be improved.
[0138] The embodiments shown in FIG. 3 and FIG. 8 above mainly introduce the detailed execution flow of the service processing method. Based on this, the relevant technical support for the service processing method is introduced below.
[0139] The business processing method provided in the embodiment of the present application can be integrated into a business processing engine (for example, the business processing engine in the game business can be UE5 (Unreal Engine 5)), and can be provided for use in the form of a plug-in (for example, a PhysionGroom plug-in). In the PhysionGroom plug-in, the real-time dynamic effect of matching simulated virtual hair can be simulated using physical simulation strategies such as MPM (a physical simulation strategy) and DER (another physical simulation strategy), and can be implemented based on C++ (a compiled language) and hlsl (another compiled language). During the implementation process, the embodiment of the present application can use GPU (Graphics Processing Unit, graphics processor) parallel computing acceleration, and develop debugging tools. Specifically:
[0140] Parallel acceleration: Since the interpolation calculation process of each interpolated virtual hair is independent and does not interfere with each other, the process can be accelerated by parallel calculation. The embodiment of the present application can use the Compute Shader method to call the GPU for calculation, using 128 thread blocks (blocks). Using 128 thread blocks means that each thread block processes 128 points at the same time, and each block is divided into 4 thread groups (warps). The threads in each thread group process the calculation of the same interpolated virtual hair, and each thread is responsible for calculating one hair point. The division of thread groups is in line with the hardware structure of the GPU, and is also consistent with the existing data structure in the PhysionGroom plug-in. Each thread block processes 128 points at the same time, and the GPU can pull up multiple thread blocks at the same time according to the computing resources. In this way, parallel calculation can reduce the time consumption by several orders of magnitude, thereby improving the realism of the simulation of the dynamic effect of the interpolated virtual hair.
[0141] Debugging tool: The embodiment of the present application can provide a debugging tool for the interpolation calculation process in the business processing engine. The debugging tool can read the hair point data in the GPU during operation and call the PDI (Primitive Draw Interface) of the business processing engine to draw various attributes of virtual hair in the scene. The debugging tool can help business developers or testers quickly locate problems in the interpolation calculation process during business development or testing. As shown in the debugging tool interface in Figure 12, the number of the interpolated virtual hair to be located and the display form of the interpolated virtual hair can be specified in the debugging tool interface (a). The display form can be, for example, a display color or a display line style. The debugging tool can read the mapping relationship between the previously calculated and stored simulated virtual hair and the interpolated virtual hair and visualize it. As shown in Figure 12 (b), an interpolated virtual hair of a specified number is shown. One end of the line segment in Figure 12 (b) is connected to a hair point in the interpolated virtual hair, and the other end is used to connect to a hair point in the matching simulated virtual hair of the interpolated virtual hair. The color of the line segment can be used to indicate the weight of the influence of the connected matching simulated virtual hair on the interpolated virtual hair. As shown in Figure 12 (c), a simulated virtual hair in the virtual hair is shown (the solid line in Figure 12 (c)). As shown in Figure 12 (d), both the simulated virtual hair (the solid line in Figure 12 (d)) and the interpolated virtual hair (the dotted line in Figure 12 (d)) are displayed, as well as a matching simulated virtual hair connected to the interpolated virtual hair (i.e., a simulated virtual hair connected to the interpolated virtual hair via a line segment).
[0142] The following introduces the experimental results of the service processing method provided in the embodiment of the present application.
[0143] The business processing method provided in the embodiment of the present application has made innovations in the sampling process, interpolation classification process and interpolation calculation process. By adopting the business processing method provided in the embodiment of the present application, the sampling and interpolation effects of virtual hair are significantly improved.
[0144] In terms of sampling effect, compared to simple random sampling (i.e., randomly sampling some root points in the root point cloud as the root points corresponding to the simulated virtual hair), the sampling results of the embodiment of the present application are significantly more uniform in spatial distribution and can ensure that the root points at the boundary are included. Figure 13 shows a comparison of the sampling results when approximately 6% of the root points in the root point cloud are sampled as the root points corresponding to the simulated virtual hair under the simple random sampling method and the sampling method provided by the embodiment of the present application. Figure 13 (a) shows the simulated virtual hair sampled using the simple random sampling method, and Figure 13 (b) shows the simulated virtual hair sampled using the sampling method provided by the embodiment of the present application. The comparison shows that the spatial distribution of the simulated virtual hair sampled using the sampling method provided by the embodiment of the present application is more uniform. The sampling method provided by the embodiment of the present application ensures that the sampled simulated virtual hair can include the virtual hair at the boundary. In the simple random sampling method, the edge virtual hair in the rectangular box is not sampled.
[0145] In terms of interpolation effect, the interpolation method provided by the embodiment of the present application achieves a good simulation effect on the hair style of the middle part, and does not cause errors caused by large morphological differences between the three interpolated virtual hairs. Figure 14 shows a comparison of the interpolation results of a simple interpolation method (i.e., selecting the simulated virtual hair closest to the interpolated virtual hair as the matching simulated virtual hair to follow) and the interpolation method provided by the embodiment of the present application. Figure 14 (a) shows the virtual hair interpolation effect using the simple interpolation method, and Figure 14 (b) shows the root point interpolation effect using the simple interpolation method. The larger dots represent the root points corresponding to the simulated virtual hairs, and the smaller dots represent the root points corresponding to the interpolated virtual hairs. The line between the root points corresponding to the simulated virtual hairs and the root points corresponding to the interpolated virtual hairs represents the driving relationship and the influence weight of the color depth of the line. Figure 14 (c) shows the virtual hair interpolation effect using the interpolation method provided by the embodiment of the present application, and Figure 14 (d) shows the root point interpolation effect using the interpolation method provided by the embodiment of the present application. By comparison, it can be seen that for simple interpolation methods, many interpolated virtual hairs use the simulated virtual hair on both sides to calculate the interpolation position, resulting in the interpolation result being incorrectly located in the middle; the interpolation method provided in the embodiment of the present application can avoid such problems. It can be seen that under the interpolation method provided in the embodiment of the present application, there is an obvious break in the line between the simulated virtual hair and the interpolated virtual hair, corresponding to the middle seam of the virtual hair shape, proving that the interpolated virtual hair will not select the hair on both sides for interpolation at the same time, and there is no obvious error in the hair performance during actual operation.
[0146] In terms of overall interpolation efficiency, we used an interpolation algorithm with GPU parallel acceleration to test UE5 on an experimental platform equipped with an Nvidia 2060 (a graphics card). The test results can be seen in Table 1 below:
[0147] Table 1
[0148] Overall, even with millions of hair points, the processing method provided by the embodiments of this application consumes only about 0.5 milliseconds per frame, fully meeting real-time requirements and accounting for a relatively small portion of the overall simulation algorithm time. Furthermore, this time consumption is solely related to the number of hair points in the interpolated virtual hair and is largely unaffected by the number of hair points in the simulated virtual hair.
[0149] The above describes in detail the method of the embodiment of the present application. In order to facilitate better implementation of the above scheme of the embodiment of the present application, the device of the embodiment of the present application is provided below accordingly.
[0150] Please refer to Figure 15, which is a schematic diagram of the structure of a business processing device provided in an embodiment of the present application. The business processing device can be set in the computer device provided in an embodiment of the present application. The computer device can be a terminal or a server. The business processing device shown in Figure 15 can be a computer program (including program code) running on the computer device. The business processing device can be used to execute some or all of the steps in the method embodiment shown in Figure 3 or Figure 8. Please refer to Figure 15. The business processing device may include the following units:
[0151] An acquiring unit 1501 is configured to acquire a hair root point cloud of a business character in a business, where the hair root point cloud includes hair root points corresponding to multiple virtual hairs of the business character;
[0152] The acquisition unit 1501 is further configured to acquire sampling control information, where the sampling control information is used to control the distance between sampling points during the sampling process of the rooting point cloud.
[0153] The processing unit 1502 is configured to perform sampling processing on the rooting point cloud according to the sampling control information to obtain sampling points;
[0154] The processing unit 1502 is further configured to determine the virtual hair corresponding to the sampling point as simulated virtual hair, and determine the virtual hair corresponding to other hair root points in the hair root point cloud except the sampling point as interpolated virtual hair;
[0155] Among them, the simulated virtual hair adopts a physical simulation strategy to simulate dynamic effects during the execution of the business, and the simulated virtual hair is used to control the interpolated virtual hair to follow the movement of the simulated virtual hair during the execution of the business.
[0156] In one implementation, the processing unit 1502 is configured to perform sampling processing on the rooting point cloud according to the control information, and to execute the following steps when obtaining the sampling points:
[0157] Generate a voxel grid set according to the sampling control information and the position range information of the root point cloud; the sampling control information is used to determine the size of each voxel grid in the voxel grid set, and the position range information of the root point cloud is used to determine the enclosing range of the voxel grid set;
[0158] Establishing a mapping between the rooting point cloud and the voxel grid set, the mapping is used to indicate the belonging relationship between the rooting points in the rooting point cloud and the voxel grids in the voxel grid set;
[0159] In each voxel grid, a rooting point belonging to the voxel grid is determined according to the mapping, and the rooting point belonging to the voxel grid is sampled according to the sampling control information to obtain the sampling point of the voxel grid.
[0160] In one implementation, each voxel grid in the voxel grid set is sampled sequentially according to a sampling order; the processing unit 1502 is configured to determine, in each voxel grid, a root point belonging to the voxel grid according to the mapping, and sample the root point belonging to the voxel grid according to the sampling control information. When the sampling points of the voxel grid are obtained, the processing unit 1502 is configured to perform the following steps:
[0161] When the sampled voxel grid is the current voxel grid, in the current voxel grid, the root points belonging to the current voxel grid are determined according to the mapping, and the root points belonging to the current voxel grid are randomly sampled according to the sampling control information;
[0162] If the distance between the randomly sampled root point and the existing sampling point is greater than the sampling control information, the randomly sampled root point is determined as the new sampling point;
[0163] If the random sampling times of the current voxel grid reaches the sampling times threshold, the root point of the next voxel grid belonging to the current voxel grid is determined according to the mapping, and the root point of the next voxel grid is randomly sampled according to the sampling control information until all voxel grids in the voxel grid set are traversed.
[0164] In one implementation, the processing unit 1502 is configured to perform the following steps when randomly sampling the rooting points belonging to the current voxel grid according to the sampling control information:
[0165] Obtaining the random probability of each hair root point in the current voxel grid; the random probability of each hair root point is positively correlated with the hair length of the virtual hair corresponding to each hair root point;
[0166] According to the random probability of each rooting point and the sampling control information, the rooting points belonging to the current voxel grid are randomly sampled.
[0167] In one implementation, the processing unit 1502 is further configured to perform the following steps:
[0168] Adjust the sampling control information according to the number of rooting points belonging to the current voxel grid;
[0169] The processing unit 1502 is configured to determine the randomly sampled root point as a new sampling point if the distance between the randomly sampled root point and the existing sampling point is greater than the sampling control information, and is specifically configured to perform the following steps:
[0170] If the distance between the randomly sampled root point and the existing sampling point is greater than the adjusted sampling control information, the randomly sampled root point is determined as a new sampling point.
[0171] In one implementation, the acquiring unit 1501 is further configured to perform the following steps:
[0172] Obtaining the matching simulated virtual hair of the interpolated virtual hair, and obtaining the influence weight of the matching simulated virtual hair on the interpolated virtual hair; the matching simulated virtual hair is the simulated virtual hair that matches the interpolated virtual hair in the simulated virtual hair corresponding to the sampling point;
[0173] The processing unit 1502 is further configured to perform the following steps:
[0174] According to the influence weight of the matching simulated virtual hair and the matching simulated virtual hair on the interpolated virtual hair, the interpolated virtual hair is controlled to follow the movement of the matching simulated virtual hair.
[0175] In one implementation, the acquiring unit 1501 is configured to acquire the matching simulated virtual hair of the interpolated virtual hair and the influence weight of the matching simulated virtual hair on the interpolated virtual hair by performing the following steps:
[0176] determining a degree of matching between the simulated virtual hair and the interpolated virtual hair based on the hair characteristics of the simulated virtual hair and the hair characteristics of the interpolated virtual hair;
[0177] According to a degree of matching between the simulated virtual hair and the interpolated virtual hair, matching simulated virtual hair of the interpolated virtual hair is selected from the simulated virtual hair.
[0178] In one implementation, the acquiring unit 1501 is configured to determine the degree of matching between the simulated virtual hair and the interpolated virtual hair based on the hair features of the simulated virtual hair and the hair features of the interpolated virtual hair, by performing the following steps:
[0179] Determining surrounding simulated virtual hair of the interpolated virtual hair in the simulated virtual hair;
[0180] Based on the hair features of the surrounding simulated virtual hair and the hair features of the interpolated virtual hair, a matching degree between the surrounding simulated virtual hair and the interpolated virtual hair is determined.
[0181] In one implementation, the hair features of any virtual hair include the location information of the hair root point corresponding to the virtual hair and the attribute information of the virtual hair. The acquisition unit 1501 is configured to determine the degree of matching between the surrounding simulated virtual hair and the interpolated virtual hair based on the hair features of the surrounding simulated virtual hair and the hair features of the interpolated virtual hair, specifically performing the following steps:
[0182] Determining root distance information between the surrounding simulated virtual hair and the interpolated virtual hair based on the position information of the root points corresponding to the surrounding simulated virtual hair and the position information of the root points corresponding to the interpolated virtual hair;
[0183] Determining attribute similarity between the surrounding simulated virtual hair and the interpolated virtual hair based on attribute information of the surrounding simulated virtual hair and attribute information of the interpolated virtual hair;
[0184] The matching degree between the surrounding simulated virtual hair and the interpolated virtual hair is determined based on the hair root distance information and attribute similarity.
[0185] In one implementation, the processing unit 1502 is configured to select, from the simulated virtual hairs, matching simulated virtual hairs of the interpolated virtual hairs based on the matching degree between the simulated virtual hairs and the interpolated virtual hairs, by performing the following steps:
[0186] According to the principle of high matching priority, matching simulated virtual hairs of the interpolated virtual hairs are selected from the surrounding simulated virtual hairs, the number of matching simulated virtual hairs is M, and M is an integer greater than or equal to 2;
[0187] When obtaining the influence weight of the matching simulated virtual hair on the interpolated virtual hair, it is specifically used to perform the following steps:
[0188] The influence weight of each matching simulated virtual hair is determined according to the proportion of the matching degree of each matching simulated virtual hair in the overall matching degree of each matching simulated virtual hair.
[0189] In one implementation, any virtual hair is composed of multiple hair points and hair segments between two adjacent hair points; the number of matched simulated virtual hairs is M, where M is an integer greater than or equal to 2; and the processing unit 1502 is configured to control the interpolated virtual hair to follow the matching simulated virtual hair in movement based on the matched simulated virtual hair and the influence weight of the matched simulated virtual hair on the interpolated virtual hair, specifically to perform the following steps:
[0190] Determining, in each of the M matching simulated virtual hairs, a matching hair segment that matches the hair point to be processed in the interpolated virtual hair; one matching hair segment is determined in each matching simulated virtual hair, and the number of matching hair segments is M;
[0191] Calculate the initial interpolation position information of the hair point to be processed based on the influence weights of the M matching simulated virtual hairs and the position information of the M matching hair segments;
[0192] The initial interpolated position information of the hair point to be processed is updated according to the influence weights of the M matching simulated virtual hairs and the updated position information of the M matching hair segments.
[0193] In one implementation, the position information of any matched hair segment includes the position information of the hair points at both ends of the matched hair segment. The processing unit 1502 is configured to calculate the initial interpolated position information of the hair point to be processed based on the influence weights of the M matched simulated virtual hairs and the position information of the M matched hair segments, specifically performing the following steps:
[0194] Calculate interpolated position component information of the hair point to be processed under the corresponding matching hair segment according to the position information of each matching hair segment in the M matching hair segments;
[0195] According to the influence weights of the M matching simulated virtual hairs, the interpolation position component information of the hair point to be processed under the M matching hair segments is weightedly summed to obtain the initial interpolation position information of the hair point to be processed.
[0196] In one implementation, any one of the M matching hair segments is represented as a hair segment to be processed, and the hair points at both ends of the hair segment to be processed are a first hair point and a second hair point. The processing unit 1502 is configured to calculate, based on the position information of each matching hair segment in the M matching hair segments, interpolated position component information of the hair point to be processed in the corresponding matching hair segment by performing the following steps:
[0197] Projecting the hair point to be processed into the hair segment to be processed, determining a first distance between the first hair point and the projection point of the hair point to be processed, and determining a second distance between the second hair point and the projection point of the hair point to be processed;
[0198] Determining a first weight corresponding to a first hair point based on a proportion of the first distance in the length of the hair segment to be processed; and determining a second weight corresponding to a second hair point based on a proportion of the second distance in the length of the hair segment to be processed;
[0199] According to the first weight and the second weight, weighted sum processing is performed on the position information of the first hair point and the position information of the second hair point to obtain interpolated position component information of the hair point to be processed in the hair segment to be processed.
[0200] In one implementation, each hair point in the virtual hair corresponds to its own original position information; the processing unit 1502 is configured to perform the following steps when updating the initial interpolated position information of the hair point to be processed based on the influence weights of the M matching simulated virtual hairs and the updated position information of the M matching hair segments:
[0201] determining offset information of the hair point to be processed according to a difference between the initial interpolated position information of the hair point to be processed and the original position information of the hair point to be processed;
[0202] Calculate reference interpolation position information of the hair point to be processed based on the influence weights of the M matching simulated virtual hairs and the updated position information of the M matching hair segments;
[0203] determining position transformation information based on a difference between the updated position information of the M matching hair segments and the position information of the M matching hair segments before the update;
[0204] Correcting the offset information of the hair point to be processed according to the position transformation information to obtain corrected offset information;
[0205] The reference interpolation position information of the hair point to be processed and the corrected offset information are summed to obtain updated interpolation position information of the hair point to be processed.
[0206] In one implementation, the position information of any matching hair segment includes the position information of hair points at both ends of the matching hair segment; the processing unit 1502 is configured to determine the position transformation information based on the difference between the updated position information of the M matching hair segments and the position information of the M matching hair segments before the update, by specifically performing the following steps:
[0207] Calculating a first position information change of the hair points at both ends of each matching hair segment before the update, and calculating a second position information change of the hair points at both ends of each matching hair segment after the update;
[0208] determining a transformation matrix corresponding to the matching hair segment according to a difference between a first position information variation and a second position information variation of each matching hair segment;
[0209] The transformation matrix of the reference hair segment among the M matching hair segments is determined as position transformation information; wherein the reference hair segment is the matching hair segment among the matching simulated virtual hairs with the largest influence weight among the M matching simulated virtual hairs.
[0210] According to another embodiment of the present application, the various units in the business processing device shown in Figure 15 can be individually or all combined into one or several other units to form, or one (or some) of the units can be further divided into multiple functionally smaller units to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In actual applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the business processing device may also include other units. In actual applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0211] According to another embodiment of the present application, a business processing device as shown in FIG15 can be constructed, and the business processing method of the embodiment of the present application can be implemented by running a computer program (including program code) capable of executing the steps involved in some or all of the methods shown in FIG3 or FIG8 on a general-purpose computing device such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), a random access memory medium (RAM), and a read-only memory medium (ROM). The computer program can be recorded on, for example, a computer-readable storage medium, and loaded into the above-mentioned computing device via the computer-readable storage medium and run therein.
[0212] In an embodiment of the present application, the sampling of virtual hair is converted into the sampling of root points corresponding to the virtual hair. The root point cloud of the business role in the business can be sampled to obtain sampling points. The virtual hair corresponding to the sampling points can be used as simulated virtual hair, and the virtual hair corresponding to other root points in the root point cloud except the sampling points can be used as interpolated virtual hair. The simulated virtual hair can use a physical simulation strategy to simulate dynamic effects during the execution of the business. The simulated virtual hair can be used to control the interpolated virtual hair to follow the movement of the simulated virtual hair during the execution of the business; that is, a part of the virtual hair (simulated virtual hair) can be sampled from the virtual hair and a physical simulation strategy can be used to simulate dynamic effects. The remaining virtual hair (interpolated virtual hair) follows the simulated virtual hair to move. There is no need to use a physical simulation strategy to simulate dynamic effects for all virtual hair. This can improve the efficiency of virtual hair dynamic effect simulation and reduce the overhead of virtual hair dynamic effect simulation. Moreover, during the sampling process of the hair root point cloud, the distance between the sampling points is controlled by the sampling control information, so that the sampling points can be evenly distributed in the hair root point cloud, so that the sampling points can more accurately reflect the original hair root point cloud, and the hair root points corresponding to the simulated virtual hair can be reasonably sampled from the hair root point cloud. In other words, the simulated virtual hair can be reasonably sampled from the virtual hair, which can effectively improve the realism of the simulation of the virtual hair dynamic effect, thereby achieving the improvement of the efficiency of the virtual hair dynamic effect simulation and the reduction of the overhead of the virtual hair dynamic effect simulation on the premise of improving the realism of the virtual hair dynamic effect simulation.
[0213] Based on the above method and device embodiments, an embodiment of the present application provides a computer device. Please refer to Figure 16, which is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device shown in Figure 16 includes at least a processor 1601, an input interface 1602, an output interface 1603, and a computer-readable storage medium 1604. The processor 1601, input interface 1602, output interface 1603, and computer-readable storage medium 1604 may be connected via a bus or other means.
[0214] Computer-readable storage medium 1604 may be stored in a memory of a computer device. Computer-readable storage medium 1604 is used to store a computer program, which includes computer instructions. Processor 1601 is used to execute the program instructions stored in computer-readable storage medium 1604. Processor 1601 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device. It is suitable for implementing one or more computer instructions, and is specifically suitable for loading and executing one or more computer instructions to implement a corresponding method flow or corresponding function.
[0215] The embodiment of the present application also provides a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the operating system of the computer device. In addition, one or more computer instructions suitable for being loaded and executed by the processor are also stored in the storage space. These computer instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory; optionally, it can also be at least one computer-readable storage medium located away from the aforementioned processor.
[0216] In some embodiments, the computer device may be a terminal or a server, and the processor 1601 may load and execute one or more computer instructions stored in the computer-readable storage medium 1604 to implement the corresponding steps of the business processing method shown in Figure 3 or Figure 8. In a specific implementation, the computer instructions in the computer-readable storage medium 1604 are loaded by the processor 1601 to execute the business processing method provided in the aforementioned embodiments.
[0217] According to one aspect of the present application, a computer program product is provided. The computer program product or computer program includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the service processing method provided in the aforementioned embodiments.
[0218] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A business processing method, the method being executed by a computer device, comprising: Acquire a hair root point cloud of a business character in the business, wherein the hair root point cloud includes hair root points corresponding to multiple virtual hairs of the business character; Acquire sampling control information, where the sampling control information is used to control the distance between sampling points during the sampling process of the rooting point cloud; According to the sampling control information, the rooting point cloud is sampled to obtain sampling points; Determine the virtual hair corresponding to the sampling point as simulated virtual hair, and determine the virtual hair corresponding to other hair root points in the hair root point cloud except the sampling point as interpolated virtual hair; The simulated virtual hair adopts a physical simulation strategy to simulate dynamic effects during the execution of the service, and the simulated virtual hair is used to control the interpolated virtual hair to follow the movement of the simulated virtual hair during the execution of the service.
2. The method according to claim 1, wherein the step of sampling the rooting point cloud according to the sampling control information to obtain sampling points comprises: Generate a voxel grid set according to the sampling control information and the position range information of the rooting point cloud; The sampling control information is used to determine the size of each voxel grid in the voxel grid set, and the position range information of the root point cloud is used to determine the enclosing range of the voxel grid set; Establishing a mapping between the rooting point cloud and the voxel grid set, wherein the mapping is used to indicate the belonging relationship between the rooting points in the rooting point cloud and the voxel grids in the voxel grid set; In each of the voxel grids, a rooting point belonging to the voxel grid is determined according to the mapping, and the rooting point belonging to the voxel grid is sampled according to the sampling control information to obtain the sampling point of the voxel grid.
3. The method according to claim 2, wherein each voxel grid in the voxel grid set is sampled in sequence according to a sampling order; wherein in each voxel grid, a root point belonging to the voxel grid is determined according to the mapping, and the root point belonging to the voxel grid is sampled according to the sampling control information to obtain the sampling point of the voxel grid, comprising: When the sampled voxel grid is the current voxel grid, in the current voxel grid, a rooting point belonging to the current voxel grid is determined according to the mapping, and the rooting point belonging to the current voxel grid is randomly sampled according to the sampling control information; If the distance between the randomly sampled root point and the existing sampling point is greater than the sampling control information, the randomly sampled root point is determined as a new sampling point; If the random sampling times of the current voxel grid reaches the sampling times threshold, the rooting point of the next voxel grid belonging to the current voxel grid is determined according to the mapping, and the rooting point of the next voxel grid is randomly sampled according to the sampling control information until all voxel grids in the voxel grid set are traversed.
4. The method according to claim 3, wherein the randomly sampling the rooting points belonging to the current voxel grid according to the sampling control information comprises: Obtaining the random probability of each hair root point of the current voxel grid; the random probability of each hair root point is positively correlated with the hair length of the virtual hair corresponding to each hair root point; According to the random probability of each rooting point and the sampling control information, the rooting points belonging to the current voxel grid are randomly sampled.
5. The method of claim 3, further comprising: adjusting the sampling control information according to the number of rooting points belonging to the current voxel grid; If the distance between the randomly sampled root point and the existing sampling point is greater than the sampling control information, determining the randomly sampled root point as a new sampling point includes: If the distance between the randomly sampled root point and the existing sampling point is greater than the adjusted sampling control information, the randomly sampled root point is determined as a new sampling point.
6. The method according to any one of claims 1 to 5, further comprising: Acquire matching simulated virtual hair of the interpolated virtual hair, and acquire influence weight of the matching simulated virtual hair on the interpolated virtual hair; The matched simulated virtual hair is the simulated virtual hair that matches the interpolated virtual hair among the simulated virtual hair corresponding to the sampling point; According to the matching simulated virtual hair and the influence weight of the matching simulated virtual hair on the interpolated virtual hair, the interpolated virtual hair is controlled to follow the movement of the matching simulated virtual hair.
7. The method according to claim 6, wherein obtaining the matching simulated virtual hair of the interpolated virtual hair comprises: Determining a degree of matching between the simulated virtual hair and the interpolated virtual hair based on the hair features of the simulated virtual hair and the hair features of the interpolated virtual hair; According to the matching degree between the simulated virtual hair and the interpolated virtual hair, a matching simulated virtual hair of the interpolated virtual hair is selected from the simulated virtual hair.
8. The method of claim 7, wherein determining the degree of matching between the simulated virtual hair and the interpolated virtual hair based on the hair features of the simulated virtual hair and the hair features of the interpolated virtual hair comprises: Determining surrounding simulated virtual hair of the interpolated virtual hair in the simulated virtual hair; Based on the hair features of the surrounding simulated virtual hair and the hair features of the interpolated virtual hair, a matching degree between the surrounding simulated virtual hair and the interpolated virtual hair is determined.
9. The method according to claim 8, wherein the hair features of any of the virtual hairs include the position information of the hair root point corresponding to the virtual hair and the attribute information of the virtual hair, and the determining the matching degree between the surrounding simulated virtual hair and the interpolated virtual hair based on the hair features of the surrounding simulated virtual hair and the hair features of the interpolated virtual hair comprises: Determining hair root distance information between the surrounding simulated virtual hair and the interpolated virtual hair according to the position information of the hair root point corresponding to the surrounding simulated virtual hair and the position information of the hair root point corresponding to the interpolated virtual hair; Determining the attribute similarity between the surrounding simulated virtual hair and the interpolated virtual hair according to the attribute information of the surrounding simulated virtual hair and the attribute information of the interpolated virtual hair; The matching degree between the surrounding simulated virtual hair and the interpolated virtual hair is determined according to the hair root distance information and the attribute similarity.
10. The method according to claim 8, wherein the step of selecting a matching simulated virtual hair of the interpolated virtual hair from the simulated virtual hair according to the matching degree between the simulated virtual hair and the interpolated virtual hair comprises: According to the principle of high matching degree priority selection, selecting matching simulated virtual hairs of the interpolated virtual hairs from the surrounding simulated virtual hairs, the number of the matching simulated virtual hairs is M, and M is an integer greater than or equal to 2; The obtaining the influence weight of the matching simulated virtual hair on the interpolated virtual hair includes: According to the proportion of the matching degree corresponding to each matching simulated virtual hair in the overall matching degree of each matching simulated virtual hair, the influence weight corresponding to each matching simulated virtual hair is determined.
11. The method according to claim 6, wherein any virtual hair is composed of a plurality of hair points and hair segments between two adjacent hair points; the number of the matching simulated virtual hairs is M, where M is an integer greater than or equal to 2; and the controlling the interpolated virtual hair to follow the movement of the matching simulated virtual hair according to the matching simulated virtual hair and the influence weight of the matching simulated virtual hair on the interpolated virtual hair comprises: In each of the M matching simulated virtual hairs, determining a matching hair segment that matches the hair point to be processed in the interpolated virtual hair; determining one matching hair segment in each of the matching simulated virtual hairs, and the number of the matching hair segments is M; Calculating the initial interpolation position information of the hair point to be processed according to the influence weights of the M matching simulated virtual hairs and the position information of the M matching hair segments; The initial interpolation position information of the to-be-processed hair point is updated according to the influence weights of the M matching simulated virtual hairs and the updated position information of the M matching hair segments.
12. The method according to claim 11, wherein the position information of any of the matching hair segments includes the position information of the hair points at both ends of the matching hair segment; and the initial interpolation position information of the hair point to be processed is calculated based on the influence weights of the M matching simulated virtual hairs and the position information of the M matching hair segments, comprising: Calculating interpolated position component information of the hair point to be processed under the corresponding matching hair segment according to the position information of each matching hair segment in the M matching hair segments; According to the influence weights of the M matching simulated virtual hairs, weighted sum processing is performed on the interpolation position component information of the hair point to be processed under the M matching hair segments to obtain the initial interpolation position information of the hair point to be processed.
13. The method according to claim 12, wherein any one of the M matching hair segments is represented as a hair segment to be processed, and the hair points at both ends of the hair segment to be processed are a first hair point and a second hair point; and the step of calculating the interpolated position component information of the hair point to be processed under the corresponding matching hair segment according to the position information of each matching hair segment in the M matching hair segments comprises: Projecting the hair point to be processed into the hair segment to be processed, determining a first distance between the first hair point and a projection point of the hair point to be processed, and determining a second distance between the second hair point and a projection point of the hair point to be processed; Determining a first weight corresponding to the first hair point according to the proportion of the first distance in the length of the hair segment to be processed; and determining a second weight corresponding to the second hair point according to the proportion of the second distance in the length of the hair segment to be processed; According to the first weight and the second weight, weighted sum processing is performed on the position information of the first hair point and the position information of the second hair point to obtain interpolated position component information of the hair point to be processed in the hair segment to be processed.
14. The method according to claim 11, wherein each hair point in any virtual hair corresponds to its own original position information; and updating the initial interpolated position information of the hair point to be processed according to the influence weights of the M matching simulated virtual hairs and the updated position information of the M matching hair segments, comprises: determining the offset information of the hair point to be processed according to the difference between the initial interpolation position information of the hair point to be processed and the original position information of the hair point to be processed; Calculating reference interpolation position information of the to-be-processed hair point according to the influence weights of the M matching simulated virtual hairs and the updated position information of the M matching hair segments; determining position change information according to a difference between the updated position information of the M matching hair segments and the position information of the M matching hair segments before the update; According to the position transformation information, the offset information of the hair point to be processed is corrected to obtain the corrected offset information; The reference interpolation position information of the hair point to be processed and the corrected offset information are summed to obtain updated interpolation position information of the hair point to be processed.
15. The method of claim 14, wherein the position information of any of the matching hair segments includes the position information of the hair points at both ends of the matching hair segment; and determining the position change information based on the difference between the updated position information of the M matching hair segments and the position information of the M matching hair segments before the update, comprises: Calculating the first position information change amount of the hair points at both ends of each matching hair segment before updating, and calculating the second position information change amount of the hair points at both ends of each matching hair segment after updating; Determine a transformation matrix corresponding to the matching hair segment according to a difference between a first position information variation and a second position information variation of each matching hair segment; The transformation matrix of the reference hair segment in the M matching hair segments is determined as the position transformation information; wherein the reference hair segment is the matching hair segment in the matching simulated virtual hair with the greatest influence weight in the M matching simulated virtual hairs.
16. A service processing device, the device being deployed on a computer device, comprising: An acquisition unit, configured to acquire a hair root point cloud of a business character in a business, wherein the hair root point cloud includes hair root points corresponding to a plurality of virtual hairs of the business character; The acquisition unit is further used to acquire sampling control information, where the sampling control information is used to control the distance between sampling points during the sampling process of the rooting point cloud; A processing unit, configured to perform sampling processing on the rooting point cloud according to the sampling control information to obtain sampling points; The processing unit is further configured to determine the virtual hair corresponding to the sampling point as simulated virtual hair, and determine the virtual hair corresponding to other hair root points in the hair root point cloud except the sampling point as interpolated virtual hair; The simulated virtual hair adopts a physical simulation strategy to simulate dynamic effects during the execution of the service, and the simulated virtual hair is used to control the interpolated virtual hair to follow the movement of the simulated virtual hair during the execution of the service.
17. A computer device comprising: a processor suitable for implementing a computer program; A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program is suitable for being loaded by the processor and executing the business processing method according to any one of claims 1 to 15.
18. A computer-readable storage medium storing a computer program, wherein the computer program is suitable for being loaded by a processor and executing the business processing method according to any one of claims 1 to 15.
19. A computer program product, wherein the computer program product stores a computer program, wherein the computer program is suitable for being loaded by a processor to execute the business processing method according to any one of claims 1 to 15.
