Virtual hair generation method and device, storage medium and electronic equipment

By obtaining the original model of virtual characters, drawing hair -oriented lines, determining stickers and legal lines, generating hair material data, and rendering models, the problem of low hair efficiency and accuracy of virtual role in the existing technology has achieved high efficiency, and achieved efficient efficiency. , Expert hair generation and reuse.

CN119379884APending Publication Date: 2025-01-28NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411515887.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The prior art is inefficient and inaccurate when generating flaky hairs of cluster virtual characters. It is necessary to manually generate hairs of each character one by one, and the generated hairs cannot be reused, resulting in low production efficiency.

Method used

By obtaining the original model corresponding to the virtual character, draw the hair -oriented line, determine the virtual hair map and method line, generate hair material data, and renders the original model based on these data to generate pieces of hair.

Benefits of technology

Improved the efficiency and accuracy of virtual characters, without manual generationing one by one. The hair of each character can be quickly generated and reused, suitable for large -scale cluster characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379884A_ABST
    Figure CN119379884A_ABST
Patent Text Reader

Abstract

The invention relates to a virtual hair generation method and device, a storage medium and electronic equipment, and relates to the technical field of computers.The method comprises the steps that an original virtual character model corresponding to a virtual character is obtained, and a hair guide line of the virtual character is drawn based on the original virtual character model; determining a virtual hair map of the virtual character, and determining a virtual hair normal of the virtual character according to the facial contour information of the virtual character; according to the hair guide line, a virtual hair map and a virtual hair normal, generating hair material data for the virtual character; and rendering the original virtual character model based on the hair material data to obtain a flaky hair rendering result of the virtual character. The generation efficiency of the virtual hair is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method for generating virtual hair, a device for generating virtual hair, a computer-readable storage medium, and an electronic device. Background Art

[0002] In the existing hair generation scheme for clustered virtual characters, the hair obtained based on the hair plug-in can be exported into curves, and then the exported curves are used to generate sheet-like hair through a plug-in tool capable of generating patches configured in the game engine.

[0003] However, the above method has the following defects: on the one hand, the hair of each virtual character needs to be generated manually one by one, which makes the generation efficiency low; on the other hand, there is also the problem of low accuracy of the generated hair.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the present disclosure is to provide a method for generating virtual hair, a device for generating virtual hair, a computer-readable storage medium and an electronic device, thereby at least to a certain extent overcoming the problems of low hair generation efficiency and low hair accuracy caused by the limitations and defects of related technologies.

[0006] According to one aspect of the present disclosure, a method for generating virtual hair is provided, comprising:

[0007] Acquire an original virtual character model corresponding to the virtual character, and draw hair guide lines of the virtual character based on the original virtual character model;

[0008] Determining a virtual hair map of the virtual character, and determining a virtual hair normal of the virtual character according to facial contour information of the virtual character;

[0009] Generating hair material data for the virtual character according to the hair guide line, the virtual hair map and the virtual hair normal;

[0010] The original virtual character model is rendered based on the hair material data to obtain a flake hair rendering result of the virtual character.

[0011] According to one aspect of the present disclosure, there is provided a device for generating virtual hair, comprising:

[0012] A hair guide line drawing module, used for acquiring an original virtual character model corresponding to the virtual character, and drawing the hair guide lines of the virtual character based on the original virtual character model;

[0013] A hair map determination module, used to determine a virtual hair map of the virtual character, and determine a virtual hair normal of the virtual character according to facial contour information of the virtual character;

[0014] A hair material data generation module, used to generate hair material data for the virtual character according to the hair guide line, the virtual hair map and the virtual hair normal;

[0015] The sheet hair rendering module is used to render the original virtual character model based on the hair material data to obtain the sheet hair rendering result of the virtual character.

[0016] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned methods for generating virtual hair is implemented.

[0017] According to one aspect of the present disclosure, there is provided an electronic device, including:

[0018] Processor; and

[0019] A memory, configured to store executable instructions of the processor;

[0020] The processor is configured to execute any one of the above-mentioned methods for generating virtual hair by executing the executable instructions.

[0021] A method for generating virtual hair provided by an embodiment of the present disclosure comprises the following steps: on the one hand, obtaining an original virtual character model corresponding to a virtual character, and drawing hair guide lines of the virtual character based on the original virtual character model; determining a virtual hair map of the virtual character, and determining virtual hair normals of the virtual character according to facial contour information of the virtual character; generating hair material data for the virtual character according to the hair guide lines, the virtual hair map and the virtual hair normals; rendering the original virtual character model based on the hair material data to obtain a flake hair rendering result of the virtual character, thereby realizing the generation of flake hair of the virtual character without manually generating hair of each character in the virtual character one by one, thereby improving the generation efficiency of flake hair of the virtual character; on the other hand, since the hair material data for the virtual character can be generated according to the hair guide lines, the virtual hair map and the virtual hair normals, and the original virtual character model can be rendered based on the hair material data to obtain a flake hair rendering result of the virtual character, thereby improving the accuracy of the obtained flake hair.

