Virtual object model rendering method and device, computer equipment and storage medium

By obtaining a mask texture of the virtual object model, expanding the object area, determining the external contour special area, and obtaining special effects stickers, the virtual object model is rendered, solving the problem of unable to adjust the flame combustion effect in the existing technology, and achieved more flexibility And rich style special effects.

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

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, the flame combustion effect is realized by pre-rendering maps and cannot be adjusted according to the dynamic changes of the scene, resulting in duplication and singular visual effects.

Method used

By determining the virtual object model to be rendered, obtain the mask map, expand the object area, determine the outer contour special effect area, obtain special effects maps, and render the virtual object model based on these elements.

Benefits of technology

The flexible performance of the style and special effects of the virtual object model can be improved, and the flame combustion effect can be adjusted according to the dynamic changes of the scene to avoid the duplicate and single of the visual effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379837A_ABST
    Figure CN119379837A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a rendering method and device of a virtual object model, computer equipment and a computer readable storage medium. According to the scheme, the to-be-rendered virtual object model is determined; acquiring a mask map of the virtual object model, wherein the mask map comprises a background area and an object area corresponding to the virtual object model; performing expansion processing on an object area in the mask map to obtain an expanded object area; based on the expanded object area and the object area, determining an outer contour special effect area of the virtual object model; obtaining a special effect map corresponding to the target special effect; and rendering the virtual object model based on the outer contour special effect region and the special effect map. Therefore, the flexible performance of the stylized special effect of the virtual object model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a rendering method, device, computer equipment and computer-readable storage medium for a virtual object model. Background Art

[0002] In stylized art games, exaggerated visual effects are crucial to improving user experience and increasing visual impact. Among various visual effects, the flame burning effect is widely used in character design, scene rendering, animation production and other fields due to its dynamic changes and visual impact.

[0003] In the related art, flame burning effects are usually achieved by pre-rendering textures, that is, the flame rendering texture is pre-generated in the development process, and only the rendering image needs to be simply called at runtime. However, the pre-rendering texture to achieve the character flame effect cannot be adjusted according to the dynamic changes of the scene, lacks flexibility, and may lead to repeated and monotonous visual effects. Summary of the invention

[0004] The embodiments of the present application provide a rendering method, apparatus, computer device, and computer-readable storage medium for a virtual object model, which can improve the flexible expression of stylized special effects of the virtual object model.

[0005] The present application provides a method for rendering a virtual object model, including:

[0006] Determining a virtual object model to be rendered;

[0007] Acquire a mask map of the virtual object model, wherein the mask map includes a background area and an object area corresponding to the virtual object model;

[0008] Expanding the object area in the mask map to obtain an expanded object area;

[0009] Determining an outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area;

[0010] Get the special effect map corresponding to the target special effect;

[0011] The virtual object model is rendered based on the outer contour special effect area and the special effect map.

[0012] Accordingly, an embodiment of the present application further provides a rendering device for a virtual object model, comprising:

[0013] A first determining unit, used to determine a virtual object model to be rendered;

[0014] A first acquisition unit, configured to acquire a mask map of the virtual object model, wherein the mask map includes a background area and an object area corresponding to the virtual object model;

[0015] A processing unit, configured to enlarge the object region in the mask map to obtain an enlarged object region;

[0016] A second determining unit, configured to determine an outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area;

[0017] A second acquisition unit, used to acquire a special effect map corresponding to a target special effect;

[0018] A rendering unit is used to render the virtual object model based on the outer contour special effect area and the special effect map.

[0019] Correspondingly, an embodiment of the present application further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes any mapping processing method provided in the embodiments of the present application.

[0020] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute the above-mentioned mapping processing method.

[0021] The embodiment of the present application determines a virtual object model to be rendered; obtains a mask map of the virtual object model, the mask map includes a background area and an object area corresponding to the virtual object model; enlarges the object area in the mask map to obtain an enlarged object area; determines the outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area; obtains a special effect map corresponding to the target special effect; and renders the virtual object model based on the outer contour special effect area and the special effect map. In this way, the flexible expression of the stylized special effects of the virtual object model can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 A flowchart of a method for rendering a virtual object model provided in an embodiment of the present application.

[0024] Figure 2A schematic diagram of an application scenario of a method for rendering a virtual object model provided in an embodiment of the present application.

[0025] Figure 3 A schematic diagram of an application scenario of another method for rendering a virtual object model provided in an embodiment of the present application.

[0026] Figure 4 A schematic diagram of an application scenario of another method for rendering a virtual object model provided in an embodiment of the present application.

[0027] Figure 5 A schematic diagram of an application scenario of another method for rendering a virtual object model provided in an embodiment of the present application.

[0028] Figure 6 A schematic diagram of an application scenario of another method for rendering a virtual object model provided in an embodiment of the present application.

[0029] Figure 7 A schematic diagram of an application scenario of another method for rendering a virtual object model provided in an embodiment of the present application.

[0030] Figure 8 A flowchart of another method for rendering a virtual object model provided in an embodiment of the present application.

[0031] Fig. 9 A structural block diagram of a rendering device for a virtual object model provided in an embodiment of the present application.

