Hair rendering speed improvement method, device, equipment and readable storage medium

By constructing target three-dimensional grayscale maps and global lighting technology, the problem of time-consuming three-dimensional hair rendering is solved, and efficient and real hair rendering effect is achieved, which is suitable for various computing devices and terminals.

CN116468833BActive Publication Date: 2025-08-19GUANGZHOU AIFEI CULTURE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211699524.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-28
Publication Date
2025-08-19
Estimated Expiration
2042-12-28

AI Technical Summary

Technical Problem

In the prior art, three-dimensional hair production and rendering take a long time, high computing resource requirements, low rendering efficiency, and difficult to adapt to complex and changeable business needs.

Method used

By building a target three-dimensional grayscale map of the target object model corresponding to user needs, setting hair parameters using random functions and grayscale maps, combining global lighting technology for hair rendering, reducing computing resource requirements, improving hair generation speed and improving visual effects.

Benefits of technology

It has achieved the improvement of hair rendering speed, reduced the performance requirements of computing resources, and the generated hair visual effects are more realistic, reaching the quality of film and television level, and solved the problem of long rendering waiting in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116468833B_ABST
    Figure CN116468833B_ABST
Patent Text Reader

Abstract

The present application provides a method, apparatus, device and readable storage medium for improving hair rendering speed. The present application constructs a grayscale map corresponding to the model of a virtual object and determines the number of hairs to be generated through the grayscale map, thereby reducing the performance requirements for computing resources in the hair generation process and improving the hair generation speed. The present application uses a preset random function and grayscale map to render the color, material and gloss of the generated hair, thereby improving the hair rendering speed while making the visual effect of the hair more realistic and better. By generating multiple layers of hair of different lengths and combining them to form a layered visual perception, the present application controls the thickness changes of the hair at each layer and the roughness of the hair material in a real-time rendering engine, and adjusts the ambient light effect in real time, thereby achieving further visual enhancement. This solves the problems of long rendering wait times and long single-frame rendering times caused by existing offline hair rendering methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of rendering technology, and in particular to a method, apparatus, device, and readable storage medium for improving hair rendering speed. Background Art

[0002] With the development of science and technology, 3D hair production and rendering have also been developed. However, 3D hair production and rendering have always been time-consuming in the industry and require high computer resources. The traditional production process is to draw the hair guide curve in the 3D software, and then generate hair brushes based on the guide curve. Then use the offline renderer to perform lighting rendering through CPU calculations, and finally present the character's hair effect. The whole production process is relatively long. In the design of hair shape, it is necessary to brush the hair once, then render and wait, and then adjust the hair drawing after seeing the effect. The time to render a frame of hair is about 1 to 2 hours, and the rendering efficiency is low. Summary of the Invention

[0003] The present application aims to solve at least one of the above-mentioned technical defects. In view of this, the present application provides a method, device, equipment and readable storage medium for improving hair rendering speed, which are used to solve the technical defect of low efficiency of hair rendering of virtual objects in the existing technology.

[0004] A method for improving hair rendering speed, comprising:

[0005] Constructing a target three-dimensional grayscale map of a target object model corresponding to the user's requirements for generating hair;

[0006] Determining the number of hairs corresponding to a user's needs based on the target three-dimensional grayscale map, and generating first target hairs to be rendered corresponding to the number of hairs corresponding to the user's needs;

[0007] Setting parameters of the first target hair to be rendered according to a preset random function and the target three-dimensional grayscale map;

[0008] Processing the material parameters of the first target hair to be rendered to obtain the second target hair to be rendered;

[0009] The illumination parameters of the second target hair to be rendered are processed to obtain target rendered hair.

[0010] Preferably, the step of constructing a target three-dimensional grayscale map of a target object model corresponding to the user's requirement for hair generation includes:

[0011] Analyze the user's needs for hair generation and determine the target object model that matches the hair that the user needs to generate;

[0012] Determining the grayscale value of the color of the hair to be generated based on the target object model;

[0013] Setting the length of the hair to be generated according to the grayscale value of the color of the hair to be generated;

[0014] A target three-dimensional grayscale map of a target object model corresponding to the user's requirement for hair generation is generated according to the length and color of the hair to be generated.

[0015] Preferably, the setting of the parameters of the first target hair to be rendered according to a preset random function and the target three-dimensional grayscale map includes:

[0016] Dividing the area corresponding to the target three-dimensional grayscale map into different hair division areas according to the grayscale value distribution of the target three-dimensional grayscale map;

[0017] The parameters of each hair division area are set according to the preset random function to control the thickness of the hair corresponding to each hair division area.

[0018] Preferably, the processing of the material parameters of the first target hair to be rendered to obtain the second target hair to be rendered includes:

[0019] Combining a preset noise function and the target three-dimensional grayscale map, rendering the color of the first target hair to be rendered using a standard material in a rendering engine;

[0020] In combination with the target three-dimensional grayscale map and a preset random function, the roughness of the highlight of the rendering engine is controlled to adjust the physical glossiness of the first target hair to be rendered.

[0021] Preferably, processing the illumination parameters of the second target hair to be rendered to obtain target rendered hair includes:

[0022] The global light technology in the Unreal Engine is used to process the lighting parameters of the hair of the second target to be rendered, so as to achieve direct bounce lighting between the hairs, thereby reflecting the global physical lighting of the hair of the second target to be rendered.

[0023] A device for improving hair rendering speed, comprising:

[0024] A texture construction unit, configured to construct a target three-dimensional grayscale texture of a target object model corresponding to a user's requirement for hair generation;

[0025] a hair generation unit, configured to determine the number of hairs corresponding to a user's needs based on the target three-dimensional grayscale map, and generate first target hairs to be rendered corresponding to the number of hairs corresponding to the user's needs;

[0026] A hair parameter setting unit, configured to set the parameters of the first target hair to be rendered according to a preset random function and the target three-dimensional grayscale map;

[0027] A first rendering unit is configured to process material parameters of the first target hair to be rendered to obtain a second target hair to be rendered;

[0028] The second rendering unit is used to process the illumination parameters of the second target hair to be rendered to obtain target rendered hair.

[0029] Preferably, the map construction unit includes:

[0030] A demand analysis unit, configured to analyze the user's demand for hair generation and determine a target object model corresponding to the hair that the user needs to generate;

[0031] a grayscale value determining unit, configured to determine the grayscale value of the color of the hair to be generated based on the target object model;

[0032] a hair length setting unit, configured to set the length of the hair to be generated according to the grayscale value of the color of the hair to be generated;

