Model information processing methods, devices, storage media and computer equipment

By obtaining an auxiliary sphere from the target model and using the sphere's radius and distance to determine ambient occlusion information, the problem of simplifying the ambient occlusion effect of the virtual model is solved, and a gradual occlusion effect is achieved.

CN115272432BActive Publication Date: 2025-10-28NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210931523.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-04
Publication Date
2025-10-28
Estimated Expiration
2042-08-04

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve the desired ambient occlusion effect in virtual models when simplifying the model's surface shape.

Method used

By obtaining an auxiliary sphere of the target model, ambient occlusion information is determined based on the radius of the auxiliary sphere and the distance between its vertices and the center of the sphere, thus avoiding reliance on the surface morphology of the model, such as curvature and normals.

Benefits of technology

Regardless of how simplified or abstract the model state is, it can achieve good ambient occlusion effect, produce a gradual occlusion effect, and improve the occlusion effect of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115272432B_ABST
    Figure CN115272432B_ABST
Patent Text Reader

Abstract

This application discloses a model information processing method, apparatus, storage medium, and computer device. The method includes: acquiring a target model to be processed and an auxiliary sphere corresponding to the target model, wherein the target model includes multiple vertices, and the auxiliary sphere includes at least one, the auxiliary sphere being pre-determined based on the contour of the target model; for each vertex of the target model, determining a target auxiliary sphere matching the vertex from the auxiliary spheres; and determining the ambient occlusion information corresponding to the vertex of the target model based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere. This application provides a new scheme for determining the ambient occlusion information of a target model, eliminating the need to determine the ambient occlusion information based on the surface morphology of the target model, thus improving the ambient occlusion effect of the target model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, specifically to a model information processing method, apparatus, computer-readable storage medium, and computer equipment. Background Technology

[0002] Currently, in most Digital Content Creation (DCC) tools, when implementing the ambient occlusion (AO) effect for virtual scenes, including virtual models, the usual method is to add ambient lighting to the virtual model to simulate it, and then combine the surface information of the virtual model, such as curvature and normals, to calculate ambient occlusion information that is similar to that in reality, and assign it to the vertex color of vertices in nearby positions.

[0003] Currently, the determination of the ambient occlusion effect of virtual models is based on the shape of the virtual model's surface. When the details of the virtual model itself are greatly simplified, the current ambient occlusion effect will not meet the target expectation and will not achieve the desired effect. Summary of the Invention

[0004] This application provides a model information processing method, apparatus, computer-readable storage medium, and computer device, offering a new scheme for determining the ambient light occlusion information of a target model. This eliminates the need to determine the ambient light occlusion information of the target model based on its surface morphology, thereby improving the ambient light occlusion effect of the target model.

[0005] This application provides a model information processing method, including:

[0006] Obtain the target model to be processed, the target model including multiple vertices;

[0007] Obtain an auxiliary sphere corresponding to the target model, wherein the auxiliary sphere includes at least one, and the auxiliary sphere is predetermined according to the contour of the target model;

[0008] For each vertex of the target model, a target auxiliary sphere matching the vertex is determined from the auxiliary spheres;

[0009] Based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere, the ambient light occlusion information corresponding to the vertex of the target model is determined.

[0010] This application embodiment also provides a model information processing device, including:

[0011] An acquisition module is used to acquire a target model to be processed and an auxiliary sphere corresponding to the target model. The target model includes multiple vertices, and the auxiliary sphere includes at least one. The auxiliary sphere is predetermined according to the contour of the target model.

[0012] The first determining module is used to determine, for each vertex of the target model, a target auxiliary sphere that matches the vertex from the auxiliary spheres;

[0013] The second determining module is used to determine the ambient light occlusion information corresponding to the vertex of the target model based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere.

[0014] This application also provides a computer-readable storage medium storing a computer program adapted for loading by a processor to perform the steps in the model information processing method as described in any of the above embodiments.

[0015] This application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the steps in the model information processing method described in any of the above embodiments by calling the computer program stored in the memory.

[0016] The model information processing method, apparatus, computer-readable storage medium, and computer device provided in this application embodiment acquire a target model to be processed and an auxiliary sphere corresponding to the target model. The auxiliary sphere is pre-determined based on the contour of the target model. Since the auxiliary sphere is determined based on the contour of the target model, the determination of the auxiliary sphere meets expectations. For each vertex of the target model, a target auxiliary sphere matching the vertex is determined from the auxiliary spheres. Based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere, the ambient light occlusion information corresponding to the vertex of the target model is determined. That is, this application embodiment provides a new way to determine ambient light occlusion information without relying on the target model. The ambient occlusion information of the target model is determined by the surface state of the model, such as curvature and normals. Since it is not necessary to determine the ambient occlusion information of the target model based on the shape of the model surface, a good ambient occlusion effect can be achieved regardless of how simplified or abstract the model is. Moreover, the ambient occlusion information is determined based on the radius of the target auxiliary sphere that meets the expectations, as well as the distance between the vertex and the center of the target auxiliary sphere. This makes the determined ambient occlusion information related to the distance between the vertex and the center of the target auxiliary sphere, which can produce a gradual ambient occlusion effect. At the same time, the center point and range of the gradual ambient occlusion effect are determined based on the target auxiliary sphere, which improves the ambient occlusion effect of the target model. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating the model information processing method provided in an embodiment of this application.

[0019] Figure 2 A schematic diagram of the target model provided in the embodiments of this application.

[0020] Figure 3 This is a schematic diagram of the auxiliary sphere of the target model provided in the embodiments of this application.

[0021] Figure 4 This is a schematic diagram of a sub-process of the model information processing method provided in the embodiments of this application.

[0022] Figure 5 This is a schematic diagram of another sub-process of the model information processing method provided in the embodiments of this application.

[0023] Figure 6 This is another schematic diagram of the model information processing method provided in the embodiments of this application.

[0024] Figure 7 This is a schematic diagram of the interactive interface provided in an embodiment of this application.

[0025] Figure 8 A schematic diagram showing the comparison between the ambient light occlusion effect in this application embodiment and the ambient light occlusion effect in the prior art.

[0026] Figure 9 This is a schematic diagram of the structure of the model information processing device provided in the embodiments of this application.

[0027] Figure 10 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0029] This application provides a model information processing method, apparatus, computer-readable storage medium, and computer device. Specifically, the model information processing method of this application can be executed by a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet computer, laptop computer, touch screen, game console, personal computer (PC), personal digital assistant (PDA), robot, or other terminal device. The server can be an independent physical server, 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 communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0030] For example, when the model information processing method runs on a terminal, the terminal implements the model information processing method in this embodiment to achieve the ambient occlusion effect of the target model. Alternatively, when the model information processing method runs on a terminal, the terminal stores digital content creation tools or applications such as Maya, 3ds Max, Softimage, Houdini, Cinema4D Blender, Modo, or Lightwave. In this embodiment, 3ds Max is used as an example. The digital content creation tools or applications are used to present the scene of the target model, load the interactive screen of the target model, and adjust the interactive screen of the auxiliary sphere of the target model. The model information processing method in this application can be implemented in the digital content creation tools or applications. The terminal is used to interact with the user through a graphical user interface. The way the terminal provides the graphical user interface to the user can include various methods, such as rendering and displaying it on the terminal's screen or presenting the graphical user interface through holographic projection.

[0031] For example, when this model information processing method runs on a server, it can be used for cloud production, such as generating ambient occlusion information online and rendering target models online. In cloud production mode, the main body running the digital content production tool or application is separate from the main body presenting the production screen. The storage and operation of the model information processing method are completed on the cloud server, while the presentation of the production screen is completed on the cloud production client. During cloud production, the user's client sends operation instructions to the cloud server. The cloud server executes the operation instructions, encodes and compresses the production screen, display effects, and other data, returns them to the client via the network, and finally, the client decodes and outputs the production screen, display effects, etc. This reduces the terminal's computing resource consumption and improves the image quality displayed on the terminal.

