Model rendering method and device based on virtual scene gridding and computer device

By determining the mesh rendering weight and priority of virtual models in a virtual scene, the resource consumption problem of traditional rendering methods is solved, achieving efficient and smooth virtual scene rendering effects.

CN114596423BActive Publication Date: 2025-12-30GUANGZHOU KETENG INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210143119.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-16
Publication Date
2025-12-30
Estimated Expiration
2042-02-16

AI Technical Summary

Technical Problem

Traditional virtual scene mesh model rendering methods consume a lot of memory and video memory resources, resulting in slow rendering speed and inability to present high-quality effects.

Method used

By acquiring the mesh region data of the virtual model and the pose data of the virtual camera, the relative position information between the model and the camera is determined, and the model mesh is assigned rendering weights based on the position information, and the rendering priority is sorted according to the weights.

Benefits of technology

It improves model rendering efficiency, avoids stuttering caused by model deformation and excessive computation, and ensures smooth virtual camera shots and high-precision rendering effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114596423B_ABST
    Figure CN114596423B_ABST
Patent Text Reader

Abstract

The application relates to a model rendering method and device based on virtual scene gridding, computer equipment, a storage medium and a computer program product. The method comprises the following steps: acquiring grid area data corresponding to at least two virtual models in a target virtual scene; the grid area data is used to represent a grid area in which the virtual models are located in the gridded target virtual scene; acquiring pose data of a virtual camera in the target virtual scene, and determining relative position information between the virtual models and the virtual camera according to the grid area data and the pose data; determining grid rendering weights corresponding to the virtual models according to the relative position information; and rendering the virtual models according to the grid rendering weights corresponding to the virtual models. The method avoids problems such as model deformation and broken surfaces by gridding the target virtual scene, realizes the separation of the construction and application of the grid area data, and can further improve the model rendering effect in the virtual scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a model scheduling and rendering method, apparatus, computer equipment, storage medium and computer program product based on virtual scene meshing. Background Technology

[0002] Virtual scenes refer to digital scenes created by computers through digital communication technology, and rendering technology can create more realistic virtual scenes.

[0003] In traditional techniques, when rendering mesh models in virtual scenes, lightweight processing of the mesh models is often required. However, this rendering method requires a lot of data processing, which consumes a lot of memory and video memory resources, resulting in slow rendering speed and an inability to present high-quality rendering effects in virtual scenes.

[0004] Therefore, virtual scenes in traditional technologies suffer from poor model rendering effects. Summary of the Invention

[0005] Therefore, it is necessary to provide a model rendering method, apparatus, computer equipment, computer-readable storage medium, and computer program product based on virtual scene meshing that can improve the model rendering effect in virtual scenes, addressing the aforementioned technical problems.

[0006] Firstly, this application provides a model rendering method based on virtual scene meshing. The method includes:

[0007] Obtain grid region data corresponding to at least two virtual models in the target virtual scene; the grid region data is used to characterize the grid region where the virtual model is located in the gridded target virtual scene.

[0008] Acquire the pose data of the virtual camera in the target virtual scene, and determine the relative position information between each virtual model and the virtual camera based on the grid area data and the pose data;

[0009] Based on the relative position information, determine the mesh rendering weight corresponding to each virtual model;

[0010] Each virtual model is rendered according to the mesh rendering weight corresponding to each virtual model.

[0011] In one embodiment, the pose data includes the viewpoint data of the virtual camera; determining the relative position information between each virtual model and the virtual camera based on the mesh region data and the pose data includes: determining a first distance between the viewpoint centers of each virtual model and the virtual camera based on the mesh region data and the viewpoint data; determining the mesh rendering weight corresponding to each virtual model based on the relative position information includes: determining the mesh rendering weight corresponding to each virtual model based on the first distance; wherein, the first distance and the mesh rendering weight are negatively correlated.

[0012] In one embodiment, the pose data further includes the position data of the virtual camera; if there are at least two virtual models with the first distance equal, determining the mesh rendering weight corresponding to each virtual model based on the relative position information includes: determining a second distance between the at least two virtual models with the first distance equal and the shooting position of the virtual camera based on the mesh region data and the position data; determining the mesh rendering weight corresponding to the at least two virtual models with the first distance equal based on the second distance; wherein the second distance corresponding to the at least two virtual models with the first distance equal is negatively correlated with the corresponding mesh rendering weight.

[0013] In one embodiment, rendering each virtual model according to the mesh rendering weight corresponding to each virtual model includes: determining the rendering priority corresponding to each virtual model according to the mesh rendering weight corresponding to each virtual model; wherein the mesh rendering weight is positively correlated with the rendering priority; and rendering each virtual model according to the rendering priority.

[0014] In one embodiment, if there are at least two virtual models with equal mesh rendering weights, the method further includes: determining the mesh scheduling level corresponding to the at least two virtual models with equal mesh rendering weights; determining the rendering priority corresponding to the at least two virtual models with equal mesh rendering weights according to each mesh scheduling level; wherein the mesh scheduling level corresponding to the at least two virtual models with equal mesh rendering weights is positively correlated with the corresponding rendering priority; and rendering the at least two virtual models with equal mesh rendering weights according to each rendering priority.