[0033] The map generating unit is used to generate a target three-dimensional grayscale map of the target object model corresponding to the user's requirements for generating hair according to the length and color of the hair to be generated.

[0034] Preferably, the hair parameter setting unit includes:

[0035] a hair region division unit, configured to divide the region corresponding to the target three-dimensional grayscale map into different hair division regions according to the grayscale value distribution of the target three-dimensional grayscale map;

[0036] The hair area parameter setting unit is used to set the parameters of each hair divided area according to the preset random function to control the thickness of the hair corresponding to each hair divided area.

[0037] A device for improving hair rendering speed, comprising: one or more processors, and a memory;

[0038] The memory stores computer-readable instructions, which, when executed by the one or more processors, implement the steps of the method for improving hair rendering speed as described in any one of the above descriptions.

[0039] A readable storage medium stores computer-readable instructions, which, when executed by one or more processors, enable the one or more processors to implement the steps of the hair rendering speed improvement method as described in any of the above descriptions.

[0040] It can be seen from the technical solution introduced above that when it is necessary to render the hair of a virtual object, the method provided in the embodiment of the present application can construct a target three-dimensional grayscale map of the target object model corresponding to the user's demand for generating hair; so that the number of hairs corresponding to the user's demand can be determined based on the target three-dimensional grayscale map, and the first target hair to be rendered corresponding to the number of hairs corresponding to the user's demand can be generated; by determining the corresponding number of hairs based on the target three-dimensional grayscale map, the number of hairs can be determined based on the color of each area of the target three-dimensional grayscale map, so that the overall visual effect of the hair is better, and the number of hairs can be evenly distributed, which can reduce the resource requirements for hardware devices and reduce the performance overhead of hardware devices. Furthermore, after generating the first target hair to be rendered corresponding to the number of hairs corresponding to the user's needs, the parameters of the first target hair to be rendered can be set according to a preset random function and the target three-dimensional grayscale map, so that the thickness of hair of different lengths can be accurately controlled, so that the final presentation effect of the hair is smoother and more delicate, and the overall layering of the hair is enhanced; further, the material parameters of the first target hair to be rendered can be processed to make the length and thickness of the hair more consistent, so that the overall visual effect of the hair is better, thereby obtaining the second target hair to be rendered; after obtaining the second target rendered hair, the lighting parameters of the second target hair to be rendered can also be processed to make the glossiness and color of the hair more realistic, thereby obtaining the target rendered hair.

[0041] The method provided in the embodiments of the present application can construct a grayscale map corresponding to the model of the virtual object and use the grayscale map to determine the amount of hair to be generated. This can reduce the performance requirements of computing resources during the hair generation process and increase the hair generation speed. Furthermore, a preset random function and grayscale map can be used to render the color, material, and gloss of the generated hair. This improves the hair rendering speed while also making the hair visual effect more realistic and better. High-quality hair visual effects can be generated using a minimum number of hairs. By generating multiple layers of hair of different lengths and combining them to form a rich visual experience, the hair rendering effect can achieve film-quality hair effects. In the real-time rendering engine, by controlling the thickness of each layer of hair and the roughness of the hair material, and adjusting the ambient lighting effect in real time, further visual efficiency is achieved. This solves the problems of long rendering wait times and long single-frame rendering times caused by existing offline hair rendering methods. Through the real-time hair rendering method, what you see is what you get hair effects can be effectively achieved, and the effect of a character with hair effects can be interpreted in real time. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] 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 paying any creative labor.

[0043] Figure 1 A flowchart of a method for improving hair rendering speed provided in an embodiment of the present application;

[0044] Figure 2 A schematic diagram of a rendering effect using global illumination technology as an example of an embodiment of the present application;

[0045] Figure 3 A schematic diagram of a hair rendering effect provided in an embodiment of the present application;

[0046] Figure 4 This is a schematic diagram of the structure of a device for improving hair rendering speed according to an embodiment of the present application;

[0047] Figure 5 This is a hardware structure block diagram of a hair rendering speed improvement device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0048] 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.

[0049] Currently, most common hair rendering technologies are based on offline rendering using CPU or GPU computing. The rendering time for film-quality effects is generally between 1 and 2 hours per frame, which is very time-consuming. When companies mass-produce films, they need to purchase large computer clusters to form render farms, which requires high hardware costs.

[0050] Given that most of the current hair rendering speed-enhancing solutions are difficult to adapt to complex and changing business needs, the applicant has developed a hair rendering speed-enhancing solution. This hair rendering speed-enhancing solution can construct a grayscale map corresponding to the model of the virtual object and determine the number of hairs to be generated through the grayscale map. This can reduce the performance requirements of computing resources in the hair generation process and increase the hair generation speed. Furthermore, the preset random function and grayscale map can be used to render the color, material, and gloss of the generated hair. While improving the hair rendering speed, it can also make the visual effect of the hair more realistic and better.

[0051] For example, it can be applied to real-time rendering in game production, but the hair produced in games is generally made by using a patch model plus a hair transparency map, the effect is relatively crude, and most of it is used for human characters.

[0052] The methods provided in the embodiments of the present application can be used in a variety of general-purpose or specialized computing device environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, and distributed computing environments including any of the above.

[0053] The embodiment of the present application provides a method for improving hair rendering speed. The method can be applied to various image rendering systems and can also be applied to various computer terminals or smart terminals. The execution subject can be the processor or server of the computer terminal or smart terminal.

[0054] For example, the method provided in the embodiment of the present application can be applied to hair rendering in film and television CG films.

[0055] The following combination Figure 1 , introduces the process of the hair rendering speed improvement method given in the embodiment of this application, such as Figure 1As shown, the process can include the following steps:

[0056] Step S101 : constructing a target three-dimensional grayscale map of a target object model corresponding to a user's requirement for hair generation.

[0057] Specifically, in actual application, with the development of the gaming industry, sometimes, in order to make the visual effects of some images of game characters look better, image data is generally rendered in real time according to image visual requirements to optimize the image display effect and enrich the image visual effect.

[0058] The essence of real-time rendering technology is to calculate and output the data to be displayed in real time. Common real-time image rendering technology is to calculate and process the vertex data of the image data in real time before outputting it for display.

[0059] in,

[0060] The vertex data of the image data may include the position, normal information, color, coordinates, and weight information of the vertices of the image.

[0061] In 2002, the performance of computer graphics cards has been greatly improved. The first is the introduction of AGP8X plug-in on the graphics card interface. The introduction of AGP8X plug-in on the graphics card interface can multiply the data transmission bandwidth between the graphics card and the processor to 2.1Gb / s.

[0062] In addition, some 3D performance and its powerful GPU graphics card development has gradually developed, such as many tools can support real-time rendering.

