Method and device for generating agent model in virtual scene, and electronic device
By generating visual bounding boxes and clusters of object models in a virtual scene, and constructing application location points for proxy models, the problem of balancing visual effects and rendering performance in game scenes is solved, achieving efficient game rendering and preservation of realism.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (SHANGHAI) NETWORK CO LTD
- Filing Date
- 2022-12-27
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies struggle to balance game visuals and rendering performance in game scenarios. HLOD technology suffers from poor performance gains or visual degradation when clustering object models, especially for large object models, where the lack of proxy models leads to increased draw calls and reduced game visual realism.
By acquiring the potential visible set information of the virtual scene, the visual bounding box of the object model is generated, and the model bounding box is clustered to generate the visual bounding box of the target object cluster. The application location point of the proxy model is constructed to ensure the visibility of the object model and that object models with similar positions are divided into the same cluster, thereby reducing DrawCall while maintaining the game screen effect.
It achieves the goal of reducing game screen loading overhead while maintaining the realism and effects of the game screen, avoiding game screen degradation, and improving rendering performance.
Smart Images

Figure CN115837163B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to a method, apparatus, electronic device, and computer-readable storage medium for generating proxy models in a virtual scene. Background Technology
[0002] With the development of electronic technology, game scenes in video games are becoming increasingly complex, and the types and numbers of virtual objects in game scenes are numerous, resulting in a large number of rendering task commands (such as DrawCall) initiated during the game rendering process, and a large game rendering overhead.
[0003] Existing technologies typically use HLOD (Hierarchical Level of Detail) to cluster virtual object models in a virtual scene. When the player-controlled virtual character is within a certain range of an object cluster, a proxy model replaces the object model in that cluster, reducing the number of object models on screen and thus lowering draw calls and rendering overhead. However, while grouping more object models into a single cluster ensures higher performance gains, it severely degrades the game's visual quality. Conversely, grouping fewer object models into a single cluster reduces visual degradation but results in poor performance gains. Balancing these two aspects—game visual quality and rendering performance—is a critical problem that needs to be solved. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, electronic device, and storage medium for generating proxy models in virtual scenes to address the aforementioned technical problems, thereby improving the realism of shadow representation in cartoon rendering.
[0005] In a first aspect, this application provides a method for generating a proxy model in a virtual scene, the method comprising:
[0006] Obtain the potential visibility set information of the virtual scene and the object models in the virtual scene;
[0007] Based on the potential visibility set information of the virtual scene, obtain the visual bounding box of the object model;
[0008] Obtain the model bounding box of the object model, and cluster the object model according to the model bounding box and the visible bounding box to obtain multiple target object clusters;
[0009] Based on the visual bounding boxes of each object model under the target object cluster, generate the visual bounding box of the target object cluster.
[0010] Generate a proxy model corresponding to the target object cluster, and determine the model application location point of the proxy model based on the visual bounding box of the target object cluster.
[0011] Secondly, this application provides an apparatus for generating a proxy model in a virtual scene, the apparatus comprising:
[0012] The object model acquisition module is used to acquire the potential visible set information of the virtual scene and the object models in the virtual scene.
[0013] The visual information acquisition module is used to acquire the visual bounding box of the object model based on the potential visible set information of the virtual scene;
[0014] The object cluster acquisition module is used to acquire the model bounding box of the object model, and to cluster the object model according to the model bounding box and the visible bounding box to obtain multiple target object clusters.
[0015] The visible range acquisition module is used to generate the visible bounding box of the target object cluster based on the visible bounding boxes of each object model under the target object cluster.
[0016] The proxy model acquisition module is used to generate a proxy model corresponding to the target object cluster, and determine the model application location point of the proxy model based on the visual bounding box of the target object cluster.
[0017] Thirdly, this application also provides an electronic device, which includes:
[0018] One or more processors;
[0019] Memory; and
[0020] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement a method for generating proxy models in a virtual scene.
[0021] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to execute steps in a method for generating a proxy model in a virtual scene.
[0022] The method, apparatus, computer equipment, and storage medium for generating proxy models in the aforementioned virtual scene acquire latent visible set information and object models in the virtual scene; based on the latent visible set information of the virtual scene, acquire the visual bounding boxes of the object models; acquire the model bounding boxes of the object models, and cluster the object models according to the model bounding boxes and visual bounding boxes to obtain multiple target object clusters; generate the visual bounding boxes of the target object clusters according to the visual bounding boxes of each object model under the target object clusters; generate proxy models corresponding to the target object clusters, and determine the model application location points of the proxy models based on the visual bounding boxes of the target object clusters. The above describes how to construct the visual bounding box of an object model using the potential visibility set information of a virtual scene. Then, based on the visual bounding box and the model bounding box of the object model, the object models in the virtual scene are clustered. This achieves the division of object models with similar positions and visibility into the same object cluster based on the visibility and position information of the object model. Subsequently, proxy models are constructed for these object clusters, and the application location range of the corresponding proxy model is determined by the visual bounding box of the object cluster. This reduces DrawCalls and game screen loading overhead while ensuring the visual effect of the game screen and avoiding the degradation of the game screen. Attached Figure Description
[0023] 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.
[0024] Figure 1 This is a scene diagram illustrating the setup of a shadow camera in existing technology;
[0025] Figure 2 This is a flowchart illustrating the method for generating a proxy model in a virtual scene according to an embodiment of this application.
[0026] Figure 3A This is a schematic diagram of the visual bounding box of the object model in an embodiment of this application;
[0027] Figure 3B This is another schematic diagram of the visible bounding box in the embodiments of this application;
[0028] Figure 4 This is a flowchart illustrating the steps of clustering the object model in an embodiment of this application;
[0029] Figure 5 This is a schematic diagram of the visible bounding box of the object cluster in an embodiment of this application;
[0030] Figure 6 This is a schematic diagram of the application location points of the proxy model corresponding to the object cluster in the embodiments of this application;
[0031] Figure 7 This is a flowchart illustrating the method for generating a proxy model in a virtual scene according to an embodiment of this application.
[0032] Figure 8 This is a schematic diagram of the structure of the device for generating a proxy model in a virtual scene according to an embodiment of this application;
[0033] Figure 9 This is a schematic diagram of the structure of the computer device in the embodiments of this application. Detailed Implementation
[0034] 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.
[0035] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0036] In the description of this application, the word "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0037] Before describing the technical solutions disclosed in this application, the application scenarios and related terms involved in the embodiments of this application will first be introduced. The technical solutions of this application can be applied to game production or animation production. For example, the technical solutions disclosed herein can be applied to game production. More specifically:
[0038] Virtual scenes refer to game scenes set up during game development, which can specifically be three-dimensional scenes;
[0039] An object model refers to a three-dimensional model used to represent different objects in a virtual scene. For example, it can represent objects that are always stationary in a game scene, such as mountains, buildings, plants, rivers, streets, etc.
[0040] Potentially Visible Set (PVS) information provides visibility information for each object model in a virtual scene. For example, if any object model obj in the virtual scene can be seen at a sampling point samplePos in the virtual scene plot, it is denoted by the following formula (1):
[0041] Vis(samplePos,obj) = 1
[0042] Conversely, if the object model obj cannot be seen at a certain sampling point samplePos in the virtual scene plot, it is denoted by the following formula:
[0043] Vis(samplePos,obj)=0
[0044] The potential visibility set information includes the visibility results of each sampling point for all object models in the virtual scene.
[0045] In existing game systems, to provide players with a better gaming or visual experience, a large number of object models are often set in virtual scenes (such as game scenes). During the game's rendering process, the sequential rendering of these object models causes the CPU to frequently call the GPU interface to instruct the GPU to perform rendering operations (i.e., DrawCalls), resulting in heavy loading pressure on the virtual scene. To solve this problem, HLOD technology emerged. In HLOD technology, object models are clustered. When the player-controlled game character is far from a cluster, each cluster is replaced with a proxy model, thereby reducing the number of object models on the screen, reducing DrawCalls, and minimizing the overhead of loading object models.
[0046] In HLOD technology, it can be divided into an offline generation part and a real-time application part. The offline generation part specifically involves: clustering the object models in the virtual scene according to a certain rule to divide the object models in the virtual scene into at least one object cluster, generating a proxy model for each object cluster, and determining the effective range of the proxy model corresponding to the object cluster. In the real-time application part, the position information of the game character controlled by the player is obtained. If the position information of the game character is within the effective range of the proxy model of a certain physical cluster, then the proxy model of the physical cluster is used to represent the object models in that object cluster, that is, the original object models under that physical cluster are hidden. When the position information of the game character is not within the effective range of the proxy model of the physical cluster, then the proxy model of the physical cluster is hidden, and the original object models under that physical cluster are displayed.
[0047] For the offline generation part, in order to reduce draw calls and game screen loading overhead to achieve higher performance gains, the proxy models of each physics cluster need to be designed as simply as possible, and their effective range needs to be defined as large as possible. However, in order to ensure the visual quality of the game and avoid visual degradation, the proxy models of each physics cluster need to be as similar as possible to the original physics model, and their effective range needs to be as small as possible. These conflicting requirements place high demands on the offline generation part.
[0048] Furthermore, for object models in virtual scenes, existing technologies typically cluster them using the K-Means clustering algorithm based on the physical model's position information. To avoid degrading the game's visuals, larger object models in the virtual scene are often excluded. However, not using proxy models to replace larger object models results in a large number of draw calls during the game rendering process, leading to low performance gains. Moreover, clustering object models using the K-Means clustering algorithm can cause adjacent object models to belong to different clusters. This results in one object in the same game scene being represented using a proxy model, while another adjacent object is represented using its original object model, significantly reducing the realism of the game visuals and causing severe degradation.
[0049] To address the aforementioned issues, this application provides a method for generating proxy models in virtual scenes, which can be run in environments such as... Figure 1The terminal device or server shown. The terminal device can be a local terminal device. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing 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 (Content Delivery Network), and big data and artificial intelligence platforms.
[0050] See Figure 2 This application provides a method for generating a proxy model in a virtual scene. The method is illustrated by its application to a terminal. The method includes steps S210 to S250, as follows:
[0051] Step S210: Obtain the potential visible set information of the virtual scene and the object model in the virtual scene.
[0052] Among them, the potential visibility set information records the visibility information of each object model at each location point in the virtual scene, that is, whether the object model can be seen at each location point.
[0053] Specifically, the terminal can obtain the potential visible set information of the virtual scene, and at the same time traverse all objects in the virtual scene to obtain the object model corresponding to each object.
[0054] Step S220: Obtain the visual bounding box of the object model based on the potential visibility set information of the virtual scene.
[0055] Here, the visual bounding box refers to the smallest spatial region containing all visible points of an object model; that is, the visible points of an object model are the points where the object model can be seen. Specifically, in one embodiment, the visual bounding box can be an AABB bounding box.
[0056] As mentioned above, the latent visibility set information records the visibility of each object model at various locations in the virtual scene. For example, if the virtual scene includes object A, suppose the latent visibility set information includes:
[0057] Vis(samplePos-A,obj-A) = 1;
[0058] Vis(samplePos-B,obj-A) = 1; and
[0059] Vis(samplePos-C,obj-A)=1.
[0060] That is, when the virtual character is at position point A, the virtual character can see object A; when the virtual character is at position point B, the virtual character can see object A; when the virtual character is at position point C, the virtual character cannot see object A. At this time, the visible position points of the object model corresponding to object A include position point A and position point B. The visible bounding box of the object model corresponding to object A is a bounding box that completely surrounds position points A and B.
[0061] In one embodiment, the step of obtaining the visual bounding box of an object model based on the potential visible set information of a virtual scene includes: obtaining the visible position points of the object model based on the potential visible set information of the virtual scene; and generating the visual bounding box of the object model based on the position information of each visible position point.
[0062] Specifically, suppose there is a set of sampling points S in the virtual scene plot. pvs If an object model obj can be seen at a certain location point samplePos, then the latent visibility set information is denoted as follows:
[0063] Vis(samplePos,obj) = 1
[0064] The set of visible points S(obj) of the object model can be represented by the following formula:
[0065]
[0066] Wherein, VisibleSamples(obj) refers to the set of location points in the potential visible set information that satisfy the condition Vis(samplePos,obj)=1.
[0067] After obtaining all visible location points of the object model, a visual bounding box of the object model can be constructed based on these visible location points. See also Figure 3A Physical model 310 is a schematic diagram of the projection of object model A onto the horizontal plane, physical model 320 is a schematic diagram of the projection of object model B onto the horizontal plane, region 330 is the set of points of the visible position of object model A, and rectangle 340 is the projection area of the visible bounding box of object model A onto the horizontal plane.
[0068] Furthermore, the presence of a few outliers or perturbation points can lead to a significant expansion of the visual bounding box, making it difficult for the visual bounding box to effectively approximate the visible positions of the object model. Therefore, in one embodiment, the step of generating the visual bounding box of the object model based on the position information of each visible position point includes: obtaining a first distance value between each visible position point and the object model; filtering target position points based on the first distance value corresponding to each visible position; and generating the visual bounding box of the object model based on each target position point.
[0069] Specifically, the first distance value between each visible position point corresponding to the object model and the object model can be calculated first. Then, a preset number of visible position points that are closest to the object model are selected as the target position points of the object model. Finally, the visible bounding box of the object model is constructed based on the target position points.
[0070] See Figure 3B Physical model 310 is a schematic diagram of the projection of object model A onto the horizontal plane, physical model 320 is a schematic diagram of the projection of object model B onto the horizontal plane, region 320 is the set of points of the visible position of object model A, and rectangle 350 is the projection area of the visible bounding box of object model A onto the horizontal plane.
[0071] Step S230: Obtain the model bounding box of the object model. Based on the model bounding box and the visible bounding box of the object model, cluster the object model to obtain multiple target object clusters.
[0072] Among them, the model bounding box refers to a closed control that completely encloses the object model; specifically, the model bounding box of the object model can be obtained through bounding box algorithms, such as AABB (Axis aligned bounding box), Sphere, and OBB (Oriented bounding box).
[0073] In one embodiment, the bounding box of an object model is specifically an AABB bounding box, which is defined as the smallest hexahedron containing the model object (in this embodiment, the contained object is the object model) with edges parallel to the coordinate axes. Specifically, all object models in the virtual scene can be traversed, and the bounding box of each object model can be obtained.
[0074] Here, a target object cluster refers to a collection of objects (or object models). Specifically, after obtaining the visual bounding boxes of the object models, the object models can be clustered based on their model information. This allows object models with similar or overlapping positional information to be grouped together, resulting in multiple initial object clusters. Then, for each initial object cluster, based on the visual bounding boxes of the object models within the initial object cluster, object models with similar positional information and similar visible position points are grouped together to obtain the target object cluster.
[0075] More specifically, buildings in virtual scenes often have the function of obstructing the view; therefore, objects in the virtual scene can be divided into objects inside buildings and objects outside buildings, based on buildings. In one embodiment, the target object cluster includes a cluster of objects inside the building and a cluster of objects outside the building. Figure 4As shown, the steps for clustering the object model into multiple target object clusters based on the object model's model information and the visible bounding box include:
[0076] Step S410: Based on the bounding boxes of each object model, the object models are clustered to obtain at least one first-level building cluster and one second-level building cluster; the distance between the bounding boxes of each object model under the first-level building cluster is less than a first distance threshold; the second-level building cluster includes object models other than the object models under each first-level building cluster.
[0077] Specifically, based on the bounding boxes of each object model, object models whose bounding boxes overlap, whose bounding boxes contain each other on the planar projection, or whose distance between bounding boxes is less than a certain distance threshold can be classified into a first-level building cluster; while the remaining object models that cannot be classified into any first-level building cluster are uniformly classified into a second-level building cluster.
[0078] In one embodiment, the step of clustering object models based on their bounding boxes to obtain at least one first-level building cluster and a second-level building cluster includes: selecting a reference object model from the object models based on the model volume of the object models; using a reference object model as a reference building cluster, merging clusters based on the bounding boxes of each reference building cluster to obtain a first-level building cluster; wherein the bounding box of the reference building cluster is the bounding box of the reference object model; obtaining the bounding boxes of the first-level building clusters, and classifying other object models (excluding the reference object models) according to the distance values between them and the bounding boxes of each first-level building cluster, obtaining first object models with distance values less than a first distance threshold and second object models with distance values greater than or equal to the first distance threshold; determining the second object model as the second-level building cluster, and traversing the first object models, assigning the first object models to the first-level building cluster with the smallest distance value between them, so as to update the first-level building cluster.
[0079] Specifically, a volume threshold can be set in advance. All object models in the virtual scene are then iterated through, and those with a volume greater than the threshold are identified as baseline object models. Each baseline object model is then individually identified as a baseline building cluster. Understandably, at this point, the baseline building cluster contains only the baseline object model.
[0080] After determining the reference object cluster, the reference building clusters can be merged to obtain the first-level building cluster. Specifically, if the bounding boxes of any two reference building clusters overlap, and the bounding box of the building cluster obtained after merging the two reference building clusters is less than or equal to the preset ratio of the larger of the two reference building clusters, then the two reference building clusters are merged.
[0081] For example, in a virtual scene, a base building cluster A and a base building cluster B can be identified. The bounding box of the model of base building cluster A is larger than that of base building cluster B, and the bounding boxes of base building cluster A and base building cluster B overlap. If the bounding box of the building cluster obtained after merging base building cluster A and base building cluster B is less than or equal to K% of the bounding box of base building cluster A (K% is a preset ratio), then base building cluster A and base building cluster B can be merged to obtain a first building cluster.
[0082] In addition, merging reference building clusters can also include: if the bounding boxes of any two reference building clusters have an inclusion relationship in the planar projection, but the bounding boxes of these two reference building clusters do not overlap in height, then these two reference building clusters can be understood as multi-layered buildings, and these two reference building clusters can be merged.
[0083] After merging the baseline building clusters to obtain multiple first-level building clusters, for any one of the first-level building clusters, the cluster can be updated based on object models whose distance to the cluster is less than a certain distance threshold. Specifically, all object models in the virtual scene except for the first-level building clusters can be traversed. For a given object model, if the minimum distance from the center point of the object model to the bounding box of any first-level building cluster is less than the first distance threshold, the object model is determined as the first object model; if the minimum distance from the center point of the object model to the bounding box of any first-level building cluster is greater than or equal to the first distance threshold, the object model is determined as the second object model.
[0084] After identifying the first object model and the second object model, the first object model can be assigned to the nearest first-level building cluster. For example, if the virtual scene contains a first object model A, a first-level building cluster A, and a first-level building cluster B, where the distance between the first object model A and the first-level building cluster A is less than a first distance threshold, the distance between the first object model A and the first-level building cluster B is also less than the first distance threshold, and the distance between the first object model A and the first-level building cluster A is greater than the distance between the first object model A and the first-level building cluster B, then the first object model A can be assigned to the first-level building cluster B to update the first-level building cluster B.
[0085] Meanwhile, since the second object model is not close to any first-level building cluster, all second object models can be identified as second-level building clusters so that the second object models can be uniformly clustered in the future.
[0086] Step S420: For any first-level building cluster, based on the visual bounding box of the object model under the first-level building cluster, the object model of the first-level building cluster is clustered to obtain the building interior object cluster and the first and second-level building clusters; wherein, the visual bounding box of each object model under the building interior object cluster is within the model bounding box of the first-level building cluster, and the first and second-level building clusters include object models other than the building interior object cluster.
[0087] After identifying the first-level building clusters, for any given first-level building cluster, secondary clustering can be performed on the object models within that cluster based on their visible bounding boxes. Specifically, the object models within the first-level building clusters are traversed. If the visible bounding box of a given object model is within the bounding box of the first-level building cluster's model, the object model is considered to be inside the building, and is assigned to the building's interior object cluster. If the visible bounding box of a given object model is outside the bounding box of the first-level building cluster's model, the object model is considered to be outside the building, and is assigned to the first-secondary building cluster.
[0088] It is understandable that each first-level building cluster can be divided into at least one building interior object cluster and at least one first- and second-level building cluster. For example, a virtual scene includes first-level building cluster A and first-level building cluster B. First-level building cluster A can be further subdivided into building interior object cluster A and first- and second-level building cluster A. First-level building cluster B can be further subdivided into building interior object cluster B and first- and second-level building cluster B. In this case, the virtual scene includes at least building interior object cluster A, building interior object cluster B, first- and second-level building cluster A, and first- and second-level building cluster B.
[0089] Step S430: Based on the position information of the object models under the second-level building cluster, perform secondary clustering on the object models under the second-level building cluster to obtain at least one second-level building cluster.
[0090] After identifying the second-level building clusters, the object models within these clusters can be clustered based on their location information to divide them into at least one second-level building cluster. Specifically, the K-Means clustering method can be used to cluster the object models within the second-level building clusters, or other clustering methods can be used; no limitation is made here.
[0091] It is understandable that if the models of objects are close in position, their visibility is also close. By using the position information of the object models under the second-level building cluster, the object models under the second-level building cluster are further clustered, so that object models with close visibility are effectively aggregated together to obtain object clusters. The proxy model generated based on the object clusters can reduce the game screen loading overhead while ensuring the game screen effect.
[0092] Step S440: Based on the model bounding boxes of the first and second-level building clusters and the model bounding boxes of the second and third-level building clusters, merge the first and second-level building clusters and the second and third-level building clusters to obtain at least one cluster of external building objects.
[0093] It is understandable that both the first and second-level building clusters are clusters of object models outside the building. In order to reduce the number of object clusters, the first and second-level building clusters and the second-level building clusters can be merged based on the bounding box range of the model bounding box of the first and second-level building clusters and the bounding box range of the model bounding box of the second and second-level building clusters to obtain the final object clusters outside the building.
[0094] Specifically, traverse the first and second-level building clusters and the second-level building cluster. If the number of object models in any two target second-level building clusters (the target second-level building cluster is either the first or the second-level building cluster) is less than a preset value, and the diameter of the bounding box of the object cluster obtained after merging the two target second-level building clusters is less than the sum of the diameters of the bounding boxes of the two target second-level building clusters, then merge the two target second-level building clusters.
[0095] For example, if a virtual scene includes target secondary building cluster A and target secondary building cluster B, and the number of object models under target secondary building cluster A is less than a preset value, the number of object models under target secondary building cluster B is less than a preset value, and the diameter of the bounding box of the object cluster obtained after merging target secondary building cluster A and target secondary building cluster B is less than the sum of the diameter of the bounding box of target secondary building cluster A and target secondary building cluster B, then target secondary building cluster A and target secondary building cluster B are merged.
[0096] By using buildings as a benchmark, objects in the virtual scene are divided into a first-level building cluster based on buildings and a second-level building cluster unrelated to buildings. The first-level building cluster is further divided into internal building object clusters located inside buildings and first- and second-level building clusters located outside buildings. The second-level building cluster is then divided into second- and second-level building clusters based on model positions. Finally, the first- and second-level building clusters and the second- and second-level building clusters are further clustered to obtain multiple external building object clusters that are located outside buildings and whose internal object models are in close proximity. This allows object models with similar visibility to be effectively aggregated together to form object clusters. The proxy models subsequently generated based on these object clusters can reduce game screen loading overhead while ensuring the visual quality of the game screen.
[0097] Considering that basements may exist within buildings in virtual scenes, and game characters need to use specific passages to enter them, the frequency of entering and exiting basements is very low. If the basement or object models within it are treated as a target object cluster, a proxy model of this target object cluster can be used for game rendering most of the time, effectively reducing game loading overhead. Therefore, based on the height information of the visible bounding box corresponding to the object model, the object clusters inside the building can be further subdivided to obtain the object clusters corresponding to the basement and those not in the basement. In one embodiment, the building interior object cluster includes a first object cluster and a second object cluster. After the step of clustering the object models of the first-level building cluster based on the visual bounding boxes of the object models under the first-level building cluster to obtain the building interior object cluster and the first and second-level building clusters, the method further includes: obtaining the horizontal plane height information of the virtual scene; dividing the object models under the building interior object cluster into a first object cluster and a second object cluster according to the height information of the visual bounding boxes and the horizontal plane height information of each object model under the building interior object cluster; wherein, the first object cluster includes object models whose visual bounding box height information is less than the horizontal plane height information, and the second object cluster includes object models whose visual bounding box height information is greater than or equal to the corresponding horizontal plane height information of the virtual scene.
[0098] The horizontal plane height information of the virtual scene refers to the ground height within the virtual scene. Specifically, the horizontal plane height information of the virtual scene can be calculated by raying a ray downwards from the sky position in the virtual scene; if the virtual scene is a flat urban scene, the horizontal plane height information can also be directly configured by the developers.
[0099] The height information of the object model's visible bounding box can be the coordinate information of the visible bounding box in the vertical direction (the direction perpendicular to the horizontal plane). For example, the height information of the object model's visible bounding box can include the maximum height value, minimum height value, etc. of the visible bounding box in the vertical direction (the direction perpendicular to the horizontal plane).
[0100] Specifically, the object models under the object clusters inside the building are traversed. Given an object model, if the maximum height of the visible bounding box of the object model is less than the horizontal plane height information of the virtual scene, then the object model can be considered to be a basement object and the object model is assigned to the first object cluster; if the maximum height of the visible bounding box of the object model is greater than or equal to the horizontal plane height information of the virtual scene, then the object model can be considered to be a non-basement object and the object model is assigned to the second object cluster.
[0101] Furthermore, considering that buildings in virtual scenes are multi-story buildings, when a game character enters a certain floor of a building, objects on other floors of the building are not visible to the game character. If the object models of each floor in the building are treated as a target object cluster, when a game character enters a certain floor of the building, the object models of other floors can use proxy models for game screen rendering, effectively reducing the game screen loading overhead. Therefore, in one embodiment, the building interior object cluster includes a third object cluster and a fourth object cluster; after the step of clustering the object models of the first-level building cluster based on the visual bounding boxes of the object models under the first-level building cluster to obtain the building interior object cluster and the first and second-level building clusters, the method further includes: obtaining target object models whose height information of the visual bounding boxes is within a preset height range from the object models under the building interior object cluster; clustering the target object models based on the maximum and minimum height values of the visual bounding boxes of the target object models to obtain at least one third object cluster; traversing other object models in the building interior object cluster except for the target object models, and dividing the other object models into third object models and fourth object models based on the visual bounding boxes of the third object clusters; wherein the visual bounding boxes of the third object models are within the model bounding boxes of the third object clusters, and the fourth object models are object models other than the third object models among the other object models; merging the third object models into the third object clusters to update the third object clusters; and clustering the fourth object models based on the projection coordinate information of the visual bounding boxes of the fourth object models on the horizontal plane to obtain the fourth object cluster.
[0102] The height information of the visual bounding box can be its coordinates in the vertical direction (perpendicular to the horizontal plane). For example, the height information of the object model's visual bounding box can include the maximum height value, minimum height value, and height range of the visual bounding box in the vertical direction (perpendicular to the horizontal plane). For example, the maximum height value of the visual bounding box in the vertical direction is Heigh. max The minimum height in the vertical direction is Heigh. min The height range is (Height) max -eight min ).
[0103] Specifically, iterate through the object models under the object clusters inside the building. Given an object model, if the visible bounding box height of the object model is within a preset height range, i.e. (h... max -eight min If the height is less than DeltaHeigh, where DeltaHeigh is a preset height range (specifically, it can be set to 1.5 times the height of a single floor), the object model can be identified as the target object model. After identifying the target object model within the building's internal object cluster, the target object model can be clustered based on its maximum and minimum height information to obtain at least one third object cluster. It can be understood that a third object cluster includes object models from one floor within the building.
[0104] Furthermore, after obtaining the third object clusters, considering that the visible bounding boxes of any two third object clusters overlap in height information, the third object clusters can be merged based on the height information of their corresponding visible bounding boxes to update the third object clusters. For example, if the height range of the visible bounding box of a third object cluster A is [0,2], while the height range of the visible bounding box of another third object cluster B is [1.1,1.9], then third object cluster A and third object cluster B need to be merged. Specifically, the height information of the visible bounding boxes corresponding to the third object clusters is traversed. If the height information of the visible bounding boxes corresponding to any two third object clusters overlaps, and the overlap height accounts for a preset percentage threshold of the total height of the two third object clusters' corresponding visible bounding boxes, then the two third object clusters are merged.
[0105] After obtaining multiple third object clusters, for any given third object cluster, the object models that can be incorporated into the third object cluster can be determined based on the visible bounding box of the third object cluster and the visible bounding boxes of other object models within the building's internal object clusters. Specifically, all object models within the building's internal object clusters, excluding the third object clusters, can be traversed. For a given object model, if its visible bounding box is within the visible bounding box of a certain third object cluster, the object model can be identified as a third object model and incorporated into the target third object cluster, where the visible bounding box of the third object model is within the visible bounding box of the target third object cluster.
[0106] If the visible bounding box of an object model is not within the visible bounding box of any third object cluster, the object model can be identified as the fourth object model. Subsequently, the fourth object models under the object clusters inside the building can be directly identified as the fourth object cluster, or the fourth object models can be clustered based on the projection coordinate information of the visible bounding boxes of each fourth object model on the horizontal plane to obtain the fourth object cluster.
[0107] In one embodiment, the fourth object models are clustered based on the projection coordinate information of the visual bounding boxes corresponding to each fourth object model on the horizontal plane. Specifically, clustering can be performed based on the projection coordinate information of the visual bounding boxes corresponding to the fourth object models on the horizontal plane to obtain at least one fourth object cluster.
[0108] For example, the range of projected coordinates of the visual bounding box corresponding to the fourth object model on the horizontal plane can be denoted as X. min X max Z min Z max , where X min This represents the minimum value of the visible bounding box along the horizontal X-axis. max The Z represents the maximum value of the visible bounding box along the horizontal X-axis. min This represents the minimum value of the visible bounding box along the Z-axis in the horizontal plane. max This represents the maximum value of the visible bounding box along the Z-axis in the horizontal plane; specifically, it can be based on the X-axis of the visible bounding box corresponding to the fourth object model on the horizontal plane. min X max Z min Z max K-Means clustering is performed on the fourth object model to obtain at least one fourth object cluster.
[0109] Furthermore, in one embodiment, the step of clustering the fourth object model based on the projection coordinate information of the visual bounding box of the fourth object model on the horizontal plane to obtain the fourth object cluster may further include the following steps: taking all the fourth object models as the initial object cluster; if the number of fourth object models in the initial object cluster is greater than a preset number threshold, clustering the initial object cluster based on the projection coordinate information of the visual bounding box of the fourth object cluster on the horizontal plane to obtain object clusters; traversing any object cluster; if the number of fourth object models in the object cluster is greater than the preset number threshold, clustering the object cluster again based on the projection coordinate information of the visual bounding box of the object cluster on the horizontal plane, until the number of fourth object models in the obtained object cluster is less than or equal to the preset number threshold.
[0110] Specifically, for the fourth object model, all fourth object models can be considered as an initial object cluster. If the number of fourth object models within the initial object cluster is less than or equal to a preset threshold, then the initial object cluster is determined as a fourth object cluster. If the number of fourth object models within the initial object cluster is greater than the preset threshold, based on the projection coordinates of the visual bounding box of the initial object cluster on the horizontal plane, a horizontal direction with a larger value is determined, and the fourth object models under the initial object cluster are bisected along this horizontal direction, resulting in two object sub-clusters. The number of fourth object models within these two object sub-clusters is counted separately. If the number of fourth object models within the object sub-cluster is less than or equal to the preset threshold, then the object sub-cluster is determined as a fourth object cluster. If the number of fourth object models within the object sub-cluster is greater than the preset threshold, based on the projection coordinates of the visual bounding box of the object sub-cluster on the horizontal plane, a horizontal direction with a larger value is determined, and the fourth object models under the object sub-cluster are bisected along this horizontal direction, resulting in a new object sub-cluster. The step of counting the number of fourth object models within these two object sub-clusters is repeated until the number of fourth object models within the resulting object sub-cluster is less than or equal to the preset threshold.
[0111] Step S240: Generate the visual bounding box of the target object cluster based on the visual bounding boxes of each object model under the target object cluster.
[0112] The visual bounding box of the target object cluster refers to the approximate polygon of the visible location points of the target building cluster; specifically, the visual bounding box of the target object cluster can be the union of the visual bounding boxes of all object models within the target object cluster.
[0113] More specifically, the visual bounding box of the target object cluster can be represented by the following formula:
[0114] V(cluster)≈VisBox(cluster)=AABB ∪{VisBox(obj)|obj∈vluster}
[0115] Where V (cluster) represents the visual bounding box of the target object cluster, and VisBox (obj) refers to the visual bounding box of the target object model.
[0116] See Figure 5 The target object cluster includes object model 1 (obj1), object model 2 (obj2), and object module 3 (obj3). Figure 5 The diagram shows the projection of each object model onto the horizontal plane. Regions 510, 520, and 530 are projections of the visual bounding boxes of object model 1, object model 2, and object module 3 onto the horizontal plane, respectively. The visual bounding box of the target object cluster is shown in region 540.
[0117] Step S250: Generate a proxy model corresponding to the target object cluster, and determine the model application location point of the proxy model based on the visual bounding box of the target object cluster.
[0118] In this context, a surrogate model refers to a simple model used to replace the individual object models in a target object cluster when it is not necessary to precisely observe each object model in the target object cluster.
[0119] After acquiring each target object cluster, a corresponding proxy model can be generated for any target object cluster. Then, all visible position points in the visible bounding box of the target object cluster can be directly used as the application position points of the proxy model. In other words, when the virtual character is within the visible bounding box of the target object cluster, the proxy model corresponding to the target object cluster is not used; when the virtual character is outside the visible bounding box of the target object cluster, the proxy model corresponding to the target object cluster can be used.
[0120] Furthermore, considering that the visible bounding boxes of some target object clusters are too large, the model bounding boxes of the target object clusters can also be taken into consideration. Specifically, in one embodiment, the step of determining the model application location point of the proxy model based on the visible bounding boxes of the target object clusters includes: obtaining the model bounding boxes of the target object clusters, and determining the first application location point of the proxy model based on the model bounding boxes of the target object clusters; determining the second application location point of the proxy model based on the visible bounding boxes of the target object clusters; and determining the model application location point of the proxy model according to the union of the first application location point and the second application location point.
[0121] Among them, the model bounding box of the target object cluster refers to a closed control that completely encloses the object models under the target object cluster.
[0122] Specifically, the bounding box of the target object cluster can be obtained, and the position points whose minimum distance value from the bounding box is greater than a preset distance value are determined as the first application range of the proxy model corresponding to the target object cluster. At the same time, the position points other than the visible bounding box of the target object cluster are determined as the second application range of the proxy model corresponding to the target object cluster. Then, the union of the first application position points and the second application position points is used to determine the model application position points of the proxy model.
[0123] More specifically, the application location of the proxy model for the target object cluster can be represented by the following formula:
[0124]
[0125] Where pos represents the position point in the virtual scene; VisBox(cluster) represents the visible bounding box of the target object cluster, AABB. cluster The bounding box of the model represents the target object cluster; D represents the preset distance value.
[0126] like Figure 6 As shown, the target object cluster includes object model A, object model B, and object module C. Figure 6 The diagram shows the projection of object model A onto the horizontal plane (610), object model B onto the horizontal plane (620), and object module C onto the horizontal plane (630). The area within rectangle 640 is the projection area of the bounding box of the target object cluster onto the horizontal plane. The area within rectangle 650 is the area of the position points on the horizontal plane that are less than a preset distance from the bounding box of the target object cluster. The area within rectangle 650 represents the projection area of the visible bounding box of the target object cluster onto the horizontal plane. At this time, the model application position point of the proxy model of the target object cluster in the virtual scene (within the dashed box) is any position point within the gray area.
[0127] The method for generating proxy models in the aforementioned virtual scene involves: acquiring the latent visible set information of the virtual scene and the object models in the virtual scene; acquiring the visual bounding boxes of the object models based on the latent visible set information of the virtual scene; acquiring the model bounding boxes of the object models; clustering the object models according to the model bounding boxes and the visual bounding boxes to obtain multiple target object clusters; generating the visual bounding boxes of the target object clusters according to the visual bounding boxes of each object model under the target object clusters; generating proxy models corresponding to the target object clusters; and determining the model application location points of the proxy models based on the visual bounding boxes of the target object clusters. The above describes how to construct the visual bounding box of an object model using the potential visibility set information of a virtual scene. Then, based on the visual bounding box and the model bounding box of the object model, the object models in the virtual scene are clustered. This achieves the division of object models with similar positions and visibility into the same object cluster based on the visibility and position information of the object model. Subsequently, proxy models are constructed for these object clusters, and the application location range of the corresponding proxy model is determined by the visual bounding box of the object cluster. This reduces DrawCalls and game screen loading overhead while ensuring the visual effect of the game screen and avoiding the degradation of the game screen.
[0128] The following section further explains the method for generating the proxy model in the aforementioned virtual scenario using a specific application scenario. Specifically, the method for generating the proxy model in the virtual scenario includes:
[0129] Step 1: Obtain the potential visible set information of the virtual scene and the object models in the virtual scene.
[0130] Step 2: Obtain the visual bounding box of the object model based on the potential visible set information of the virtual scene.
[0131] Step 3: Obtain the bounding box of the object model. Based on the bounding box and the visible bounding box of the object model, cluster the object model to obtain multiple target object clusters.
[0132] Among them, see Figure 7 The steps for clustering the object model are as follows:
[0133] Step 3-1: Cluster according to buildings;
[0134] Step 3-1-1: Select a baseline object model from the object models based on the model volume of the object model.
[0135] Specifically, a volume threshold V is set in advance, and the object models in the virtual scene are traversed. Object models whose volume is greater than the volume threshold V are marked as buildings (i.e., reference object models), and a cluster is created based on the marked buildings. At this time, each cluster contains only one reference object model of the building itself.
[0136] Step 3-1-2: Using a reference object model as a reference building cluster, merge the clusters based on the model bounding boxes of each reference building cluster to obtain the first-level building cluster; wherein, the model bounding box of the reference building cluster is the model bounding box of the reference object model.
[0137] As shown above, a cluster (i.e., a baseline building cluster) is created based on the marked buildings. Baseline buildings can be merged to obtain the first-level building cluster. Specifically, merging baseline buildings can be divided into the following two cases:
[0138] Case 1: If the bounding boxes of any two reference building clusters overlap, and the bounding box of the building cluster obtained after merging these two reference building clusters is less than or equal to the preset ratio of the larger of the two reference building clusters, then the two reference building clusters will be merged.
[0139] Case 2: If the bounding boxes of any two reference building clusters are contained in the planar projection, but the bounding boxes of these two reference building clusters do not overlap in height, then these two reference building clusters can be understood as multi-layered buildings, and these two reference building clusters can be merged.
[0140] Step 3-1-3: Obtain the bounding box of the model of the first-level building cluster. Based on the distance value between the model bounding box of each first-level building cluster, classify the other object models except the reference object model to obtain the first object model with a distance value less than the first distance threshold and the second object model with a distance value greater than or equal to the first distance threshold. Determine the second object model as the second-level building cluster, and traverse the first object models to assign the first object model to the first-level building cluster with the smallest distance value between it and the first object model, so as to update the first-level building cluster.
[0141] Specifically, after merging the baseline buildings to obtain the first-level building cluster, the first-level building cluster can absorb nearby object models. The specific process is as follows: traverse all object models in the virtual scene. For a given object model, if the distance from the center point of the object model to the bounding box of a certain first-level building cluster is less than a given distance threshold D, then the object model is considered to belong to that first-level building cluster. It can be understood that if the distance from the center point of the object model to the bounding boxes of multiple first-level building clusters is less than the given distance threshold D, the object model can be assigned to the nearest first-level building cluster. If the distance from the center point of the object model to the bounding box of any first-level building cluster is greater than or equal to the given distance threshold D, then the object model is not adjacent to any first-level building cluster, and the object model is an external object of the building, assigned to the second-level building cluster, and processed in subsequent processes.
[0142] After the first-level building cluster is completed and can absorb nearby object models, each first-level building cluster can be evaluated. For a given first-level building cluster, if the number of object models under the first-level building cluster is lower than a certain threshold, the first-level building cluster is determined as a third-level building cluster (i.e., a normal building cluster), and the subsequent step 3-2 is not performed; if the number of object models under the first-level building cluster is higher than or equal to a certain threshold, the subsequent step 3-2 is performed.
[0143] See here. Figure 7 Step 3-1 divides the object models in the virtual scene into large building clusters (corresponding to the first-level building clusters mentioned above), ordinary building clusters (corresponding to the third-level building clusters mentioned above), and building external object clusters (corresponding to the second-level building clusters mentioned above).
[0144] Step 3-2: Generate clusters of objects inside the building;
[0145] For the aforementioned first-level building clusters, which often contain numerous object models corresponding to indoor objects, this stage will utilize the visible bounding boxes of the object models to separate and cluster the object models within the first-level building clusters. The specific process is as follows:
[0146] Step 3-2-1: For any first-level building cluster, based on the visual bounding box of the object model under the first-level building cluster, the object model of the first-level building cluster is clustered to obtain the building interior object cluster and the first and second-level building clusters; wherein, the visual bounding box of each object model under the building interior object cluster is within the model bounding box of the first-level building cluster, and the first and second-level building clusters include object models other than the building interior object cluster.
[0147] Among them, such as Figure 7 As shown, for any first-level building cluster (i.e., large building cluster), we can first separate the inside and outside, divide the object models of objects inside the building and the object models of objects outside the building, and obtain the object cluster inside the building and the first and second-level building clusters (i.e. building clusters).
[0148] Specifically, given a first-level building cluster, traverse the object models under the first-level building cluster. If the visible bounding box of the given object model is within the bounding box of the model of the first-level building cluster, the object model can be considered to be an internal object of the building, and the object model is assigned to the internal object cluster. If the visible bounding box of the given object model is outside the bounding box of the model of the first-level building cluster, the object model can be considered to be an external object of the building, and the object model is assigned to the first-second-level building cluster.
[0149] Step 3-2-2: Obtain the horizontal plane height information of the virtual scene; based on the height information of the visible bounding box and the horizontal plane height information of each object model under the object cluster inside the building, divide the object models under the object cluster inside the building into a first object cluster and a second object cluster; wherein, the first object cluster includes object models whose visible bounding box height information is less than the horizontal plane height information, and the second object cluster includes object models whose visible bounding box height information is greater than or equal to the corresponding horizontal plane height information of the virtual scene.
[0150] Among them, such as Figure 7 As shown, after completing the separation of the interior and exterior, the object cluster inside the building can be separated into basements. The object models of the basement objects and the non-basement objects in the object cluster inside the building are divided to obtain the first object cluster (i.e., the basement cluster) and the second object cluster.
[0151] Specifically, iterate through the object models under the object clusters inside the building. Given an object model, if the maximum height of the visible bounding box of that object model is Height... max If the height of the object model is less than the horizontal plane height of the virtual scene, then the object model is considered to be a basement object and is assigned to the first object cluster. If the maximum height of the visible bounding box of the object model is greater than or equal to the horizontal plane height of the virtual scene, then the object model is considered to be a non-basement object and is assigned to the second object cluster.
[0152] Step 3-2-3: Obtain target object models whose visible bounding box height information is within a preset height range from the object models under the second object cluster; cluster the target object models using the maximum and minimum height values of their visible bounding boxes to obtain at least one third object cluster; traverse other object models in the building's internal object clusters except for the target object model, and divide the other object models into third object models and fourth object models based on the visible bounding boxes of the third object clusters; wherein, the visible bounding box of the third object model is within the model bounding box of the third object cluster, and the fourth object model is an object model other than the third object model among the other object models; determine the fourth object model as the fourth object cluster, and merge the third object model into the third object cluster to update the third object cluster.
[0153] Among them, such as Figure 7 As shown, after the basement separation is completed, for the second object cluster, the object models under the second object cluster can be separated into floors, and the object models of non-basement objects under the second object cluster can be divided into a third object cluster (i.e., floor cluster) within different floor ranges and a fourth object cluster that cannot be divided into any floor range.
[0154] Specifically, iterate through the object models under the second object cluster. Given an object model, if the visible bounding box height of the object model is within a preset height range, i.e. (h... max -eight min If the height is less than DeltaHeigh, which is a preset height range, it can be set to 1.5 times the height of a single floor to confirm that the object model is the target object model.
[0155] After determining the target object model within the second object cluster, the height of the target object model can be used as a basis. min and Heigh max These two dimensions are used to perform K-Means clustering on the target object model to obtain at least one third object cluster; it can be understood that a third object cluster includes the object model of a floor inside the building.
[0156] Considering that the visible bounding boxes of any two third object clusters have overlapping height information, the height information of the visible bounding boxes corresponding to the third object clusters can be traversed. If the height information of the visible bounding boxes corresponding to any two third object clusters overlaps, and the overlapping height accounts for K% of the total height of the visible bounding boxes corresponding to these two third object clusters (K is a pre-set threshold), then these two third object clusters are merged to update the third object clusters.
[0157] Furthermore, inefficient clusters within the third object cluster can be discarded. Specifically, cluster efficiency is defined as the ratio between the number of object models within a cluster and the diameter of the corresponding visible bounding box. If the cluster efficiency of a third object cluster is lower than a set threshold, the third object cluster can be disbanded, and the object models within it can be reassigned to a fourth object cluster.
[0158] After obtaining multiple third object clusters, it is possible to traverse all object models within the building's internal object clusters, excluding the third object clusters themselves. For a given object model, if its visible bounding box is within the visible bounding box of a third object cluster, the object model is identified as a third object model and assigned to the target third object cluster, provided that its visible bounding box is within the visible bounding box of the target third object cluster. If the object model's visible bounding box is not within the visible bounding box of any third object cluster, the object model is identified as a fourth object model and assigned to the fourth object cluster.
[0159] Step 3-2-4: Based on the projection coordinate information of the visible bounding box of the object model under the fourth object cluster on the horizontal plane, the fourth object model is clustered to obtain the fourth object cluster.
[0160] Among them, such as Figure 7As shown, after the floor separation is completed, the object models under the fourth object cluster can be divided into planar clusters. The fourth object cluster, which cannot be divided into any floor range, is divided into room clusters in different planar ranges and a fifth object cluster, which cannot be divided into any room cluster.
[0161] Specifically, iterate through the object models under the fourth object cluster and obtain the projection range X of the visible bounding box of each object model on the horizontal plane. min X max Z min and Z max Furthermore, based on the X-axis of the visible bounding box corresponding to the object model on the horizontal plane... min X max Z min Z max K-Means clustering is performed on the object models in the fourth object cluster to obtain at least one room cluster. Object models that cannot be assigned to any room cluster are assigned to the fifth object cluster.
[0162] Step 3-2-5: Count the number of object models under the fifth object cluster. If the number of object models under the fifth object cluster is greater than the preset number threshold, the fifth object cluster is divided into planar clusters based on the projection coordinate information of the visible bounding box of the fifth object cluster on the horizontal plane. Traverse any planar cluster. If the number of object models in the planar cluster is greater than the preset number threshold, the planar cluster is divided into planar clusters again based on the projection coordinate information of the visible bounding box of the planar cluster on the horizontal plane, until the number of object models in the resulting planar cluster is less than or equal to the preset number threshold.
[0163] This concludes the clustering process for the objects within the building, as well as the first and second-level building clusters (i.e., building clusters).
[0164] Step 3-3: Clustering of objects outside the building.
[0165] Step 3-3-1: Based on the position information of the object models under the second-level building cluster, perform secondary clustering on the object models under the second-level building cluster to obtain at least one second-level building cluster.
[0166] For object models under the second-level building cluster, K-Means clustering based on model location can be used to cluster the object models under the second-level building cluster, resulting in at least one second-level building cluster.
[0167] Step 3-3-1: Based on the model bounding boxes of the first and second-level building clusters, the model bounding boxes of the second and third-level building clusters, the first and second-level building clusters, the second and third-level building clusters are merged to obtain at least one cluster of external building objects.
[0168] Specifically, after identifying the second and third-level building clusters, the second and third-level building clusters, the first and second-level building clusters generated in step 3-2-1, and the third-level building clusters generated in step 3-1 are merged. The criteria for merging clusters are as follows: if the number of objects in both clusters is less than a given value, and the diameter of the bounding box of the merged cluster is less than the sum of the diameters of the bounding boxes of the original two clusters, then the two clusters are deemed suitable for merging.
[0169] Furthermore, if a cluster, such as cluster A, can be merged with multiple clusters, such as cluster B1 and cluster B2, then cluster A can be merged with the cluster with the largest model bounding box diameter among clusters B1 and B2.
[0170] At this point, the clustering of object models in the virtual environment is complete.
[0171] Step 4: Generate the visual bounding box of the target object cluster based on the visual bounding boxes of each object model under the target object cluster.
[0172] Step 5: Generate a proxy model corresponding to the target object cluster, and determine the model application location point of the proxy model based on the visual bounding box of the target object cluster.
[0173] Based on the above-mentioned method for generating proxy models in virtual scenes, by clustering object models with similar visibility in the virtual scene, the visibility range of each object cluster is effectively limited. Based on this visibility range, the effective range of the proxy model is defined, which can safely and effectively expand the application range of the proxy model, thereby increasing the technical benefits of HLOD.
[0174] Tests in game scenarios show that, compared to the K-Means clustering method used in existing technologies, the number of loaded objects is reduced by approximately 20.8%, and the number of draw calls is reduced by approximately 17.6%.
[0175] To better implement the method for generating proxy models in virtual scenes provided in the embodiments of this application, this application also provides a device for generating proxy models in virtual scenes, based on the method for generating proxy models in virtual scenes provided in the embodiments of this application. Figure 8 As shown, the proxy model generation device 800 in the virtual scene includes:
[0176] The object model acquisition module 810 is used to acquire the potential visible set information of the virtual scene and the object model in the virtual scene.
[0177] The visual information acquisition module 820 is used to acquire the visual bounding box of the object model based on the potential visible set information of the virtual scene;
[0178] The object cluster acquisition module 830 is used to acquire the model bounding box of the object model, and to cluster the object model according to the model bounding box and the visible bounding box to obtain multiple target object clusters.
[0179] The visible range acquisition module 840 is used to generate the visible bounding box of the target object cluster based on the visible bounding boxes of each object model under the target object cluster.
[0180] The proxy model acquisition module 850 is used to generate a proxy model corresponding to the target object cluster, and determine the model application location point of the proxy model based on the visual bounding box of the target object cluster.
[0181] In some embodiments of this application, the visual information acquisition module 820 is used to acquire the visual position points of the object model based on the potential visible set information of the virtual scene; and to generate the visual bounding box of the object model based on the position information of each visual position point.
[0182] In some embodiments of this application, the visual information acquisition module 820 is used to acquire a first distance value between each of the visual location points and the object model; filter target location points based on the first distance value corresponding to each of the visual locations; and generate a visual bounding box of the object model according to each of the target location points.
[0183] In some embodiments of this application, the proxy model acquisition module 850 is used to acquire the model bounding box of the target object cluster, and determine the first application location point of the proxy model based on the model bounding box of the target object cluster; determine the second application location point of the proxy model based on the visual bounding box of the target object cluster; and determine the model application location point of the proxy model according to the union of the first application location point and the second application location point.
[0184] In some embodiments of this application, the target object cluster includes an internal building object cluster and an external building object cluster; the object cluster acquisition module 830 is used to cluster the object models based on the model bounding boxes of each object model to obtain at least one first-level building cluster and a second-level building cluster; the distance between the model bounding boxes of each object model under the first-level building cluster is less than a first distance threshold; the second-level building cluster includes object models other than the object models under each of the first-level building clusters; for any first-level building cluster, the object models of the first-level building cluster are clustered based on the visible bounding boxes of the object models under the first-level building cluster. The process involves obtaining an internal building object cluster and a first and second-level building cluster. The visible bounding boxes of each object model within the internal building object cluster are within the model bounding box of the first-level building cluster. The first-level building cluster includes object models other than those within the internal building object cluster. Based on the positional information of the object models within the second-level building cluster, the object models within the second-level building cluster are further clustered to obtain at least one second-level building cluster. Based on the model bounding boxes of the first and second-level building clusters, the first and second-level building clusters are merged to obtain at least one external building object cluster.
[0185] In some embodiments of this application, the object cluster acquisition module 830 is used to filter reference object models from the object models according to the model volume of the object models; take one reference object model as a reference building cluster, and merge the clusters based on the model bounding boxes of each reference building cluster to obtain a first-level building cluster; wherein, the model bounding box of the reference building cluster is the model bounding box of the reference object model; acquire the model bounding box of the first-level building cluster, and classify the other object models except the reference object models according to the distance value between them and the model bounding boxes of each first-level building cluster to obtain a first object model with a distance value less than a first distance threshold and a second object model with a distance value greater than or equal to the first distance threshold; determine the second object model as a second-level building cluster, and traverse the first object models to assign the first object model to the first-level building cluster with the smallest distance value between it and the first object model, so as to update the first-level building cluster.
[0186] In some embodiments of this application, the building interior object cluster includes a first object cluster and a second object cluster; the object cluster acquisition module 830 is further configured to acquire the horizontal plane height information of the virtual scene; based on the height information of the visible bounding box of each object model under the building interior object cluster and the horizontal plane height information, the object models under the building interior object cluster are divided into a first object cluster and a second object cluster; wherein, the first object cluster includes object models whose visible bounding box height information is less than the horizontal plane height information, and the second object cluster includes object models whose visible bounding box height information is greater than or equal to the corresponding horizontal plane height information of the virtual scene.
[0187] In some embodiments of this application, the building interior object cluster includes a third object cluster and a fourth object cluster; the object cluster acquisition module 830 is further configured to acquire target object models whose visible bounding box height information is within a preset height range from the object models under the building interior object cluster; cluster the target object models using the maximum and minimum height values of the visible bounding boxes of the target object models to obtain at least one third object cluster; traverse other object models in the building interior object cluster except for the target object models, and divide the other object models into third object models and fourth object models based on the visible bounding boxes of the third object clusters; wherein the visible bounding boxes of the third object models are within the model bounding boxes of the third object clusters, and the fourth object models are object models other than the third object models among the other object models; merge the third object models into the third object clusters to update the third object clusters; and cluster the fourth object models based on the projection coordinate information of the visible bounding boxes of the fourth object models on the horizontal plane to obtain the fourth object clusters.
[0188] In some embodiments of this application, the object cluster acquisition module 830 is further configured to use all the fourth object models as an initial object cluster; if the number of fourth object models in the initial object cluster is greater than a preset number threshold, the initial object cluster is clustered based on the projection coordinate information of the visual bounding box of the fourth object cluster on the horizontal plane to obtain object clusters; traversing any object cluster, if the number of fourth object models in the object cluster is greater than the preset number threshold, the object cluster is clustered again based on the projection coordinate information of the visual bounding box of the object cluster on the horizontal plane, until the number of fourth object models in the obtained object cluster is less than or equal to the preset number threshold.
[0189] In some embodiments of this application, the proxy model generation device 800 in the virtual scene can be implemented as a computer program, which can be implemented in, for example... Figure 9The computer device shown is running on this device. The computer device's memory can store the various program modules of the generation device 800 that constitute the proxy model in the virtual scene, for example, Figure 8 The illustrated modules are object model acquisition module 810, visual information acquisition module 820, object cluster acquisition module 830, visual range acquisition module 840, and proxy model acquisition module 850. The computer program comprised of these modules causes the processor to execute the steps in the proxy model generation method for a virtual scene in the various embodiments of this application described in this specification.
[0190] For example, Figure 9 The computer equipment shown can be used as follows Figure 8 In the virtual scene, the object model acquisition module 810 of the proxy model generation device 800 executes step S210. The computer device can execute step S220 via the visual information acquisition module 820. The computer device can execute step S230 via the object cluster acquisition module 830. The computer device can execute step S240 via the visual range acquisition module 840. The computer device can execute step S250 via the proxy model acquisition module 850. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with external computer devices via a network connection. When the computer program is executed by the processor, it implements a method for generating proxy models in a virtual scene.
[0191] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0192] In some embodiments of this application, a computer device is provided, including one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processors in the following steps:
[0193] Obtain the potential visibility set information of the virtual scene and the object models in the virtual scene;
[0194] Based on the potential visibility set information of the virtual scene, obtain the visual bounding box of the object model;
[0195] Obtain the model bounding box of the object model, and cluster the object model according to the model bounding box and the visible bounding box to obtain multiple target object clusters;
[0196] Based on the visual bounding boxes of each object model under the target object cluster, generate the visual bounding box of the target object cluster.
[0197] Generate a proxy model corresponding to the target object cluster, and determine the model application location point of the proxy model based on the visual bounding box of the target object cluster.
[0198] In some embodiments of this application, when the processor executes the computer program, it further implements the following steps: obtaining a first distance value between each of the visible position points and the object model; filtering target position points based on the first distance value corresponding to each of the visible positions; and generating a visible bounding box of the object model according to each of the target position points.
[0199] In some embodiments of this application, when the processor executes the computer program, it further implements the following steps: obtaining the model bounding box of the target object cluster, and determining the first application location point of the proxy model based on the model bounding box of the target object cluster; determining the second application location point of the proxy model based on the visual bounding box of the target object cluster; and determining the model application location point of the proxy model according to the union of the first application location point and the second application location point.
[0200] In some embodiments of this application, the target object cluster includes an internal building object cluster and an external building object cluster; when the processor executes the computer program, it further implements the following steps: based on the model bounding boxes of each object model, the object models are clustered to obtain at least one first-level building cluster and a second-level building cluster; the distance between the model bounding boxes of each object model under the first-level building cluster is less than a first distance threshold; the second-level building cluster includes object models other than the object models under each of the first-level building clusters; for any first-level building cluster, based on the visible bounding boxes of the object models under the first-level building cluster, the object models of the first-level building cluster are... The system performs row clustering to obtain an internal building object cluster and a first- and second-level building cluster. The visible bounding boxes of each object model within the internal building object cluster are within the model bounding box of the first-level building cluster. The first-level building cluster includes object models other than those within the internal building object cluster. Based on the position information of the object models within the second-level building cluster, the system performs secondary clustering to obtain at least one second-level building cluster. Based on the model bounding boxes of the first and second-level building clusters, the system merges the first and second-level building clusters to obtain at least one external building object cluster.
[0201] In some embodiments of this application, when the processor executes the computer program, it further implements the following steps: filtering reference object models from the object models according to the model volume of the object models; taking one reference object model as a reference building cluster, merging clusters based on the model bounding boxes of each reference building cluster to obtain a first-level building cluster; wherein, the model bounding box of the reference building cluster is the model bounding box of the reference object model; obtaining the model bounding box of the first-level building cluster, classifying the other object models besides the reference object models according to the distance values between them and the model bounding boxes of each first-level building cluster, obtaining a first object model with a distance value less than a first distance threshold and a second object model with a distance value greater than or equal to the first distance threshold; determining the second object model as a second-level building cluster, and traversing the first object models, assigning the first object model to the first-level building cluster with the smallest distance value between it and the first object model, so as to update the first-level building cluster.
[0202] In some embodiments of this application, the building interior object cluster includes a first object cluster and a second object cluster; when the processor executes the computer program, it further implements the following steps: obtaining the horizontal plane height information of the virtual scene; dividing the object models under the building interior object cluster into a first object cluster and a second object cluster based on the height information of the visible bounding box of each object model and the horizontal plane height information; wherein, the first object cluster includes object models whose visible bounding box height information is less than the horizontal plane height information, and the second object cluster includes object models whose visible bounding box height information is greater than or equal to the corresponding horizontal plane height information of the virtual scene.
[0203] In some embodiments of this application, the building interior object cluster includes a third object cluster and a fourth object cluster; when the processor executes the computer program, it further implements the following steps: from the object models under the building interior object cluster, obtain target object models whose visible bounding box height information is within a preset height range; cluster the target object models using the maximum and minimum height values of the visible bounding boxes of the target object models to obtain at least one third object cluster; traverse other object models in the building interior object cluster except for the target object models, and divide the other object models into third object models and fourth object models based on the visible bounding boxes of the third object clusters; wherein, the visible bounding boxes of the third object models are within the model bounding boxes of the third object clusters, and the fourth object models are object models other than the third object models among the other object models; merge the third object models into the third object cluster to update the third object cluster; and cluster the fourth object models based on the projection coordinate information of the visible bounding boxes of the fourth object models on the horizontal plane to obtain the fourth object cluster.
[0204] In some embodiments of this application, when the processor executes the computer program, it further implements the following steps: taking all the fourth object models as an initial object cluster, if the number of fourth object models in the initial object cluster is greater than a preset number threshold, the initial object cluster is clustered based on the projection coordinate information of the visual bounding box of the fourth object cluster on the horizontal plane to obtain object clusters; traversing any object cluster, if the number of fourth object models in the object cluster is greater than the preset number threshold, the object cluster is clustered again based on the projection coordinate information of the visual bounding box of the object cluster on the horizontal plane, until the number of fourth object models in the obtained object cluster is less than or equal to the preset number threshold.
[0205] In some embodiments of this application, a computer-readable storage medium is provided, storing a computer program that is loaded by a processor, causing the processor to perform the following steps:
[0206] Obtain the potential visibility set information of the virtual scene and the object models in the virtual scene;
[0207] Based on the potential visibility set information of the virtual scene, obtain the visual bounding box of the object model;
[0208] Obtain the model bounding box of the object model, and cluster the object model according to the model bounding box and the visible bounding box to obtain multiple target object clusters;
[0209] Based on the visual bounding boxes of each object model under the target object cluster, generate the visual bounding box of the target object cluster.
[0210] Generate a proxy model corresponding to the target object cluster, and determine the model application location point of the proxy model based on the visual bounding box of the target object cluster.
[0211] In some embodiments of this application, when the computer program is executed by the processor, it further performs the following steps: obtaining a first distance value between each of the visible location points and the object model; filtering target location points based on the first distance value corresponding to each of the visible locations; and generating a visual bounding box of the object model according to each of the target location points.
[0212] In some embodiments of this application, when the computer program is executed by the processor, it further implements the following steps: obtaining the model bounding box of the target object cluster, and determining the first application location point of the proxy model based on the model bounding box of the target object cluster; determining the second application location point of the proxy model based on the visual bounding box of the target object cluster; and determining the model application location point of the proxy model according to the union of the first application location point and the second application location point.
[0213] In some embodiments of this application, the target object cluster includes an internal building object cluster and an external building object cluster; when the computer program is executed by a processor, it further implements the following steps: based on the model bounding boxes of each object model, the object models are clustered to obtain at least one first-level building cluster and a second-level building cluster; the distance between the model bounding boxes of each object model under the first-level building cluster is less than a first distance threshold; the second-level building cluster includes object models other than those under each of the first-level building clusters; for any first-level building cluster, based on the visible bounding boxes of the object models under the first-level building cluster, the object models of the first-level building cluster are... The system performs row clustering to obtain an internal building object cluster and a first- and second-level building cluster. The visible bounding boxes of each object model within the internal building object cluster are within the model bounding box of the first-level building cluster. The first-level building cluster includes object models other than those within the internal building object cluster. Based on the position information of the object models within the second-level building cluster, the system performs secondary clustering to obtain at least one second-level building cluster. Based on the model bounding boxes of the first and second-level building clusters, the system merges the first and second-level building clusters to obtain at least one external building object cluster.
[0214] In some embodiments of this application, when the computer program is executed by the processor, it further performs the following steps: filtering reference object models from the object models according to the model volume of the object models; taking one reference object model as a reference building cluster, merging clusters based on the model bounding boxes of each reference building cluster to obtain a first-level building cluster; wherein, the model bounding box of the reference building cluster is the model bounding box of the reference object model; obtaining the model bounding box of the first-level building cluster, classifying the other object models besides the reference object models according to the distance values between them and the model bounding boxes of each first-level building cluster, obtaining a first object model with a distance value less than a first distance threshold and a second object model with a distance value greater than or equal to the first distance threshold; determining the second object model as a second-level building cluster, and traversing the first object models, assigning the first object model to the first-level building cluster with the smallest distance value between it and the first object model, so as to update the first-level building cluster.
[0215] In some embodiments of this application, the building interior object cluster includes a first object cluster and a second object cluster; when the computer program is executed by the processor, it further implements the following steps: obtaining the horizontal plane height information of the virtual scene; dividing the object models under the building interior object cluster into a first object cluster and a second object cluster according to the height information of the visible bounding box of each object model and the horizontal plane height information; wherein, the first object cluster includes object models whose visible bounding box height information is less than the horizontal plane height information, and the second object cluster includes object models whose visible bounding box height information is greater than or equal to the corresponding horizontal plane height information of the virtual scene.
[0216] In some embodiments of this application, the building interior object cluster includes a third object cluster and a fourth object cluster; when the computer program is executed by the processor, it further implements the following steps: obtaining target object models whose visible bounding box height information is within a preset height range from the object models under the building interior object cluster; clustering the target object models using the maximum and minimum height values of the visible bounding boxes of the target object models to obtain at least one third object cluster; traversing other object models in the building interior object cluster except for the target object models, and dividing the other object models into third object models and fourth object models based on the visible bounding boxes of the third object clusters; wherein the visible bounding boxes of the third object models are within the model bounding boxes of the third object clusters, and the fourth object models are object models other than the third object models among the other object models; merging the third object models into the third object clusters to update the third object clusters; and clustering the fourth object models based on the projection coordinate information of the visible bounding boxes of the fourth object models on the horizontal plane to obtain the fourth object clusters.
[0217] In some embodiments of this application, when the computer program is executed by the processor, it further implements the following steps: taking all the fourth object models as an initial object cluster, if the number of fourth object models in the initial object cluster is greater than a preset number threshold, the initial object cluster is clustered based on the projection coordinate information of the visual bounding box of the fourth object cluster on the horizontal plane to obtain object clusters; traversing any object cluster, if the number of fourth object models in the object cluster is greater than the preset number threshold, the object cluster is clustered again based on the projection coordinate information of the visual bounding box of the object cluster on the horizontal plane, until the number of fourth object models in the obtained object cluster is less than or equal to the preset number threshold.
[0218] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0219] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0220] The foregoing has provided a detailed description of a method, apparatus, computer device, and storage medium for generating a proxy model in a virtual scene, as provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for generating a proxy model in a virtual scene, characterized in that, The method includes: Obtain the potential visibility set information of the virtual scene and the object models in the virtual scene; Based on the potential visibility set information of the virtual scene, the visual bounding box of the object model is obtained; wherein, the visual bounding box is the smallest region space that includes all visible position points of the object model; Obtain the model bounding box of the object model, and cluster the object model according to the model bounding box and the visible bounding box to obtain multiple target object clusters; The step of obtaining the model bounding box of the object model involves clustering the object model based on its model bounding box and its visible bounding box to obtain multiple target object clusters, including: Based on the bounding box of the object model, the object model of the virtual scene is clustered to obtain multiple initial object clusters; Based on the visual bounding boxes of each object model within the initial object cluster, object models with similar positional information and similar visual position points are aggregated together to obtain the target object cluster. Based on the visual bounding boxes of each object model under the target object cluster, generate the visual bounding box of the target object cluster. Generate a proxy model corresponding to the target object cluster, and determine the model application location point of the proxy model based on the visual bounding box of the target object cluster.
2. The method according to claim 1, characterized in that, The step of obtaining the visual bounding box of the object model based on the potential visibility set information of the virtual scene includes: Based on the potential visibility set information of the virtual scene, obtain each visible position point of the object model; Based on the position information of each of the visible locations, a visual bounding box for the object model is generated.
3. The method according to claim 2, characterized in that, The step of generating the visual bounding box of the object model based on the position information of each of the visible location points includes: Obtain the first distance value between each of the visible position points and the object model; Based on the first distance value corresponding to each of the aforementioned visible positions, target location points are filtered; Generate the visual bounding box of the object model based on each of the target location points.
4. The method according to claim 1, characterized in that, The step of determining the model application location point of the proxy model based on the visual bounding box of the target object cluster includes: Obtain the model bounding box of the target object cluster, and determine the first application location point of the proxy model based on the model bounding box of the target object cluster; The second application location point of the proxy model is determined based on the visual bounding box of the target object cluster; The model application location of the proxy model is determined based on the union of the first application location and the second application location.
5. The method according to claim 1, characterized in that, The target object cluster includes both the object cluster inside the building and the object cluster outside the building. The model bounding box based on the object model clusters the object model of the virtual scene to obtain multiple initial object clusters, including: Based on the bounding boxes of each object model, the object models are clustered to obtain at least one first-level building cluster and one second-level building cluster; the distance between the bounding boxes of each object model under the first-level building cluster is less than a first distance threshold; the second-level building cluster includes object models other than those under each of the first-level building clusters. The process of aggregating object models with similar positional information and similar visible position points based on the visual bounding boxes of each object model within the initial object cluster to obtain the target object cluster includes: For any first-level building cluster, based on the visual bounding box of the object model under the first-level building cluster, the object model of the first-level building cluster is clustered to obtain the building interior object cluster and the first and second-level building clusters; wherein, the visual bounding box of each object model under the building interior object cluster is within the model bounding box of the first-level building cluster, and the first and second-level building clusters include object models other than the building interior object cluster. Based on the location information of the object models under the second-level building cluster, the object models under the second-level building cluster are further clustered to obtain at least one second-level building cluster. Based on the model bounding boxes of the first secondary building cluster and the second secondary building cluster, the first secondary building cluster and the second secondary building cluster are merged to obtain at least one cluster of external building objects.
6. The method according to claim 5, characterized in that, The method of clustering the object models based on their bounding boxes to obtain at least one first-level building cluster and one second-level building cluster includes: A baseline object model is selected from the object models based on the model volume of the object model; Using one of the reference object models as a reference building cluster, cluster merging is performed based on the model bounding boxes of each reference building cluster to obtain a first-level building cluster; wherein, the model bounding box of the reference building cluster is the model bounding box of the reference object model; Obtain the bounding box of the model of the first-level building cluster. Based on the distance value between the model bounding box of each of the first-level building clusters, classify the other object models except the reference object model to obtain the first object model with a distance value less than the first distance threshold and the second object model with a distance value greater than or equal to the first distance threshold. The second object model is identified as the second level-one building cluster, and the first object model is traversed. The first object model is assigned to the first level-one building cluster with the smallest distance value between it and the first object model, so as to update the first level-one building cluster.
7. The method according to claim 6, characterized in that, The cluster of objects inside the building includes a first cluster of objects and a second cluster of objects; The method of using the visual bounding box of the object model under the first-level building cluster to cluster the object model of the first-level building cluster, and obtaining the internal object cluster and the first and second-level building clusters, further includes: Obtain the horizontal plane height information of the virtual scene; Based on the height information of the visible bounding box of each object model under the object cluster inside the building and the horizontal plane height information, the object models under the object cluster inside the building are divided into a first object cluster and a second object cluster. The first object cluster includes object models whose visible bounding box height information is less than the horizontal plane height information, and the second object cluster includes object models whose visible bounding box height information is greater than or equal to the horizontal plane height information corresponding to the virtual scene.
8. The method according to claim 6, characterized in that, The cluster of objects inside the building includes a third cluster of objects and a fourth cluster of objects; The method of using the visual bounding box of the object model under the first-level building cluster to cluster the object model of the first-level building cluster, and obtaining the internal object cluster and the first and second-level building clusters, further includes: Obtain the target object model whose visible bounding box height information is within a preset height range from the object model under the object cluster inside the building; Cluster the target object model using the maximum and minimum height values of its visible bounding box to obtain at least one third object cluster. Traverse the object models other than the target object model in the object cluster inside the building, and divide the other object models into third object models and fourth object models based on the visual bounding box of the third object cluster; wherein the visual bounding box of the third object model is within the model bounding box of the third object cluster, and the fourth object model is the object model other than the third object model in the other object models. The third object model is merged into the third object cluster to update the third object cluster; Based on the projection coordinate information of the visual bounding box of the fourth object model on the horizontal plane, the fourth object model is clustered to obtain the fourth object cluster.
9. The method according to claim 8, characterized in that, The fourth object model is clustered based on the projection coordinate information of its visual bounding box on the horizontal plane to obtain a fourth object cluster, which includes: Using all the fourth object models as the initial object cluster, if the number of fourth object models in the initial object cluster is greater than a preset number threshold, the initial object cluster is divided into sub-clusters based on the projection coordinate information of the visual bounding box of the fourth object cluster on the horizontal plane to obtain object clustering. Traverse any object cluster. If the number of fourth object models in the object cluster is greater than a preset number threshold, the object cluster is re-clustered based on the projection coordinate information of the visual bounding box of the object cluster on the horizontal plane until the number of fourth object models in the resulting object cluster is less than or equal to the preset number threshold.
10. A device for generating proxy models in a virtual scene, characterized in that, The device includes: The object model acquisition module is used to acquire the potential visible set information of the virtual scene and the object models in the virtual scene. The visual information acquisition module is used to acquire the visual bounding box of the object model based on the potential visible set information of the virtual scene; The object cluster acquisition module is used to acquire the model bounding box of the object model, and to cluster the object model according to the model bounding box and the visible bounding box to obtain multiple target object clusters. The object cluster acquisition module is further used for: Based on the bounding box of the object model, the object model of the virtual scene is clustered to obtain multiple initial object clusters; Based on the visual bounding boxes of each object model within the initial object cluster, object models with similar positional information and similar visual position points are aggregated together to obtain the target object cluster. The visible range acquisition module is used to generate the visible bounding box of the target object cluster based on the visible bounding boxes of each object model under the target object cluster. The proxy model acquisition module is used to generate a proxy model corresponding to the target object cluster, and determine the model application location point of the proxy model based on the visual bounding box of the target object cluster.
11. An electronic device, characterized in that, The electronic device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the method for generating a proxy model in a virtual scene according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the method for generating a proxy model in a virtual scene according to any one of claims 1 to 9.