[0032] The following will provide a detailed description of a model information processing method, apparatus, computer-readable storage medium, and computer device provided in the embodiments of this application. It should be noted that the sequence numbers of the following embodiments are not intended to limit the preferred order of the embodiments. In the embodiments of this application, ambient light occlusion (AO) describes the effect of blocking surrounding light when objects intersect or are close together, and can be used to control the intensity of indirect lighting received by the model surface.

[0033] Figure 1 This is a flowchart illustrating the model information processing method provided in this application embodiment, which includes the following steps.

[0034] 101. Obtain the target model to be processed, which includes multiple vertices.

[0035] The target model to be processed can be any model that needs to generate ambient occlusion information.

[0036] For example, the target model can be a tree canopy model or a shrub model, or it can be a model created using mesh patches. To achieve a better ambient occlusion effect, while also considering efficiency and accuracy, the target model can be a tree canopy or shrub model created using mesh patches, or even a tree canopy or shrub model created using mesh patches that only requires a small amount of macroscopic ambient occlusion effect.

[0037] like Figure 2 The image shown is a schematic diagram of a tree crown model created using mesh inserts.

[0038] In particular, since tree canopy and shrub-like models created using mesh interpolation do not require a large number of auxiliary spheres (described later) to meet the requirements, fewer auxiliary spheres improve computational efficiency, and fewer auxiliary spheres also require less adjustment, improving the efficiency of adjusting auxiliary spheres. Moreover, this application needs to store the calculated ambient light occlusion intensity value in the vertex color of the model. Therefore, a large number of vertices are required to ensure the accuracy of ambient light occlusion, and the number of vertices in tree canopy and shrub-like models created using mesh interpolation can well meet the requirements.

[0039] The target model can be stored using model variables. The target model includes a vertex list, with multiple vertices, each with a corresponding vertex color attribute. This model is stored through model variables to facilitate subsequent modification of vertex colors. The model variables determine whether the target model has been acquired. If the model variable is empty, it means the target model has not been acquired, and a prompt will be displayed; otherwise, it means the target model has been acquired. Vertex color is an attribute of the target model's vertices. During game rendering of the target model, it can be obtained from the corresponding material and used for custom calculations of its vertex colors.

[0040] In one embodiment, a target model can be preset, thus allowing direct acquisition of the preset target model. Alternatively, the target model can be acquired through other means.

[0041] 102. Obtain the auxiliary sphere corresponding to the target model. The auxiliary sphere includes at least one and is predetermined according to the contour of the target model.

[0042] An auxiliary sphere is a spherical model set up to assist in determining the ambient occlusion information of the target model. The target model may have at least one auxiliary sphere, and there may be one or more. The auxiliary sphere determines information such as the distribution, center point, and range of the ambient occlusion information of the target model. For example, the distribution of the ambient occlusion information of the target model can be determined based on the distribution of the auxiliary spheres; the center point of the ambient occlusion information of the target model can be determined based on the center of each auxiliary sphere (one center point per sphere); and the range of the ambient occlusion information of the target model can be determined based on the radius of the auxiliary spheres.

[0043] The auxiliary spheres for the target model can be predetermined, for example, based on the outline of the target model. The determination can be automatic or manual, as described in detail below. The determined auxiliary spheres are saved to a list variable of auxiliary spheres. If the list variable is empty, it means no auxiliary spheres for the target model have been determined; if the list variable is not empty, it means auxiliary spheres for the target model have been determined.

[0044] The target model's outline includes an overall outline and / or partial outlines. Correspondingly, an auxiliary sphere is pre-set for the overall outline of the target model, meaning the overall outline corresponds to one auxiliary sphere, and / or an auxiliary sphere is set for each partial outline, meaning each partial outline corresponds to one auxiliary sphere. The corresponding auxiliary sphere will include / enclose the outline with a preset proportion.

[0045] For example, when the target model is a tree canopy model or a shrub model, the outline of the target model includes an overall outline and / or at least one branch and leaf cluster outline. A target model may include one or more branch and leaf cluster outlines. The auxiliary spheres of the target model include an auxiliary sphere corresponding to the overall outline and / or an auxiliary sphere corresponding to each branch and leaf cluster outline. The auxiliary sphere corresponding to the overall outline at least includes / encloses the overall outline at a first preset ratio, and the branch and leaf cluster outlines at least include / enclose branch and leaf cluster outlines at a second preset ratio. The first preset ratio and the second preset ratio can be the same or different; for example, the first preset ratio is 90%, and the second preset ratio is 85%, etc.

[0046] Among them, the auxiliary sphere corresponding to the overall outline can be used to determine the overall ambient occlusion effect of the target model, while the auxiliary sphere corresponding to the partial outline can be used to determine the ambient occlusion effect of the details inside the model.

[0047] like Figure 3 The diagram shown is a schematic of the auxiliary sphere provided in an embodiment of this application. Figure 3 The auxiliary sphere in the text corresponds to: Figure 2 The auxiliary spheres corresponding to the canopy model shown are as follows: there are three auxiliary spheres corresponding to the canopy model, namely the auxiliary sphere corresponding to the overall outline and the two auxiliary spheres corresponding to the outlines of the two branch and leaf clusters, as shown in the lower right corner, corresponding to Sphere001, Sphere002 and Sphere003.

[0048] 103. For each vertex of the target model, determine the target auxiliary sphere that matches the vertex from the auxiliary spheres.

[0049] The process iterates through all vertices of the target model. For each vertex, it obtains the vertex's world space coordinates, the coordinates of the center of the corresponding auxiliary sphere (which are world coordinates), and its radius. Based on the vertex's world space coordinates, center coordinates, and radius, it determines the target auxiliary sphere that matches the vertex. A single target auxiliary sphere corresponds to one vertex.

[0050] In one embodiment, such as Figure 4 As shown, step 103 includes steps 201 to 202.

[0051] 201. Based on the bounding box of the target model, determine candidate auxiliary spheres from the auxiliary spheres.

[0052] The bounding box of the target model refers to a cube or two-dimensional rectangle that can contain the target model. It is a type of bounding body. In this embodiment, the target model is a three-dimensional model. Therefore, the bounding box of the target model refers to a cube that can contain the target model. For example, the bounding box is an axis-aligned bounding box. In other embodiments, other matching bounding boxes can also be selected.

[0053] An axis-aligned bounding box (AABB) is defined as the smallest hexahedron containing the target model with edges parallel to the coordinate axes. In one embodiment, the bounding box is a cuboid-shaped axis-aligned bounding box. Cuboid-shaped axis-aligned bounding boxes are simple to construct; describing one requires only six scalars and has a small storage space.

[0054] In one embodiment, the step of determining candidate auxiliary spheres from auxiliary spheres based on the bounding box of the target model specifically includes: obtaining the bounding box of the target model; and determining auxiliary spheres whose centers are within the bounding box of the target model as candidate auxiliary spheres.

[0055] The bounding box of the target model is determined by the maximum and minimum values ​​of the coordinates along the three axes in the local coordinate system corresponding to the target model. The bounding box of the target model can be obtained through an interface, such as the one provided by MaxScript.

[0056] After obtaining the bounding box of the target model, the world coordinates of the center of the auxiliary sphere are converted into local coordinates in the local coordinate system of the target model. The local coordinates of the center of the auxiliary sphere are then compared with the coordinates corresponding to the bounding box. For example, the local coordinates of the center of the auxiliary sphere are compared with the maximum and minimum values ​​of the coordinates along the three coordinate axes. If the local coordinates of the center of the auxiliary sphere are all between the maximum and minimum values, then the center of the auxiliary sphere is determined to be within the bounding box of the target model. The auxiliary sphere whose center is within the bounding box of the target model is determined as a candidate auxiliary sphere. Otherwise, if the center is not within the bounding box of the target model, then the auxiliary sphere is not a candidate auxiliary sphere and is skipped. In this way, the candidate auxiliary spheres among all auxiliary spheres are obtained.