[0015] In one embodiment, determining the mesh scheduling level corresponding to at least two virtual models with equal mesh rendering weights includes: acquiring the geometric attributes corresponding to at least two virtual models with equal mesh rendering weights; the geometric attributes are used to determine the number and volume of meshes occupied by the corresponding virtual models in the target virtual scene; determining the mesh scheduling level corresponding to the at least two virtual models with equal mesh rendering weights based on the number of meshes; wherein the number of meshes occupied by the at least two virtual models with equal mesh rendering weights is positively correlated with the corresponding mesh scheduling level; if there are at least two virtual models with equal meshes, then determining the mesh scheduling level corresponding to the at least two virtual models with equal meshes based on the volume occupied by the at least two virtual models with equal meshes; wherein the volume occupied by the at least two virtual models with equal meshes is positively correlated with the corresponding mesh scheduling level.

[0016] Secondly, this application also provides a model rendering apparatus based on virtual scene meshing. The apparatus includes:

[0017] The first acquisition module is used to acquire grid region data corresponding to at least two virtual models in the target virtual scene; the grid region data is used to characterize the grid region where the virtual model is located in the gridded target virtual scene.

[0018] The second acquisition module is used to acquire the pose data of the virtual camera in the target virtual scene, and determine the relative position information between each virtual model and the virtual camera based on the grid area data and the pose data;

[0019] The determining module is used to determine the mesh rendering weight corresponding to each virtual model based on the relative position information.

[0020] The rendering module is used to render each virtual model according to the mesh rendering weight corresponding to each virtual model.

[0021] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0022] Obtain grid region data corresponding to at least two virtual models in the target virtual scene; the grid region data is used to characterize the grid region where the virtual model is located in the gridded target virtual scene.

[0023] Acquire the pose data of the virtual camera in the target virtual scene, and determine the relative position information between each virtual model and the virtual camera based on the grid area data and the pose data;

[0024] Based on the relative position information, determine the mesh rendering weight corresponding to each virtual model;

[0025] Each virtual model is rendered according to the mesh rendering weight corresponding to each virtual model.

[0026] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0027] Obtain grid region data corresponding to at least two virtual models in the target virtual scene; the grid region data is used to characterize the grid region where the virtual model is located in the gridded target virtual scene.

[0028] Acquire the pose data of the virtual camera in the target virtual scene, and determine the relative position information between each virtual model and the virtual camera based on the grid area data and the pose data;

[0029] Based on the relative position information, determine the mesh rendering weight corresponding to each virtual model;

[0030] Each virtual model is rendered according to the mesh rendering weight corresponding to each virtual model.

[0031] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0032] Obtain grid region data corresponding to at least two virtual models in the target virtual scene; the grid region data is used to characterize the grid region where the virtual model is located in the gridded target virtual scene.

[0033] Acquire the pose data of the virtual camera in the target virtual scene, and determine the relative position information between each virtual model and the virtual camera based on the grid area data and the pose data;

[0034] Based on the relative position information, determine the mesh rendering weight corresponding to each virtual model;

[0035] Each virtual model is rendered according to the mesh rendering weight corresponding to each virtual model.

[0036] The aforementioned model rendering method, apparatus, computer equipment, storage medium, and computer program product based on virtual scene meshing can determine the mesh region of a virtual model within the meshed target virtual scene by acquiring mesh region data corresponding to at least two virtual models in the target virtual scene. This meshing of the target virtual scene eliminates the need for lightweighting of the virtual models, avoiding problems such as model deformation and surface breakage, thus improving the model rendering effect. Next, the pose data of the virtual camera in the target virtual scene is acquired, and the relative position information between each virtual model and the virtual camera is determined based on the mesh region data and pose data. Then, based on the relative position information, the mesh rendering weight corresponding to each virtual model is determined. Finally, each virtual model is rendered according to its corresponding mesh rendering weight. This allows for direct acquisition of the mesh region data corresponding to the virtual model, eliminating the need for real-time construction of mesh region data for model rendering, thus separating the construction and application of mesh region data and improving the model rendering efficiency in the virtual scene. Simultaneously, it avoids excessive CPU consumption due to excessive computational load. The processing unit (CPU) performance issues that could cause system lag were addressed by ensuring smooth movement of the virtual camera lens, allowing for timely display of high-precision virtual models, and further enhancing the rendering effect of models in the virtual scene. Attached Figure Description

[0037] Figure 1 This is a flowchart illustrating a model rendering method based on virtual scene meshing in one embodiment;

[0038] Figure 2 This is an application environment diagram of a model rendering method based on virtual scene meshing in one embodiment;

[0039] Figure 3 This is a flowchart illustrating a model rendering method based on virtual scene meshing in another embodiment;

[0040] Figure 4 This is a structural block diagram of a model rendering device based on virtual scene meshing in one embodiment;

[0041] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0043] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0044] In one embodiment, such as Figure 1 As shown, a model rendering method based on virtual scene meshing is provided, which can be applied to computer devices, including terminals, independent servers, or server clusters composed of multiple servers. The method includes:

[0045] Step S110: Obtain grid region data corresponding to at least two virtual models in the target virtual scene.

[0046] Among them, grid region data is used to characterize the grid region in which the virtual model is located in the gridded target virtual scene.

[0047] The grid area data can be stored locally or on other storage devices, such as server storage devices.

[0048] One approach is to create a virtual information environment in a multidimensional information space to simulate an interactive, virtual spatial scene, thereby obtaining the target virtual scene.

