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

By determining the target sticker area of ​​each point of each point of the virtual object model from the preset gradient map, and rendering based on the gradients of these areas, the problem of difficulty in achieving the shadow effects of multiple different areas in the existing technology has been solved. High -quality virtual object model rendering effect.

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

Patent Information

Application Number
CN202411345764.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

It is difficult for the prior art to use a Ramp map to render shadow effects in multiple different regions, resulting in different regions of the same virtual object model not being able to achieve different shadow effects.

Method used

By obtaining the color information of each point on the surface of the model of the virtual object model, according to this information, determine the target sticker area corresponding to each point from the preset graphic map. Each map area is set. The gradient schematic texture of the texture area renders the virtual object model.

Benefits of technology

It is possible to use a preset gradient map to control the independent rendering of different positions on the surface of the same virtual object model to achieve gradient rendering effects at different positions, thereby improving the rendering effect of the virtual object model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359834A_ABST
    Figure CN119359834A_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 color information of each position point on the model surface of the virtual object model is acquired; according to the color information, a target map area corresponding to each position point is determined from a preset gradient map, the preset gradient map comprises a plurality of map areas, and each map area is provided with a gradient texture sub map; and rendering the virtual object model based on the gradient texture sub-map corresponding to the target map area. Therefore, one preset gradual change map can be used for controlling independent rendering of different positions on the surface of the same virtual object model, so that the gradual change rendering effect of different positions is realized, and the rendering 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] With the continuous development of computer graphics technology, stylized rendering is also making progress. The technical implementation of stylized rendering involves many aspects, including lighting models, material processing, shadow effects, post-processing effects, etc. Among them, shadow effects are the key to achieving high-quality rendering effects. Shadow effects can be achieved through ramp map rendering. Ramp maps are a kind of gradient texture that simulates lighting, shadows, materials and other effects by smoothly transitioning different colors or brightness values ​​in the horizontal direction.

[0003] In the related art, in the ramp map, the alpha channel is used to define the intensity or depth of the shadow, that is, by adjusting the alpha value, the shade and distribution of the shadow can be controlled. However, since different areas of the same virtual object model may need to achieve different shadow effects, it is impossible to use one ramp map to render multiple shadow effects through the above method. Summary of the invention

[0004] Embodiments of the present application provide a method, apparatus, computer device, and computer-readable storage medium for rendering a virtual object model, which can improve the rendering effect of the virtual object model.

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

[0006] Acquire color information of each position point on the model surface of the virtual object model;

[0007] Determine a target map area corresponding to each position point from a preset gradient map according to the color information, wherein the preset gradient map includes a plurality of map areas, and a gradient texture sub-map is set in each map area;

[0008] The virtual object model is rendered based on the gradient texture sub-map corresponding to the target map area.

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

[0010] An acquisition unit, used to acquire color information of each position point on the model surface of the virtual object model;

[0011] A determination unit, configured to determine a target map area corresponding to each position point from a preset gradient map according to the color information, wherein the preset gradient map includes a plurality of map areas, and a gradient texture sub-map is set in each map area;

[0012] A rendering unit is used to render the virtual object model based on the gradient texture sub-map corresponding to the target map area.

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

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

[0015] The embodiment of the present application obtains the color information of each position point on the model surface of the virtual object model; determines the target map area corresponding to each position point from the preset gradient map according to the color information, wherein the preset gradient map includes multiple map areas, and each map area is provided with a gradient texture sub-map; and renders the virtual object model based on the gradient texture sub-map corresponding to the target map area. In this way, a preset gradient map can be used to control the separate rendering of different positions on the surface of the same virtual object model to achieve the gradient rendering effect of different positions, thereby improving the rendering effect of the virtual object model. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0018] Figure 2 A schematic diagram of a preset gradient map provided in an embodiment of the present application.

[0019] Figure 3 A structural block diagram of a rendering device for a virtual object model provided in an embodiment of the present application.

[0020] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0022] The embodiments of the present application provide a rendering method, device, computer-readable storage medium and computer equipment for a virtual object model. Specifically, the rendering method of the 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.

[0023] For example, the computer device may be a terminal that can obtain color information of each position point on the model surface of the virtual object model; determine a target map area corresponding to each position point from a preset gradient map based on the color information, wherein the preset gradient map includes multiple map areas, and a gradient texture sub-map is set in each map area; and render the virtual object model based on the gradient texture sub-map corresponding to the target map area.