[0057] Candidate auxiliary spheres can also be represented by a list of candidate auxiliary spheres. If the list of candidate auxiliary spheres is empty, it means that the centers of all auxiliary spheres are not within the bounding box of the target model, and a prompt will be given, and no further steps will be taken.

[0058] This step uses the bounding box of the target model to determine candidate auxiliary spheres, thereby removing auxiliary spheres that are not within the bounding box of the target model. This avoids the impact of auxiliary spheres not within the bounding box of the target model on the ambient light occlusion effect, and improves the rationality and accuracy of the ambient light occlusion effect.

[0059] 202. Based on the positional relationship between the vertex and the candidate auxiliary spheres, determine the target auxiliary sphere that matches the vertex from the candidate auxiliary spheres.

[0060] After determining the candidate auxiliary spheres, for each vertex of the target model, based on the positional relationship between the vertex and the candidate auxiliary spheres, a target auxiliary sphere matching the vertex is determined from the candidate auxiliary spheres. This positional relationship includes whether the vertex is inside or outside the candidate auxiliary sphere.

[0061] In one embodiment, step 202 includes: when the vertex is inside at least one candidate auxiliary sphere, determining a first distance between the vertex and the center of the candidate auxiliary sphere, and selecting the candidate auxiliary sphere with the smallest first distance as the target auxiliary sphere to match the vertex; when the vertex is outside all candidate auxiliary spheres, determining a second distance between the vertex and the surfaces of all candidate auxiliary spheres, and selecting the candidate auxiliary sphere with the smallest second distance as the target auxiliary sphere to match the vertex.

[0062] Specifically, when a vertex is inside at least one candidate auxiliary sphere, the smaller the first distance between the vertex and the center of the candidate auxiliary sphere, the greater the influence of the candidate auxiliary sphere on the ambient light occlusion information of the vertex. The candidate auxiliary sphere with the smallest first distance is taken as the target auxiliary sphere of the vertex. When a vertex is outside all candidate auxiliary spheres, the smaller the second distance between the vertex and the surfaces of all candidate auxiliary spheres, the greater the influence of the candidate auxiliary sphere on the ambient light occlusion information of the vertex. The candidate auxiliary sphere with the smallest second distance is determined as the target auxiliary sphere of the vertex.

[0063] In one embodiment, a vertex being inside a candidate auxiliary sphere can be represented by the distance between the vertex and the center of the candidate auxiliary sphere being less than the radius of the sphere. Correspondingly, a vertex being outside a candidate auxiliary sphere can be represented by the distance between the vertex and the center of the candidate auxiliary sphere being greater than the radius of the sphere. The case of a vertex being on the surface of a candidate auxiliary sphere can be classified as either a vertex being inside or outside the candidate auxiliary sphere.

[0064] Correspondingly, such as Figure 5 The aforementioned step 202 includes the following steps 301 to 310.

[0065] 301. Obtain the first candidate auxiliary sphere from the candidate auxiliary sphere list as the temporary target sphere.

[0066] 302. Are there any unacquired candidate auxiliary spheres in the candidate auxiliary sphere list?

[0067] If there are no unacquired candidate auxiliary spheres, that is, all candidate auxiliary spheres in the candidate auxiliary sphere list have been acquired, then proceed to step 303; otherwise, that is, if there are unacquired candidate auxiliary spheres, then proceed to step 304.

[0068] 303, Use the temporary target sphere as the target auxiliary sphere to match the vertex.

[0069] When there is only one candidate auxiliary sphere in the candidate auxiliary sphere list, the candidate auxiliary sphere is directly used as the target auxiliary sphere to match the vertex. When all candidate auxiliary spheres in the candidate auxiliary sphere list have been obtained, the temporary target sphere is used as the target auxiliary sphere to match the vertex.

[0070] 304. Retrieve the next candidate auxiliary sphere from the candidate auxiliary sphere list as the current sphere.

[0071] 305, is the distance between the vertex and the center of the temporary target sphere less than or equal to the radius of the temporary target sphere?

[0072] That is, whether the distance between the vertex and the center of the temporary target sphere is less than or equal to the radius of the temporary target sphere. If so, it means that the vertex is inside the temporary target sphere, and step 306 is executed; otherwise, step 308 is executed.

[0073] 306, is the distance between the vertex and the center of the current sphere less than or equal to the radius of the current sphere?

[0074] If the distance between the vertex and the center of the current sphere is less than or equal to the radius of the current sphere, then the vertex is inside the current sphere, meaning the vertex is simultaneously inside both the temporary target sphere and the current sphere, and step 307 is executed; otherwise, the vertex is inside the temporary target sphere but outside the current sphere, and step 302 is executed.

[0075] 307. Select the candidate auxiliary sphere with the smaller distance between its vertex and the center of the current sphere, and between its vertex and the center of the temporary target sphere, as the temporary target sphere. Then proceed to step 302.

[0076] 308, is the distance between the vertex and the center of the current sphere less than or equal to the radius of the current sphere?

[0077] If the distance between the vertex and the center of the current sphere is less than or equal to the radius of the current sphere, then the vertex is inside the current sphere, meaning the vertex is outside the temporary target sphere but inside the current sphere. Proceed to step 309. Otherwise, the vertex is outside both the temporary target sphere and the current sphere. Proceed to step 310.

[0078] Although steps 306 and 308 are the same, when combined with step 305, the objectives of steps 306 and 308 are different.

[0079] 309. Set the current sphere as the temporary target sphere. Then proceed to step 302.

[0080] 310. Select the candidate auxiliary sphere with the smaller distance between the vertex and the surface of the temporary target sphere, and between the vertex and the surface of the current sphere, as the temporary target sphere. Then proceed to step 302.

[0081] Through steps 301 to 310 above, the target auxiliary sphere that matches the vertex is determined from the candidate auxiliary spheres based on the positional relationship between the vertex and the candidate auxiliary spheres.

[0082] In one embodiment, instead of individually determining candidate auxiliary spheres, each auxiliary sphere can be obtained from the auxiliary sphere list. Then, it can be determined whether the center of the auxiliary sphere is within the bounding box of the target model. If it is not, the next auxiliary sphere can be obtained from the auxiliary sphere list. If it is, the auxiliary sphere is used as a temporary target sphere. If there are still unobtained candidate auxiliary spheres in the auxiliary sphere list, the next auxiliary sphere can be obtained from the list, and it can be determined whether its center is within the bounding box of the target model. If it is, the auxiliary sphere is used as the current sphere. Then, the corresponding steps between steps 305 and 310 are executed until each auxiliary sphere in the auxiliary sphere list has been obtained. Understandably, in this embodiment, after obtaining the auxiliary sphere from the list of auxiliary spheres, it is first determined whether the center of the auxiliary sphere is within the bounding box of the target model. If it is within the bounding box, other determinations are then performed. Compared to determining candidate auxiliary spheres in advance from the list of auxiliary spheres and then determining the target auxiliary sphere from the list of candidate auxiliary spheres, the latter method (i.e., determining candidate auxiliary spheres in advance from the list of auxiliary spheres and then determining the target auxiliary sphere from the list of candidate auxiliary spheres) is more efficient and faster.

[0083] Step 103 above enables the determination of the target auxiliary sphere that matches the vertex from the auxiliary spheres.

[0084] 104. Based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere, determine the ambient occlusion information corresponding to the vertex of the target model.