[0049] In practical implementation, the computer device can pre-construct and calculate the grid region data corresponding to at least two virtual models in the target virtual scene, and store the grid region data locally, directly retrieving the grid region data corresponding to at least two virtual models in the target virtual scene from the local storage; alternatively, it can construct and calculate the aforementioned grid region data through a grid data computing device, and store the grid region data in other storage devices, such as server storage devices (this is not limited here). Therefore, the computer device can retrieve the aforementioned grid region data from other storage devices, and determine the grid region where each virtual model is located in the gridded target virtual scene through the grid region data. In this way, the construction and application of grid region data are separated.

[0050] In practical applications, the construction and calculation of grid area data can be based on the visual window of the creation engine and development tools, such as the Unity 3D visual window. The target virtual scene can be managed by obtaining the grid parameters set by the user. Among them, the grid parameters are used to determine the number of grids to divide the target virtual scene into, such as dividing the target virtual scene into a 5×5 or 10×10 grid space. By obtaining each virtual model, the grid area in which each virtual model is located in the gridded target virtual scene can be determined, and the grid area data corresponding to each virtual model can be obtained.

[0051] Step S120: Obtain the pose data of the virtual camera in the target virtual scene, and determine the relative position information between each virtual model and the virtual camera based on the grid area data and pose data.

[0052] In the world space coordinate system where the target virtual scene is located, the content presented by the graphical user interface, such as the virtual scene and the editing interface, is all obtained from the perspective of the virtual camera.

[0053] The pose data includes the position and orientation data of the target virtual camera, which can be used to determine the grid area where the virtual camera is located in the gridded target virtual scene.

[0054] The relative position information can be the distance between the virtual model and the virtual camera.

[0055] In practice, the computer device can acquire the pose data of the virtual camera in the target virtual scene, namely position data and posture data. Based on the grid area data of each virtual model and the above pose data, it can determine the grid area where each virtual model is located in the gridded target virtual scene and the grid area where the virtual camera is located in the gridded target virtual scene. Thus, it can determine the relative position information between each virtual model and the virtual camera, such as the distance information between each virtual model and the virtual camera.

[0056] Step S130: Determine the mesh rendering weights corresponding to each virtual model based on the relative position information.

[0057] In practice, the computer device can determine the mesh rendering weight of each virtual model based on the relative position information between each virtual model and the virtual camera, and determine a rendering list based on the mesh rendering weight of each virtual model. The mesh rendering weights recorded in the rendering list are sorted according to the size of the mesh rendering weight of each virtual model.

[0058] Specifically, after determining the distance information between each virtual model and the virtual camera through the relative position information between each virtual model and the virtual camera, the closer the distance between the virtual model and the virtual camera, the greater the mesh rendering weight corresponding to that virtual model.

[0059] Step S140: Render each virtual model according to the mesh rendering weight corresponding to each virtual model.

[0060] In practice, the computer device can determine the rendering priority of each virtual model based on the mesh rendering weight of each virtual model, and then render each virtual model according to its rendering priority to achieve the visual loading of each virtual model, such as rendering and loading each virtual model on the front-end page of the computer device; where the larger the mesh rendering weight of the virtual model, the higher the corresponding rendering priority.

[0061] In the aforementioned model rendering method based on virtual scene meshing, by acquiring the mesh region data corresponding to at least two virtual models in the target virtual scene, the mesh region where the virtual model is located in the meshed target virtual scene can be determined. Thus, by meshing the target virtual scene, lightweight processing of the virtual models is unnecessary, avoiding problems such as model deformation and broken surfaces, thereby improving the model rendering effect. Then, the pose data of the virtual camera in the target virtual scene is acquired, and the relative position information between each virtual model and the virtual camera is determined based on the mesh region data and pose data. Next, based on the relative position information, the mesh rendering weight corresponding to each virtual model is determined. Finally, each virtual model is rendered according to its corresponding mesh rendering weight. This allows for direct acquisition of the mesh region data corresponding to the virtual model, eliminating the need for real-time construction of mesh region data for model rendering, achieving separation of mesh region data construction and application, and improving the model rendering efficiency in the virtual scene. Simultaneously, it avoids excessive CPU consumption due to excessive computational load. The performance of the central processing unit (CPU) prevented the system from lagging, ensuring smooth movement of the virtual camera lens and timely display of high-precision virtual models, further enhancing the rendering effect of models in the virtual scene.

[0062] In one embodiment, the relative position information between each virtual model and the virtual camera is determined based on grid region data and pose data, including: determining a first distance between the viewpoint centers of each virtual model and the virtual camera based on grid region data and viewpoint data; and determining the grid rendering weight corresponding to each virtual model based on the relative position information, including: determining the grid rendering weight corresponding to each virtual model based on the first distance.

[0063] The pose data of the virtual camera can be position data and attitude data. The attitude data can be viewpoint data, which can be used to determine the viewpoint center of the virtual camera.

[0064] Among them, the first distance is negatively correlated with the mesh rendering weight.

[0065] In the specific implementation, when the computer device determines the relative position information between each virtual model and the virtual camera based on the grid area data and pose data, the computer device can obtain the viewpoint data of the virtual camera based on the pose data of the virtual camera, thereby determining the viewpoint center of the virtual camera, and determining the distance between each virtual model and the viewpoint center based on the area where the viewpoint center of the virtual camera is located in the target virtual scene and the grid area data corresponding to each virtual model, thus obtaining the first distance.