[0024] 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 rendering effect of the virtual object model.

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

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

[0027] 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:

[0028] 101. Obtain color information of each position point on the model surface of the virtual object model.

[0029] In an embodiment of the present application, the virtual object model may include a three-dimensional model of the virtual object. The position points of the virtual object model may be used to indicate the position of the surface of the virtual object model, that is, the position where rendering is performed in the virtual object model. By rendering each position on the surface of the virtual object model, a variety of stylized effects of the virtual object model can be achieved.

[0030] The virtual object may be an object included in a virtual scene, which refers to a digital scene drawn by a computer through digital communication technology, and may be a three-dimensional space scene or a two-dimensional scene, etc. For example, the virtual scene may be a game scene, and the virtual object may be a game object in the game scene, etc.

[0031] The color information of each position point may include a color value corresponding to each position point.

[0032] In some embodiments, the color value may include a value in a specified color channel. Wherein, the specified color channel may include an R channel, a G channel, or a G channel, and the color value corresponding to the position point may include a value corresponding to the position point in the R channel, a value corresponding to the G channel, or a value corresponding to the G channel.

[0033] Among them, the R channel, the G channel or the value range in the G channel may include 0 to 255, and the color value corresponding to each position point may be a value between 0 and 255.

[0034] In some embodiments, the step of “obtaining color information of each position point on the model surface of the virtual object model” may include the following operations:

[0035] Get the color map of the virtual object model;

[0036] The target color value corresponding to each position point in the specified color channel of the sample color map is obtained to obtain color information.

[0037] Among them, the color map can be prepared in advance by the art designer according to the virtual object model.

[0038] For example, an art designer may create a texture with the same size as the surface size of the virtual object model, and then set the color value of each pixel in each color channel of the texture to obtain a color texture of the virtual object model.

[0039] Specifically, the color map can be mainly used to express the color and texture details of the object surface, including the inherent color of the object, surface scratches, etc. That is, the material and texture of the object surface are simulated by color.

[0040] The target color value refers to the value corresponding to each position point in the specified color channel of the color map.

[0041] In an embodiment of the present application, each position point in the virtual object model corresponds to each pixel point in the color map, and the color value corresponding to the position point, that is, the color information, is obtained by sampling the value of each pixel point in the color map under a certain color channel.

[0042] For example, the virtual object model may include: position point 1, position point 2, position point 3, ..., position point n, and the color map may include pixel point 1, pixel point 2, pixel point 3, ..., pixel point n. Each position point in the virtual object model corresponds to each pixel point in the color map.

[0043] Wherein, the designated color channel may be the R channel, then the value corresponding to pixel 1 may be obtained from the R channel of the color map as the color value corresponding to position 1, the value corresponding to pixel 2 may be obtained as the color value corresponding to position 2, the value corresponding to pixel 3 may be obtained as the color value corresponding to position 3, and the value corresponding to pixel n may be obtained as the color value corresponding to position n. Thus, based on the color value corresponding to each position point, the color information of each position point is obtained.

[0044] 102. Determine a target map area corresponding to each position point from a preset gradient map according to the color information.

[0045] In the embodiment of the present application, the preset gradient map may include multiple map areas, each map area is set with a gradient texture sub-map, and different gradient texture sub-maps can be used to achieve different gradient effects, for example, from hard-cut gradient (black or white) to various transition gradient effects, etc. The multiple map areas are at least two map areas.

[0046] In some embodiments, the mapping area in the preset gradient can be obtained by dividing into rows or columns.

[0047] For example, the method of making a preset gradient map may include: first creating an initial map of a larger size, then dividing the initial map into multiple rows, each row being a map area, and then setting a pre-made gradient texture sub-map in each row to obtain the preset gradient map.

[0048] For example, see Figure 2 , Figure 2 A schematic diagram of a preset gradient map provided in an embodiment of the present application. Figure 2 At least part of the preset gradient map is shown. The preset gradient map includes multiple rows of map areas. A gradient texture sub-map is set in each map area. The gradient effect achieved by each gradient texture sub-map is different.