[0063] Real-time rendering technology generally includes mesh rendering technology and shadow rendering technology.

[0064] (1) Mesh rendering technology

[0065] In mesh rendering technology, the vertex attributes of image data generally include position and color. Vertex operations include simple transformation of vertex positions, vertex clipping and projection. In rasterization processing, only simple interpolation of vertex colors is performed. Pixel operations are very simple, that is, they are achieved through overlay.

[0066] (2) Shadow rendering technology

[0067] In shadow rendering technology, in addition to the original position and color attributes, the vertex attributes of the image data also have a normal attribute. The normal attribute in the vertex attributes of the image data can be used to calculate the lighting of the image.

[0068] In addition to adding normal attributes to image lighting calculations, shadow rendering technology has also gradually introduced a crucial concept: depth, a typical application of which is the depth buffer. Depth interpolation has also been added to rasterization processing, and color blending techniques have been added to pixel operations. This allows image rendering to achieve richer colors and a sense of depth.

[0069] Although color blending techniques were added to image rendering, the overall rendered image still looked rather monotonous. This led to the introduction of texture mapping, which added texture coordinates to the vertex attributes of image data. Vertex operations also included texture coordinate transformation and interpolation. Texture coordinate interpolation was added to rasterization. Pixel operations also included texture addressing, blending, and anti-aliasing techniques. This made rendered images appear more vibrant and colorful.

[0070] With the rapid development of graphics processing technology, the early fixed-function rendering pipeline can no longer meet the requirements of graphics developers, who need greater freedom in the graphics processing process.

[0071] This gave rise to programmable shading technology, which allows graphics developers to program vertex and pixel operations in the rendering pipeline separately, rather than using fixed functions to render images.

[0072] For example, for vertex rendering, you can not only simply apply the SetTransform method to achieve the transformation of vertex positions, but more flexibly, you can achieve more complex transformations of vertex positions by writing programs;

[0073] In lighting calculations, you can start from the most basic lighting model and write programs to calculate diffusion, highlights, refraction, scattering, etc. More importantly, you can also use the calculation results as input to the pixel rendering program to achieve a variety of rich effects.

[0074] In pixel rendering, in addition to calling a large number of fixed functions to implement it, you can also write programs to obtain parameters and texture resources from the outside or upstream to perform pixel rendering operations.

[0075] Pixel shading requires much more computation than vertex shading, but the quality of the output image is very high. Many high-quality images are obtained by using pixel shading instead of vertex shading.

[0076] In the early days, graphics processors were programmed using two types of assembly language-like programming languages, VertexShader and PixelShader, which required a lot of programming effort.

[0077] With the development of graphics hardware, the number of instructions that graphics processors can process has increased rapidly, and the workload of programming using assembly-like methods has gradually increased. To improve the efficiency of graphics programming, Cg was introduced. Cg is a high-level language for programming graphics processors. Cg stands for C for Graphics, which means C language for graphics processing.

[0078] The syntax of Cg is similar to that of C, but all instructions are executed by the GPU, while instructions in C are executed by the CPU.

[0079] Based on the C language, the Cg language can be improved and optimized according to the characteristics of the GPU.

[0080] Using Cg to edit image processors for image rendering can improve rendering quality. Cg browsers also allow developers to instantly view rendering instances. Cg provides numerous rendering commands and states, improving rendering speed and quality.

[0081] The development of programmable rendering technology has also had a profound impact on the development of the rendering part of the game engine.

[0082] Generally speaking, there are two ways to achieve rendering effects in games.

[0083] First, rendering effects can be flexibly implemented by designers during the game's level design process. This gives them greater freedom and scope for creativity, and the designed scenes remain consistent with the actual runtime effects. However, this approach requires careful attention to avoid frequent switching of rendering programs, which can reduce rendering frame rates.

[0084] Second, select the rendering program modules needed for the game from a pre-built rendering effect library. This requires the programmer to add the necessary C++ code to reference these rendering program modules. Typically, programmers also need to encode the relevant parameters from the rendering program into the model or texture to effectively increase the rendering speed. This approach allows programmers to more effectively avoid frequent switching of rendering programs to ensure the game's frame rate. Of course, once the engine is determined, the available rendering effect library is also determined.

[0085] Different game types and games have different requirements for the two rendering paths, which developers need to analyze and consider when designing the game engine.

[0086] As the gaming industry's graphics processing requirements continue to increase, graphics processors will develop in two directions: faster computing speeds and greater programmability. This increase in hardware speed will continue to spawn new rendering technologies, making some that were previously difficult to implement on current hardware platforms possible. Lighting calculations require a significant amount of computation, and currently can only be simulated through various indirect methods.

[0087] It is foreseeable that real-time rendering technologies, such as ray tracing and true shadows, will become possible. The implementation of these technologies will enable even more realistic graphics rendering. High realism is a key characteristic of future real-time rendering technology. Increased hardware programmability will allow designers greater flexibility and creativity in hardware control.

[0088] During hair rendering, drawing hair guides as a whole can achieve a uniform distribution of hair quantity, with a consistent amount of hair used between long and short hair. To achieve a realistic hair effect, the overall amount of hair needs to be doubled, which may increase GPU performance overhead and reduce operating efficiency.

[0089] It can be seen that image rendering technology has high requirements on computer performance. In order to reduce the consumption of computer resources, when hair needs to be generated and rendered, a target three-dimensional grayscale map of the target object model corresponding to the user's demand for generating hair can be constructed.

[0090] Constructing a target three-dimensional grayscale map of a target object model corresponding to the user's demand for hair generation can help determine the number of hairs corresponding to the user's demand based on the target three-dimensional grayscale map and generate the corresponding number of hairs.

[0091] in,

[0092] The target three-dimensional grayscale map can feedback the grayscale requirements of the pixels in each area.

[0093] In actual application, the substance painter tool can be used to import the data of the target object model, draw the required three-dimensional grayscale map in it, and set whether to generate hair in each area of the three-dimensional grayscale map.

[0094] For example, the target three-dimensional grayscale map may be configured such that hair does not grow in the black area, hair grows in the white area, and a gradient effect is formed in the gray area.

[0095] Step S102 : determining the number of hairs corresponding to the user's needs based on the target three-dimensional grayscale map, and generating first target hairs to be rendered corresponding to the number of hairs corresponding to the user's needs.

[0096] Specifically, as can be seen from the above introduction, the method provided in the embodiment of the present application constructs a target three-dimensional grayscale map of the target object model corresponding to the user's demand for generating hair.