[0066] Furthermore, in the process of determining the relative position information between each virtual model and the virtual camera based on the grid area data and pose data, the computer equipment can determine the grid rendering weight corresponding to each virtual model based on the first distance corresponding to each virtual model, that is, the first distance between the viewpoint center of each virtual model and the virtual camera. Among them, the first distance corresponding to each virtual model is negatively correlated with the corresponding grid rendering weight, that is, the closer the first distance between the virtual model and the virtual camera, the greater the grid rendering weight corresponding to the virtual model.

[0067] The technical solution of this embodiment determines the first distance between the viewpoint center of each virtual model and the virtual camera based on the grid area data corresponding to the virtual model and the viewpoint data of the virtual camera; and determines the grid rendering weight corresponding to each virtual model based on each first distance; wherein, the first distance corresponding to the virtual model and the corresponding grid rendering weight are negatively correlated; thus, by assigning grid rendering weight to each virtual model according to the distance between each virtual model and the viewpoint center of the virtual camera, the virtual model that is closer to the virtual camera has a larger grid rendering weight, thereby accurately determining the rendering order of the virtual models based on the grid rendering weight of the virtual models.

[0068] In one embodiment, if there are at least two virtual models with a first equidistant distance, the mesh rendering weight corresponding to each virtual model is determined based on the relative position information, including: determining the second distance between the at least two virtual models with a first equidistant distance and the shooting position of the virtual camera based on the mesh region data and position data; and determining the mesh rendering weight corresponding to the at least two virtual models with a first equidistant distance based on the second distance.

[0069] The pose data of the virtual camera can be both position data and attitude data. The position data can be used to determine the shooting position of the virtual camera.

[0070] Among them, the second distance corresponding to at least two virtual models with equal first distance is negatively correlated with the corresponding mesh rendering weight.

[0071] In specific implementation, when the computer device determines the mesh rendering weight corresponding to a virtual model based on the relative position information between each virtual model and the virtual camera, if there are at least two virtual models with a first distance equal to the center of view of the virtual camera, then the mesh regions of the at least two virtual models in the meshed target virtual scene are determined based on the mesh region data corresponding to the at least two virtual models with a first distance equal to the first distance; and the mesh region of the camera's shooting position in the meshed target virtual scene is determined based on the position data of the virtual camera; thus, the distance between the at least two virtual models and the shooting position of the virtual camera can be determined based on the mesh regions of the at least two virtual models in the meshed target virtual scene and the mesh region of the camera's shooting position in the meshed target virtual scene, respectively, as the second distance corresponding to the at least two virtual models; and the mesh rendering weight corresponding to the at least two virtual models with a first distance equal to each second distance is determined based on each second distance; wherein, the second distance corresponding to the at least two virtual models with a first distance equal to the first distance is negatively correlated with the corresponding mesh rendering weight, that is, when the first distances corresponding to the virtual models are equal, the closer the second distance between the virtual model and the virtual camera, the greater the mesh rendering weight corresponding to the virtual model.

[0072] In this way, the computer device can determine the mesh rendering weights corresponding to each virtual model in the target virtual scene, and determine a rendering list based on the mesh rendering weights corresponding to each virtual model. The mesh rendering weights recorded in the rendering list are sorted according to the size of the mesh rendering weights corresponding to each virtual model.

[0073] In this embodiment, if there are at least two virtual models with equal first distances, during the process of determining the mesh rendering weight of each virtual model based on its relative position information, a second distance is determined between the at least two virtual models with equal first distances and the shooting position of the virtual camera based on each mesh area data and position data. Based on each second distance, the mesh rendering weight corresponding to the at least two virtual models with equal first distances is determined. Thus, when there are at least two virtual models with equal first distances to the virtual camera, the mesh rendering weight corresponding to the at least two virtual models with equal first distances can be assigned based on the distance between the virtual models and the shooting position of the virtual camera, thereby ensuring that the mesh rendering weight assigned to each virtual model in the target virtual scene is accurate.

[0074] In one embodiment, rendering each virtual model according to the mesh rendering weight corresponding to each virtual model includes: determining the rendering priority of each virtual model according to the mesh rendering weight corresponding to each virtual model; and rendering each virtual model according to the rendering priority.

[0075] Among them, the mesh rendering weight is positively correlated with the rendering priority.

[0076] In practice, during the rendering of each virtual model according to its corresponding mesh rendering weight, the computer device can determine the rendering priority of each virtual model based on its mesh rendering weight. The mesh rendering weight and rendering priority of each virtual model are positively correlated; that is, the higher the mesh rendering weight of a virtual model, the higher its rendering priority. Then, the computer device can determine the rendering order of the virtual models based on their rendering priorities and render them according to this order to achieve the visualization loading of each virtual model. This prioritizes the rendering of virtual models with higher mesh rendering weights, i.e., those closer to the virtual camera.

[0077] In practical applications, during the rendering process of each virtual model by computer equipment based on the rendering priority which is positively correlated with the mesh rendering weight, since the mesh rendering weight of the virtual model is negatively correlated with the distance between the virtual model and the virtual camera, when rendering each virtual model, the virtual model that is closer to the virtual camera can be rendered with priority. This enables rendering and loading of virtual models that are at different distances from the virtual camera from near to far.