[0049] In some embodiments, the step of “determining the target map area corresponding to each position point from the preset gradient map according to the color information” may include the following operations:

[0050] Get the preset correspondence between the mapping area of ​​the preset gradient map and the color value of the specified color channel;

[0051] From the preset corresponding relationship, a mapping area corresponding to a target color value range to which the target color value belongs is determined to obtain a target mapping area.

[0052] The preset corresponding relationship includes the color value range corresponding to each mapping area.

[0053] In the embodiment of the present application, the correspondence between each map area in the preset gradient map and the color value in the specified color channel is preset.

[0054] In some embodiments, when setting the correspondence between each map area and the color value in the specified color channel, the corresponding color value range can be determined based on the gradient information in the gradient texture sub-map in each map area (for example, the size of the gradient transition range); for example, the map area where the gradient texture sub-map with a smaller gradient transition range is located can correspond to a smaller color value range.

[0055] For example, the steps of setting the correspondence between each map region and the color value in the specified color channel may include the following:

[0056] First, the color values ​​in the specified color channel are divided according to the number of mapping areas to obtain multiple color value ranges. For example, the number of mapping areas can be 4, and the color values ​​in the color channel include 0 to 255. Then the color values ​​in the color channel can be divided into 4 color value ranges, namely: 0 to 64, 6 to 128, 129 to 192, and 193 to 255.

[0057] Then, the mapping areas can be associated with the color value ranges according to the gradient information in the gradient texture sub-map in each mapping area, so as to obtain the color value range corresponding to each mapping area, that is, the preset corresponding relationship.

[0058] Among them, determining the mapping area corresponding to the target color value range to which the target color value belongs from the preset correspondence may include: determining the color value range corresponding to the target color value from multiple color value ranges in the preset correspondence to obtain the target color value range, and then the mapping area corresponding to the target color value range can be used as the target mapping area corresponding to the position point, and then the gradient texture sub-map set in the target mapping area can be used as the gradient texture sub-map to be rendered corresponding to the position point.

[0059] For example, the position points of the virtual object model may include: position point 1, ..., position point n. Among them, the color value corresponding to position point 1 may be 200, then the color range corresponding to position point 1 may be determined to be 193-255, and then the map area in the preset gradient map corresponding to the color range of 193-255 may be obtained from the preset corresponding relationship as the target map area corresponding to position point 1.

[0060] 103. Render the virtual object model based on the gradient texture sub-map corresponding to the target map area.

[0061] After determining the mapping area corresponding to each position point in the preset gradient map, the virtual object model can be rendered according to the gradient texture sub-map in each mapping area to obtain the gradient rendering effect corresponding to each position point.

[0062] In an embodiment of the present application, the preset gradient sub-map can be a ramp map, which is essentially a texture that provides a gradient of color or value along an 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 colored to achieve specific visual effects.

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

[0064] In some embodiments, in order to achieve different gradient effects at different positions, the step of “rendering the virtual object model based on the gradient texture sub-map corresponding to the target map area” may include the following steps:

[0065] Obtaining illumination information corresponding to each position point, and determining texture coordinate values ​​corresponding to each position point according to the illumination information;

[0066] Based on the texture coordinate values ​​corresponding to each position point, the to-be-rendered information corresponding to each position point is obtained from the gradient texture sub-map corresponding to the target map area;

[0067] The virtual object model is rendered based on the information to be rendered.

[0068] The illumination information refers to the degree of influence of the light source on the surface of the virtual object model. Specifically, the illumination information determines the distribution of illumination intensity generated by the light source on the surface of the virtual object model.

[0069] Among them, texture coordinates can be a coordinate system used to describe texture mapping. Texture mapping is a technology that applies texture maps to flat or curved surfaces, which can make the appearance of the three-dimensional model surface more realistic and detailed. When performing texture mapping, it is necessary to map the pixel coordinates in the texture map to the surface of the three-dimensional model, which requires texture coordinates. Texture coordinates are usually a two-dimensional coordinate system (which can be a UV coordinate system) that is used to describe the pixel position in the texture map. When performing texture mapping, the shader will look up the corresponding color value in the texture map according to the texture coordinates corresponding to each pixel, and apply it to the model surface, thereby achieving the effect of texture mapping.