[0097] According to the different colors of various parts of the target three-dimensional grayscale map, the target three-dimensional grayscale map can be divided into different areas.

[0098] Different areas require different amounts of hair to be generated.

[0099] Therefore, after constructing the target three-dimensional grayscale map, the number of hairs corresponding to the user's needs can be determined based on the target three-dimensional grayscale map, so that the specific number of hairs to be generated can be determined according to the user's needs, avoiding the generation of too many hairs, resulting in excessive performance overhead of the computer and reducing the image rendering rate.

[0100] Furthermore, after determining the number of hairs to be generated, a first target hair to be rendered corresponding to the number of hairs corresponding to the user's needs can be generated using a hair-by-hair curve method.

[0101] For example,

[0102] It can reduce the amount of hair in areas with longer hair length and increase the volume of hair in areas with shorter hair length.

[0103] Step S103: setting parameters of the first target hair to be rendered according to a preset random function and the target three-dimensional grayscale map.

[0104] Specifically, from the above introduction, it can be seen that the method provided in the embodiment of the present application can determine the number of hairs corresponding to the user's needs based on the target three-dimensional grayscale map, and generate the first target hair to be rendered corresponding to the number of hairs corresponding to the user's needs.

[0105] After the first target hair to be rendered is generated, the first target hair to be rendered needs to be further rendered.

[0106] Therefore, after the first target hair to be rendered is generated, the parameters of the first target hair to be rendered may be set according to a preset random function and the target three-dimensional grayscale map.

[0107] in,

[0108] The parameters of the first target hair to be rendered may include the thickness of the hair.

[0109] The preset random function can be implemented using a material function in a rendering engine.

[0110] Material functions are small snippets of the material graph that can be saved in the render toolkit and reused across multiple materials. Edits to a single function are propagated to all networks that use that function.

[0111] Therefore, if you need to fix a function or change the way a function works, you can do so by editing the Material Function without having to make further edits to the numerous Materials that may be using the Material Function.

[0112] During the rendering process, random values can be created in the required material functions, and the random values can be controlled by numerical values, maps, etc.

[0113] Functions can be edited in the Material Editor just like normal materials, but there are some restrictions on which nodes can be used.

[0114] Proper use of functions can reduce redundancy in your Materials, which in turn reduces the maintenance required to keep repeated expressions in sync, as well as the inevitable errors caused by missing a copy during modification.

[0115] Material Functions are also assets that can be displayed in the Content Browser.

[0116] The Material Function Graph differs from the Material Graph in that Material Functions do not have a main Material node, but instead have Output nodes which represent the output connections of the final function.

[0117] By using the preset random function to set the parameters of the first target hair to be rendered, the thickness of hair of different lengths can be controlled more accurately.

[0118] For example, the thickness of relatively long hair can be set to be thinner, so that the effect will be smoother and more delicate. The thickness of relatively short hair can be set to be thicker so that it can cover the skin underneath and prevent the skin from being exposed. Combining the length and thickness of the hair, the overall layering of the hair can be better achieved to achieve a realistic visual effect without the need for a large amount of hair.

[0119] Secondly,

[0120] In actual application, the parameters of the first target hair to be rendered may include the material, color, and gloss of the hair.

[0121] In the hair material, if the assigned color map is too uniform and directly mapped to the hair, the hair may appear less realistic and the rendering effect may be similar to that of a plastic doll. If the highlight performance of the hair is also too uniform, it may also affect the authenticity of the final visual effect of the hair.

[0122] Step S104: Process the material parameters of the first target hair to be rendered to obtain the second target hair to be rendered.

[0123] Specifically, as can be seen from the above introduction, the method provided in the embodiment of the present application can set the parameters of the first target hair to be rendered based on a preset random function and the target three-dimensional grayscale map.

[0124] The parameters of the first target hair to be rendered may include the thickness, color, gloss and material of the hair;

[0125] In actual application, when rendering the generated hair, in addition to rendering the thickness of the generated hair, the material parameters of the first target hair to be rendered can also be processed to obtain the second target hair to be rendered.

[0126] in,

[0127] In the hair material, if the assigned color map is too uniform and directly mapped to the hair, the hair may appear less realistic and the rendering effect may be similar to that of a plastic doll. If the highlight performance of the hair is also too uniform, it may also affect the authenticity of the final visual effect of the hair.

[0128] Therefore, after setting the parameters of the first target hair to be rendered, the method provided in the embodiment of the present application can also process the material parameters of the first target hair to be rendered to obtain the second target hair to be rendered.

[0129] In this way, the rendering effect of the first target hair to be rendered can appear closer to the visual effect of real hair.

[0130] Step S105: Process the illumination parameters of the second target hair to be rendered to obtain target rendered hair.

[0131] Specifically, as described above, the method provided in the embodiments of the present application can set the parameters of the first target hair to be rendered based on a preset random function and the target three-dimensional grayscale map. After setting the parameters of the first target hair to be rendered, the material parameters of the first target hair to be rendered can be processed to obtain the second target hair to be rendered.

[0132] In the actual rendering process, due to the large amount of hair, the traditional lighting method, and the complex way of rendering and calculating light and shadow, it takes a long time to produce a realistic light and shadow effect.

[0133] Furthermore, in order to reduce the time consumed in rendering, the hair rendering effect can be made softer and the lighting and shadow effects can be better, so that the visual effect of the second target hair to be rendered looks closer to the real visual effect of the hair. The lighting parameters of the second target hair to be rendered can be processed, and finally the target rendered hair can be obtained.

[0134] in,

[0135] In the actual rendering process, due to the large amount of hair, the traditional lighting method, and the complex way of rendering and calculating light and shadow, a realistic light and shadow effect may take a long time.

[0136] In order to increase the hair rendering speed and reduce the GPU performance overhead of hair rendering, the global light technology in the Unreal Engine can be used to process the lighting parameters of the second target hair to be rendered, so as to achieve direct bounce lighting between the hair and the hair, reflecting the global physical lighting of the second target hair to be rendered.

[0137] in,

[0138] Global illumination (GI) technology, also known as indirect lighting technology, refers to a series of 3D graphics algorithms that make computer scene lighting more realistic and natural.

[0139] In layman's terms, when a computer is rendering graphics, it can not only consider the light directly from the light source to the surface of the object, but also consider the light reflected from other surfaces to the current surface, thereby greatly increasing the realism of the scene.

[0140] For example, in the real world, it is relatively easy to observe GI-related phenomena: sunlight shining from the cave entrance to the ground will be reflected to illuminate other parts of the cave, and light shining on the red sofa will cause the red light to be reflected on the wall behind it.