[0078] The technical solution of this embodiment determines the rendering priority of each virtual model according to the mesh rendering weight corresponding to each virtual model; and renders each virtual model according to the rendering priority. Among them, the mesh rendering weight and the rendering priority are positively correlated. Thus, since the mesh rendering weight of the virtual model is negatively correlated with the distance between the virtual model and the virtual camera, the closer the virtual model is to the virtual camera, the higher its rendering priority and the more preferentially it is rendered. This realizes that the rendering of each virtual model is based on its distance from the virtual camera, from near to far, preventing the invalid rendering of virtual models that are far away from the virtual camera and are occluded, saving memory consumption and improving model rendering efficiency.

[0079] In one embodiment, if there are at least two virtual models with equal mesh rendering weights, the method further includes: determining the mesh scheduling level corresponding to the at least two virtual models with equal mesh rendering weights respectively; determining the rendering priority corresponding to the at least two virtual models with equal mesh rendering weights respectively according to each mesh scheduling level; and rendering the at least two virtual models with equal mesh rendering weights according to each rendering priority.

[0080] Among them, the grid scheduling level corresponding to at least two virtual models with equal grid rendering weights is positively correlated with the corresponding rendering priority.

[0081] In the specific implementation, when the computer device determines the rendering priority of each virtual model based on the mesh rendering weight of each virtual model, if there are at least two virtual models with equal mesh rendering weights, for example, if different models are in the same mesh and have the same mesh rendering weight, the computer device can determine the mesh scheduling level corresponding to the at least two virtual models with equal mesh rendering weights, and determine the rendering priority corresponding to the at least two virtual models based on the corresponding mesh scheduling level. Among them, the mesh scheduling level corresponding to the at least two virtual models with equal mesh rendering weights is positively correlated with the corresponding rendering priority. That is, when the mesh rendering weights of the virtual models are equal, the higher the mesh scheduling level of the virtual model, the higher the corresponding rendering priority.

[0082] In practical applications, computer devices can obtain mesh rendering weight thresholds and mesh scheduling level thresholds. If there is a virtual model whose corresponding mesh rendering weight is less than the aforementioned mesh rendering weight threshold and whose corresponding mesh scheduling level is less than the aforementioned mesh scheduling level threshold, then the virtual model is removed from the rendering loading list and is not rendered. The mesh rendering weight threshold and mesh scheduling level threshold can be set according to the performance of the computer device, automatically adjusting the mesh rendering weight threshold and mesh scheduling level threshold parameters. This allows model rendering to be performed on both high-performance and low-performance computer devices, thus balancing the needs of both types of computer devices.

[0083] In this embodiment, if there are at least two virtual models with equal mesh rendering weights, the grid scheduling level corresponding to each of the at least two virtual models with equal mesh rendering weights is determined. Based on each grid scheduling level, the rendering priority corresponding to each of the at least two virtual models with equal mesh rendering weights is determined. Based on each rendering priority, the at least two virtual models with equal mesh rendering weights are rendered. The grid scheduling level corresponding to each of the at least two virtual models with equal mesh rendering weights is positively correlated with the corresponding rendering priority. Thus, in determining the rendering priority of each virtual model based on its mesh rendering weight, if there are at least two virtual models with equal mesh rendering weights, the rendering priority can still be determined based on the corresponding grid scheduling level, thereby more accurately determining the rendering priority of each virtual model in the target virtual scene.

[0084] In one embodiment, determining the grid scheduling level corresponding to at least two virtual models with equal grid rendering weights includes: obtaining the geometric attributes corresponding to at least two virtual models with equal grid rendering weights; determining the grid scheduling level corresponding to at least two virtual models with equal grid rendering weights based on the number of each grid; and if there are at least two virtual models with equal grid numbers, determining the grid scheduling level corresponding to at least two virtual models with equal grid numbers based on the volume occupied by the at least two virtual models with equal grid numbers.

[0085] Among them, the geometric attribute is used to determine the number and volume of grids occupied by the corresponding virtual model in the target virtual scene; in practical applications, this geometric attribute can also be named the bounding box attribute.

[0086] Among them, the number of grids occupied by at least two virtual models with equal grid rendering weights is positively correlated with the corresponding grid scheduling level.

[0087] Among them, the volume occupied by at least two virtual models with equal grid numbers is positively correlated with the corresponding grid scheduling level.

[0088] In the specific implementation, when the computer device determines the grid scheduling level corresponding to at least two virtual models with equal grid rendering weights, the computer device can first obtain the bounding box attributes corresponding to at least two virtual models with equal grid rendering weights. Based on the bounding box attributes, the bounding box corresponding to the virtual model can be determined. Then, by using the vertex position of the bounding box corresponding to the virtual model, it can be determined whether the corresponding virtual model is contained in the grid of the target virtual scene. Thus, the number and volume of grids occupied by the at least two virtual models in the target virtual scene can be determined.

[0089] Among them, the number of grids occupied by at least two virtual models with equal grid rendering weights is positively correlated with the corresponding grid scheduling level. Based on the number of grids corresponding to the above at least two virtual models, the corresponding grid scheduling level can be determined respectively. That is, the larger the number of grids occupied by the virtual model, the larger the projection of the virtual model on the view section, and the higher the corresponding grid scheduling level.

