Efficient real-time game image rendering method and device, medium and program product

Through the method of combining inserts and shells, combined with vertex baking models and virtual particles, efficient hair rendering is achieved, which solves the problems of poor hair rendering and low efficiency in the existing technology, and improves the authenticity and accuracy of rendering.

CN118823201AActive Publication Date: 2024-10-22BEIJING DELPHI TECHNOLOGY CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410749884.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-10-22
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

The existing technology has poor real-time rendering effect of animal hair in games, is prone to faults, and has low rendering efficiency, making it difficult to truly simulate the shape and dynamic changes of hair.

Method used

Use the insert method to create the outer layer of hair and the shell method to create the bottom layer of hair, and obtain the hair root vertex information through the vertex baking model, perform interpolation calculations based on the virtual particle position, and use the second-order Bezier curve to generate the position of the hair from the root to the top. , and perform rasterization, adjusting parameters based on inertia, gravity and wind to simulate the swing of hair.

Benefits of technology

It improves the authenticity and accuracy of hair rendering, reduces the amount of calculation and bandwidth usage, avoids fault phenomena, is suitable for real-time rendering on mobile platforms, and improves rendering efficiency and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118823201A_ABST
    Figure CN118823201A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an efficient real-time game image rendering method and device, a medium and a program product. The method comprises the steps that outer-layer hair of a target object in a to-be-rendered image is established in a sheet inserting mode, and bottom-layer fluff of the target object is established in a shell mode; according to a vertex baking model, hair root vertex information of the outer-layer hair and the bottom-layer villus is obtained, the vertex baking model is composed of N triangular faces, N is the number of vertexes of the target object, and one triangular face corresponds to one pixel of a map; and generating each position from the hair root to the hair top according to the vertex information of the hair root and the position of the virtual mass point, enabling each position to correspond to a pixel corresponding to a screen, and carrying out rasterization processing on the pixel to obtain a target rendered image. Through some embodiments of the invention, the rendering quality can be improved, so that the rendered image is more real.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of picture rendering, and specifically to a method, device, medium and program product for efficient real-time game image rendering. Background Art

[0002] There are many rendering scenarios involved in the field of image rendering, including the rendering of animal hair in games. In the relevant technologies, the solutions for real-time rendering of animal hair in games include: relying on artists to manually make hair inserts on the surface of objects in digital asset generation software, and then assigning them separate materials when rendering, and stacking and rendering the models multiple times at runtime, moving the vertices a certain distance along the normal direction each time, and stacking the shape of the hair with pixel-level cropping. However, the rendering effect of the above technical solutions is poor, and faults are prone to occur. When observed from the side, the hair may disappear.

[0003] Therefore, how to improve the rendering quality and make the rendered image more realistic becomes a problem that needs to be solved. Summary of the invention

[0004] The embodiments of the present application provide a method, device, medium and program product for efficient real-time game image rendering. Through some embodiments of the present application, at least the rendering quality can be improved, making the rendered image more realistic.

[0005] In a first aspect, the present application provides a method for efficient real-time game image rendering, the method comprising: using an insert to establish the outer layer of hair of a target object in a to-be-rendered screen, and using a shell to establish the underlying hair of the target object; obtaining the hair root vertex information of the outer layer of hair and the underlying hair according to a vertex baking model, wherein the vertex baking model is composed of N triangles, N is the number of vertices of the target object, and one triangle corresponds to one pixel of a map; generating each position from the hair root to the hair top according to the hair root vertex information and the position of a virtual particle, and corresponding each position to a pixel corresponding to the screen, performing rasterization processing on the pixel, and obtaining a target rendered image.

[0006] Therefore, the embodiment of the present application can realistically simulate animal hair and improve the realism of rendering by rendering the outer hair and bottom layer of hair of the target object; by generating each position from the root of the hair to the top of the hair, each position can be accurately rendered, thereby improving rendering accuracy.

[0007] In combination with the first aspect, in one embodiment of the present application, the vertex information of the hair roots of the outer layer of hair and the bottom layer of hair is obtained based on the vertex baking model, including: solving the vertex animation during the rendering process and writing the position of the target object in the vertex baking model into the corresponding pixel points; solving the vertex animation and writing the normal and tangent information of the vertices of the target object in the vertex baking model into the corresponding pixel points to obtain the vertex information of the hair roots.