[0141] The counterpart to global illumination is called direct illumination or local illumination; for example, Figure 2 An example of a schematic diagram of the effect processed using global illumination technology;

[0142] like Figure 2 The effect on the left shows that the light stops immediately after it is emitted from the light source and hits the object, without multiple reflections.

[0143] In early related research, due to hardware limitations and other reasons, a more empirical approach was often used to model and simulate local lighting, for example, the Phong model and the Blinn-Phong model were established.

[0144] However, the effect achieved through this hacking method is obviously not realistic and natural enough, which causes many games to give players an indescribable sense of disharmony.

[0145] On the other hand, although global illumination has ideal effects, it requires a lot of calculations for light bounces. Therefore, for a long time, lighting technology can only be used in non-real-time rendering fields such as CG and movies.

[0146] However, with the advancement of hardware technology, GI in modern game engines has gradually evolved from early pre-calculated global illumination technologies, such as lightmaps and light probes, to dynamic global illumination technologies with excellent effects such as UE5Lumen.

[0147] For example, the method provided in the embodiment of the present application can use the Lumen global light technology of the Unreal Engine to easily generate bounce light directly between hairs, which well reflects the global physical lighting and makes the hair effect more realistic.

[0148] In actual application, Unreal Engine's real-time rendering is fast, and its efficiency is greatly improved compared to Maya's offline rendering, and the hardware cost of rendering can be greatly reduced.

[0149] As can be seen from the technical solutions described above, the method provided in the embodiments of the present application can construct a grayscale map corresponding to the model of the virtual object and use the grayscale map to determine the number of hairs to be generated. This can reduce the performance requirements of computing resources during the hair generation process, avoid generating an excessive number of hairs, and thus increase the hair generation speed. Furthermore, a preset random function and grayscale map can be used to render the color, material, and gloss of the generated hair. While improving the hair rendering speed, the visual effect of the hair can also be made more realistic and better. High-quality hair visual effects can be generated using a minimum number of hairs. By generating multiple layers of hair of different lengths and combining them to form a rich visual experience, the hair rendering effect can achieve film-quality hair effects. In the real-time rendering engine, by controlling the thickness changes of each layer of hair and the roughness of the hair material, and adjusting the ambient lighting effect in real time, further visual efficiency is achieved. The process flow of 3D hair production and rendering is improved, and hair guide curves are used to draw hair, and the final hair effect rendering is performed by Unreal Engine 5. The final rendering effect of hair can be displayed in real time, solving the problems of long rendering waits and long rendering time of single-frame effects caused by the existing offline hair rendering method. By using the real-time hair rendering method, the hair rendering effect can be effectively achieved as what you see is what you get, and the character can be interpreted in real time with the final film effect of real hair visual effects.

[0150] As can be seen from the above description, when it is necessary to generate and render hair based on a target object model corresponding to a user's requirement for hair generation, the method provided in the embodiments of the present application can construct a target three-dimensional grayscale map of the target object model corresponding to the user's requirement for hair generation. The following describes the process, which may include the following steps:

[0151] Step S201 : analyzing the user's need for generating hair, and determining a target object model corresponding to the hair that the user needs to generate.

[0152] Specifically, in actual application, when the user has the need to generate and render hair, the method provided in the embodiment of the present application can analyze the user's need to generate hair and determine the target object model of the hair that the user needs to generate.

[0153] The target object model may be a hair model constructed based on user needs.

[0154] The target object model can be used to determine the amount of hair, hair color, and hair length that needs to be generated.

[0155] Step S202: determining the grayscale value of the color of the hair to be generated based on the target object model.

[0156] Specifically, as can be seen from the above introduction, the method provided in the embodiment of the present application can analyze the user's demand for generating hair and determine the target object model of the hair that the user needs to generate.

[0157] in,

[0158] The hair color to be generated can be determined through the target object model.

[0159] Furthermore, after the target object model is determined, the grayscale value of the color of the hair to be generated may be determined based on the target object model.

[0160] The grayscale value of the color of the hair to be generated is determined so that the hair to be generated can be determined according to the grayscale value of the color of the hair to be generated.

[0161] Step S203: setting the length of the hair to be generated according to the grayscale value of the color of the hair to be generated.

[0162] Specifically, as can be seen from the above introduction, the method provided in the embodiment of the present application can determine the grayscale value of the color of the hair to be generated based on the target object model.

[0163] The grayscale value of the hair can reflect the color depth of the hair. The larger the grayscale value of the hair, the darker the hair color.

[0164] Therefore, after determining the grayscale value of the color of the hair to be generated, the length of the hair to be generated can be set according to the grayscale value of the color of the hair to be generated.

[0165] During the actual rendering process, the length of the hair can be controlled according to the grayscale value of the color. The smaller the grayscale value and the whiter the area, the longer the hair length can be, and the larger the grayscale value and the darker the area, the shorter the hair length. The overall length of the hair to be generated can be controlled in conjunction with the target three-dimensional grayscale map.

[0166] For example, Figure 3 A schematic diagram showing an example of hair rendering effect.

[0167] from Figure 3 The rendering effect of the puppy's hair is very natural. The gray area of the puppy's hair looks thicker and shorter, while the white area's hair is longer and less abundant than the gray area.

[0168] Step S204 : generating a target three-dimensional grayscale map of the target object model corresponding to the user's requirement for hair generation according to the length and color of the hair to be generated.

[0169] Specifically, as can be seen from the above introduction, the method provided in the embodiment of the present application can set the length of the hair to be generated according to the grayscale value of the color of the hair to be generated.

[0170] After determining the length and color of the hair to be generated, a target three-dimensional grayscale map of the target object model corresponding to the user's requirements for hair generation may be generated based on the length and color of the hair to be generated.

[0171] As can be seen from the technical solutions described above, the method provided in the embodiment of the present application can generate and render hair based on a target object model corresponding to the user's demand for hair generation. The method provided in the embodiment of the present application can construct a target three-dimensional grayscale map of the target object model corresponding to the user's demand for hair generation, so that the number of hairs and the hairs to be generated can be determined based on the target three-dimensional grayscale map, thereby achieving a high-quality hair visual effect using a smaller number of hairs. The method provided in the embodiment of the present application can achieve the same visual effect with a smaller number of hairs than the number of hairs required by traditional rendering technologies. Since the number of hairs required for the same visual effect is reduced, the performance overhead of the GPU during hair rendering can be reduced, and the speed of hair rendering can also be increased.

[0172] As can be seen from the above description, after hair is generated, it needs to be rendered to achieve the visual effect required by the user. The method provided in the embodiment of the present application can set the parameters of the first target hair to be rendered based on a preset random function and the target three-dimensional grayscale map. The following describes this process, which may include the following steps:

[0173] Step S301 : dividing the area corresponding to the target three-dimensional grayscale map into different hair division areas according to the grayscale value distribution of the target three-dimensional grayscale map.

[0174] Specifically, as can be seen from the above introduction, the method provided in the embodiment of the present application can determine the target three-dimensional grayscale map.

[0175] The target three-dimensional grayscale map may reflect the grayscale value of each pixel corresponding to the target object model.

[0176] Furthermore, after the target three-dimensional grayscale map is determined, the area corresponding to the target three-dimensional grayscale map may be divided into different hair division areas according to the grayscale value distribution of the target three-dimensional grayscale map.

[0177] This allows you to generate and render hair based on different hair division areas to achieve the desired hair visual effect.

[0178] The area with longer hair can reduce the amount of hair, while the area with shorter hair can increase the amount of hair.

[0179] Among them, because longer hair is more likely to show a dense feeling from the visual effect, it is difficult to see the skin underneath the hair. Therefore, the amount of hair will be reduced in the area with longer hair.

[0180] Because shorter hair tends to reveal the skin underneath, the amount of hair in areas with shorter hair needs to be increased accordingly to bring out the overall visual effect.

[0181] Step S302: Setting the parameters of each hair division area according to the preset random function to control the thickness of the hair corresponding to each hair division area.

[0182] Specifically, as can be seen from the above introduction, the method provided in the embodiment of the present application can divide the area corresponding to the target three-dimensional grayscale map into different hair division areas according to the grayscale value distribution of the target three-dimensional grayscale map.

[0183] After the area corresponding to the target three-dimensional grayscale map is divided into different hair divided areas, the number of hairs, hair colors, and hair lengths in each different hair divided area are different.

[0184] In the actual rendering process, different visual effects of rendering hair are achieved by setting the parameters of the hair.

[0185] In terms of hair parameters, the traditional approach is to control the overall thickness of the hair. When the amount of hair is insufficient, the hair will be too thin, exposing the skin underneath, making the hair appear sparse and the visual effect poor. To solve this problem, the amount of hair needs to be doubled, which will correspondingly increase the cost of the rendering hardware.

[0186] In order to improve the hair rendering speed, after dividing the area corresponding to the target three-dimensional grayscale map into different hair division areas, the method provided in the embodiment of the present application can also set the parameters of each hair division area according to the preset random function to control the thickness of the hair corresponding to each hair division area.

[0187] By setting the parameters of each hair segmentation region using the preset random function to control the thickness of the hair corresponding to each hair segmentation region, the thickness of each hair can be effectively controlled without increasing hardware costs. This allows for efficient hair rendering with limited hardware costs.

[0188] From the technical solutions introduced above, it can be seen that the method provided in the embodiment of the present application can, after the hair is generated, need to render the hair to achieve the visual effect required by the user. The method provided in the embodiment of the present application can set the parameters of the first target hair to be rendered according to the preset random function and the target three-dimensional grayscale map, and further can use the preset random function and grayscale map to render the color, material, and gloss of the generated hair, while improving the hair rendering speed and making the visual effect of the hair more realistic and better, and can achieve the generation of high-quality hair with the least amount of hair. The hair visual effect is achieved by generating multiple layers of hair of different lengths to form a rich visual sense, which can make the hair rendering effect reach the film and television level of hair effect quality. In the real-time rendering engine, by controlling the thickness changes of each layer of hair and mixing it with the roughness of the hair material, and adjusting the ambient light effect in real time, further visual efficiency is achieved, which solves the problems of long rendering waits and long rendering time of single-frame effects caused by the existing offline hair rendering method. Through the real-time hair rendering method, the hair rendering effect can be effectively achieved as what you see is what you get, and the character can be interpreted in real time with the visual effect of real hair.

[0189] As can be seen from the above description, after hair is generated, it is necessary to render the hair to present the desired visual effect. The method provided in the embodiment of the present application can process the material parameters of the first target hair to be rendered to obtain the second target hair to be rendered. The following describes this process, which may include the following steps:

[0190] Step S401 : Rendering the color of the hair of the first target to be rendered using a standard material in a rendering engine in combination with a preset noise function and the target three-dimensional grayscale map.

[0191] Specifically, as can be seen from the above introduction, the method provided in the embodiment of the present application can determine the number of hairs to be generated and generate the hair to be rendered based on the target three-dimensional grayscale map.

[0192] After the hair is generated, the color of the hair is rendered to present the expected effect. When the hair needs to be rendered, the preset noise function and the target three-dimensional grayscale map can be combined to render the color of the first target hair to be rendered using the standard material in the rendering engine.

[0193] For example, in the actual rendering process, the color of the hair can be rendered and controlled through the standard material function in the rendering engine. At the same time, the color of the hair can be controlled and processed in combination with the preset noise function and the target three-dimensional grayscale map, so that the color of the hair can present a physically realistic visual effect of the hair.

[0194] For example, in UE's materials, you can generally use a set of general mother materials as standard materials. The mother material generates instance materials, which can be used in the materials of each model required for rendering; the mother material will expose the basic color map, highlight, brightness, reflection and other nodes in the instance material for adjustment of the required model. The mother material can also contain the noise function node prepared in advance, in which you can replace the corresponding model's map, UV and noise function map, control the adjustment parameters, and you can get the correct hair rendering effect you need.

[0195] in,

[0196] The preset noise function is similar to the preset random function introduced above, except that the map required by the preset noise function is a parameter or a map. The preset noise function is different from the preset random function in that the preset noise function can be controlled by a noise map, while the preset random function is controlled by a map and parameters.

[0197] Step S402 : Controlling the roughness of the highlight of the rendering engine in combination with the target three-dimensional grayscale map and a preset random function, so as to adjust the physical glossiness of the first target hair to be rendered.

[0198] Specifically, from the above introduction, it can be seen that the method provided in the embodiment of the present application can determine the target three-dimensional grayscale map, and can combine the preset noise function and the target three-dimensional grayscale map to render the color of the hair to be rendered of the first target using the standard material in the rendering engine.

[0199] After rendering the color of the hair, the visual effect of the hair color can be relatively close to the expected rendering effect, and the shadow and gloss of the hair still need to be further rendered.

[0200] Therefore, the target 3D grayscale map and a preset random function can be combined to control the roughness of the rendering engine's highlights, thereby adjusting the physical glossiness of the first target hair to be rendered. By using the preset random function in conjunction with the hair density map to process the roughness of the highlights, the physical glossiness of the hair can be made closer to the visual effect of real hair.