[0090] If there are at least two virtual models that occupy the same number of grids in the target virtual scene, the corresponding grid scheduling level can be determined based on the volume occupied by the at least two virtual models with the same number of grids in the target virtual scene. The volume occupied by the at least two virtual models with the same number of grids is positively correlated with the corresponding grid scheduling level. That is, when the virtual models occupy the same number of grids in the target virtual scene, the larger the volume occupied by the virtual models in the target virtual scene, the higher the corresponding grid scheduling level.

[0091] In practical applications, users can set preset mesh scheduling levels for virtual models. Therefore, when determining the mesh scheduling levels for at least two virtual models with equal mesh rendering weights, the computer device must first determine whether the virtual model has a preset mesh scheduling level. If, among the at least two virtual models with equal mesh rendering weights, there is a virtual model with a preset mesh scheduling level, then the mesh scheduling level corresponding to that virtual model with the preset mesh scheduling level is the priority scheduling level, that is, the preset mesh scheduling level set by the user is the highest level. If there is no virtual model with a preset mesh scheduling level, then the corresponding mesh scheduling level is determined based on the bounding box attribute of the virtual model.

[0092] In addition, the grid scheduling level corresponding to each virtual model in the target virtual scene can be calculated using a grid data computing device. This device can determine the grid scheduling level for each virtual model based on whether it has a pre-defined grid scheduling level and its corresponding bounding box attributes. Specifically, the device first determines whether a pre-defined grid scheduling level exists in each virtual model. If so, the virtual model with the pre-defined grid scheduling level is designated as the priority scheduling level. If not, the number of grids occupied by the virtual model in the target virtual scene is determined based on the bounding box attributes, and the corresponding grid scheduling level is determined based on the number of grids. The grid scheduling hierarchy is defined as follows: the number of grids occupied by a virtual model is positively correlated with its corresponding grid scheduling hierarchy. If at least two virtual models have the same number of grids, the volume occupied by each virtual model in the target virtual scene is determined based on the bounding box attribute, and the corresponding grid scheduling hierarchy is determined based on this volume. The volume occupied by the virtual model is positively correlated with its corresponding grid scheduling hierarchy. Thus, the grid data computing device can calculate and determine the grid scheduling hierarchy corresponding to each virtual model in the target virtual scene and send the corresponding grid scheduling hierarchy to other storage devices, such as server storage devices (this is not limited to these devices). It is understood that computer devices can also pre-calculate and determine the grid scheduling hierarchy corresponding to each virtual model using the above method and store it locally.

[0093] Therefore, in the process of determining the grid scheduling levels corresponding to at least two virtual models with equal grid rendering weights, the computer device does not need to calculate the grid scheduling levels corresponding to the virtual models in real time. It can directly obtain the grid scheduling levels corresponding to at least two virtual models with equal grid rendering weights from other storage devices, or directly obtain the grid scheduling levels corresponding to the above-mentioned at least two virtual models from the local storage device. This achieves the separation of grid scheduling level construction and application, which helps to reduce the amount of data calculation and improves model rendering efficiency.

[0094] For the convenience of those skilled in the art, Figure 2An application scenario diagram is provided in one embodiment. The grid data computing device 202 communicates with the storage device 204 via a network; the storage device 204 communicates with the computer device 206 via a network. The data storage system can store the data that the storage device 204 needs to process. The data storage system can be integrated on the storage device 204, or it can be located in the cloud or on other network servers. The grid data computing device 202 can be a server or another computer device; the storage device 204 can be a server; the computer device 206 can be, but is not limited to, a personal computer, laptop, smartphone, tablet, IoT device, augmented reality, and virtual reality device, etc.; the server can be a standalone server or a server cluster composed of multiple servers.

[0095] like Figure 2 As shown, the grid data computing device 202 is used to construct and calculate the grid area data and grid scheduling level corresponding to each virtual model, and send the grid area data and grid scheduling level corresponding to each virtual model to the storage device 204 to store the grid area data and grid scheduling level in the data storage system, so that the computer device 206 can obtain the grid area data and grid scheduling level corresponding to each virtual model through the storage device 204.

[0096] The technical solution of this embodiment involves obtaining the geometric attributes corresponding to at least two virtual models with equal mesh rendering weights. These geometric attributes determine the number and volume of meshes occupied by the corresponding virtual models in the target virtual scene. Based on the number of meshes, the mesh scheduling level corresponding to the at least two virtual models with equal mesh rendering weights is determined. The number of meshes occupied by the at least two virtual models with equal mesh rendering weights is positively correlated with the corresponding mesh scheduling level. If at least two virtual models with equal mesh numbers exist, the corresponding mesh scheduling level is determined based on the volume occupied by the at least two virtual models with equal mesh numbers. The grid scheduling level is defined as follows: the volume occupied by at least two virtual models with equal grid numbers is positively correlated with the corresponding grid scheduling level. Thus, in the process of determining the grid scheduling level of a virtual model based on the number of grids it occupies, and in order to determine the rendering priority of the virtual model, even if there are at least two virtual models with equal grid numbers, the grid scheduling level of the at least two virtual models with equal grid numbers can still be determined based on the volume occupied by the virtual models. This enables the accurate determination of the grid scheduling level of the virtual model in the target virtual scene, thereby allowing the accurate determination of the rendering priority of the virtual model based on the grid scheduling level.