[0008] Therefore, the embodiment of the present application can ensure that the pixel points corresponding to the target object include accurate data through two renderings, thereby improving the rendering accuracy.

[0009] In combination with the first aspect, in one embodiment of the present application, before generating each position from the hair root to the hair top based on the vertex information of the hair root and the position of the virtual particle, the method also includes: determining the position of the virtual particle corresponding to each vertex included in the target object, wherein the virtual particle is set on the target object, and the position of the virtual particle includes the position information of the current frame and the position information of the previous frame.

[0010] Therefore, the embodiments of the present application can reduce the amount of positioning data by setting virtual particles, and setting virtual particles on the target object can reduce the amount of calculation and ensure rendering efficiency.

[0011] In combination with the first aspect, in one embodiment of the present application, each position from the hair root to the hair top is generated based on the vertex information of the hair root and the position of the virtual particle, including: rendering to generate a position map of the virtual particle corresponding to each vertex, and updating the particle position, and writing the corresponding pixel point; interpolating the vertex information of the hair root with the position map of the virtual particle to obtain each position from the hair root to the hair top, wherein the interpolation calculation is completed by the second-order Bezier curve.

[0012] Therefore, the embodiment of the present application can accurately obtain each position from the hair root to the hair top by interpolating the vertex information of the hair root and the position map of the virtual particle.

[0013] In combination with the first aspect, in one embodiment of the present application, the outer layer of hair of the target object in the image to be rendered is established by using an insert, comprising: generating an insert perpendicular to the normal direction of the surface of the target object for each edge of the target object, and using the insert to establish the outer layer of hair of the target object in the image to be rendered.

[0014] In combination with the first aspect, in an implementation manner of the present application, the vertex information of the target object includes: a vertex ID, an X channel of a vertex texture mapping coordinate, and a Y channel of a vertex texture mapping coordinate.

[0015] In combination with the first aspect, in one embodiment of the present application, before corresponding each position to a pixel corresponding to the screen, the method also includes: obtaining parameters for characterizing inertia, gravity, and wind; adjusting each position by the parameters to obtain each target position; corresponding each position to a pixel corresponding to the screen includes: corresponding each target position to a pixel corresponding to the screen.

[0016] Therefore, the embodiment of the present application adjusts and renders each position by characterizing the parameters of inertia, gravity, and wind, and can truly simulate the swaying shape of the target object's hair during movement, thereby improving the accuracy and authenticity of the rendering.

[0017] In a second aspect, the present application provides a device for efficient real-time game image rendering, the device comprising:

[0018] The model building module is configured to build the outer layer of hair of the target object in the to-be-rendered picture by means of inserts, and to build the bottom layer of hair of the target object by means of shells.

[0019] The vertex calculation module is configured to obtain the vertex information of the hair roots of the outer layer of hair and the bottom layer of hair according to the vertex baking model, wherein the vertex baking model is composed of N triangular faces, N is the number of vertices of the target object, and one triangular face corresponds to one pixel of the map.

[0020] The image rendering module is configured to generate each position from the hair root to the hair top according to the vertex information of the hair root and the position of the virtual particle, correspond each position to the pixel corresponding to the screen, perform rasterization processing on the pixel, and obtain the target rendered image.

[0021] In combination with the second aspect, in one embodiment of the present application, the vertex calculation module is also configured to: solve vertex animation during the rendering process and write the position of the target object in the vertex baking model into the corresponding pixel points; solve vertex animation and write the normal and tangent information of the vertices of the target object in the vertex baking model into the corresponding pixel points to obtain the hair root vertex information.

[0022] In combination with the second aspect, in one embodiment of the present application, the image rendering module is further configured to: determine the position of a virtual particle corresponding to each vertex included in the target object, wherein the virtual particle is set on the target object, and the position of the virtual particle includes position information of a current frame and position information of a previous frame.

[0023] In combination with the second aspect, in one embodiment of the present application, the image rendering module is further configured to: render and generate a position map of the virtual particles corresponding to each vertex, update the particle positions, and write corresponding pixels; interpolate the vertex information of the hair root with the position map of the virtual particles to obtain each position from the hair root to the top of the hair, wherein the interpolation calculation is completed by the second-order Bezier curve.