[0070] In the embodiment of the present application, the texture coordinate value refers to the coordinate value of the position point where texture mapping is required on a coordinate axis (U axis or V axis) of a two-dimensional coordinate system (ie, UV coordinate system).

[0071] In some embodiments, if a plurality of preset gradient texture sub-maps are divided in rows in the preset texture map, the texture coordinate value may be a coordinate value of a position point requiring texture mapping on the U axis of the two-dimensional coordinate system.

[0072] That is, the coordinate value of the position point on the V axis of the two-dimensional coordinate system can be determined according to the target color value corresponding to the position point, and thus the corresponding target mapping area can be determined according to the coordinate value on the V axis; the coordinate value of the position point on the U axis of the two-dimensional coordinate system can be determined according to the lighting information corresponding to the position point, and thus the color or value used to render the position point can be determined from the preset gradient texture sub-map in the target mapping area according to the coordinate value on the U axis.

[0073] In some embodiments, if a plurality of preset gradient texture sub-maps are divided in columns in the preset texture map, the texture coordinate value may be a coordinate value of a position point requiring texture mapping on the V axis of the two-dimensional coordinate system.

[0074] That is, the coordinate value of the position point on the U axis of the two-dimensional coordinate system can be determined according to the target color value corresponding to the position point, and thus the corresponding target mapping area can be determined according to the coordinate value on the U axis; the coordinate value of the position point on the V axis of the two-dimensional coordinate system can be determined according to the lighting information corresponding to the position point, and thus the color or value used to render the position point can be determined from the preset gradient texture sub-map in the target mapping area according to the coordinate value on the V axis.

[0075] In some embodiments, in order to improve the rendering effect of the virtual object model, the step of "obtaining the lighting information corresponding to each position point, and determining the texture coordinate value corresponding to each position point according to the lighting information" may include the following operations:

[0076] Get the normal vector and light source direction vector corresponding to each position point;

[0077] Calculate the dot product of the normal vector of each position point and the light source direction vector;

[0078] Based on the dot product, the texture coordinate value corresponding to each position point is determined.

[0079] Among them, the normal vector refers to the normal vector in the world space, that is, the vector that describes the direction of the surface normal in the world space of the three-dimensional model.

[0080] In the embodiment of the present application, the normal vector of a position point refers to the normal direction vector corresponding to the position point in the world space where the virtual object model is located.

[0081] The normal vector of each position point may be obtained from a normal map of the virtual object model.

[0082] Specifically, a normal map refers to drawing a normal at each point on the concave and convex surface of the original object model, and marking the direction of the normal through the RGB color channel.

[0083] In the embodiment of the present application, a normal map of the virtual object model may be created in advance. For example, a corresponding normal may be generated according to the concave-convex position information of each position point on the surface of the virtual object model.

[0084] In an embodiment of the present application, the normal map includes normals of each position point of the virtual object model, and the normal vectors of each position point of the virtual object model are obtained by sampling each normal in the normal map.

[0085] For example, the virtual object model may include: position point 1, position point 2, position point 3, ..., position point n, and the normal map may include normal line 1, normal line 2, normal line 3, ..., normal line n. Further, normal line 1 is obtained from the normal map to obtain the normal vector corresponding to position point 1, normal line 2 is obtained to obtain the normal vector corresponding to position point 2, normal line 3 is obtained to obtain the normal vector corresponding to position point 3, normal line n is obtained to obtain the normal vector corresponding to position point n.

[0086] The light source direction vector refers to the direction vector of the light source, indicating the direction of the position point where the light shines on the surface of the virtual object model.

[0087] The calculation formula for calculating the dot product of the normal vector of each position point and the light source direction vector can be as follows:

[0088] A·B=|A||B|cos(θ);

[0089] Where A refers to the normal vector, B refers to the light source direction vector, and θ refers to the angle between the normal vector and the light source direction vector. A·B refers to the dot product of the calculated normal vector and the light source direction vector.

[0090] Determining the texture coordinate value corresponding to each position point based on the dot product may include using the value corresponding to the dot product as the texture coordinate value corresponding to the position point.