[0085] After determining the target auxiliary sphere, the ambient occlusion information corresponding to the vertices of the target model is determined based on the distance between the vertices and the target auxiliary sphere. For example, the radius of the target auxiliary sphere is obtained; the distance between the vertex and the center of the target auxiliary sphere is determined; and based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere, the ambient occlusion information corresponding to the vertices of the target model is determined.

[0086] Specifically, the distance between the vertex and the center of the target auxiliary sphere is determined based on their world coordinates and the world coordinates of the target auxiliary sphere's center. After determining the distance and obtaining the radius of the target auxiliary sphere, the ratio of distance to radius is used to determine the ambient occlusion information corresponding to the vertex of the target model. This ambient occlusion information includes the ambient occlusion intensity value; for example, the ratio of distance to radius is directly used to determine the ambient occlusion intensity value corresponding to the vertex of the target model. In one viewpoint, the radius of the target auxiliary sphere can be understood as being used to normalize the distance.

[0087] Specifically, when the ratio of distance to radius is less than or equal to a preset ratio, the ratio is directly used to determine the ambient occlusion intensity value corresponding to the vertex of the target model. When the ratio of distance to radius is greater than the preset ratio, the preset ratio is used as the ambient occlusion intensity value corresponding to the vertex of the target model. The preset ratio can be set to 1 or other reasonable values, such as 0.9. This can be understood as truncating the ratio of distance to radius to the preset ratio, such as 1.

[0088] Therefore, by uniformly increasing the ambient light occlusion intensity value from the center of the target auxiliary sphere to the surface of the sphere from 0 to 1, a gradual ambient light occlusion effect can be produced. At the same time, the center point of the ambient light occlusion effect is determined according to the center of the target auxiliary sphere, and the range of the ambient light occlusion effect is determined according to the radius of the target auxiliary sphere. If the vertex is located outside the target auxiliary sphere, it will not affect its ambient light occlusion intensity value.

[0089] The smaller the ambient light occlusion intensity value, the lower the degree of ambient light received by the surface near the corresponding vertex. Under the condition that the degree of direct lighting remains unchanged, the surface of the target model appears darker. When the ambient light occlusion intensity value is 0, it means that the position corresponding to this vertex does not receive ambient light. The larger the ambient light occlusion intensity value, the higher the degree of ambient light received by the surface near the vertex. Under the condition that the degree of direct lighting remains unchanged, the surface of the target model appears brighter. When the ambient light occlusion intensity value is 1, it means that the position corresponding to this vertex receives full intensity of ambient light and is not affected by ambient light occlusion.

[0090] In this embodiment, it is not necessary to determine the ambient occlusion information of the target model based on the surface morphology of the model, such as curvature and normals. Therefore, regardless of how simplified or abstract the model is, a good ambient occlusion effect can be achieved. Moreover, the ambient occlusion information is determined based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere. This makes the determined ambient occlusion information related to the distance between the vertex and the center of the target auxiliary sphere, which can produce a gradual and soft ambient occlusion effect. At the same time, the center point and range of the gradual ambient occlusion effect are determined based on the center and radius of the target auxiliary sphere, thereby improving the ambient occlusion effect of the target model.

[0091] The solutions in this application embodiment can be integrated into a model information processing tool (such as a vertex color auto-drawing tool). This model information processing tool is based on a digital content creation tool or application, such as 3ds Max. This can be understood as the model information processing tool in this application embodiment being developed / integrated within 3ds Max, which integrates the model information processing method in this application embodiment, or as the model information processing method in this application embodiment being executed through the model information processing tool.

[0092] Figure 6 This is another schematic flowchart of the model information processing method provided in the embodiments of this application, which includes the following steps.

[0093] 401. Set the target model to be processed, which includes multiple vertices.

[0094] The model information processing tool provides an interactive interface that assists users in customizing gradient ambient occlusion effects. The interface is displayed through a graphical user interface on a computer device, allowing users to load / set / acquire the target model, add auxiliary spheres to the target model, and set the visibility or invisibility of the auxiliary spheres. The target model contains multiple vertices.

[0095] like Figure 7 The diagram shown is a schematic of the interactive interface provided in an embodiment of this application. This interactive interface is a newly added interface to implement the solution in the embodiment of this application. The interactive interface displays multiple controls, such as the SELECT TREE control, AO Visible control, AO Spheres control, ADD control, PAINT→AO control, etc., and the corresponding functions are implemented through the corresponding controls, which will be described in detail later.

[0096] The step of setting the target model to be processed includes: displaying an interactive interface through a graphical user interface, and setting the target model to be processed through a model selection control on the interactive interface. The model selection control is... Figure 7 The SELECT TREE control in [the context of the text].

[0097] Further, the step of setting the target model to be processed includes: displaying an interactive interface through a graphical user interface, on which a model selection control is displayed; displaying a model selection interface in response to a trigger operation on the model selection control; determining the selected target model based on the model selection interface, and using the selected target model as the target model to be processed; and further, displaying the target model to be processed through a graphical user interface.

[0098] The trigger operation can be based on a model selection control, such as... Figure 7 The SELECT TREE control can be triggered by clicks, double-clicks, right-clicks, touches, or other actions, such as voice prompts. For example, if a voice prompt such as "select model" is detected, the model selection control is triggered. The triggering actions for other controls discussed later are similar and will not be elaborated upon further.

[0099] In response to a trigger action on the model selection control, the model selection interface is displayed. Through this interface, the target model to be processed can be selected / set from the computer device, such as... Figure 7 In this context, the currently selected target model to be processed is the model named SM_Tyro_Tree_13.

[0100] In this way, a model variable `Tree` can be added to the MaxScript code to load and store the target model into the model variable `Tree`. After the target model is rendered, it is displayed through a graphical user interface, such as... Figure 2 The target model shown in the figure.

[0101] In this embodiment, the target model to be processed can be conveniently selected through the model selection control, so as to facilitate the processing of existing target models.

[0102] 402, Add an auxiliary sphere to the target model, the auxiliary sphere comprising at least one, the auxiliary sphere being determined based on the contour of the target model.

[0103] The step of adding an auxiliary sphere to the target model includes: displaying an interactive interface through a graphical user interface, and adding the auxiliary sphere to the target model using an add control on the interactive interface. The add control is... Figure 7 The ADD control in the game.

[0104] Furthermore, the step of adding an auxiliary sphere to the target model includes: displaying an interactive interface through a graphical user interface, showing a control for adding the auxiliary sphere on the interactive interface, and adding the auxiliary sphere to the target model in response to a trigger operation on the add control. That is, adding the auxiliary sphere to the target model in response to a trigger operation on the ADD control. Further, when the auxiliary sphere is visible, it is displayed through the graphical user interface.

[0105] The above describes adding an auxiliary sphere to the target model, specifically by adding an auxiliary sphere to the target model based on its contour. That is, the determination of this auxiliary sphere is related to the contour of the target model. Because the auxiliary sphere is determined based on the contour of the target model, the determined auxiliary sphere meets expectations.

[0106] In one scenario, the steps described above for adding an auxiliary sphere to the target model based on its outline include: adding an initial sphere to the target model, and adjusting the initial sphere according to the outline of the target model to obtain the adjusted auxiliary sphere. Understandably, after the ADD control is triggered, an initial sphere is automatically added to the target model, and then the initial sphere is adjusted according to its outline to obtain the adjusted auxiliary sphere.

[0107] The initial sphere, like the auxiliary sphere, is a spherical model and is automatically generated in the scene. In one scenario, the initial sphere will be generated with a default radius at a default spawn location, for example, the origin of the world coordinate system, and the default radius in 3ds Max units, such as 100. The generated initial sphere will be displayed through the graphical user interface. Alternatively, the spawn location and radius of the initial sphere can be set.