[0024] In combination with the second aspect, in one embodiment of the present application, the model building module is further configured to: generate an insert perpendicular to the normal direction of the target object surface for each edge of the target object, and use the insert to build the outer layer of hair of the target object in the image to be rendered.

[0025] In combination with the second aspect, in an implementation of the present application, the vertex information of the target object includes: a vertex ID, an X channel of a vertex texture mapping coordinate, and a Y channel of a vertex texture mapping coordinate.

[0026] In combination with the second aspect, in one embodiment of the present application, the image rendering module is further configured to: obtain parameters used to characterize inertia, gravity and wind force; adjust each position according to the parameters to obtain each target position; correspond each target position to pixels corresponding to the screen.

[0027] In a third aspect, the present application provides an electronic device comprising: a processor, a memory and a bus; the processor is connected to the memory via the bus, the memory stores a computer program, and when the computer program is executed by the processor, it can implement the method described in any embodiment of the first aspect.

[0028] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed, can implement the method described in any embodiment of the first aspect.

[0029] In a fifth aspect, the present application provides a computer program product, including a computer program / instructions, which, when executed, can implement the method described in any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1A flowchart of a method for rendering game images shown in an embodiment of the present application;

[0031] Figure 2 This is one of the rendering schematic diagrams shown in the embodiment of the present application;

[0032] Figure 3 This is a second rendering schematic diagram showing an embodiment of the present application;

[0033] Figure 4 This is a third rendering diagram of an embodiment of the present application;

[0034] Figure 5 This is a fourth rendering diagram shown in an embodiment of the present application;

[0035] Figure 6 A schematic diagram of the device composition of the method for rendering game images shown in an embodiment of the present application;

[0036] Figure 7 A schematic diagram of the composition of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0038] In the related technology, artists use digital asset production software to place hair insert models on the surface of the model and assign separate materials for rendering. The defects are: first, the art production process is complicated, and the industrial production and iteration cycles are lengthy, resulting in extremely high production costs; second, the flexibility is poor, and it is impossible to dynamically adjust according to the platform performance and detail level, resulting in performance waste; third, the effect is not ideal, and it is difficult to express the messy, dense, and fine fur effects of animals.

[0039] In addition, the technical solution of stacking and rendering the model multiple times during runtime, moving the vertices a certain distance along the normal direction each time, and stacking the shape of the hair with pixel-level clipping has the following defects: first, the effect is not ideal, there is a fault phenomenon in the performance, and the hair disappears when observed from the side; second, the rendering efficiency is low, the number of vertices is huge, and a large number of pixels are discarded, resulting in a huge waste of performance.

[0040] In addition, the above two hair rendering solutions do not solve the problems of physical performance, shadow rendering, production process, etc. of the target object. Therefore, the rendering solutions in the related technologies are not suitable for real-time rendering of mobile platform games.

[0041] The embodiments of the present application can be applied to the real-time rendering scene of mobile platform games. Specifically, it can be used to render the animal hair in the scene, including: real-time hair rendering on the mobile terminal, hair animation support, and physical simulation of hair.

[0042] The following uses a mobile device as an example to illustrate a specific implementation of a real-time rendering method provided by some embodiments of the present application. It is understandable that the execution subject of the embodiments of the present application can be any electronic device that can run the method, such as a computer, a tablet computer, etc. The above mobile device is only an example and the present application does not limit this.

[0043] At least to solve the problems in the background technology, such as Figure 1 As shown, some embodiments of the present application provide a method for efficient real-time game image rendering, the method comprising:

[0044] S110, using an insert method to create the outer layer of hair of the target object in the to-be-rendered image, and using a shell method to create the bottom layer of hair of the target object.

[0045] Specifically, a patch perpendicular to the normal direction of the surface of the target object is generated for each edge of the target object, and the patch is used to establish the outer layer of hair of the target object in the image to be rendered.

[0046] That is to say, Figure 2-Figure 5 As shown, the original model of the target object in the rendered image is as follows Figure 2 As shown, for example, Figure 2 Can be a bird without rendered feathers, based on Figure 2 Each edge of the original model shown in , first confirm each edge of the original model, then establish an insert perpendicular to the normal direction of the surface on each edge, and obtain Figure 3 The patch model shown is based on which the hair of the target object is established.