[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0024] Figure 1 A flowchart of a method for generating virtual hair according to an exemplary embodiment of the present disclosure is schematically shown.

[0025] Figure 2 A diagram schematically shows an example scene of hair guide lines of a single character model according to an example embodiment of the present disclosure.

[0026] Figure 3 A flowchart of a method for determining a virtual hair map of a virtual character according to an exemplary embodiment of the present disclosure is schematically shown.

[0027] Figure 4 A schematic diagram shows an example scene of a first target virtual hemisphere obtained according to an example embodiment of the present disclosure.

[0028] Figure 5 A diagram schematically shows an example scene of basic virtual hair obtained according to an example embodiment of the present disclosure.

[0029] Figure 6 A scene example diagram schematically shows an obtained header information filling result according to an example embodiment of the present disclosure.

[0030] Figure 7 A scene example diagram schematically illustrates a hair growth direction of a single character model obtained according to an example embodiment of the present disclosure.

[0031] Figure 8 A scene example diagram schematically shows hair material data of a single character model obtained according to an example embodiment of the present disclosure.

[0032] Fig. 9 The structure block diagram of a device for generating virtual hair according to an exemplary embodiment of the present disclosure is schematically shown.

[0033] Fig.10 An electronic device for implementing a method for generating virtual hair according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0034] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0035] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0036] In the development process of virtual games, using the hair plug-in XGen to quickly generate flaky hair for clustered characters is a difficult point in cluster production; in actual application, since a single virtual character in a cluster is generally used for medium and long shots in the camera, the effect is not required to be particularly fine, but it involves a huge number of clustered characters, resource optimization, and process optimization. The current method of producing a large number of flaky hair for clustered characters cannot efficiently complete the production of a large number of flaky hair for Class C or Class D characters.

[0037] Furthermore, for using XGen to convert and generate flaky hair for clustered characters, the existing technical solutions can be mainly divided into the following two generation methods: one is to use XGen's own method of creating geometry to convert the character's hair into flaky hair; the other is to export the XGen hair into curves, and then use the exported hair curves to generate flaky hair through a plug-in tool that can generate patches in the Maya engine.

[0038] However, the above method has the following defects: on the one hand, the above scheme has many steps to adjust when making the sheet-like hair of clustered characters, which leads to a waste of time cost; further, for the generated sheet-like hair, it is necessary to carefully adjust the hair width, hair direction, hair normal and UV map of each sheet-like hair to adapt to the subsequent production, and the adjustment process is very time-consuming and labor-intensive, which makes the hair generation efficiency low; on the other hand, the sheet-like hair produced by the above scheme cannot be reused on different virtual characters; therefore, each new character is equivalent to starting from scratch, and the large number of clustered characters cannot be produced in an assembly line, and the production efficiency is not high. Based on this, a new method for quickly generating lightweight hair is provided, so that the hair setting of a virtual character can be quickly completed on the basis of quickly and automatically generating lightweight hair.

[0039] In this exemplary embodiment, a method for generating virtual hair is first provided, which can be run on a terminal device, server, server cluster or cloud server where a game development engine is located; of course, those skilled in the art can also run the method disclosed in this disclosure on other platforms as required, which is not specifically limited in this exemplary embodiment. Figure 1 As shown, the method for generating virtual hair may include the following steps:

[0040] Step S110. Acquire an original virtual character model corresponding to the virtual character, and draw hair guide lines of the virtual character based on the original virtual character model;

[0041] Step S120. Determine a virtual hair map of the virtual character, and determine a virtual hair normal of the virtual character according to the facial contour information of the virtual character;

[0042] Step S130. Generate hair material data for the virtual character according to the hair guide line, the virtual hair map and the virtual hair normal;

[0043] Step S140: Rendering the original virtual character model based on the hair material data to obtain a flake hair rendering result of the clustered virtual character.

[0044] In the above-mentioned method for generating virtual hair, on the one hand, by obtaining the original virtual character model corresponding to the virtual character, and drawing the hair guide lines of the virtual character based on the original virtual character model; determining the virtual hair map of the virtual character, and determining the virtual hair normal of the virtual character according to the facial contour information of the virtual character; generating hair material data for the virtual character according to the hair guide lines, the virtual hair map and the virtual hair normal; rendering the original virtual character model based on the hair material data to obtain the sheet-like hair rendering result of the virtual character, the sheet-like hair of the virtual character can be generated without manually generating the hair of each character in the virtual character one by one, thereby improving the generation efficiency of the sheet-like hair of the virtual character; on the other hand, since the hair material data for the virtual character can be generated according to the hair guide lines, the virtual hair map and the virtual hair normal, and the original virtual character model can be rendered based on the hair material data to obtain the sheet-like hair rendering result of the virtual character, thereby improving the accuracy of the obtained sheet-like hair.

[0045] Hereinafter, the method for generating virtual hair according to the exemplary embodiment of the present disclosure will be explained and illustrated in detail with reference to the accompanying drawings.

[0046] First, the terms involved in the exemplary embodiments of the present disclosure are explained and illustrated.

[0047] XGen: A hair generation plug-in in the Maya engine; based on the XGen plug-in, you can draw the hair guide lines of the virtual character and adjust the length and direction of the hair guide lines.