[0108] After generating the initial sphere, adjust it according to the outline of the target model. For example, the initial sphere can be adjusted using the properties panel of an auxiliary sphere based on the outline of the target model. Specifically, adjust the radius and position (including the center point) of the initial sphere on the auxiliary sphere's properties panel. Adjustments can also be made in conjunction with the pivot or coordinate parameter values ​​of the target model. Correspondingly, obtain the selected initial sphere, for example, by using the AO Spheres control to select the initial sphere to be adjusted, receiving the radius, position, etc., set on the auxiliary sphere's properties panel, and adjust the initial sphere according to the set radius and position, thus adjusting the initial sphere's radius and position to match the set values.

[0109] Alternatively, you can select the initial sphere, such as using the AO Spheres control, to move or enlarge / shrink its radius to achieve the desired adjustment.

[0110] Finally, the adjusted target model's first auxiliary sphere includes at least the overall outline of the target model at a first preset ratio, and / or the target model's second auxiliary sphere includes at least a partial outline at a second preset ratio, such as the second auxiliary sphere including at least a branch and leaf cluster outline at a second preset ratio, with one branch and leaf cluster outline corresponding to one second auxiliary sphere. The target model's auxiliary spheres include the first auxiliary sphere and / or the second auxiliary sphere.

[0111] In this case, an initial sphere is first generated, and then the initial sphere is adjusted according to the contour of the target model to obtain an auxiliary sphere.

[0112] In one scenario, the outline of the target model includes an overall outline and / or at least one branch and leaf cluster outline. The step of adding auxiliary spheres to the target model based on its outline includes: adding a first auxiliary sphere to the target model based on its overall outline, the first auxiliary sphere at least encompassing the overall outline at a first preset proportion; and / or adding a second auxiliary sphere corresponding to the number of branch and leaf clusters to the target model based on the branch and leaf cluster outlines, the second auxiliary sphere at least encompassing the branch and leaf cluster outlines at a second preset proportion; using the first and / or second auxiliary spheres as auxiliary spheres for the target model. Further, the auxiliary spheres of the target model can be adjusted to obtain the final auxiliary spheres. During adjustment, the auxiliary sphere to be adjusted is selected using the AO Spheres control. After selecting an auxiliary sphere, adjustments can be made on the auxiliary sphere's property panel, or the initial sphere can be moved or its radius enlarged / reduced to achieve the corresponding adjustment.

[0113] In this case, auxiliary spheres can be added first according to the outline of the target model, and then the added auxiliary spheres can be adjusted.

[0114] The auxiliary sphere after the target model is adjusted can be like Figure 3 As shown.

[0115] In one embodiment, the added auxiliary spheres can also be deleted. For example, by selecting an auxiliary sphere, the auxiliary sphere can be deleted in response to a delete command for that sphere. This delete command can be triggered by selecting the auxiliary sphere and right-clicking.

[0116] The target model has at least one auxiliary sphere. When there are multiple auxiliary spheres, they can be interspersed, contained, or separated. That is, the positional relationship between the multiple auxiliary spheres is unrestricted and only depends on the outline of the target model.

[0117] A list variable has been added to the MaxScript code. The auxiliary spheres added to the target model are added to the list variable containing the list of auxiliary spheres. Currently, three auxiliary spheres have been added to the target model; correspondingly, the list variable includes these three auxiliary spheres. For example... Figure 7 and Figure 2 As shown, the names of the three auxiliary spheres are Sphere001, Sphere002, and Sphere003, respectively.

[0118] In the above scheme, the auxiliary spheres can be adjusted by changing their radius, center point, number, etc. In this way, by adjusting the number, center point, and radius of the auxiliary spheres, the distribution, center point, and range of ambient light occlusion information can be adjusted, thereby achieving arbitrary distribution and gradation effects of ambient light occlusion.

[0119] In this embodiment, the distribution effect of ambient light occlusion on the target model can be autonomously set by controlling the number and / or position of the auxiliary spheres. The gradual change effect of ambient light occlusion can also be controlled by adjusting the radius of the auxiliary model, so as to generate ambient light occlusion effect without relying on the shape of the target model.

[0120] It should be noted that current ambient occlusion effects obtained based on the shape of the target model, such as curvature and normals, only produce one type of similar ambient occlusion effect for a single target model, and the distribution of the ambient occlusion effect cannot be adjusted. However, in the embodiments of this application, the distribution of the ambient occlusion effect can be adjusted, and a regular and gentle gradient ambient occlusion effect can be produced.

[0121] In one embodiment, the display and hiding of the auxiliary sphere can also be configured. For example, the display and hiding of the auxiliary sphere can be controlled by a display / hide control. The display / hide control is... Figure 7 The AO Visible control is used in the graphical user interface (GUI). Correspondingly, an interactive interface is displayed on the GUI, showing / hiding the auxiliary sphere. In response to triggering the control, the display and / or hiding of the auxiliary sphere is controlled. Specifically, if the auxiliary sphere is currently displayed on the GUI, triggering the AO Visible control sets its state to invisible, thus hiding it. If the auxiliary sphere is not currently displayed on the GUI, triggering the AO Visible control sets its state to visible, thus displaying it. The display effect is as follows: Figure 3 As shown. Control the display and hiding of the auxiliary sphere to avoid affecting other operations.

[0122] 403. When a vertex color drawing instruction is detected, obtain the target model and the corresponding auxiliary sphere.

[0123] Among them, the drawing controls on the interactive interface are triggered, such as Figure 7 The PAINT→AO control in the browser generates vertex color drawing instructions. For example, clicking the PAINT→AO control triggers the control, generating vertex color drawing instructions. When these instructions are detected, the target model and its corresponding auxiliary sphere are obtained.

[0124] For example, you can retrieve model variables. If the model variable is empty, it means that the target model does not exist, and a prompt will be given. Otherwise, it means that the target model has been retrieved. You can retrieve list variables. If the list variable is empty, it means that an auxiliary sphere has been set for the target model. If the list variable is not empty, you can retrieve the list of auxiliary spheres in the list variable.

[0125] 404. For each vertex of the target model, determine the target auxiliary sphere that matches the vertex from the auxiliary spheres.

[0126] 405. Based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere, determine the ambient occlusion information corresponding to the vertex of the target model.

[0127] In one embodiment, such as Figure 6 The model information processing method further includes the following steps 406 to 407.

[0128] 406. Save the ambient occlusion information to the vertex color of the target model.

[0129] For example, the calculated ambient light occlusion intensity value can be saved to the vertex color corresponding to each vertex of the target model.

[0130] 407. Render the target model based on vertex colors to obtain the ambient occlusion effect of the target model.

[0131] When rendering the target model based on vertex colors, the color value of the corresponding vertex can be obtained within the corresponding material. This color value, along with the vertex color, is used to determine the final color value of the vertex. For example, the vertex color value is multiplied by the vertex color (e.g., if the vertex color is 0.2, multiply by 0.2) to obtain the final color value. If there are other pixels between the pixels corresponding to two adjacent vertices, interpolation is performed on the two adjacent vertices to obtain the final color values ​​corresponding to the other pixels. After obtaining the final color value, rendering and display are performed.

[0132] like Figure 8 The image shown is a comparison diagram of the ambient light occlusion effect obtained by the tools or methods in this application embodiment and the ambient light occlusion effect obtained by the prior art. The target model used is... Figure 2 The model shown. Wherein, Figure 8 The left side of the image shows the ambient occlusion effect obtained using existing techniques such as ambient light baking calculation in 3ds Max (which requires calculation based on model states such as curvature and normals). The right side shows the ambient occlusion effect calculated using the tools or methods in the embodiments of this application. The ambient occlusion effect is obtained by rendering vertex colors through materials in Unrea Engine 4.

[0133] from Figure 8 As can be seen, since the arrangement of faces in the model made by mesh patching is relatively chaotic, the ambient light occlusion effect calculated by the existing technology based on the model shape such as curvature and normals is relatively messy and does not conform to the real situation. However, the ambient light occlusion effect obtained by using the method or tool in this application is more gentle and regular, conforms to the real situation, and meets the requirements.