[0047] After obtaining the insert model, use the insert method to create the longer and thicker outer protective hair of the target object in the rendered image. Figure 4 As shown, it can be understood that the length of the outer layer of hair can be greater than the length of the bottom layer of hair. At the same time, the shells are used for stacking, and the vertices are moved a certain distance along the normal direction to obtain the following Figure 5 The subject is shown with a matted, fine undercoat close to the skin.

[0048] Therefore, the embodiment of the present application can realistically simulate animal hair by rendering the outer hair and the bottom hair of the target object, combining the advantages of the insert method and the shell method to improve the authenticity of the rendering.

[0049] As a specific embodiment of the present application, the vertex information of the target object includes: a vertex ID, an X channel of a vertex texture mapping coordinate, and a Y channel of a vertex texture mapping coordinate.

[0050] That is to say, the embodiment of the present application integrates the steps of rendering, animation, and physical simulation, and also proposes a solution to optimize bandwidth usage based on the solution itself. That is, a unique, pre-generated model is used for each drawing step, and since the position, vector, physics and other information of the hair vertices are baked into the map in advance, only the minimum vertex information needs to be retained on the pre-generated model.

[0051] To draw the patch model, you need to determine the vertex position, vertex color, and triangle index:

[0052] The vertex position includes: the X channel (i.e., the vertex ID, used to identify the position of the vertex corresponding to the vertex information map), the Y channel (i.e., the X channel of the vertex texture mapping coordinates, used for main texture sampling), and the Z channel (i.e., the Y channel of the vertex texture mapping coordinates, used for main texture sampling).

[0053] Vertex colors include: R channel (i.e. the current hair layer ID), G channel (i.e. the total number of current hair layers), B channel (i.e. the transition value of the current hair layer (gradient from hair root 0 to hair tip 1)) and A channel (unused, can be reserved).

[0054] The triangle face index includes: the number of triangle faces.

[0055] The model used to draw the shell requires determining the vertex positions and triangle face indices:

[0056] The vertex position includes: the X channel (i.e., the vertex ID, used to identify the position of the vertex corresponding to the vertex information map), the Y channel (i.e., the X channel of the vertex texture mapping coordinates, used for main texture sampling), and the Z channel (i.e., the Y channel of the vertex texture mapping coordinates, used for main texture sampling).

[0057] The triangle face index includes: the number of triangle faces.

[0058] Therefore, through the above embodiments, the GPU does not need to load useless data (such as normals, tangents, model space positions, etc.) when binding the model, which can greatly reduce bandwidth usage and has a significant effect on reducing video memory usage, heat generation and power consumption.

[0059] S120, obtaining vertex information of hair roots of outer layer hair and bottom layer hair according to the vertex baking model.

[0060] It can be understood that the vertex baking model is composed of N triangles, where N is the number of vertices of the target object, and one triangle corresponds to one pixel of the map.

[0061] In one embodiment of the present application, the specific execution steps of S120 include: first, solving the vertex animation during the rendering process and writing the position of the target object in the vertex baking model into the corresponding pixel points, then solving the vertex animation and writing the normal and tangent information of the vertices of the target object in the vertex baking model into the corresponding pixel points to obtain the vertex information of the hair root.

[0062] That is to say, in order to enable the hair of the target object to follow the surface movement of the model, where the movement includes overall displacement, rotation, scaling and animation deformation, and is compatible with mobile platforms, this application uses a special method to bake the vertex position of each frame, including:

[0063] A vertex baking model is generated in advance, in which each vertex of the original model of the target object has a triangular face, that is, there are N triangular faces for N vertices, and the vertex information of the original model of the target object is stored on the three vertices of the triangular face.

[0064] During the running process, the above vertex baking model is rendered twice for each frame, where each triangle corresponds to a pixel of the map, that is, each map only needs a small size (for example, only 128×64 is needed on mobile devices) to occupy less bandwidth. During the first rendering process, after solving the vertex animation, the local spatial position is written to the corresponding pixel on the screen to obtain the first map. During the second rendering process, after solving the vertex animation, the normal and tangent information of the vertex is written to the corresponding pixel to obtain the second map. When rendering hair, the above first map and second map are read as the vertex information of the hair root.