[0201] For example,

[0202] In combination with the target three-dimensional grayscale map and the preset random function, the process of controlling the roughness of the highlight of the rendering engine can be as follows:

[0203] According to the object's three-dimensional grayscale map, the specular roughness in the instance material of the random function value exposed in the parent material is read, which is equivalent to adding the random function value to the basic specular map material.

[0204] It can be seen from the technical solution introduced above that after the hair is generated, it is necessary to render the hair to present the expected visual effect. The method provided in the embodiment of the present application can combine the preset noise function and the target three-dimensional grayscale map, and use the standard material in the rendering engine to render the color of the first target hair to be rendered. In combination with the target three-dimensional grayscale map and the preset random function, the roughness of the highlight of the rendering engine is controlled to achieve the adjustment of the physical glossiness of the first target hair to be rendered, and to achieve the processing of the material parameters of the first target hair to be rendered, thereby enabling the rendering effect of the first target hair to be rendered to achieve the expected rendering visual effect.

[0205] The following describes a hair rendering speed improvement device provided in an embodiment of the present application. The hair rendering speed improvement device described below and the hair rendering speed improvement method described above can refer to each other.

[0206] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of a hair rendering speed improvement device disclosed in an embodiment of the present application.

[0207] like Figure 4 As shown, the hair rendering speed improving device may include:

[0208] A map construction unit 101 is used to construct a target three-dimensional grayscale map of a target object model corresponding to a user's requirement for generating hair;

[0209] The hair generation unit 102 is configured to determine the number of hairs corresponding to a user's needs based on the target three-dimensional grayscale map, and generate first target hairs to be rendered corresponding to the number of hairs corresponding to the user's needs;

[0210] A hair parameter setting unit 103 is used to set the parameters of the first target hair to be rendered according to a preset random function and the target three-dimensional grayscale map;

[0211] A first rendering unit 104 is configured to process the material parameters of the first target hair to be rendered to obtain a second target hair to be rendered;

[0212] The second rendering unit 105 is configured to process the illumination parameters of the second target hair to be rendered to obtain target rendered hair.

[0213] It can be seen from the technical solution introduced above that when it is necessary to render the hair of a virtual object, the device provided by the embodiment of the present application can construct a target three-dimensional grayscale map of the target object model corresponding to the user's demand for generating hair; so that the number of hairs corresponding to the user's demand can be determined based on the target three-dimensional grayscale map, and the first target hair to be rendered corresponding to the number of hairs corresponding to the user's demand can be generated; by determining the corresponding number of hairs based on the target three-dimensional grayscale map, the number of hairs can be determined based on the color of each area of the target three-dimensional grayscale map, so that the overall visual effect of the hair is better, and the number of hairs can be evenly distributed, which can reduce the resource requirements for hardware devices and reduce the performance overhead of hardware devices. Furthermore, after generating the first target hair to be rendered corresponding to the number of hairs corresponding to the user's needs, the parameters of the first target hair to be rendered can be set according to a preset random function and the target three-dimensional grayscale map, so that the thickness of hair of different lengths can be accurately controlled, so that the final presentation effect of the hair is smoother and more delicate, and the overall layering of the hair is enhanced; further, the material parameters of the first target hair to be rendered can be processed to make the length and thickness of the hair more consistent, so that the overall visual effect of the hair is better, thereby obtaining the second target hair to be rendered; after obtaining the second target rendered hair, the lighting parameters of the second target hair to be rendered can also be processed to make the glossiness and color of the hair more realistic, thereby obtaining the target rendered hair.

[0214] The apparatus provided in the embodiments of the present application can construct a grayscale map corresponding to the model of the virtual object and use the grayscale map to determine the number of hairs to be generated. This can reduce the performance requirements of computing resources during the hair generation process, avoid generating an excessive number of hairs, and thus increase the hair generation speed. Furthermore, a preset random function and grayscale map can be used to render the color, material, and gloss of the generated hair. While improving the hair rendering speed, the visual effect of the hair can also be made more realistic and better. High-quality hair visual effects can be generated using a minimum number of hairs. By generating multiple layers of hair of different lengths and combining them to form a rich visual experience, the hair rendering effect can achieve film-quality hair effects. In a real-time rendering engine, by controlling the thickness changes of each layer of hair and the roughness of the hair material, and adjusting the ambient lighting effect in real time, further visual enhancement is achieved. The process flow of three-dimensional hair production and rendering is improved, and hair guide curves are used to draw hair, and the final hair effect rendering is performed by the Unreal Engine 5. The final rendering effect of hair can be displayed in real time, solving the problems of long rendering waits and long rendering time of single-frame effects caused by the existing offline hair rendering method. By using the real-time hair rendering method, the hair rendering effect can be effectively achieved as what you see is what you get, and the character can be interpreted in real time with the final film effect of real hair visual effects.

[0215] Further optionally, the texture construction unit 101 may include:

[0216] A demand analysis unit, configured to analyze the user's demand for hair generation and determine a target object model corresponding to the hair that the user needs to generate;

[0217] a grayscale value determining unit, configured to determine the grayscale value of the color of the hair to be generated based on the target object model;

[0218] a hair length setting unit, configured to set the length of the hair to be generated according to the grayscale value of the color of the hair to be generated;

[0219] The map generating unit is used to generate a target three-dimensional grayscale map of the target object model corresponding to the user's requirements for generating hair according to the length and color of the hair to be generated.

[0220] Further optionally, the hair parameter setting unit 103 may include:

[0221] a hair region division unit, configured to divide the region corresponding to the target three-dimensional grayscale map into different hair division regions according to the grayscale value distribution of the target three-dimensional grayscale map;

[0222] The hair area parameter setting unit is used to set the parameters of each hair divided area according to the preset random function to control the thickness of the hair corresponding to each hair divided area.

[0223] Further optionally, the first rendering unit 104 may include:

[0224] a hair color rendering unit, configured to render the color of the first target hair to be rendered using a standard material in a rendering engine in combination with a preset noise function and the target three-dimensional grayscale map;

[0225] A highlight control unit is used to control the roughness of the highlight of the rendering engine in combination with the target three-dimensional grayscale map and a preset random function, so as to adjust the physical glossiness of the hair to be rendered of the first target.

[0226] Further optionally, the execution process of the second rendering unit 105 may include:

[0227] Using the global illumination technology within the Unreal Engine, the lighting parameters of the second target hair to be rendered are processed to achieve direct bounce lighting between the hairs, reflecting global physical lighting for the second target hair to be rendered. The specific processing flow of each unit included in the hair rendering speed-enhancing device can be found in the description of the hair rendering speed-enhancing method above and will not be repeated here.