[0134] The embodiments of this application allow users to customize gradient ambient occlusion effects and conveniently and quickly assign ambient occlusion intensity values ​​to the vertex colors of the target model.

[0135] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.

[0136] To facilitate better implementation of the model information processing method of this application, this application also provides a model information processing apparatus. Please refer to... Figure 9 , Figure 9 This is a schematic diagram of the structure of the model information processing device provided in an embodiment of this application. The model information processing device 500 may include an acquisition module 501, a first determination module 502, and a second determination module 503.

[0137] The acquisition module 501 is used to acquire the target model to be processed and the auxiliary sphere corresponding to the target model. The target model includes multiple vertices, and the auxiliary sphere includes at least one. The auxiliary sphere is predetermined according to the contour of the target model.

[0138] The first determining module 502 is used to determine, for each vertex of the target model, a target auxiliary sphere that matches the vertex from the auxiliary spheres.

[0139] The second determining module 503 is used to determine the ambient light occlusion information corresponding to the vertex of the target model based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere.

[0140] Specifically, the first determining module 502, when performing the step of determining the target auxiliary sphere that matches the vertex from the auxiliary spheres, performs the following: determining candidate auxiliary spheres from the auxiliary spheres based on the bounding box of the target model; and determining the target auxiliary sphere that matches the vertex from the candidate auxiliary spheres based on the positional relationship between the vertex and the candidate auxiliary spheres.

[0141] Specifically, when the first determining module 502 performs the step of determining the target auxiliary sphere that matches the vertex from the candidate auxiliary spheres based on the positional relationship between the vertex and the candidate auxiliary spheres, it performs the following: when the vertex is inside at least one candidate auxiliary sphere, it determines a first distance between the vertex and the center of the candidate auxiliary sphere, and selects the candidate auxiliary sphere with the smallest first distance as the target auxiliary sphere that matches the vertex; when the vertex is outside all candidate auxiliary spheres, it determines a second distance between the vertex and the surfaces of all candidate auxiliary spheres, and selects the candidate auxiliary sphere with the smallest second distance as the target auxiliary sphere that matches the vertex.

[0142] Specifically, when the first determining module 502 performs the step of determining candidate auxiliary spheres from the auxiliary spheres based on the bounding box of the target model, it performs the following: obtaining the bounding box of the target model; and determining the auxiliary sphere whose center is within the bounding box of the target model as a candidate auxiliary sphere.

[0143] Specifically, the second determining module 503 is used to obtain the radius of the target auxiliary sphere and determine the distance between the vertex and the center of the target auxiliary sphere; and to determine the ambient light occlusion information corresponding to the vertex of the target model based on the ratio of the distance to the radius.

[0144] The ambient light occlusion information includes an ambient light occlusion intensity value. The second determining module 503, when performing the step of determining the ambient light occlusion information corresponding to the vertex of the target model based on the ratio of the distance to the radius, specifically executes the following: when the ratio of the distance to the radius is less than or equal to a preset ratio, the ratio is directly determined as the ambient light occlusion intensity value corresponding to the vertex of the target model; when the ratio of the distance to the radius is greater than the preset ratio, the preset ratio is determined as the ambient light occlusion intensity value corresponding to the vertex of the target model.

[0145] Among them, such as Figure 9As shown, the model information processing device 500 may further include a display module 504, which is used to display an interactive interface through a graphical user interface. The interactive interface displays model selection controls and / or auxiliary sphere addition controls. The display module 504 is also used to display the target model through the graphical user interface. When the auxiliary sphere is visible, the auxiliary sphere is displayed, and the ambient light occlusion effect of the target model is displayed.

[0146] Among them, such as Figure 9 As shown, the model information processing device 500 may further include a model setting module 505. The model setting module 505 is used to set the target model to be processed. Specifically, the model setting module 505 is used to set the target model to be processed through a model selection control on an interactive interface.

[0147] Specifically, the model setting module 505 is used to display the model selection interface in response to the trigger operation of the model selection control; and to determine the selected target model based on the model selection interface, and to use the selected target model as the target model to be processed.

[0148] Among them, such as Figure 9 As shown, the model information processing device 500 may further include a sphere setting module 506. The sphere setting module 506 is used to add auxiliary spheres to the target model in response to a trigger operation on the added control. Specifically, auxiliary spheres are added to the target model according to its outline.

[0149] Specifically, when the sphere setting module 506 performs the step of adding an auxiliary sphere to the target model according to the outline of the target model, it performs the following: adding an initial sphere to the target model; and adjusting the initial sphere according to the outline of the target model to obtain the adjusted auxiliary sphere.

[0150] The target model is either a tree crown model or a shrub model. The outline of the target model includes an overall outline and / or at least one branch and leaf cluster outline. The sphere setting module 506, when performing the step of adding auxiliary spheres to the target model based on its outline, specifically performs the following: adding a first auxiliary sphere to the target model based on its overall outline, wherein the first auxiliary sphere at least covers a first preset proportion of the overall outline; and / or adding a second auxiliary sphere corresponding to the number of branch and leaf clusters to the target model based on the branch and leaf cluster outline, wherein the second auxiliary sphere at least covers a second preset proportion of the branch and leaf cluster outline; and using the first auxiliary sphere and / or the second auxiliary sphere as auxiliary spheres for the target model. The sphere setting module 506 is also used to adjust the auxiliary spheres.

[0151] Among them, such as Figure 9 As shown, the model information processing device 500 may further include a storage module 507 and a rendering module 508. The storage module 507 is used to store the ambient occlusion information in the vertex colors of the target model. The rendering module 508 is used to render the target model based on the vertex colors to obtain the ambient occlusion effect of the target model.

[0152] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.

[0153] Accordingly, embodiments of this application also provide a computer device, which can be a terminal or a server. For example... Figure 10 As shown, Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 600 includes a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, and a computer program stored in the memory 602 and executable on the processor. The processor 601 and the memory 602 are electrically connected. Those skilled in the art will understand 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, or combine certain components, or have different component arrangements.

[0154] The processor 601 is the control center of the computer device 600. It connects various parts of the computer device 600 through various interfaces and lines. By running or loading software programs (computer programs) and / or modules stored in the memory 602, and calling data stored in the memory 602, it performs various functions of the computer device 600 and processes data, thereby monitoring the computer device 600 as a whole.

[0155] In this embodiment, the processor 601 in the computer device 600 loads the instructions corresponding to the processes of one or more applications into the memory 602 according to the following steps, and the processor 601 runs the applications stored in the memory 602 to achieve various functions:

[0156] A target model to be processed is obtained, the target model including multiple vertices; an auxiliary sphere corresponding to the target model is obtained, the auxiliary sphere including at least one, the auxiliary sphere being predetermined according to the contour of the target model; for each vertex of the target model, a target auxiliary sphere matching the vertex is determined from the auxiliary spheres; based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere, the ambient light occlusion information corresponding to the vertex of the target model is determined.

[0157] Specifically, when processor 601 performs the step of determining a target auxiliary sphere that matches the vertex from the auxiliary spheres, it performs the following: determining a candidate auxiliary sphere from the auxiliary spheres based on the bounding box of the target model; and determining a target auxiliary sphere that matches the vertex from the candidate auxiliary spheres based on the positional relationship between the vertex and the candidate auxiliary spheres.

[0158] Specifically, when processor 601 executes the step of determining a target auxiliary sphere that matches the vertex from among the candidate auxiliary spheres based on the positional relationship between the vertex and the candidate auxiliary spheres, it performs the following: when the vertex is inside at least one candidate auxiliary sphere, it determines a first distance between the vertex and the center of the candidate auxiliary sphere, and selects the candidate auxiliary sphere with the smallest first distance as the target auxiliary sphere that matches the vertex; when the vertex is outside all candidate auxiliary spheres, it determines a second distance between the vertex and the surfaces of all candidate auxiliary spheres, and selects the candidate auxiliary sphere with the smallest second distance as the target auxiliary sphere that matches the vertex.