[0097] In another embodiment, such as Figure 3As shown, a model rendering method based on virtual scene meshing is provided. Taking the application of this method to a computer device as an example, it includes the following steps: Step S302, obtaining mesh region data corresponding to at least two virtual models in the target virtual scene, and pose data of the virtual camera in the target virtual scene. Step S304, determining a first distance between the viewpoint center of each virtual model and the virtual camera, and a second distance between the shooting position of the virtual model and the virtual camera, based on the mesh region data and pose data. Step S306, determining the mesh rendering weight corresponding to each virtual model based on the first distance and the second distance. Step S308, obtaining the mesh scheduling level corresponding to each virtual model, and determining the rendering priority corresponding to each virtual model based on the mesh scheduling level and mesh rendering weight. Step S310, rendering each virtual model according to its rendering priority.

[0098] It should be noted that the specific limitations of the above steps can be found in the above description of the specific limitations of a model rendering method based on virtual scene meshing.

[0099] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0100] Based on the same inventive concept, this application also provides a virtual scene mesh-based model rendering apparatus for implementing the aforementioned virtual scene mesh-based model rendering method. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations of one or more embodiments of the virtual scene mesh-based model rendering apparatus provided below can be found in the above-described limitations of a virtual scene mesh-based model rendering method, and will not be repeated here.

[0101] In one embodiment, such as Figure 4 As shown, a model rendering device based on virtual scene meshing is provided, including: a first acquisition module 410, a second acquisition module 420, a determination module 430, and a rendering module 440, wherein:

[0102] The first acquisition module 410 is used to acquire grid region data corresponding to at least two virtual models in the target virtual scene; the grid region data is used to characterize the grid region where the virtual model is located in the gridded target virtual scene.

[0103] The second acquisition module 420 is used to acquire the pose data of the virtual camera in the target virtual scene, and determine the relative position information between each virtual model and the virtual camera based on the grid area data and the pose data.

[0104] The determining module 430 is used to determine the mesh rendering weight corresponding to each virtual model based on the relative position information.

[0105] The rendering module 440 is used to render each virtual model according to the mesh rendering weight corresponding to each virtual model.

[0106] In one embodiment, the pose data includes the viewpoint data of the virtual camera; the second acquisition module 420 is specifically used to determine a first distance between the viewpoint center of each virtual model and the virtual camera based on the grid region data and the viewpoint data; the determination module 430 is specifically used to determine the grid rendering weight corresponding to each virtual model based on each of the first distances; wherein, the first distance and the grid rendering weight are negatively correlated.

[0107] In one embodiment, the pose data further includes the position data of the virtual camera; if there are at least two virtual models with the first distance equal, the determining module 430 is specifically used to determine the second distance between the at least two virtual models with the first distance equal and the shooting position of the virtual camera based on each of the grid region data and the position data; and to determine the grid rendering weight corresponding to each of the second distances based on each of the second distances; wherein the second distance corresponding to the at least two virtual models with the first distance equal is negatively correlated with the corresponding grid rendering weight.

[0108] In one embodiment, the rendering module 440 is specifically used to determine the rendering priority of each virtual model according to the mesh rendering weight corresponding to each virtual model; wherein the mesh rendering weight is positively correlated with the rendering priority; and to render each virtual model according to the rendering priority.

[0109] In one embodiment, if there are at least two virtual models with equal mesh rendering weights, the apparatus further includes: a scheduling level determination module, configured to determine the mesh scheduling level corresponding to the at least two virtual models with equal mesh rendering weights; a priority determination module, configured to determine the rendering priority corresponding to the at least two virtual models with equal mesh rendering weights according to each mesh scheduling level; wherein the mesh scheduling level corresponding to the at least two virtual models with equal mesh rendering weights is positively correlated with the corresponding rendering priority; and a rendering submodule, configured to render the at least two virtual models with equal mesh rendering weights according to each rendering priority.

[0110] In one embodiment, the scheduling level determination module is specifically used to obtain the geometric attributes corresponding to at least two virtual models with equal mesh rendering weights; the geometric attributes are used to determine the number and volume of meshes occupied by the corresponding virtual models in the target virtual scene; based on the number of meshes, the grid scheduling level corresponding to the at least two virtual models with equal mesh rendering weights is determined; wherein, the number of meshes occupied by the at least two virtual models with equal mesh rendering weights is positively correlated with the corresponding grid scheduling level; if there are at least two virtual models with equal meshes, the grid scheduling level corresponding to the at least two virtual models with equal meshes is determined based on the volume occupied by the at least two virtual models with equal meshes; wherein, the volume occupied by the at least two virtual models with equal meshes is positively correlated with the corresponding grid scheduling level.

[0111] The modules in the aforementioned virtual scene mesh-based model rendering device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the corresponding operations of each module.

[0112] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a model rendering method based on virtual scene meshing. The display screen can be an LCD screen or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0113] Those skilled in the art will understand that Figure 5 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.

[0114] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0115] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0116] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0117] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0118] 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 above methods. Any references to memory, 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, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

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