[0032] Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0034] The embodiments of the present application provide a method, device, computer-readable storage medium and computer equipment for rendering a virtual object model. Specifically, the method for rendering a virtual object model of the embodiments of the present application can be performed by a computer device, wherein the computer device can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA), etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and big data and artificial intelligence platforms.

[0035] For example, the computer device can be a terminal, which can determine a virtual object model to be rendered; obtain a mask map of the virtual object model, the mask map including a background area and an object area corresponding to the virtual object model; expand the object area in the mask map to obtain an expanded object area; based on the expanded object area and the object area, determine an outer contour special effects area of ​​the virtual object model; obtain a special effects map corresponding to a target special effect; and render the virtual object model based on the outer contour special effects area and the special effects map.

[0036] Based on the above problems, the embodiments of the present application provide a first method, apparatus, computer device and computer-readable storage medium for rendering a virtual object model, which can improve the flexible expression of the stylized special effects of the virtual object model.

[0037] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0038] An embodiment of the present application provides a method for rendering a virtual object model. The method can be executed by a terminal or a server. The embodiment of the present application takes the method for rendering a virtual object model executed by a terminal as an example for explanation.

[0039] See also Figure 1 , Figure 1 A schematic diagram of a flow chart of a method for rendering a virtual object model provided in an embodiment of the present application. The specific flow of the method for rendering a virtual object model may be as follows:

[0040] 101. Determine a virtual object model to be rendered.

[0041] In the embodiments of the present application, the virtual object model refers to a digital reconstruction or abstract representation of a physical object in a virtual space. By digitally processing the basic elements of a physical object (such as geometry, rules, behavior, and physical information, etc.), a virtual object that can be simulated, analyzed, and operated in a computer environment is created. The virtual object model may include a two-dimensional model and a three-dimensional model.

[0042] Among them, virtual space refers to the digital scene outlined by the computer through digital communication technology. The virtual scene can be a three-dimensional space scene or a two-dimensional scene, etc.

[0043] In some embodiments, the virtual scene may be a game scene, and the virtual object may be a game object (eg, a game character) in the game scene.

[0044] The virtual object model to be rendered refers to the one for which stylized special effects need to be rendered. The stylized special effects may include multiple types, such as flame burning effects.

[0045] In some embodiments, stylized special effects can be rendered in the post-processing stage of the virtual object model. Post-processing of the virtual object model refers to a series of detailed adjustments, optimizations, and enhancements performed on the virtual object model after it is created. These processes are intended to make the virtual object more realistic and vivid, and to enhance its expressiveness and interactive performance in the virtual environment.

[0046] The post-processing stage can be achieved by adding a post-processing pass to the original rendering pipeline of the engine to achieve the flame burning effect. A pass refers to a drawing process in the rendering pipeline.

[0047] Among them, the post-processing pass can be implemented through a custom RenderFeature script file. RenderFeature is a rendering function written in C# script, which can be added to the rendering pipeline as a new rendering process.

[0048] For example, a RenderFeature script may be written according to the flame burning effect that the virtual object model needs to achieve, and the RenderFeature script may be added to the original rendering pipeline of the virtual object model to add the rendering function of the flame burning effect of the virtual object model.

[0049] 102. Obtain a mask map of the virtual object model.

[0050] Among them, the mask map is also called a mask map. The principle of the mask map is to use the grayscale information of the image to set the mask, display the area of ​​interest, and mask the area of ​​no interest. The area of ​​interest can be the area that needs to be displayed or processed.

[0051] In the embodiment of the present application, the mask map can be used to indicate the silhouette of the virtual object model. The silhouette refers to a plane figure that forcibly ignores all details of an object and only retains its outer contour. It is used to quickly capture and present the basic form and features of the object.

[0052] The mask map may include a background area and an object area corresponding to the virtual object model, and the object area is also a silhouette of the virtual object model. The mask map may include contour information of the virtual object model.

[0053] In some embodiments, the method may further include the following steps:

[0054] The mask map of the virtual object model is drawn through the target rendering process in the rendering pipeline.

[0055] The target rendering process is a customized post-processing rendering process, in which the object area corresponding to the virtual object model in the mask map is drawn in white, and the background area outside the object area is drawn in black.

[0056] For example, drawing a mask map may include: drawing the virtual object model onto an RT (rendertexure, rendering texture, which means that the rendering result is saved in the image) through the RenderFeature in the above step, wherein the silhouette of the virtual object model is drawn in white and the rest of the background is drawn in black to obtain a mask map.

[0057] For example, see Figure 2 , Figure 2 A schematic diagram of an application scenario of a method for rendering a virtual object model provided in an embodiment of the present application. Figure 2 The mask map of the virtual object model is shown. In the mask map, the white area is the object area of ​​the virtual object model, showing the basic contour characteristics of the virtual object model.

[0058] 103. Expand the object area in the mask map to obtain an expanded object area.

[0059] The object area in the mask map is enlarged, that is, the range of the silhouette area of ​​the virtual object model in the mask map is enlarged.

[0060] In some embodiments, in order to determine the rendering range of the stylized special effects corresponding to the virtual object model, the step of “enlarging the object area in the mask map to obtain an enlarged object area” may include the following operations:

[0061] Get the preset scaling and offset parameters;

[0062] Get the first UV coordinate of the object area in the mask map;

[0063] The second UV coordinate is calculated according to the scaling parameter, the offset parameter and the first UV coordinate;

[0064] Based on the area corresponding to the second UV coordinate in the mask map, the enlarged object area is obtained.

[0065] In the embodiment of the present application, the object area can be expanded by controlling the scaling and offset of the object area.

[0066] Among them, the scaling parameter can be used to control the scaling of the object area of ​​the mask map, and the offset parameter can be used to control the offset of the object area.

[0067] In some embodiments, the preset scaling parameter and offset parameter may be determined according to the rendering range of the stylized special effect, which is also the display area range of the stylized special effect.

[0068] For example, the stylized special effects may include a flame burning effect, and the rendering range may include a flame width of the flame burning effect. Then, the scaling parameter and the offset parameter may be determined according to the flame width.

[0069] In some embodiments, the scaling parameters and offset parameters corresponding to different effect ranges may be preset, and then after the target effect range is determined, the scaling parameters and offset parameters corresponding to the target effect range may be directly acquired.

[0070] The first UV coordinate refers to the position coordinate of the object area in the UV coordinate space of the mask map, and the second UV coordinate refers to the position coordinate of the object area in the UV coordinate space of the mask map after scaling and offsetting the object area.

[0071] In some embodiments, the second UV coordinate is calculated according to the scaling parameter, the offset parameter and the first UV coordinate, which can be calculated by the following formula 1:

[0072] Formula 1: UV offset =UV RT *Scale+offset

[0073] Among them, UV offset is the second UV coordinate, UV RT is the first UV coordinate, Scale is the scaling parameter, and offset is the offset parameter.

[0074] The enlarged object area is obtained based on the area corresponding to the second UV coordinate in the mask map, that is, in the UV coordinate space corresponding to the mask map, the area corresponding to the second UV coordinate is used as the enlarged object area.

[0075] In some embodiments, the offset of the object area in the mask map may include offsets in multiple directions. Calculating the second UV coordinate based on the scaling parameter, the offset parameter and the first UV coordinate may include: calculating the offset UV coordinate corresponding to each offset direction based on each offset direction, the scaling parameter, the offset parameter and the first UV coordinate, and then determining the offset area corresponding to each direction based on the offset UV coordinates in each direction, and then using the total area of ​​each offset area as the expanded object area.

[0076] For example, the offset direction may include: up, down, left, and right. Then, the offset parameter of the upper direction may be determined according to the offset direction being the upper direction and the offset parameter, and then the offset UV coordinate of the upper direction may be calculated according to the offset parameter of the upper direction, the scaling parameter, and the first UV coordinate according to Formula 1. The upper offset area Mask may be determined from the mask map according to the offset UV coordinate of the upper direction. Up ; According to the offset direction being the downward direction and the offset parameter, the downward offset parameter is determined, and then the downward offset UV coordinate is calculated according to the downward offset parameter, the scaling parameter and the first UV coordinate according to Formula 1. According to the downward offset UV coordinate, the downward offset area Mask can be determined from the mask map Down ; According to the offset direction being the left direction and the offset parameter, the offset parameter of the left direction is determined, and then the offset UV coordinate of the left direction is calculated according to the offset parameter of the left direction, the scaling parameter and the first UV coordinate according to Formula 1. According to the offset UV coordinate of the left direction, the Mask of the left offset area can be determined from the mask map Left ; According to the offset direction being the right direction and the offset parameter, the offset parameter of the right direction is determined, and then the offset UV coordinate of the right direction is calculated according to the offset parameter of the right direction, the scaling parameter and the first UV coordinate according to Formula 1. According to the offset UV coordinate of the right direction, the Mask of the offset area on the right side can be determined from the mask map Right .

[0077] In the embodiment of the present application, by sampling the mask map according to the offset UV coordinates corresponding to each offset direction, it is possible to obtain an enlarged object area after the object area is scaled and offset in each direction.

[0078] Further, according to the total area of ​​each offset area, the offset area in each direction may be added together as follows:

[0079] Mask offset =Mask Up +Mask Down +Mask Left +Mask Right

[0080] Among them, Mask offset Refers to the enlarged object area.

[0081] For example, see Figure 3 , Figure 3 A schematic diagram of an application scenario of another method for rendering a virtual object model provided in an embodiment of the present application. Figure 3 The white area in the mask map on the left is the object area. Figure 3 The object area in the mask map on the right is the enlarged object area.

[0082] 104. Determine an outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area.

[0083] Among them, based on the enlarged object area and the object area, the outer contour special effect area of ​​the virtual object model is determined, that is, the non-overlapping area of ​​the object area and the enlarged object area is selected from the mask map as the outer contour special effect area.

[0084] In some embodiments, the step of “determining the outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area” may include the following operations:

[0085] Calculate the difference between the first UV coordinate of the object area and the second UV coordinate of the expanded object area to obtain a third UV coordinate;

[0086] Based on the area corresponding to the third UV coordinate in the mask map, the outer contour effect area is obtained:

[0087] The difference between the first UV coordinate of the object area and the second UV coordinate of the expanded object area is calculated to obtain the third UV coordinate, which can be calculated according to the following formula 2:

[0088] Formula 2: UV Outline =UV offset -UV RT

[0089] Among them, UV offset Refers to the second UV coordinate of the expanded object area, UV RT Refers to the first UV coordinate of the object area, UV Outline Refers to the third UV coordinate.

[0090] Then, the outer contour special effect area is determined according to the area corresponding to the third UV coordinate in the initial mask map.

[0091] In some embodiments, after the outer contour special effect area is determined in the mask map, the initial object area can be masked, for example, set to black, indicating that the object area does not need to be processed.

[0092] For example, see Figure 4 , Figure 4 A schematic diagram of an application scenario of another method for rendering a virtual object model provided in an embodiment of the present application. Figure 4 The white area in the mask map on the left is the outer contour special effects area where the flame burning effect needs to be rendered.

[0093] 105. Obtain the special effect map corresponding to the target special effect.

[0094] Among them, the target special effects are also the stylized special effects that the virtual object model needs to render.

[0095] In some embodiments, the special effect map may include multiple types, such as a preset noise map and a preset gradient map.

[0096] Among them, the preset noise map refers to a map used to realize the dynamics and shape of the special effects in the target special effects; the preset gradient map refers to a map used to realize the color of the special effects in the target special effects.

[0097] For example, the target special effect may be a flame burning effect, and the preset noise map may be used to realize the dynamics and shape of the flame in the flame burning effect; the preset gradient special map may be used to realize the color of the flame in the flame burning effect.

[0098] In some embodiments, different noise maps and gradient maps may be pre-made for different stylized special effects, so as to facilitate use when rendering different stylized special effects.

[0099] 106. Render the virtual object model based on the outer contour special effect area and the special effect map.

[0100] In some embodiments, in order to achieve dynamic changes and naturalness of stylized special effects, the step of “rendering the virtual object model based on the outer contour special effect area and the special effect map” may include the following operations:

[0101] The outer contour special effect area is adjusted based on the preset noise map to obtain the adjusted area;

[0102] The adjusted area is processed based on a preset gradient map to obtain a target special effect area;

[0103] The virtual object model is rendered based on the target special effect area.

[0104] Among them, adjusting the outer contour special effect area based on the preset noise map may include adjusting the shape of the outer contour special effect area in the mask map by encountering the noise map.

[0105] In some embodiments, the preset noise map includes a disturbance noise map and a dissolution noise map, and the step of "adjusting the outer contour special effect area based on the preset noise map to obtain an adjusted area" may include the following operations:

[0106] Get the preset disturbance parameters;

[0107] Based on the disturbance parameters and the disturbance noise map, the outer contour special effect area is disturbed to obtain the outer contour special effect area after disturbance;

[0108] The disturbed outer contour special effect area is dissolved based on the dissolution noise map to obtain the adjusted area.

[0109] Among them, the perturbation noise map generates a series of random but regular numerical distributions in two-dimensional or three-dimensional space through a specific noise algorithm. These numerical distributions are mapped to color or brightness to form maps with unique textures and appearances. When these maps are applied to the surface of an object or as part of a special effect, they can produce rich visual effects such as distortion, flickering, and fluctuations.

[0110] The disturbance parameters may be used to control the dynamic changes of the special effects in the stylized special effects. For example, the disturbance parameters may include the intensity of the disturbance noise.

[0111] In some embodiments, based on the disturbance parameters and the disturbance noise map, the outer contour special effect area is disturbed to obtain the outer contour special effect area after disturbance, which can be calculated according to the following formula 3:

[0112] Formula 3: UV distort =UV offset +k distort *Tex distort

[0113] Among them, UV offset Refers to the UV coordinates of the object area after enlargement in the mask map, k distort Refers to the disturbance noise intensity, Tex distort Refers to the disturbance noise map. UV distort That is, the UV coordinates of the outer contour special effect area after disturbance.

[0114] For example, see Figure 5 , Figure 5 A schematic diagram of an application scenario of another method for rendering a virtual object model provided in an embodiment of the present application. Figure 5 The white area in the mask map on the left is the outer contour special effect area where the flame burning effect needs to be achieved. By processing the outer contour special effect area in the mask map with the perturbed noise map, we can get Figure 5 The mask map on the right. Figure 5In the mask map on the right, the white area is the perturbed outer contour special effect area obtained by processing the perturbation noise map.

[0115] The outer contour special effect area in the mask map is processed by the perturbed noise map, that is, the sampled UV (UV coordinates in the UV coordinate space of the mask map) of the outer contour special effect area in the mask map is superimposed with the perturbed noise map. By sampling the area in the mask map with the perturbed UV, the special effect fluctuation effect can be produced.

[0116] Among them, the dissolve noise map controls the degree of dissolution of an object by using a noise map. A noise map is a texture containing random noise, whose pixel values ​​fluctuate between 0 and 1. When these noise values ​​are used to control the transparency or clipping conditions of an object, a dissolving effect can be achieved.