[0065] It can be understood that the hair root is the end of the animal hair close to the skin.

[0066] Therefore, the embodiment of the present application can ensure that the pixel points corresponding to the target object include accurate data through two renderings, thereby improving the rendering accuracy.

[0067] S130, based on the vertex information of the hair root and the position of the virtual particle, each position from the hair root to the hair top is generated, and each position is corresponded to the pixel corresponding to the screen, and the pixel is rasterized to obtain the target rendered image.

[0068] In one implementation of the present application, the specific implementation steps of S130 are as follows:

[0069] S1301: Determine the position of a virtual particle corresponding to each vertex included in the target object.

[0070] It should be noted that the virtual mass point is set on the target object, and the position of the virtual mass point includes the position information of the current frame and the position information of the previous frame.

[0071] That is to say, since the scope of the world map is too wide, if the world map is used in the rendering process, it will lead to a large amount of calculation and inaccurate positioning. Therefore, this application uses the position of the virtual particle as a reference point, places the position of the virtual particle on the target object, and uses this as a reference point in the process of calculating the vertex to reduce the amount of calculation, and since the position of the virtual particle is relatively close to the position of each vertex of the target object, the positioning is relatively accurate.

[0072] For example, if the target object is a bird, the position of the virtual particle can be the bird's beak or the eye. The above examples are only examples and this application does not limit this.

[0073] Therefore, the embodiments of the present application can reduce the amount of positioning data by setting virtual particles, and setting virtual particles on the target object can reduce the amount of calculation and ensure rendering efficiency.

[0074] S1302: Render and generate a position map of the virtual particles corresponding to each vertex, update the particle positions, and write the corresponding pixels.

[0075] That is to say, the vertex baking model used for rendering the position map and vector map in the above technical solution is still used, and a virtual mass point is set for each vertex in the original model of the target object for subsequent physical simulation (including inertia, gravity and wind force), wherein each mass point only needs to record the position information of the current and previous frames. During runtime, the vertex baking model is rendered once per frame, and the mass point position map is generated by rendering, and the mass point position is updated using the Verret integral and written into the corresponding pixel.

[0076] It can be understood that the above-described use of Verleigh integrals to update the particle position is only one implementation method for updating the particle position, and the present application does not limit this.

[0077] S1303: Perform interpolation calculation on the vertex information of the hair root and the position map of the virtual particle to obtain each position from the hair root to the hair top, wherein the interpolation calculation is completed by a second-order Bezier curve.

[0078] That is to say, the particle position map will be read when rendering hair to affect the shape of hair. According to the vertex information and particle position of the hair root, each position of the hair from the root to the tip can be interpolated through the second-order Bezier curve. At the same time, each position needs to correspond to the screen pixel point. Among them, the starting point of the Bezier curve is the hair root position, the end point of the Bezier curve is the particle position, and the Bezier curve control point is set by the user as an external parameter.

[0079] Therefore, the embodiment of the present application can accurately obtain each position from the hair root to the hair top by interpolating the vertex information of the hair root with the position map of the virtual particle. By generating each position from the hair root to the hair top, each position can be accurately rendered, thereby improving the rendering accuracy.

[0080] S1304: Obtain parameters for characterizing inertia, gravity, and wind force, and then adjust each position by the parameters to obtain each target position.

[0081] That is to say, in order to ensure that the hair rendering is more realistic, it is necessary to render the physical changes of hair in the real world due to the influence of the environment. The change parameters of inertia, gravity and wind force need to be pre-set first. After obtaining each position from the root of the hair to the top of the hair, each position from the root of the hair to the top of the hair needs to be adjusted by these parameters. For example, after the target object accelerates to fly, due to inertia, each position from the root of the hair to the top of the hair needs to continue to move forward in the next frame after stopping in the current frame.

[0082] It is understandable that the above parameters of physical changes are only examples and the present application does not limit them.

[0083] Therefore, the embodiment of the present application adjusts and renders each position by characterizing the parameters of inertia, gravity, and wind, and can truly simulate the swaying shape of the target object's hair during movement, thereby improving the accuracy and authenticity of the rendering.