[0048] Alembic file: It can be referred to as ABC file for short. It is an open file format for 3D rendering and animation. It is widely used in 3D graphics and special effects production in film, television, games and other media industries. Alembic file can save the object's geometric information, vertex and patch attributes, animation keyframes, bone binding and other data.

[0049] Secondly, the application scenarios and technical implementation principles of the example embodiments of the present disclosure are explained and illustrated. Specifically, the method for generating virtual hair recorded in the example embodiments of the present disclosure can be used in the scenario of generating sheet-like hair for clustered virtual characters; as distinguished from a single virtual character, a clustered virtual character refers to a virtual character that appears in the form of a cluster in certain specific game scenarios; a clustered virtual character may include multiple different virtual characters, and the specific situation can be set according to the actual application scenario, and this example does not impose any special restrictions on this. Furthermore, the method for generating virtual hair recorded in the example embodiments of the present disclosure provides an easy-to-apply modular process for making sheet-like hair for clustered virtual characters. In the process of actual application, it can achieve the purpose of being lightweight, time-saving, efficient, and easy to reuse, thereby improving the generation efficiency of sheet-like hair for clustered virtual characters.

[0050] Furthermore, the virtual hair map recorded in the exemplary embodiment of the present disclosure is explained and illustrated. Specifically, the virtual hair map recorded in the exemplary embodiment of the present disclosure may include a basic model information map, an inherent color information map (Diffuse map), a depth information map (Depth map), a channel information map (Alpha map), a hair tail information map (Tip map), a hair area information map (ID map), and a UV information map (UV map). Bounds map) and the like; at the same time, the basic model information map recorded here is used to present the hair length and / or hair density of each original virtual character included in the cluster-type virtual character; the inherent color information map recorded here is used to present the inherent hair color of the virtual hair of each original virtual character included in the cluster-type virtual character; the depth information map recorded here is used to present the three-dimensional sense of the virtual hair of each original virtual character included in the cluster-type virtual character; the channel information map recorded here is used to present the transparency of the virtual hair of each original virtual character included in the cluster-type virtual character; the hair tail information map recorded here is used to present the bending direction and / or bending angle of the hair tail of the virtual hair of each original virtual character included in the cluster-type virtual character; the hair area information map recorded here is used to present the regional hair color of the virtual hair of different areas of each original virtual character included in the cluster-type virtual character; the UV information map recorded here is used to present the texture of the virtual hair of each original virtual character included in the cluster-type virtual character.

[0051] The following will Figure 1 The method for generating virtual hair shown in the following is further explained and illustrated. Specifically:

[0052] In step S110, an original virtual character model corresponding to the virtual character is obtained, and hair guide lines of the virtual character are drawn based on the original virtual character model.

[0053] Specifically, the specific drawing process of the hair guide line can be implemented in the following way: obtain a single character model corresponding to each original virtual character included in the virtual character, and splice the single character models based on the placement position of each single character model in the original virtual character model to obtain a model splicing result; adaptively adjust each single character model in the model splicing result based on the model display size of each single character model in the original virtual character model to obtain the original virtual character model; based on the placement position and the character attribute information of each single character model, draw hair guide lines for the single character model, and generate the hair guide lines of the virtual character based on the hair guide lines of each single character model. That is, in the actual application process, the hair generation plug-in XGen in the Maya engine can be called to draw the hair guide lines; at the same time, in the process of drawing the hair guide lines, it is first necessary to load the single character model corresponding to each original virtual character included in the clustered virtual character; wherein, the single character model can refer to Figure 2 As shown; secondly, since the virtual character is a cluster-type virtual character, the placement position and model display size of each original virtual character in the cluster-type virtual character are different, so the single character model can be adaptively adjusted according to the distance relationship between each single character model and the virtual lens; as for the specific splicing process, it can be achieved according to the placement position of each original virtual character in the cluster-type virtual character; further, in the process of drawing the hair guide line, it can be carried out according to the actual situation; for example, some characters have straight hair, some characters have curly hair, some characters have short curly hair or long straight hair, etc., this information will be pre-set in the character attribute information; under this premise, the hair guide line can be drawn according to the actual situation; among them, the specific drawing result of the hair guide line of the single character model can refer to Figure 2 shown.

[0054] It should be noted here that the specific drawing process of the hair guide lines is implemented in Maya, and the specific rendering process of the sheet hair is implemented in Houdini; therefore, after the hair guide lines are drawn, they need to be exported in the ABC file format, and then the hair guide lines in the ABC file format are imported into Houdini; further, in the process of importing the hair guide lines in the ABC file format into Houdini, the Alembic node can be called in Houdini, and then the hair guide lines of the clustered virtual character can be imported based on the node.

[0055] In step S120, a virtual hair map of the virtual character is determined, and a virtual hair normal of the virtual character is determined according to facial contour information of the virtual character.

[0056] In this example embodiment, first, a virtual hair map of the virtual character is determined; specifically, referring to Figure 3 As shown, the specific process of determining the virtual hair map may include the following steps:

[0057] Step S310, determining the number of virtual characters included in the virtual characters; wherein the virtual characters are cluster-type virtual characters.

[0058] Specifically, in the actual application process, since the virtual character is a cluster-type virtual character, it is necessary to count the total number of original virtual characters included in the cluster-type virtual character; wherein, the specific character quantity counting process can be implemented manually or based on a corresponding image processing model, and this example does not impose any special restrictions on this.

[0059] Step S320: creating first original virtual spheres equal in number to the number of the virtual characters, and segmenting the first original virtual spheres to obtain first original virtual hemispheres.

[0060] In this example embodiment, first, a number of first original virtual spheres equal to the number of virtual characters are created; wherein the first original virtual spheres recorded herein can be used to refer to the virtual heads of the original virtual characters included in the cluster-type virtual characters; secondly, the first original virtual spheres are segmented to obtain first original virtual hemispheres; at the same time, the segmentation process is required because only a part of the head area is the hair area, and the other part is the face area; therefore, polarity segmentation processing is required.

[0061] Step S330, adaptively adjusting the first original virtual hemisphere to obtain a first target virtual hemisphere, and calling a virtual hair generation node to generate basic virtual hair corresponding to the first target virtual hemisphere.

[0062] Specifically, the specific generation process of basic virtual hair can be achieved in the following way: first, based on the preset length attribute parameter, the hemisphere height of the first original virtual hemisphere is adaptively adjusted to obtain the first target virtual hemisphere; secondly, a first mapping relationship is established between each target virtual hemisphere in the first target virtual hemisphere and each original virtual character included in the cluster virtual character; then, based on the first mapping relationship and the character position of the original virtual character in the cluster virtual character, the virtual hair length corresponding to each target virtual hemisphere is determined; further, a virtual hair generation node is called, and the virtual hair generation node is assigned a value based on the virtual hair length to obtain the basic virtual hair corresponding to each target virtual hemisphere in the first target virtual hemisphere. Among them, the length attribute parameter recorded here is lengthscale; based on the length attribute parameter, the hemisphere height of the first original virtual hemisphere can be adaptively adjusted, and then the first target virtual hemisphere with decreasing height can be obtained; wherein the obtained first target virtual hemisphere can refer to Figure 4 As shown; after obtaining the first target virtual hemisphere, the virtual hair generation node in Houdini can be called to generate basic virtual hair; the basic virtual hair obtained can refer to Figure 5 shown.

[0063] It should be noted here that the reason why the hemisphere height of the first original virtual hemisphere needs to be adaptively adjusted based on the preset length attribute parameters to obtain the first target virtual hemisphere is because the original virtual characters in the clustered virtual characters need to be displayed at different sizes, so the hair areas also have different sizes; based on this method, the accuracy of the rendering results can be improved.

[0064] Step S340: Rendering the first target virtual hemisphere based on the basic virtual hair to obtain a virtual hair map of the virtual character.

[0065] Specifically, the virtual hair map can be implemented in the following manner: based on the basic virtual hair, the first target virtual hemisphere is rendered to obtain the basic model information map of the clustered virtual character; in response to the assignment operation on the basic model information map, an inherent color information map and / or a depth information map and / or a channel information map and / or a hair tail information map and / or a hair region information map and / or a UV information map are obtained. That is, in the actual application process, the basic model information map needs to be determined first, and then other maps are generated based on the basic model map.

[0066] In an exemplary embodiment, in response to the assignment operation on the basic model information map, the inherent color information map and / or the depth information map and / or the channel information map and / or the hair tail information map and / or the hair area information map and / or the UV information map are obtained, which can be achieved in the following way: calling a color assignment node, and performing an assignment operation on the basic model information map based on the color assignment node to obtain the inherent color information map; calling a depth information assignment node, and performing an assignment operation on the basic model information map based on the depth information assignment node to obtain the channel information map; calling a tail information assignment node; point, and based on the hair tail information assignment node, the basic model information map is assigned to obtain the hair tail information map; the area information assignment node is called, and based on the area information assignment node, the basic model information map is assigned to obtain the hair area information map; based on the basic model information map, the original virtual character model is rendered to obtain an intermediate character model, and the intermediate character model is UV unfolded to obtain the original UV map; the UV information assignment node is called, and based on the UV information assignment node, the original UV map is assigned to obtain the UV information map.

[0067] In an exemplary embodiment, the inherent color information map (Diffuse map), depth information map (Depth map), channel information map (Alpha map), hair tail information map (Tip map), hair area information map (ID map) and UV information map (UV Bounds map) are all implemented on the basis of the basic model information map; therefore, in the actual application process, after obtaining the basic model information map, the corresponding information assignment results are called to perform corresponding assignment operations to obtain other maps; at the same time, the reason why a variety of different maps need to be generated is to further improve the accuracy of the obtained sheet-like hair, so that the obtained sheet-like hair is more refined and more realistic.