[0091] For example, the virtual object model may include: position point 1, position point 2, position point 3, ..., position point n. Among them, the normal vector corresponding to position point 1 may be vector a1, and the corresponding light source direction vector may be b1; the normal vector corresponding to position point 1 may be vector a1, and the corresponding light source direction vector may be b1; the normal vector corresponding to position point 1 may be vector a1, and the corresponding light source direction vector may be b1, the normal vector corresponding to position point 3 may be vector c, ..., and the normal vector corresponding to position point n may be vector n. Then, the dot product of the normal vector corresponding to each position point and the light source direction vector may be calculated respectively, and the value corresponding to the dot product may be used as the texture coordinate value corresponding to each position point.

[0092] In the embodiment of the present application, the texture position of each position point for texture mapping can be determined according to the above-calculated coordinate values ​​of each position point. Then, the rendering information corresponding to the texture position can be obtained from the preset gradient texture sub-map corresponding to each position point according to the texture position.

[0093] In some embodiments, in order to facilitate the acquisition of gradient rendering information corresponding to each position point from a preset gradient map, the step of "obtaining the information to be rendered corresponding to each position point from the gradient texture sub-map corresponding to the target map area based on the texture coordinate value corresponding to each position point" may include the following operations:

[0094] According to the texture coordinate value corresponding to each position point, the corresponding sampling position is determined from the gradient texture sub-map;

[0095] The rendering information corresponding to each sampling position is obtained from the gradient texture sub-map to obtain the information to be rendered corresponding to each position point.

[0096] Specifically, the sampling position can be a coordinate system used to sample the texture map. When performing texture mapping, the shader needs to obtain rendering information from the texture map, and the sampling position can be used to specify the pixel position where the rendering information needs to be obtained. When performing texture sampling, the shader will search for the corresponding rendering information (such as color value, etc.) in the texture map according to the sampling position corresponding to each pixel, and then apply it to the surface of the virtual object model to achieve the effect of texture mapping.

[0097] In an embodiment of the present application, the corresponding sampling position is determined from the gradient texture sub-map according to the texture coordinate value corresponding to each position point, that is, the position corresponding to the texture coordinate value is determined from the preset texture sub-map corresponding to each position point as the sampling position.

[0098] For example, the position points of the virtual object model may include: position point 1, position point 2, position point 3, ..., position point n. The texture coordinate value of position point 1 may be 1. The preset texture map may include: preset texture sub-map Figure 1 , preset texture sub-texture Figure 2 , preset texture sub-texture Figure 3 And preset texture sub-texture Figure 4 Among them, the preset texture sub-map corresponding to the position point 1 in the preset texture map can be: preset texture sub-map Figure 1 .

[0099] Furthermore, you can select a preset texture sub-texture Figure 1 When it is determined that the texture coordinate value is 1, the corresponding sampling position is 1, and then the rendering information of the sampling position 1 is obtained as the information to be rendered at position point 1.

[0100] In some embodiments, the rendering information in the preset texture sub-map may include a color value, and obtaining the rendering information of the sampling position as the information to be rendered at the position point may include: obtaining the rendering color value corresponding to the sampling position as the color value to be rendered at the position point.

[0101] Specifically, after obtaining the information to be rendered of each position point from the preset texture sub-map, the virtual object model can be rendered through the shader according to the information to be rendered.

[0102] In some embodiments, the step of “rendering the virtual object model based on the information to be rendered” may include the following operations:

[0103] According to the rendering information corresponding to each sampling position, each position point is rendered respectively.

[0104] For example, the rendering information may include a rendering color value. The rendering color value corresponding to position point 1 may be: a first color value, and the color of position point 1 may be rendered according to the first color value. The above method is also used for other position points. In this way, the same preset gradient map may be used to achieve separate rendering of different position points of the same virtual object model, so as to achieve a gradient rendering effect of different position points.

[0105] The embodiment of the present application discloses a method for rendering a virtual object model, the method comprising: obtaining color information of each position point on the model surface of the virtual object model; determining a target map area corresponding to each position point from a preset gradient map according to the color information, wherein the preset gradient map includes multiple map areas, and each map area is provided with a gradient texture sub-map; rendering the virtual object model based on the gradient texture sub-map corresponding to the target map area. In this way, a preset gradient map can be used to control the separate rendering of different positions on the surface of the same virtual object model to achieve a gradient rendering effect at different positions, thereby improving the rendering effect of the virtual object model.