[0084] S1305: Correspond each target position to a pixel corresponding to the screen, perform rasterization processing on the pixel, and obtain a target rendered image.

[0085] That is, after obtaining each target position from the hair root to the hair top after physical change adjustment, each target position is mapped to a corresponding pixel, and then the pixel is processed in color, gloss, etc. to obtain a target rendered image.

[0086] Therefore, based on the above-mentioned implementation methods, the present application has better rendering performance, that is, there is no sense of discontinuity, and it has a good plush feeling when observed from the side; it is suitable for physical performance on mobile terminals, that is, the mobile terminal can also get real physical feedback in real time when the object moves, and even achieve real-time physical interaction with surrounding objects; higher production and iteration efficiency, that is, the process can be programmed and automated, and the user can observe the effect changes in real time with one-click update; better flexibility, that is, the number of hair layers drawn, animation update frequency, etc. can be automatically adjusted according to the platform performance and detail level, so as to better perform performance grading; it is suitable for high rendering efficiency on mobile platforms, that is, the number of vertices and triangles that need to be drawn are greatly reduced, and the bandwidth occupancy is improved compared with related technologies under the same performance.

[0087] The above describes a specific embodiment of a method for efficient real-time game image rendering, and the following will describe a method for efficient real-time game image rendering.

[0088] like Figure 6 As shown, some embodiments of the present application provide a real-time rendering device 600 , which includes: a model building module 610 , a vertex calculation module 620 , and an image rendering module 630 .

[0089] The model building module 610 is configured to build the outer hair of the target object in the to-be-rendered image by using an insert, and to build the bottom hair of the target object by using a shell.

[0090] The vertex calculation module 620 is configured to obtain the hair root vertex information of the outer layer of hair and the bottom layer of hair according to a vertex baking model, wherein the vertex baking model is composed of N triangles, N is the number of vertices of the target object, and one triangle corresponds to one pixel of the map.

[0091] The image rendering module 630 is configured to generate each position from the hair root to the hair top according to the vertex information of the hair root and the position of the virtual particle, correspond each position to the pixel corresponding to the screen, rasterize the pixel, and obtain the target rendered image.

[0092] In one embodiment of the present application, the vertex calculation module 620 is also configured to: solve vertex animation during the rendering process and write the position of the target object in the vertex baking model into the corresponding pixel points; solve vertex animation and write the normal and tangent information of the vertices of the target object in the vertex baking model into the corresponding pixel points to obtain the hair root vertex information.

[0093] In one embodiment of the present application, the image rendering module 630 is further configured to: determine the position of a virtual particle corresponding to each vertex included in the target object, wherein the virtual particle is set on the target object, and the position of the virtual particle includes position information of a current frame and position information of a previous frame.

[0094] In one embodiment of the present application, the image rendering module 630 is further configured to: render and generate a position map of the virtual particles corresponding to each vertex, update the particle positions, and write corresponding pixels; interpolate the vertex information of the hair root with the position map of the virtual particles to obtain each position from the hair root to the top of the hair, wherein the interpolation calculation is completed by the second-order Bezier curve.

[0095] In one embodiment of the present application, the model building module 610 is further configured to: generate an insert perpendicular to the normal direction of the target object surface for each edge of the target object, and use the insert to build the outer layer of hair of the target object in the image to be rendered.

[0096] In one implementation of the present application, the vertex information of the target object includes: a vertex ID, an X channel of a vertex texture mapping coordinate, and a Y channel of a vertex texture mapping coordinate.

[0097] In one embodiment of the present application, the image rendering module 630 is further configured to: obtain parameters for characterizing inertia, gravity, and wind force; adjust each position by the parameters to obtain each target position; correspond each target position to a pixel corresponding to the screen;

[0098] In the embodiments of the present application, Figure 6 The modules shown can achieve Figures 1 to 5 Each process in the method embodiment. Figure 6 The operations and / or functions of each module in Figures 1 to 5 For details, please refer to the description in the above method embodiment. To avoid repetition, detailed description is appropriately omitted here.