[0159] Specifically, when the processor 601 executes the step of determining candidate auxiliary spheres from the auxiliary spheres based on the bounding box of the target model, it performs the following: obtaining the bounding box of the target model; and determining the auxiliary sphere whose center is within the bounding box of the target model as a candidate auxiliary sphere.

[0160] Specifically, when processor 601 executes the step of determining the ambient occlusion information corresponding to the vertex of the target model based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere, it performs the following steps: obtaining the radius of the target auxiliary sphere and determining the distance between the vertex and the center of the target auxiliary sphere; and determining the ambient occlusion information corresponding to the vertex of the target model based on the ratio of the distance to the radius.

[0161] The ambient light occlusion information includes an ambient light occlusion intensity value. When the processor 601 executes the step of determining the ambient light occlusion information corresponding to the vertex of the target model based on the ratio of the distance to the radius, it specifically performs the following: when the ratio of the distance to the radius is less than or equal to a preset ratio, the ratio is directly determined as the ambient light occlusion intensity value corresponding to the vertex of the target model; when the ratio of the distance to the radius is greater than the preset ratio, the preset ratio is determined as the ambient light occlusion intensity value corresponding to the vertex of the target model.

[0162] The processor 601 further performs the following actions: displaying an interactive interface through a graphical user interface, on which a model selection control is displayed; displaying a model selection interface in response to a trigger operation on the model selection control; and determining the selected target model based on the model selection interface, and using the selected target model as the target model to be processed.

[0163] The processor 601 further executes the following: displaying an interactive interface through a graphical user interface, on which an auxiliary sphere addition control is displayed; adding an auxiliary sphere to the target model in response to a trigger operation on the addition control; and displaying the auxiliary sphere through the graphical user interface when the auxiliary sphere is visible.

[0164] Specifically, when the processor 601 performs the step of adding an auxiliary sphere to the target model, it performs the following: adding an auxiliary sphere to the target model according to the outline of the target model.

[0165] Specifically, when processor 601 adds an auxiliary sphere to the target model based on the outline of the target model, it performs the following steps: adding an initial sphere to the target model; and adjusting the initial sphere according to the outline of the target model to obtain the adjusted auxiliary sphere.

[0166] The target model is either a tree canopy model or a shrub model. The outline of the target model includes an overall outline and / or at least one branch and leaf cluster outline. When the processor 601 adds auxiliary spheres to the target model based on the outline of the target model, it specifically performs the following: adding a first auxiliary sphere to the target model based on the overall outline of the target model, wherein the first auxiliary sphere at least covers the overall outline by a first preset proportion; and / or adding a second auxiliary sphere to the target model based on the branch and leaf cluster outline, corresponding to the number of branch and leaf clusters, wherein the second auxiliary sphere at least covers the branch and leaf cluster outline by a second preset proportion; and using the first auxiliary sphere and / or the second auxiliary sphere as auxiliary spheres for the target model.

[0167] The processor 601 further performs the following steps: saving the ambient occlusion information to the vertex color of the target model; and rendering the target model according to the vertex color to obtain the ambient occlusion effect of the target model.

[0168] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0169] Optional, such as Figure 10As shown, the computer device 600 also includes: a touch screen display 603, a radio frequency circuit 604, an audio circuit 605, an input unit 606, and a power supply 607. The processor 601 is electrically connected to the touch screen display 603, the radio frequency circuit 604, the audio circuit 605, the input unit 606, and the power supply 607. Those skilled in the art will understand that... Figure 10 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0170] The touch display screen 603 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 603 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar formats. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program. The touch panel may cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the data to the processor 601 to determine the type of touch event. Subsequently, the processor 601 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and display panel can be integrated into the touch display screen 603 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 603 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 603 can also be used as part of the input unit 606 to achieve input functions.

[0171] In this embodiment, the touch display screen 603 is used to present a graphical user interface and receive operation commands generated by the user interacting with the graphical user interface.

[0172] The radio frequency circuit 604 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other computer devices, and to transmit and receive signals with network devices or other computer devices.

[0173] Audio circuitry 605 can be used to provide an audio interface between a user and a computer device via a speaker and a microphone. Audio circuitry 605 can convert received audio data into electrical signals and transmit them to the speaker, where the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 605, converted back into audio data, and then processed by processor 601 before being transmitted via radio frequency circuitry 604 to, for example, another computer device, or output to memory 602 for further processing. Audio circuitry 605 may also include an earphone jack to facilitate communication between peripheral headphones and computer devices.

[0174] The input unit 606 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0175] Power supply 607 is used to supply power to various components of computer device 600. Optionally, power supply 607 can be logically connected to processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 607 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0176] although Figure 10 As not shown in the diagram, computer device 600 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.

[0177] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0178] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0179] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute steps in any of the model information processing methods provided in embodiments of this application. For example, the computer program can execute the following steps:

[0180] A target model to be processed is obtained, the target model including multiple vertices; an auxiliary sphere corresponding to the target model is obtained, the auxiliary sphere including at least one, the auxiliary sphere being predetermined according to the contour of the target model; for each vertex of the target model, a target auxiliary sphere matching the vertex is determined from the auxiliary spheres; based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere, the ambient light occlusion information corresponding to the vertex of the target model is determined.

[0181] Specifically, when the processor performs the step of determining the target auxiliary sphere that matches the vertex from the auxiliary spheres, it performs the following: determining candidate auxiliary spheres from the auxiliary spheres based on the bounding box of the target model; and determining the target auxiliary sphere that matches the vertex from the candidate auxiliary spheres based on the positional relationship between the vertex and the candidate auxiliary spheres.

[0182] Specifically, when the processor executes the step of determining a target auxiliary sphere that matches the vertex from the candidate auxiliary spheres based on the positional relationship between the vertex and the candidate auxiliary spheres, it performs the following: when the vertex is inside at least one candidate auxiliary sphere, it determines a first distance between the vertex and the center of the candidate auxiliary sphere, and selects the candidate auxiliary sphere with the smallest first distance as the target auxiliary sphere that matches the vertex; when the vertex is outside all candidate auxiliary spheres, it determines a second distance between the vertex and the surfaces of all candidate auxiliary spheres, and selects the candidate auxiliary sphere with the smallest second distance as the target auxiliary sphere that matches the vertex.

[0183] Specifically, when the processor executes the step of determining candidate auxiliary spheres from the auxiliary spheres based on the bounding box of the target model, it performs the following: obtaining the bounding box of the target model; and determining the auxiliary sphere whose center is within the bounding box of the target model as a candidate auxiliary sphere.

[0184] Specifically, when the processor executes the step of determining the ambient occlusion information corresponding to the vertex of the target model based on the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere, it performs the following steps: obtaining the radius of the target auxiliary sphere and determining the distance between the vertex and the center of the target auxiliary sphere; and determining the ambient occlusion information corresponding to the vertex of the target model based on the ratio of the distance to the radius.

[0185] The ambient light occlusion information includes an ambient light occlusion intensity value. When the processor executes the step of determining the ambient light occlusion information corresponding to the vertex of the target model based on the ratio of the distance to the radius, it specifically performs the following: when the ratio of the distance to the radius is less than or equal to a preset ratio, the ratio is directly determined as the ambient light occlusion intensity value corresponding to the vertex of the target model; when the ratio of the distance to the radius is greater than the preset ratio, the preset ratio is determined as the ambient light occlusion intensity value corresponding to the vertex of the target model.