[0106] 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 meaning of the terms is the same as that in the virtual object model rendering method, and the specific implementation details can refer to the description in the method embodiment.

[0107] See also Figure 3 , Figure 3 A structural block diagram of a rendering device for a virtual object model provided in an embodiment of the present application, the device comprising:

[0108] An acquisition unit 301 is used to acquire color information of each position point on the model surface of the virtual object model;

[0109] A determination unit 302 is used to determine a target map area corresponding to each position point from a preset gradient map according to the color information, wherein the preset gradient map includes a plurality of map areas, and a gradient texture sub-map is set in each map area;

[0110] The rendering unit 303 is used to render the virtual object model based on the gradient texture sub-map corresponding to the target map area.

[0111] In some embodiments, the acquisition unit 301 may include:

[0112] A first acquisition subunit, used to acquire a color map of the virtual object model;

[0113] The sampling subunit is used to sample the target color value corresponding to each position point in the specified color channel of the color map to obtain the color information.

[0114] In some embodiments, the determining unit 302 may include:

[0115] A second acquisition subunit is used to acquire a preset correspondence between a map area of ​​the preset gradient map and a color value of the specified color channel, wherein the preset correspondence includes a color value range corresponding to each map area;

[0116] The first determining subunit is used to determine, from the preset corresponding relationship, a mapping area corresponding to a target color value range to which the target color value belongs, to obtain the target mapping area.

[0117] In some embodiments, the rendering unit 303 may include:

[0118] A third acquisition subunit is used to acquire illumination information corresponding to each position point, and determine a texture coordinate value corresponding to each position point according to the illumination information;

[0119] A fourth acquisition subunit is used to acquire the to-be-rendered information corresponding to each position point from the gradient texture sub-map corresponding to the target map area based on the texture coordinate value corresponding to each position point;

[0120] A rendering subunit is used to render the virtual object model based on the information to be rendered.

[0121] In some embodiments, the third acquisition subunit may be specifically used for:

[0122] Get the normal vector and light source direction vector corresponding to each position point;

[0123] Calculate the dot product of the normal vector of each position point and the light source direction vector;

[0124] Based on the dot product, the texture coordinate value corresponding to each position point is determined.

[0125] In some embodiments, the fourth acquisition subunit may be specifically used for:

[0126] Determine the corresponding sampling position from the gradient texture sub-map according to the texture coordinate value corresponding to each position point;

[0127] The rendering information corresponding to each sampling position is obtained from the gradient texture sub-map to obtain the information to be rendered corresponding to each position point.

[0128] In some embodiments, the rendering subunit may be specifically used for:

[0129] According to the rendering information corresponding to each sampling position, each position point is rendered respectively.

[0130] The embodiment of the present application discloses a rendering device for a virtual object model, wherein the color information of each position point on the model surface of the virtual object model is obtained by an acquisition unit 301; a determination unit 302 determines a target map area corresponding to each position point from a preset gradient map according to the color information, wherein the preset gradient map includes multiple map areas, and a gradient texture sub-map is set in each map area; a rendering unit 303 renders the virtual object model based on the gradient texture sub-map corresponding to the target map area. In this way, the rendering effect of the virtual object model can be improved.

[0131] Accordingly, the embodiment of the present application also provides a computer device, which may be a terminal. Figure 4 As shown, Figure 4 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.

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

[0133] 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:

[0134] Acquire color information of each position point on the model surface of the virtual object model;

[0135] Determine a target map area corresponding to each position point from a preset gradient map according to the color information, wherein the preset gradient map includes a plurality of map areas, and a gradient texture sub-map is set in each map area;

[0136] The virtual object model is rendered based on the gradient texture sub-map corresponding to the target map area.

[0137] The embodiment of the present application obtains the color information of each position point on the model surface of the virtual object model; determines the target map area corresponding to each position point from the preset gradient map according to the color information, wherein the preset gradient map includes multiple map areas, and each map area is provided with a gradient texture sub-map; and renders the virtual object model based on the gradient texture sub-map corresponding to the target map area. In this way, a preset gradient map can be used to control the separate rendering of different positions on the surface of the same virtual object model to achieve the gradient rendering effect of different positions, thereby improving the rendering effect of the virtual object model.

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

[0139] Optional, such as Figure 4 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 Figure 4 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.

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

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

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

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

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