[0068] It is necessary to further explain here that, since the flaky hair presented by each original virtual character included in the cluster-type virtual character is different, it is necessary to configure a separate basic model information map, inherent color information map (Diffuse map), depth information map (Depth map), channel information map (Alpha map), hair tail information map (Tip map), hair area information map (ID map) and UV information map (UV Bounds map) for each original virtual character; among all the original virtual characters, the individual maps of individual original virtual characters can be the same or completely different, and this example does not impose any special restrictions on this.

[0069] Secondly, the virtual hair normal of the virtual character is determined according to the facial contour information of the virtual character. Specifically, in the process of determining the virtual hair normal, it is first necessary to determine the facial contour information of the virtual character; specifically, the specific determination process of the facial contour information can be implemented in the following manner: extract the head contour information corresponding to each original virtual character included in the virtual character, and fill the second original virtual sphere in the head contour information to obtain a head filling result; based on the spherical contour information of the second original virtual sphere included in the head filling result, determine the facial contour information corresponding to each original virtual character. That is, in the actual application process, the second original virtual sphere can be placed in the head contour information, and the specific restriction condition is that the head contour information needs to completely wrap the second original virtual sphere to which it is scaled; and the second original virtual sphere can be adaptively resized according to actual needs, in order to make the filled sphere fit the head contour information more closely; wherein, the obtained head information filling result can refer to Figure 6 shown.

[0070] Furthermore, the virtual hair normal of the virtual character is determined according to the facial contour information; specifically, this can be achieved in the following manner: obtaining the world space vertex normal data of the facial contour information, and determining the hair growth direction corresponding to each original virtual character included in the clustered virtual character according to the world space vertex normal data; generating the virtual hair normal of the clustered virtual character based on the hair growth direction corresponding to each original virtual character. Wherein, in the process of determining the hair growth direction corresponding to each original virtual character included in the clustered virtual character according to the world space vertex normal data, since the overall growth trend of the virtual hair is to grow outward, it is necessary to filter out the normal data with the normal direction pointing inward (pointing to the center of the sphere) in the world space vertex normal data, and the remaining is the hair growth direction; wherein, the obtained hair growth direction can be referenced. Figure 7 shown.

[0071] In step S130, hair material data for the virtual character is generated according to the hair guide lines, the virtual hair map and the virtual hair normals.

[0072] Specifically, the process of generating hair material data can be implemented in the following manner: according to the character name and character identifier of the original virtual character corresponding to the hair guide lines, virtual hair maps and virtual hair normals, a second association relationship is established between the hair guide lines, virtual hair maps and virtual hair normals; based on the second association relationship, hair material data of a single character model corresponding to each original virtual character in the clustered virtual characters is generated. That is, in the actual application process, the hair guide lines, virtual hair maps and virtual hair normals of each original virtual character in the clustered virtual characters need to be grouped together first, and then based on the hair guide lines, virtual hair maps and virtual hair normals of each original virtual character, the hair material data of the single character model corresponding to the original virtual character is obtained; wherein the hair material data of the single character model can refer to Figure 8 shown.

[0073] In step S140, the original virtual character model is rendered based on the hair material data to obtain a flake hair rendering result of the virtual character.

[0074] Specifically, in the actual application process, the original virtual character model can be rendered based on the hair material data of each single character model to obtain the flake hair rendering result of the virtual character.

[0075] It should be noted here that, in the process of grouping together the hair guide lines, virtual hair maps and virtual hair normals of each original virtual character in the clustered virtual characters, the virtual hair maps and virtual hair normals can be automatically stored in the path based on the storage path of the ABC file of the hair guide lines in Houdini, and then it can be implemented based on the character name and character ID; further, in the process of determining the storage path of the ABC file of the hair guide lines in Houdini, it can be implemented based on Python commands.

[0076] So far, the method for generating virtual hair recorded in the exemplary embodiment of the present disclosure has been fully realized. Based on the aforementioned contents, it can be known that the method for generating virtual hair recorded in the exemplary embodiment of the present disclosure, on the one hand, can save the heavy adjustment work of the traditional hair production method when producing the sheet-like hair of clustered virtual characters, and the whole process can complete the hair production of a character in just a few simple steps; on the other hand, the method for generating virtual hair recorded in the exemplary embodiment of the present disclosure can not only quickly generate the sheet-like hair of clustered characters, but also quickly adapt different hairstyles to different head shapes, so as to realize the rapid production of variants; and, it can also realize the semi-automatic generation of sheet-like hair, and the sheet-like hair of different characters can be generated by repeating simple operations, which has high reusability.

[0077] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.

[0078] The exemplary embodiment of the present disclosure also provides a device for generating virtual hair. Fig. 9 As shown, the virtual hair generating device may include a hair guide line drawing module 910, a hair map determination module 920, a hair material data generating module 930 and a sheet hair rendering module 940. Among them:

[0079] The hair guide line drawing module 910 may be used to obtain an original virtual character model corresponding to the virtual character, and draw the hair guide lines of the virtual character based on the original virtual character model;

[0080] The hair map determination module 920 may be used to determine the virtual hair map of the virtual character, and determine the virtual hair normal of the virtual character according to the facial contour information of the virtual character;

[0081] A hair material data generating module 930 may be used to generate hair material data for the virtual character according to the hair guide line, the virtual hair map and the virtual hair normal;