[0117] In some embodiments, the disturbed outer contour special effect area is dissolved based on the dissolution noise map to obtain an adjusted area, which can be calculated by the following formula 4:

[0118] Formula 4: Mask disslove =Mask distort *Tex disslove

[0119] Among them, Mask distort Refers to the outer contour special effect area after disturbance, Tex disslove Refers to the dissolve noise map. Mask disslove Refers to the adjusted area.

[0120] For example, see Figure 6 , Figure 6 A schematic diagram of an application scenario of another method for rendering a virtual object model provided in an embodiment of the present application. Figure 6 The white area in the mask map on the left is the outer contour effect area after disturbance. By dissolving the noise map, we can get the outer contour effect area after disturbance. Figure 6 The mask map on the right. Figure 6 In the mask map on the right, the white areas are the adjusted areas after processing with the dissolve noise map.

[0121] The outer contour effect area in the mask map is processed by the dissolve noise map, that is, the sampled UV (UV coordinates in the UV coordinate space of the mask map) of the outer contour effect area in the mask map is superimposed with the dissolve noise map. By sampling the area in the mask map with disturbed UV, a flame shape effect can be produced.

[0122] In some embodiments, the step of “processing the adjusted area based on a preset gradient map to obtain a target special effect area” may include the following operations:

[0123] Get the grayscale information of the adjusted area;

[0124] Determine the sampling UV coordinates corresponding to the adjusted area in the preset gradient map based on the grayscale information;

[0125] The color information corresponding to the sampled UV coordinates is obtained from the preset gradient map, and the adjusted area is rendered based on the color information to obtain the target special effect area.

[0126] Among them, the preset gradient map can be a ramp map. A ramp map is essentially a texture that provides a gradient of color or value along one axis (U axis or V axis). This gradient can be linear, nonlinear, or even a complex curve shape, depending on how the texture is created. Ramp maps are often used to control the way objects are shaded to achieve specific visual effects.

[0127] During rendering, sampling of a ramp map refers to the process of obtaining a color or value from a ramp map based on specific parameters (such as lighting angle, normal direction, etc.). Sampling is usually achieved by calculating the position of the sampling point (usually the angle between the lighting and the surface normal of the object) on the ramp map. This position determines the color or value obtained from the ramp map.

[0128] In the embodiment of the present application, the grayscale information of the adjusted area can be obtained, and the color of the adjusted area is obtained from the ramp map according to the grayscale information to render the adjusted area.

[0129] For example, see Figure 7 , Figure 7 A schematic diagram of an application scenario of another method for rendering a virtual object model provided in an embodiment of the present application. Figure 7 A preset gradient map for color rendering of the adjusted area in the mask map is shown, and the preset gradient map may include a plurality of gradient color information.

[0130] The grayscale information may include a grayscale value. The grayscale value may indicate the brightness or grayscale level of a pixel, and may be 0 to 1. The grayscale information of the adjusted area is obtained, that is, the grayscale value of the pixel point in the adjusted area is obtained.

[0131] Among them, determining the sampling UV coordinates corresponding to the adjusted area in the preset gradient map based on the grayscale information can include: using the grayscale value as the UUV coordinate of the sampling UV coordinate of the color obtained from the preset gradient map, and the VUV coordinate can be set to 0 by default, thereby obtaining the sampling UV coordinate.

[0132] Furthermore, the corresponding color is obtained from the preset color map based on the sampled UV coordinates as the color information for rendering the adjusted area. Finally, the adjusted area is rendered based on the obtained color information, so that the flame gradient color in the flame burning effect can be achieved.

[0133] In some embodiments, in order to make the special effect edge of the stylized special effect softer, the method may further include the following steps:

[0134] The outer contour special effect area is blurred to obtain a blurred outer contour special effect area.

[0135] In some embodiments, the step of “blurring the outer contour special effect area to obtain a blurred outer contour special effect area” may include the following operations:

[0136] Determine the edge position of the outer contour special effect area and the adjacent position of the edge position;

[0137] The first pixel value corresponding to the adjacent position in the mask map is obtained, and the second pixel value at the edge position is adjusted based on the first pixel value to obtain the blurred outer contour special effect area.

[0138] The edge position of the outer contour special effect area refers to the position of the first pixel corresponding to the outer edge of the outer contour special effect area in the mask map, and the adjacent position of the edge position refers to the position of the second pixel adjacent to the first pixel in the mask map.

[0139] Among them, obtaining the first pixel value corresponding to the adjacent position in the mask map, and adjusting the second pixel value at the edge position based on the first pixel value can include: obtaining the pixel value of each second pixel point corresponding to the adjacent position to obtain multiple second pixel values, and then calculating the average value of the multiple second pixel values, and adjusting the second pixel value of the first pixel point corresponding to the edge position based on the average value, so as to achieve an edge blur effect in the outer contour special effect area.

[0140] In the embodiment of the present application, the principle of blurring the outer contour special effect area is average processing, that is, the outer contour special effect area in the mask map is UV-shifted based on multiple directions (for example, 360 degrees are equally divided into 8 directions), the position after the shift is determined, and the pixel value of the position after the shift is averaged, so as to obtain the blurred outer contour special effect area. For example, it can be calculated according to the following formula 5:

[0141] Formula 5:

[0142] Among them, Mask iTo expand the outer contour effect area along the i-th direction to obtain the area, 8 refers to the total number of expansion directions; Mask blur That is, the outer contour special effect area after blurring.

[0143] In some embodiments, the step of “rendering the virtual object model based on the outer contour special effect area and the special effect map” may include the following operations:

[0144] The virtual object model is rendered based on the blurred outer contour special effect area and the special effect map.

[0145] That is, the shape of the blurred outer contour special effect area is adjusted by using a preset noise map, and then the color of the area after the shape adjustment is adjusted according to a preset gradient map, so as to obtain a target special effect area for achieving a target special effect.

[0146] In some embodiments, the method of rendering the virtual object model based on the target special effect area may include: integrating a mask map containing the target special effect area into the timeline of the special effect animation, and controlling the switches and properties of the stylized special effects through the clips in the timeline.

[0147] For example, a stylized effect could be a fire burning effect, see Figure 8 , Figure 8 A schematic diagram of an application scenario of another method for rendering a virtual object model provided in an embodiment of the present application. Figure 8 The flame effect property page for adjusting the properties of the flame burning effect is shown. The flame effect property page may include multiple property parameters, such as: stroke width, disturbance speed, disturbance intensity, dissolution intensity, and edge color.

[0148] Among them, the stroke width can be used to adjust the flame width, the disturbance speed can be used to adjust the speed of the flame disturbance, the disturbance intensity can be used to adjust the intensity of the flame disturbance, the dissolution intensity can be used to adjust the intensity of the flame dissolution, and the edge color can be used to adjust the color of the flame.

[0149] Among them, these attribute parameters can be dynamically adjusted by means of constants or curves, wherein the curve refers to the distribution curve of the parameter value according to time as the X-axis, and the flame combustion effect can be made more flexible by adding key points to the curve.

[0150] The embodiment of the present application discloses a rendering method of a virtual object model, the method comprising: determining a virtual object model to be rendered; obtaining a mask map of the virtual object model, the mask map comprising a background area and an object area corresponding to the virtual object model; enlarging the object area in the mask map to obtain an enlarged object area; determining an outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area; obtaining a special effect map corresponding to a target special effect; and rendering the virtual object model based on the outer contour special effect area and the special effect map. In this way, the flexible expression of the stylized special effects of the virtual object model can be improved.

[0151] In order to facilitate better implementation of the virtual object model rendering method provided in the embodiment of the present application, the embodiment of the present application also provides a virtual object model rendering device based on the virtual object model rendering method. The meanings of the terms are the same as those in the virtual object model rendering method, and the specific implementation details can refer to the description in the method embodiment.

[0152] See also Fig. 9 , Fig. 9 A structural block diagram of a rendering device for a virtual object model provided in an embodiment of the present application, the device comprising:

[0153] A first determining unit 301 is used to determine a virtual object model to be rendered;

[0154] A first acquisition unit 302 is used to acquire a mask map of the virtual object model, where the mask map includes a background area and an object area corresponding to the virtual object model;

[0155] A processing unit 303 is used to expand the object area in the mask map to obtain an expanded object area;

[0156] A second determining unit 304 is used to determine an outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area;

[0157] The second acquisition unit 305 is used to acquire a special effect map corresponding to a target special effect;

[0158] The rendering unit 306 is used to render the virtual object model based on the outer contour special effect area and the special effect map.

[0159] In some embodiments, the processing unit 303 may include:

[0160] A first acquisition subunit, used to acquire preset scaling parameters and offset parameters;

[0161] A second acquisition subunit is used to acquire a first UV coordinate of the object area in the mask map;

[0162] A first calculation subunit, configured to calculate a second UV coordinate according to the scaling parameter, the offset parameter and the first UV coordinate;

[0163] The first determining subunit is used to obtain the enlarged object area based on the area corresponding to the second UV coordinate in the mask map.

[0164] In some embodiments, the second determining unit 304 may include:

[0165] A second calculation subunit is used to calculate the difference between the first UV coordinate of the object area and the second UV coordinate of the expanded object area to obtain a third UV coordinate;

[0166] The second determining subunit is used to obtain the outer contour special effect area based on the area corresponding to the third UV coordinate in the mask map.

[0167] In some embodiments, the special effect map includes a preset noise map and a preset gradient map; the rendering unit 306 may include:

[0168] An adjustment subunit, configured to adjust the outer contour special effect area based on the preset noise map to obtain an adjusted area;

[0169] A processing subunit, configured to process the adjusted area based on the preset gradient map to obtain a target special effect area;

[0170] The first rendering subunit is used to render the virtual object model based on a target special effect area.

[0171] In some embodiments, the preset noise map includes a disturbance noise map and a dissolution noise map; the adjustment subunit can be specifically used to:

[0172] Get the preset disturbance parameters;

[0173] Based on the disturbance parameters and the disturbance noise map, the outer contour special effect area is disturbed to obtain a disturbed area;

[0174] The disturbed region is dissolved based on the dissolution noise map to obtain the adjusted region.