[0145] although Figure 4 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.

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

[0147] As can be seen from the above, the computer device provided in this embodiment can obtain the color information of each position point on the model surface of the virtual object model; determine the target map area corresponding to each position point from the preset gradient map according to the color information, wherein the preset gradient map includes multiple map areas, and a gradient texture sub-map is set in each map area; and render the virtual object model based on the gradient texture sub-map corresponding to the target map area.

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

[0149] 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:

[0150] Acquire color information of each position point on the model surface of the virtual object model;

[0151] Determine a target map area corresponding to each position point from a preset gradient map according to the color information, wherein the preset gradient map includes a plurality of map areas, and a gradient texture sub-map is set in each map area;

[0152] The virtual object model is rendered based on the gradient texture sub-map corresponding to the target map area.

[0153] The embodiment of the present application obtains the color information of each position point on the model surface of the virtual object model; determines the target map area corresponding to each position point from the preset gradient map according to the color information, wherein the preset gradient map includes multiple map areas, and each map area is provided with a gradient texture sub-map; and renders the virtual object model based on the gradient texture sub-map corresponding to the target map area. In this way, a preset gradient map can be used to control the separate rendering of different positions on the surface of the same virtual object model to achieve the gradient rendering effect of different positions, thereby improving the rendering effect of the virtual object model.

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

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

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

[0157] 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: Acquire color information of each position point on the model surface of the virtual object model; Determine a target map area corresponding to each position point from a preset gradient map according to the color information, wherein the preset gradient map includes a plurality of map areas, and a gradient texture sub-map is set in each map area; The virtual object model is rendered based on the gradient texture sub-map corresponding to the target map area.

2. The method according to claim 1, characterized in that: The step of obtaining color information of each position point on the model surface of the virtual object model includes: Obtaining a color map of the virtual object model; The target color value corresponding to each position point in the specified color channel of the color map is sampled to obtain the color information.

3. The method according to claim 2, characterized in that The step of determining a target map area corresponding to each position point from a preset gradient map according to the color information includes: Obtaining a preset correspondence between a map area of ​​the preset gradient map and a color value of the specified color channel, wherein the preset correspondence includes a color value range corresponding to each map area; From the preset corresponding relationship, a mapping area corresponding to a target color value range to which the target color value belongs is determined to obtain the target mapping area.

4. The method according to claim 1, characterized in that: The rendering of the virtual object model based on the gradient texture sub-map corresponding to the target map area includes: Acquire illumination information corresponding to each position point, and determine texture coordinate values ​​corresponding to each position point according to the illumination information; Based on the texture coordinate values ​​corresponding to each position point, obtaining the to-be-rendered information corresponding to each position point from the gradient texture sub-map corresponding to the target map area; The virtual object model is rendered based on the information to be rendered.

5. The method according to claim 4, characterized in that The obtaining of illumination information corresponding to each position point, and determining the texture coordinate value corresponding to each position point according to the illumination information, includes: Get the normal vector and light source direction vector corresponding to each position point; Calculate the dot product of the normal vector of each position point and the light source direction vector; Based on the dot product, the texture coordinate value corresponding to each position point is determined.

6. The method according to claim 4, characterized in that The step of obtaining the to-be-rendered information corresponding to each position point from the gradient texture sub-map corresponding to the target map area based on the texture coordinate value corresponding to each position point includes: Determine the corresponding sampling position from the gradient texture sub-map according to the texture coordinate value corresponding to each position point; The rendering information corresponding to each sampling position is obtained from the gradient texture sub-map to obtain the information to be rendered corresponding to each position point.

7. The method according to claim 6, characterized in that The rendering of the virtual object model based on the information to be rendered includes: According to the rendering information corresponding to each sampling position, each position point is rendered respectively.

8. A rendering device for a virtual object model, characterized in that: The device comprises: An acquisition unit, used to acquire color information of each position point on the model surface of the virtual object model; A determination unit, configured to determine a target map area corresponding to each position point from a preset gradient map according to the color information, wherein the preset gradient map includes a plurality of map areas, and a gradient texture sub-map is set in each map area; A rendering unit is used to render the virtual object model based on the gradient texture sub-map corresponding to the target map area.

9. 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 8 is implemented.

10. 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 8.