[0082] The sheet hair rendering module 940 may be used to render the original virtual character model based on the hair material data to obtain a sheet hair rendering result of the virtual character.

[0083] In an exemplary embodiment of the present disclosure, the virtual hair map includes at least one of a basic model information map, an inherent color information map, a depth information map, a channel information map, a hair tail information map, a hair area information map and a UV information map; the basic model information map is used to present the hair length and / or hair density of each original virtual character included in the virtual character; the inherent color information map is used to present the inherent hair color of the virtual hair of each original virtual character included in the virtual character; the depth information map is used to present the inherent hair color of each original virtual character included in the virtual character The three-dimensional sense of the virtual hair of an original virtual character; the channel information map is used to present the transparency of the virtual hair of each original virtual character included in the virtual character; the hair tail information map is used to present the bending direction and / or bending angle of the hair tail of the virtual hair of each original virtual character included in the virtual character; the hair area information map is used to present the regional hair color of the virtual hair of different areas of each original virtual character included in the virtual character; the UV information map is used to present the texture of the virtual hair of each original virtual character included in the virtual character.

[0084] In an exemplary embodiment of the present disclosure, an original virtual character model corresponding to a virtual character is obtained, and hair guide lines of the virtual character are drawn based on the original virtual character model, including: obtaining a single character model corresponding to each original virtual character included in the virtual character, and splicing the single character models based on the placement position of each single character model in the original virtual character model to obtain a model splicing result; adaptively adjusting each single character model in the model splicing result based on the model display size of each single character model in the original virtual character model to obtain the original virtual character model; drawing hair guide lines for the single character model based on the placement position and character attribute information of each single character model, and generating hair guide lines of the virtual character based on the hair guide lines of each single character model.

[0085] In an exemplary embodiment of the present disclosure, determining the virtual hair map of the virtual character includes: determining the number of virtual characters included in the virtual character; wherein the virtual characters are cluster-type virtual characters; creating a first original virtual sphere equal to the number of the virtual characters, and segmenting the first original virtual sphere to obtain a first original virtual hemisphere; adaptively adjusting the first original virtual hemisphere to obtain a first target virtual hemisphere, and calling a virtual hair generation node to generate basic virtual hair corresponding to the first target virtual hemisphere; rendering the first target virtual hemisphere based on the basic virtual hair to obtain the virtual hair map of the virtual character.

[0086] In an exemplary embodiment of the present disclosure, the first original virtual hemisphere is adaptively adjusted to obtain a first target virtual hemisphere, and a virtual hair generation node is called to generate basic virtual hair corresponding to the first target virtual hemisphere, including: adaptively adjusting the hemisphere height of the first original virtual hemisphere based on a preset length attribute parameter to obtain the first target virtual hemisphere; establishing a first mapping relationship between each target virtual hemisphere in the first target virtual hemisphere and each original virtual character included in the virtual character; determining the virtual hair length corresponding to each target virtual hemisphere based on the first mapping relationship and the character position of the original virtual character in the virtual character; calling a virtual hair generation node, and assigning a value to the virtual hair generation node based on the virtual hair length to obtain basic virtual hair corresponding to each target virtual hemisphere in the first target virtual hemisphere.

[0087] In an exemplary embodiment of the present disclosure, the first target virtual hemisphere is rendered based on the basic virtual hair to obtain a virtual hair map of the virtual character, including: rendering the first target virtual hemisphere based on the basic virtual hair to obtain a basic model information map of the virtual character; in response to an assignment operation on the basic model information map, an inherent color information map and / or a depth information map and / or a channel information map and / or a hair tail information map and / or a hair area information map and / or a UV information map is obtained.

[0088] In an exemplary embodiment of the present disclosure, in response to an assignment operation on the basic model information map, the inherent color information map and / or the depth information map and / or the channel information map and / or the hair tail information map and / or the hair area information map and / or the UV information map are obtained, including: calling a color assignment node, and performing an assignment operation on the basic model information map based on the color assignment node to obtain the inherent color information map; and / or calling a depth information assignment node, and performing an assignment operation on the basic model information map based on the depth information assignment node to obtain the channel information map; and / or calling a tail information assignment node, And based on the hair tail information assignment node, the basic model information map is assigned to obtain the hair tail information map; and / or the area information assignment node is called, and based on the area information assignment node, the basic model information map is assigned to obtain the hair area information map; and / or based on the basic model information map, the original virtual character model is rendered to obtain an intermediate character model, and the intermediate character model is UV unfolded to obtain the original UV map; the UV information assignment node is called, and based on the UV information assignment node, the original UV map is assigned to obtain the UV information map.

[0089] In an exemplary embodiment of the present disclosure, the facial contour information of the virtual character is obtained in the following manner: extracting head contour information corresponding to each original virtual character included in the virtual character, and filling a second original virtual sphere in the head contour information to obtain a head filling result; based on the spherical contour information of the second original virtual sphere included in the head filling result, determining the facial contour information corresponding to each original virtual character.