[0175] In some embodiments, the processing subunit may be specifically configured to:

[0176] Obtaining grayscale information of the adjusted area;

[0177] Determine, based on the grayscale information, the sampling UV coordinates corresponding to the adjusted area in the preset gradient map;

[0178] The color information corresponding to the sampled UV coordinates is obtained from the preset gradient map, and the adjusted area is rendered based on the color information to obtain the target special effect area.

[0179] In some embodiments, the apparatus may further include:

[0180] A blur processing unit, used for blurring the outer contour special effect area to obtain a blurred outer contour special effect area;

[0181] Then the rendering unit 306 may include:

[0182] The second rendering sub-unit is used to render the virtual object model based on the blurred outer contour special effect area and the special effect map.

[0183] In some embodiments, the blur processing unit may include:

[0184] A third determining subunit is used to determine the edge position of the outer contour special effect area and the adjacent position of the edge position;

[0185] The third acquisition subunit is used to obtain the first pixel value corresponding to the adjacent position in the mask map, and adjust the second pixel value of the edge position based on the first pixel value to obtain the blurred outer contour special effect area.

[0186] In some embodiments, the apparatus may further include:

[0187] A drawing unit is used to draw a mask map of the virtual object model through a target rendering process in a rendering pipeline, wherein the target rendering process is a customized post-processing rendering process, and the object area corresponding to the virtual object model in the mask map is drawn in white, and the background area outside the object area is drawn in black.

[0188] The embodiment of the present application discloses a rendering device for a virtual object model, wherein a first determining unit 301 determines a virtual object model to be rendered; a first acquiring unit 302 acquires a mask map of the virtual object model, the mask map includes a background area and an object area corresponding to the virtual object model; a processing unit 303 enlarges the object area in the mask map to obtain an enlarged object area; a second determining unit 304 determines an outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area; a second acquiring unit 305 acquires a special effect map corresponding to a target special effect; and a rendering unit 306 renders the virtual object model based on the outer contour special effect area and the special effect map. In this way, the flexible expression of the stylized special effects of the virtual object model can be improved.

[0189] Accordingly, the embodiment of the present application also provides a computer device, which may be a terminal. Fig.10 As shown, Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. It will be understood by those skilled in the art that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0190] The processor 501 is the control center of the computer device 500. It uses various interfaces and lines to connect the various parts of the entire computer device 500, executes various functions of the computer device 500 and processes data by running or loading software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, thereby monitoring the computer device 500 as a whole.

[0191] In the embodiment of the present application, the processor 501 in the computer device 500 will load instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions:

[0192] Determining a virtual object model to be rendered;

[0193] Obtaining a mask map of the virtual object model, where the mask map includes a background area and an object area corresponding to the virtual object model;

[0194] Expanding the object area in the mask map to obtain an expanded object area;

[0195] Determine an outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area;

[0196] Get the special effect map corresponding to the target special effect;

[0197] The virtual object model is rendered based on the outer contour special effect area and the special effect map.

[0198] This solution determines the virtual object model to be rendered; obtains the mask map of the virtual object model, the mask map includes the background area and the object area corresponding to the virtual object model; expands the object area in the mask map to obtain the expanded object area; determines the outer contour special effect area of ​​the virtual object model based on the expanded object area and the object area; obtains the special effect map corresponding to the target special effect; and renders the virtual object model based on the outer contour special effect area and the special effect map. In this way, the flexible expression of the stylized special effects of the virtual object model can be improved.

[0199] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0200] Optional, such as Fig.10 As shown, the computer device 500 further includes: a touch screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art can understand that Fig.10 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0201] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the computer device, and these graphical user interfaces may be composed of graphics, guide information, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 501, and can receive the command sent by the processor 501 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event, and then the processor 501 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 503 can also be used as a part of the input unit 506 to realize the input function.

[0202] The radio frequency circuit 504 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer devices through wireless communication, and to send and receive signals between the network device or other computer devices.

[0203] The audio circuit 505 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and converted into audio data, and then the audio data is output to the processor 501 for processing, and then sent to another computer device through the radio frequency circuit 504, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earphone jack to provide communication between an external headset and the computer device.

[0204] The input unit 506 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0205] The power supply 507 is used to supply power to various components of the computer device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 507 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0206] although Fig.10 Not shown, the computer device 500 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0207] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0208] As can be seen from the above, the computer device provided in this embodiment can determine the virtual object model to be rendered; obtain the mask map of the virtual object model, the mask map includes the background area and the object area corresponding to the virtual object model; expand the object area in the mask map to obtain the expanded object area; based on the expanded object area and the object area, determine the outer contour special effects area of ​​the virtual object model; obtain the special effects map corresponding to the target special effects; based on the outer contour special effects area and the special effects map, render the virtual object model.

[0209] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0210] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any one of the virtual object model rendering methods provided in the embodiments of the present application. For example, the computer program can execute the following steps:

[0211] Determining a virtual object model to be rendered;

[0212] Obtaining a mask map of the virtual object model, where the mask map includes a background area and an object area corresponding to the virtual object model;

[0213] Expanding the object area in the mask map to obtain an expanded object area;

[0214] Determine an outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area;