[0228] The hair rendering speed improvement device provided in the embodiment of the present application can be applied to a hair rendering speed improvement device, such as a terminal: a mobile phone, a computer, etc. Optionally, Figure 5 The hardware structure diagram of the hair rendering speed improvement device is shown. Figure 5 The hardware structure of the hair rendering speed improvement device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4.

[0229] In an embodiment of the present application, the number of processor 1 , communication interface 2 , memory 3 , and communication bus 4 is at least one, and the processor 1 , communication interface 2 , and memory 3 communicate with each other through the communication bus 4 .

[0230] The processor 1 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application;

[0231] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory;

[0232] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to implement each processing flow in the aforementioned terminal hair rendering speed improvement solution.

[0233] An embodiment of the present application further provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to implement various processing flows of the aforementioned terminal in the hair rendering speed improvement solution.

[0234] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0235] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0236] The above description of the disclosed embodiments is intended to enable those skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. The various embodiments may be combined with one another. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for improving hair rendering speed, characterized in that: include: Constructing a target three-dimensional grayscale map of a target object model corresponding to the user's requirements for generating hair; Determining a number of hairs corresponding to a user's needs based on the target three-dimensional grayscale map, and generating first target hairs to be rendered corresponding to the number of hairs corresponding to the user's needs; the number of hairs is determined based on the color of each area of the target three-dimensional grayscale map; Setting parameters of the first target hair to be rendered according to a preset random function and the target three-dimensional grayscale map; The parameters of the first target hair to be rendered are used to indicate the thickness of hair of different lengths, wherein the number, color, and length of hair are different in different hair division areas obtained based on the area division corresponding to the target three-dimensional grayscale map; Processing the material parameters of the first target hair to be rendered to obtain a second target hair to be rendered; the second target hair to be rendered is the hair to be rendered after rendering the color of the first target hair to be rendered and adjusting the physical glossiness of the first target hair to be rendered, wherein the adjustment of the physical glossiness is achieved by controlling the roughness of the highlights of the rendering engine in combination with the target three-dimensional grayscale map and a preset random function, wherein the controlled roughness of the highlights is the roughness of the highlights in the instance material of the random function value exposed in the parent material; The illumination parameters of the second target hair to be rendered are processed to obtain target rendered hair.

2. The method according to claim 1, characterized in that The step of constructing a target three-dimensional grayscale map of a target object model corresponding to the user's requirement for hair generation includes: Analyze the user's needs for hair generation and determine the target object model that matches the hair that the user needs to generate; Determining the grayscale value of the color of the hair to be generated based on the target object model; Setting the length of the hair to be generated according to the grayscale value of the color of the hair to be generated; A target three-dimensional grayscale map of a target object model corresponding to the user's requirement for hair generation is generated according to the length and color of the hair to be generated.

3. The method according to claim 1, characterized in that The step of setting the parameters of the first target hair to be rendered according to a preset random function and the target three-dimensional grayscale map includes: Dividing the area corresponding to the target three-dimensional grayscale map into different hair division areas according to the grayscale value distribution of the target three-dimensional grayscale map; The parameters of each hair division area are set according to the preset random function to control the thickness of the hair corresponding to each hair division area.

4. The method according to claim 1, wherein The processing of the material parameters of the first target hair to be rendered to obtain the second target hair to be rendered includes: Combining a preset noise function and the target three-dimensional grayscale map, rendering the color of the first target hair to be rendered using a standard material in a rendering engine; In combination with the target three-dimensional grayscale map and a preset random function, the roughness of the highlight of the rendering engine is controlled to adjust the physical glossiness of the first target hair to be rendered.

5. The method according to claim 1, wherein Processing the illumination parameters of the second target hair to be rendered to obtain target rendered hair includes: The global light technology in the Unreal Engine is used to process the lighting parameters of the hair of the second target to be rendered, so as to achieve direct bounce lighting between the hairs, thereby reflecting the global physical lighting of the hair of the second target to be rendered.

6. A device for improving hair rendering speed, characterized in that: include: A texture construction unit, configured to construct a target three-dimensional grayscale texture of a target object model corresponding to a user's requirement for hair generation; a hair generation unit, configured to determine, based on the target three-dimensional grayscale map, a number of hairs corresponding to a user's requirement, and generate first target hairs to be rendered corresponding to the number of hairs corresponding to the user's requirement; the number of hairs is determined based on the color of each region of the target three-dimensional grayscale map; a hair parameter setting unit, configured to set parameters of the first target hair to be rendered based on a preset random function and the target three-dimensional grayscale map; the parameters of the first target hair to be rendered are used to indicate the thickness of hair of different lengths, wherein the number, color, and length of hair in each different hair partition area obtained based on the area partition corresponding to the target three-dimensional grayscale map are different; a first rendering unit, configured to process material parameters of the first target hair to be rendered to obtain a second target hair to be rendered; the second target hair to be rendered is the hair to be rendered after rendering the color of the first target hair to be rendered and adjusting the physical glossiness of the first target hair to be rendered, wherein the adjustment of the physical glossiness is achieved by controlling the roughness of the highlights of the rendering engine in combination with the target three-dimensional grayscale map and a preset random function, wherein the controlled roughness of the highlights is the roughness of the highlights in the instance material of the random function value exposed in the parent material; The second rendering unit is used to process the illumination parameters of the second target hair to be rendered to obtain target rendered hair.

7. The device according to claim 6, characterized in that The mapping construction unit includes: A demand analysis unit, configured to analyze the user's demand for hair generation and determine a target object model corresponding to the hair that the user needs to generate; a grayscale value determining unit, configured to determine the grayscale value of the color of the hair to be generated based on the target object model; a hair length setting unit, configured to set the length of the hair to be generated according to the grayscale value of the color of the hair to be generated; The map generating unit is used to generate a target three-dimensional grayscale map of the target object model corresponding to the user's requirements for generating hair according to the length and color of the hair to be generated.

8. The device according to claim 6, characterized in that The hair parameter setting unit includes: a hair region division unit, configured to divide the region corresponding to the target three-dimensional grayscale map into different hair division regions according to the grayscale value distribution of the target three-dimensional grayscale map; The hair area parameter setting unit is used to set the parameters of each hair divided area according to the preset random function to control the thickness of the hair corresponding to each hair divided area.

9. A device for improving hair rendering speed, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, implement the steps of the method for improving hair rendering speed according to any one of claims 1 to 5.

10. A readable storage medium, characterized in that: The readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors implement the steps of the hair rendering speed improvement method according to any one of claims 1 to 5.