[0120] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for rendering a model based on virtual scene gridding, comprising: The method comprises: acquiring mesh region data corresponding to at least two virtual models in a target virtual scene; the mesh region data is used to represent a mesh region in which the virtual models are located in the meshed target virtual scene; acquiring pose data of a virtual camera in the target virtual scene, and determining relative position information between each virtual model and the virtual camera according to the mesh region data and the pose data; determining mesh rendering weights corresponding to each virtual model according to each relative position information; rendering each virtual model according to the mesh rendering weight corresponding to each virtual model; wherein if there is a virtual model corresponding to a mesh rendering weight less than a mesh rendering weight threshold and a mesh scheduling level less than a mesh scheduling level threshold, the virtual model is excluded from a rendering loading list and is not rendered; wherein the mesh rendering weight threshold and the mesh scheduling level threshold are performance settings of a computer device capable of performing rendering operations; wherein the number of meshes occupied by virtual models with equal mesh rendering weights is positively correlated with the corresponding mesh scheduling level; the volume occupied by at least two virtual models with equal mesh numbers is positively correlated with the corresponding mesh scheduling level.

2. The method of claim 1, wherein, The pose data comprises view angle data of the virtual camera; the determination of the relative position information between each virtual model and the virtual camera according to the mesh region data and the pose data comprises: determining a first distance between each virtual model and a view angle center of the virtual camera according to the mesh region data and the view angle data; The determination of the mesh rendering weight corresponding to each virtual model according to each relative position information comprises: determining the mesh rendering weight corresponding to each virtual model according to each first distance; wherein the first distance is negatively correlated with the mesh rendering weight.

3. The method of claim 2, wherein, The pose data further comprises position data of the virtual camera; if there are at least two virtual models with equal first distances, the determination of the mesh rendering weight corresponding to each virtual model according to each relative position information comprises: determining a second distance between each virtual model with equal first distances and a shooting position of the virtual camera according to each mesh region data and the position data; determining the mesh rendering weight corresponding to each virtual model with equal first distances according to each second distance; wherein the second distance corresponding to each virtual model with equal first distances is negatively correlated with the corresponding mesh rendering weight.

4. The method of claim 1, wherein, The rendering of each virtual model according to the mesh rendering weight corresponding to each virtual model comprises: determining a rendering priority corresponding to each virtual model according to the mesh rendering weight corresponding to each virtual model; wherein the mesh rendering weight is positively correlated with the rendering priority; rendering each virtual model according to the rendering priority.

5. The method of claim 4, wherein, If there are at least two virtual models with equal mesh rendering weights, the method further comprises: determine grid scheduling levels corresponding to the at least two virtual models with equal grid rendering weights respectively; determine rendering priorities corresponding to the at least two virtual models with equal grid rendering weights respectively according to the grid scheduling levels; wherein the grid scheduling levels corresponding to the at least two virtual models with equal grid rendering weights are in positive correlation with the corresponding rendering priorities; render the at least two virtual models with equal grid rendering weights according to the rendering priorities respectively.

6. The method of claim 5, wherein, The determining the grid scheduling levels corresponding to the at least two virtual models with equal grid rendering weights respectively comprises: acquire geometry attributes corresponding to the at least two virtual models with equal grid rendering weights respectively; the geometry attributes are used to determine the grid quantity and volume occupied by the corresponding virtual models in the target virtual scene; determine grid scheduling levels corresponding to the at least two virtual models with equal grid rendering weights respectively according to the grid quantities respectively; wherein the grid quantities occupied by the at least two virtual models with equal grid rendering weights are in positive correlation with the corresponding grid scheduling levels; if there are at least two virtual models with equal grid quantities, determine grid scheduling levels corresponding to the at least two virtual models with equal grid quantities respectively according to the volumes occupied by the at least two virtual models with equal grid quantities; wherein the volumes occupied by the at least two virtual models with equal grid quantities are in positive correlation with the corresponding grid scheduling levels.

7. A device for rendering a model based on virtual scene tessellation, characterized in that, The apparatus comprises: a first acquiring module configured to acquire grid region data corresponding to at least two virtual models in a target virtual scene; the grid region data is used to represent a grid region where the virtual models are located in the grid-based target virtual scene; a second acquiring module configured to acquire pose data of a virtual camera in the target virtual scene, and determine relative position information between each of the virtual models and the virtual camera according to the grid region data and the pose data; a determining module configured to determine grid rendering weights corresponding to each of the virtual models according to the relative position information; a rendering module configured to render each of the virtual models according to the grid rendering weights corresponding to each of the virtual models; The rendering module is further configured to, if there is a virtual model with a grid rendering weight less than a grid rendering weight threshold and a grid scheduling level less than a grid scheduling level threshold, exclude the virtual model from a rendering loading list and not render the virtual model; wherein the grid rendering weight threshold and the grid scheduling level threshold are performance settings of a computer device capable of performing rendering operations; wherein the grid quantities occupied by the virtual models with equal grid rendering weights are in positive correlation with the corresponding grid scheduling levels; the volumes occupied by the at least two virtual models with equal grid quantities are in positive correlation with the corresponding grid scheduling levels. 8.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-7. The processor, when executing the computer program, implements the steps of the method in any one of claims 1 to 6. The processor, when executing the computer program, implements the steps of the method in any one of claims 1 to 6.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, which when executed by a processor, implements the steps of the method of any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program, which when executed by a processor, implements the steps of the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Large-scale building scene rendering acceleration method, system and device and storage medium

    CN110443893A

  • Rendering display method and device, computer equipment and storage medium

    CN114042313A