[0215] Get the special effect map corresponding to the target special effect;

[0216] The virtual object model is rendered based on the outer contour special effect area and the special effect map.

[0217] This solution determines the virtual object model to be rendered; obtains the mask map of the virtual object model, the mask map includes the background area and the object area corresponding to the virtual object model; expands the object area in the mask map to obtain the expanded object area; determines the outer contour special effect area of ​​the virtual object model based on the expanded object area and the object area; obtains the special effect map corresponding to the target special effect; and renders the virtual object model based on the outer contour special effect area and the special effect map. In this way, the flexible expression of the stylized special effects of the virtual object model can be improved.

[0218] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0219] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0220] Since the computer program stored in the computer-readable storage medium can execute the steps in any method for rendering a virtual object model provided in the embodiments of the present application, the beneficial effects that can be achieved by any method for rendering a virtual object model provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0221] The above is a detailed introduction to a rendering method, device, computer-readable storage medium and computer equipment for a virtual object model provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for rendering a virtual object model, characterized in that: The method comprises: Determining a virtual object model to be rendered; Acquire a mask map of the virtual object model, wherein the mask map includes a background area and an object area corresponding to the virtual object model; Expanding the object area in the mask map to obtain an expanded object area; Determining an outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area; Get the special effect map corresponding to the target special effect; The virtual object model is rendered based on the outer contour special effect area and the special effect map.

2. The method according to claim 1, characterized in that The enlarging the object area in the mask map to obtain the enlarged object area comprises: Get the preset scaling and offset parameters; Obtain the first UV coordinate of the object area in the mask map; Calculate a second UV coordinate according to the scaling parameter, the offset parameter and the first UV coordinate; The enlarged object area is obtained based on the area corresponding to the second UV coordinate in the mask map.

3. The method according to claim 2, characterized in that The step of determining the outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area includes: Calculating a difference between the first UV coordinate of the object area and the second UV coordinate of the expanded object area to obtain a third UV coordinate; Based on the area corresponding to the third UV coordinate in the mask map, the outer contour special effect area is obtained.

4. The method according to claim 1, characterized in that: The special effect map includes a preset noise map and a preset gradient map; Rendering the virtual object model based on the outer contour special effect area and the special effect map includes: Adjusting the outer contour special effect area based on the preset noise map to obtain an adjusted area; Processing the adjusted area based on the preset gradient map to obtain a target special effect area; The virtual object model is rendered based on the target special effect area.

5. The method according to claim 4, characterized in that The preset noise map includes a disturbance noise map and a dissolution noise map; The step of adjusting the outer contour special effect area based on the preset noise map to obtain an adjusted area includes: Get the preset disturbance parameters; Based on the disturbance parameters and the disturbance noise map, the outer contour special effect area is disturbed to obtain a disturbed area; The disturbed region is dissolved based on the dissolution noise map to obtain the adjusted region.

6. The method according to claim 4, characterized in that The step of processing the adjusted area based on the preset gradient map to obtain a target special effect area includes: Obtaining grayscale information of the adjusted area; Determine, based on the grayscale information, the sampling UV coordinates corresponding to the adjusted area in the preset gradient map; The color information corresponding to the sampled UV coordinates is obtained from the preset gradient map, and the adjusted area is rendered based on the color information to obtain the target special effect area.

7. The method according to claim 1, characterized in that The method further comprises: Performing blur processing on the outer contour special effect area to obtain a blurred outer contour special effect area; The rendering of the virtual object model based on the outer contour special effect area and the special effect map includes: The virtual object model is rendered based on the blurred outer contour special effect area and the special effect map.

8. The method according to claim 7, characterized in that The blurring of the outer contour special effect area to obtain the blurred outer contour special effect area includes: Determine the edge position of the outer contour special effect area, and the adjacent position of the edge position; The first pixel value corresponding to the adjacent position in the mask map is obtained, and the second pixel value of the edge position is adjusted based on the first pixel value to obtain the blurred outer contour special effect area.

9. The method according to claim 1, characterized in that: The method further comprises: The mask map of the virtual object model is drawn through the target rendering process in the rendering pipeline, wherein the target rendering process is a customized post-processing rendering process, the object area corresponding to the virtual object model in the mask map is drawn in white, and the background area outside the object area is drawn in black.

10. A rendering device for a virtual object model, characterized in that: The device comprises: A first determining unit, used to determine a virtual object model to be rendered; A first acquisition unit, configured to acquire a mask map of the virtual object model, wherein the mask map includes a background area and an object area corresponding to the virtual object model; A processing unit, configured to enlarge the object area in the mask map to obtain an enlarged object area; A second determining unit, configured to determine an outer contour special effect area of ​​the virtual object model based on the enlarged object area and the object area; A second acquisition unit, used to acquire a special effect map corresponding to a target special effect; A rendering unit is used to render the virtual object model based on the outer contour special effect area and the special effect map.

11. A computer device comprising a memory, a processor and a computer program stored in the memory and running on the processor, wherein: When the processor executes the program, the method for rendering a virtual object model as described in any one of claims 1 to 9 is implemented.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the method for rendering a virtual object model according to any one of claims 1 to 9.