[0099] like Figure 7 As shown, an embodiment of the present application provides an electronic device 700, including: a processor 710, a memory 720 and a bus 730, wherein the processor is connected to the memory via the bus, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, they are used to implement a method as described in any one of the above embodiments. For details, please refer to the description in the above method embodiments. To avoid repetition, the detailed description is appropriately omitted here.

[0100] Among them, the bus is used to realize the direct connection and communication of these components. Among them, the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0101] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method described in the above embodiment may be executed.

[0102] Understandably, Figure 7 The structure shown is for illustration only and may also include Figure 7 More or fewer components as shown, or with Figure 7 Different configurations are shown. Figure 7 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0103] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a server, any method described in any of the above-mentioned embodiments is implemented. For details, please refer to the description in the above-mentioned method embodiments. To avoid repetition, the detailed description is appropriately omitted here.

[0104] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0105] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for efficient real-time game image rendering, characterized in that: The method comprises: Using inserts to create the outer layer of hair of the target object in the to-be-rendered image, and using shells to create the bottom layer of hair of the target object; Obtaining vertex information of the hair roots of the outer layer of hair and the bottom layer of hair according to a vertex baking model, wherein the vertex baking model is composed of N triangular faces, N is the number of vertices of the target object, and one triangular face corresponds to one pixel of a map; According to the vertex information of the hair root and the position of the virtual particle, each position from the hair root to the hair top is generated, and each position is corresponded to the pixel corresponding to the screen, and the pixel is rasterized to obtain the target rendered image.

2. The method according to claim 1, characterized in that The step of obtaining the vertex information of the hair roots of the outer layer of hair and the bottom layer of hair according to the vertex baking model includes: During the rendering process, vertex animation is solved and the position of the target object in the vertex baking model is written into the corresponding pixel point; The vertex animation is solved and the normal and tangent information of the vertices of the target object in the vertex baking model is written into corresponding pixel points to obtain the vertex information of the hair root.

3. The method according to claim 1, characterized in that Before generating each position from the hair root to the hair top according to the hair root vertex information and the position of the virtual particle, the method further comprises: The position of a virtual mass point corresponding to each vertex included in the target object is determined, wherein the virtual mass point is set on the target object, and the position of the virtual mass point includes position information of a current frame and position information of a previous frame.

4. The method according to claim 3, characterized in that The step of generating each position from the hair root to the hair top according to the hair root vertex information and the position of the virtual particle comprises: Rendering generates a position map of virtual particles corresponding to each vertex, and updates the positions of the particles and writes corresponding pixels; The hair root vertex information and the position map of the virtual particle are interpolated to obtain each position from the hair root to the hair top, wherein the interpolation calculation is completed by the second-order Bezier curve.

5. The method according to any one of claims 1 to 4, characterized in that: The method of using the insert to establish the outer layer hair of the target object in the to-be-rendered picture includes: A patch is generated for each edge of the target object in a direction perpendicular to the normal line of the surface of the target object, and the outer layer of hair of the target object in the to-be-rendered picture is established using the patch.

6. The method according to any one of claims 1 to 4, characterized in that: The vertex information of the target object includes: a vertex ID, an X channel of a vertex texture mapping coordinate, and a Y channel of a vertex texture mapping coordinate.

7. The method according to any one of claims 1 to 4, characterized in that: Before the step of corresponding each position to a pixel corresponding to the screen, the method further comprises: Obtain parameters for characterizing inertia, gravity, and wind forces; Adjust each position by the parameters to obtain each target position; The step of corresponding each position to a pixel corresponding to the screen includes: Each target position is mapped to a pixel corresponding to the screen.

8. An electronic device, characterized in that: include: processor, memory, and bus; The processor is connected to the memory via the bus, the memory stores a computer program, and the computer program, when executed by the processor, can implement the method as claimed in any one of claims 1 to 9.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed, can implement the method as claimed in any one of claims 1 to 9.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed, the method according to any one of claims 1 to 7 can be implemented.

Citation Information

Patent Citations

  • Image rendering method and device, electronic equipment and storage medium

    CN113822981A

  • Hair rendering method, device and storage medium

    CN113888688A

  • Fuzz effect generation method and system, equipment, medium and product

    CN113989395A

  • Hair rendering method, device and equipment for virtual object

    CN114119821A

  • Hair treatment method, device and equipment for virtual object, medium and program product

    CN115641375A