[0090] In an exemplary embodiment of the present disclosure, a virtual hair normal of the virtual character is determined based on facial contour information of the virtual character, including: acquiring world space vertex normal data of the facial contour information of the virtual character, and determining the hair growth direction corresponding to each original virtual character included in the virtual character based on the world space vertex normal data; and generating the virtual hair normal of the virtual character based on the hair growth direction corresponding to each original virtual character.

[0091] In an exemplary embodiment of the present disclosure, hair material data for the virtual character is generated based on the hair guide lines, the virtual hair map and the virtual hair normals, including: establishing a second association relationship between the hair guide lines, the virtual hair map and the virtual hair normals based on the character names and character identifiers of the original virtual characters corresponding to the hair guide lines, the virtual hair map and the virtual hair normals; and generating hair material data for a single character model corresponding to each original virtual character among the virtual characters based on the second association relationship.

[0092] The specific details of each module in the above-mentioned virtual hair generation device have been described in detail in the corresponding virtual hair generation method, so they will not be repeated here.

[0093] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0094] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0095] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module" or "system".

[0096] Refer to the following Fig.10 The electronic device 1000 according to this embodiment of the present disclosure is described. Fig.10 The electronic device 1000 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0097] like Fig.10 As shown, the electronic device 1000 is in the form of a general computing device. The components of the electronic device 1000 may include, but are not limited to: the at least one processing unit 1010, the at least one storage unit 1020, a bus 1030 connecting different system components (including the storage unit 1020 and the processing unit 1010), and a display unit 1040.

[0098] The storage unit stores program codes, which can be executed by the processing unit 1010, so that the processing unit 1010 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 1010 can perform the following steps: Figure 1 The step S110 shown in the figure is as follows: obtaining an original virtual character model corresponding to the virtual character, and drawing the hair guide lines of the virtual character based on the original virtual character model; step S120: determining the virtual hair map of the virtual character, and determining the virtual hair normal of the virtual character according to the facial contour information of the virtual character; step S130: generating hair material data for the virtual character according to the hair guide lines, the virtual hair map and the virtual hair normal; step S140: rendering the original virtual character model based on the hair material data to obtain a flake hair rendering result of the virtual character.

[0099] The storage unit 1020 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 10201 and / or a cache storage unit 10202 , and may further include a read-only storage unit (ROM) 10203 .

[0100] The storage unit 1020 may also include a program / utility 10204 having a set (at least one) of program modules 10205, such program modules 10205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0101] Bus 1030 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0102] The electronic device 1000 may also communicate with one or more external devices 1100 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1000, and / or may communicate with any device that enables the electronic device 1000 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1050. Furthermore, the electronic device 1000 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1060. As shown, the network adapter 1060 communicates with other modules of the electronic device 1000 via a bus 1030. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0103] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0104] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above "Exemplary Method" section of the present specification.

[0105] According to the program product for implementing the above method in the embodiment of the present disclosure, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0106] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0107] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0108] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0109] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0110] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0111] Other embodiments of the present disclosure will be readily apparent to those skilled in the art after considering the specification and practicing the inventions invented herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not invented by the present disclosure. The specification and examples are to be considered merely exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A method for generating virtual hair, characterized in that: include: Acquire an original virtual character model corresponding to the virtual character, and draw hair guide lines of the virtual character based on the original virtual character model; Determining a virtual hair map of the virtual character, and determining a virtual hair normal of the virtual character according to facial contour information of the virtual character; Generating hair material data for the virtual character according to the hair guide line, the virtual hair map and the virtual hair normal; The original virtual character model is rendered based on the hair material data to obtain a flake hair rendering result of the virtual character.

2. The method for generating virtual hair according to claim 1, characterized in that: The virtual hair map includes at least one of a basic model information map, an inherent color information map, a depth information map, a channel information map, a hair tail information map, a hair area information map, and a UV information map; The basic model information map is used to present the hair length and / or hair density of each original virtual character included in the virtual character; The inherent color information map is used to present the inherent hair color of the virtual hair of each original virtual character included in the virtual character; The depth information map is used to present the three-dimensional sense of virtual hair of each original virtual character included in the virtual character; The channel information map is used to present the transparency of virtual hair of each original virtual character included in the virtual character; The hair tail information map is used to present the bending direction and / or bending angle of the hair tail of the virtual hair of each original virtual character included in the virtual character; The hair region information map is used to present the regional hair color of virtual hair in different regions of each original virtual character included in the virtual character; The UV information map is used to present the texture of the virtual hair of each original virtual character included in the virtual character.

3. The method for generating virtual hair according to claim 1, characterized in that: Acquiring an original virtual character model corresponding to the virtual character, and drawing hair guide lines of the virtual character based on the original virtual character model, including: Acquire a single character model corresponding to each original virtual character included in the virtual character, and combine the single character models based on the placement positions of the single character models in the original virtual character models to obtain a model combination result; Adaptively adjusting each of the single character models in the model stitching result based on the model display size of each of the single character models in the original virtual character model to obtain the original virtual character model; Based on the placement position and the character attribute information of each single character model, hair guide lines are drawn for the single character model, and hair guide lines of the virtual character are generated according to the hair guide lines of each single character model.