[0186] The processor also performs the following actions: displaying an interactive interface through a graphical user interface, on which a model selection control is displayed; displaying a model selection interface in response to a trigger operation on the model selection control; and determining the selected target model based on the model selection interface, and using the selected target model as the target model to be processed.

[0187] The processor also executes the following: displaying an interactive interface through a graphical user interface, on which an auxiliary sphere addition control is displayed; adding an auxiliary sphere to the target model in response to a trigger operation on the addition control; and displaying the auxiliary sphere through the graphical user interface when the auxiliary sphere is visible.

[0188] Specifically, when the processor performs the step of adding auxiliary spheres to the target model, it performs the following: adding auxiliary spheres to the target model according to the outline of the target model.

[0189] Specifically, when the processor adds an auxiliary sphere to the target model based on the outline of the target model, it performs the following steps: adding an initial sphere to the target model; and adjusting the initial sphere according to the outline of the target model to obtain the adjusted auxiliary sphere.

[0190] The target model is either a tree canopy model or a shrub model. The outline of the target model includes an overall outline and / or at least one branch and leaf cluster outline. When the processor adds auxiliary spheres to the target model based on the outline of the target model, it specifically performs the following: adding a first auxiliary sphere to the target model based on the overall outline of the target model, wherein the first auxiliary sphere at least covers the overall outline by a first preset proportion; and / or adding a second auxiliary sphere to the target model based on the branch and leaf cluster outline, corresponding to the number of branch and leaf clusters, wherein the second auxiliary sphere at least covers the branch and leaf cluster outline by a second preset proportion; and using the first auxiliary sphere and / or the second auxiliary sphere as auxiliary spheres for the target model.

[0191] The processor also performs the following steps: saving the ambient occlusion information to the vertex color of the target model; and rendering the target model according to the vertex color to obtain the ambient occlusion effect of the target model.

[0192] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0193] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0194] Since the computer program stored in the storage medium can execute the steps in any of the model information processing methods provided in the embodiments of this application, the beneficial effects that any of the model information processing methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0195] The above provides a detailed description of a model information processing method, apparatus, storage medium, and computer device provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A model information processing method, characterized in that, include: Obtain the target model to be processed, the target model including multiple vertices; Obtain an auxiliary sphere corresponding to the target model, wherein the auxiliary sphere includes at least one, and the auxiliary sphere is predetermined according to the contour of the target model; For each vertex of the target model, a target auxiliary sphere matching the vertex is determined from the auxiliary spheres; Obtain the radius of the target auxiliary sphere and determine the distance between the vertex and the center of the target auxiliary sphere; Based on the ratio of the distance to the radius, determine the ambient occlusion information corresponding to the vertex of the target model; The ambient light occlusion information includes an ambient light occlusion intensity value. The step of determining the ambient light occlusion information corresponding to the vertex of the target model based on the ratio of the distance to the radius includes: When the ratio of the distance to the radius is less than or equal to a preset ratio, the ratio is directly determined as the ambient light occlusion intensity value corresponding to the vertex of the target model; When the ratio of the distance to the radius is greater than a preset ratio, the preset ratio is determined as the ambient light occlusion intensity value corresponding to the vertex of the target model.

2. The method according to claim 1, characterized in that, The step of determining the target auxiliary sphere that matches the vertex from the auxiliary spheres includes: Based on the bounding box of the target model, candidate auxiliary spheres are determined from the auxiliary spheres; Based on the positional relationship between the vertex and the candidate auxiliary spheres, a target auxiliary sphere that matches the vertex is determined from the candidate auxiliary spheres.

3. The method according to claim 2, characterized in that, The step of determining the target auxiliary sphere that matches the vertex from the candidate auxiliary spheres based on the positional relationship between the vertex and the candidate auxiliary spheres includes: When the vertex is inside at least one candidate auxiliary sphere, a first distance is determined between the vertex and the center of the candidate auxiliary sphere, and the candidate auxiliary sphere with the smallest first distance is taken as the target auxiliary sphere that matches the vertex. When the vertex is outside all candidate auxiliary spheres, a second distance is determined between the vertex and the surfaces of all candidate auxiliary spheres, and the candidate auxiliary sphere with the smallest second distance is selected as the target auxiliary sphere that matches the vertex.

4. The method according to claim 2, characterized in that, The step of determining candidate auxiliary spheres from the auxiliary spheres based on the bounding box of the target model includes: Obtain the bounding box of the target model; The auxiliary sphere whose center is within the bounding box of the target model is identified as a candidate auxiliary sphere.

5. The method according to any one of claims 1-4, characterized in that, Also includes: An interactive interface is displayed through a graphical user interface, on which a model selection control is displayed. In response to a trigger operation on the model selection control, the model selection interface is displayed; Based on the model selection interface, the selected target model is determined and used as the target model to be processed.

6. The method according to any one of claims 1-4, characterized in that, Also includes: The interactive interface is displayed through a graphical user interface, and the interactive interface displays controls for adding auxiliary spheres. In response to the triggering operation for adding the control, an auxiliary sphere is added to the target model; When the auxiliary sphere is visible, it is displayed through the graphical user interface.

7. The method according to claim 6, characterized in that, The step of adding an auxiliary sphere to the target model includes: adding an auxiliary sphere to the target model according to the outline of the target model.

8. The method according to claim 7, characterized in that, The step of adding auxiliary spheres to the target model based on the contour of the target model includes: Add an initial sphere to the target model; The initial sphere is adjusted according to the contour of the target model to obtain the adjusted auxiliary sphere.

9. The method according to claim 7, characterized in that, The target model is a canopy-shaped model or a shrub-shaped model. The outline of the target model includes an overall outline and / or at least one branch and leaf cluster outline. The step of adding auxiliary spheres to the target model based on the outline of the target model includes: Based on the overall outline of the target model, a first auxiliary sphere is added to the target model, the first auxiliary sphere at least covering the overall outline by a first preset proportion; and / or Based on the outline of the branch and leaf clusters of the target model, a second auxiliary sphere corresponding to the number of branch and leaf clusters is added to the target model. The second auxiliary sphere at least covers the outline of the branch and leaf clusters by a second preset ratio. The first auxiliary sphere and / or the second auxiliary sphere are used as auxiliary spheres for the target model.

10. The method according to any one of claims 1-4 or any one of claims 7-9, characterized in that, After determining the ambient occlusion information corresponding to the vertex, the process also includes: The ambient occlusion information is saved to the vertex color of the target model; The target model is rendered based on the vertex color to obtain the ambient occlusion effect of the target model.

11. A model information processing device, characterized in that, include: An acquisition module is used to acquire a target model to be processed and an auxiliary sphere corresponding to the target model. The target model includes multiple vertices, and the auxiliary sphere includes at least one. The auxiliary sphere is predetermined according to the contour of the target model. The first determining module is used to determine, for each vertex of the target model, a target auxiliary sphere that matches the vertex from the auxiliary spheres; The second determining module is used to obtain the radius of the target auxiliary sphere and determine the distance between the vertex and the center of the target auxiliary sphere; Based on the ratio of the distance to the radius, determine the ambient occlusion information corresponding to the vertex of the target model; The second determining module is used to directly determine the ratio as the ambient light occlusion intensity value corresponding to the vertex of the target model when the ratio of the distance to the radius is less than or equal to a preset ratio; and to determine the preset ratio as the ambient light occlusion intensity value corresponding to the vertex of the target model when the ratio of the distance to the radius is greater than the preset ratio, wherein the ambient light occlusion information includes the ambient light occlusion intensity value.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the steps of the model information processing method as described in any one of claims 1-10.

13. A computer device, characterized in that, The computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the steps of the model information processing method as described in any one of claims 1-10 by calling the computer program stored in the memory.

Citation Information

Patent Citations

  • Image processing method, image processing device and computer equipment

    CN104134230A

  • Model rendering method and device and electronic equipment

    CN114549732A