4. The method for generating virtual hair according to claim 1, characterized in that: Determining a virtual hair map of the virtual character includes: Determining the number of virtual characters included in the virtual characters; wherein the virtual characters are cluster-type virtual characters; Creating a number of first original virtual spheres equal to the number of the virtual characters, and segmenting the first original virtual spheres to obtain first original virtual hemispheres; Adaptively adjusting the first original virtual hemisphere to obtain a first target virtual hemisphere, and calling a virtual hair generation node to generate basic virtual hair corresponding to the first target virtual hemisphere; The first target virtual hemisphere is rendered based on the basic virtual hair to obtain a virtual hair map of the virtual character.

5. The method for generating virtual hair according to claim 4, characterized in that: Adaptively adjusting the first original virtual hemisphere to obtain a first target virtual hemisphere, and calling a virtual hair generation node to generate basic virtual hair corresponding to the first target virtual hemisphere, including: Adaptively adjusting the hemisphere height of the first original virtual hemisphere based on a preset length attribute parameter to obtain a first target virtual hemisphere; Establishing a first mapping relationship between each target virtual hemisphere in the first target virtual hemisphere and each original virtual character included in the virtual character; Determining the virtual hair length corresponding to each target virtual hemisphere based on the first mapping relationship and the character position of the original virtual character in the virtual character; A virtual hair generation node is called, and a value assignment operation is performed on the virtual hair generation node based on the virtual hair length to obtain basic virtual hair corresponding to each target virtual hemisphere in the first target virtual hemisphere.

6. The method for generating virtual hair according to claim 4, characterized in that: Rendering the first target virtual hemisphere based on the basic virtual hair to obtain a virtual hair map of the virtual character includes: Rendering the first target virtual hemisphere based on the basic virtual hair to obtain a basic model information map of the virtual character; In response to the assignment operation for the basic model information map, an intrinsic color information map and / or a depth information map and / or a channel information map and / or a hair tail information map and / or a hair area information map and / or a UV information map are obtained.

7. The method for generating virtual hair according to claim 6, characterized in that: In response to the assignment operation for the basic model information map, the intrinsic color information map and / or the depth information map and / or the channel information map and / or the hair tail information map and / or the hair area information map and / or the UV information map are obtained, including: Calling a color assignment node, and performing an assignment operation on the basic model information map based on the color assignment node to obtain the inherent color information map; and / or calling a depth information assignment node, and performing an assignment operation on the basic model information map based on the depth information assignment node to obtain the channel information map; and / or Calling a tail information assignment node, and performing an assignment operation on the basic model information map based on the hair tail information assignment node to obtain the hair tail information map; and / or Calling a region information assignment node, and performing an assignment operation on the basic model information map based on the region information assignment node to obtain the hair region information map; and / or Rendering the original virtual character model based on the basic model information map to obtain an intermediate character model, and UV unfolding the intermediate character model to obtain an original UV map; A UV information assignment node is called, and an assignment operation is performed on the original UV map based on the UV information assignment node to obtain the UV information map.

8. The method for generating virtual hair according to claim 1, characterized in that: The facial contour information of the virtual character is obtained in the following manner: Extracting head outline information corresponding to each original virtual character included in the virtual character, and filling a second original virtual sphere in the head outline information to obtain a head filling result; Based on the spherical contour information of the second original virtual sphere included in the head filling result, the facial contour information corresponding to each of the original virtual characters is determined.

9. The method for generating virtual hair according to claim 1, characterized in that: Determining a virtual hair normal of the virtual character according to the facial contour information of the virtual character includes: Acquire world space vertex normal data of the facial contour information of the virtual character, and determine the hair growth direction corresponding to each original virtual character included in the virtual character according to the world space vertex normal data; A virtual hair normal of each original virtual character is generated based on the hair growth direction corresponding to the virtual character.

10. The method for generating virtual hair according to claim 1, characterized in that: Generating hair material data for the virtual character according to the hair guide line, the virtual hair map and the virtual hair normal, including: Establishing a second association relationship between the hair guide line, the virtual hair map and the virtual hair normal according to the character name and the character identifier of the original virtual character corresponding to the hair guide line, the virtual hair map and the virtual hair normal; Based on the second association relationship, hair material data of a single character model corresponding to each original virtual character in the virtual characters is generated.

11. A virtual hair generating device, characterized in that: include: A hair guide line drawing module, used for acquiring an original virtual character model corresponding to the virtual character, and drawing the hair guide lines of the virtual character based on the original virtual character model; A hair map determination module, used to determine a virtual hair map of the virtual character, and determine a virtual hair normal of the virtual character according to facial contour information of the virtual character; A hair material data generation module, used to generate hair material data for the virtual character according to the hair guide line, the virtual hair map and the virtual hair normal; The sheet hair rendering module is used to render the original virtual character model based on the hair material data to obtain the sheet hair rendering result of the virtual character.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating virtual hair according to any one of claims 1 to 10 is implemented.

13. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the method for generating virtual hair according to any one of claims 1-10 by executing the executable instructions.