Spherical virtual scene terrain loading method and device, medium and electronic equipment

By generating and rendering a large target model of a spherical virtual scene, the problem of slow terrain loading speed in spherical virtual scenes is solved, achieving efficient terrain loading and enhanced realism.

CN117205554BActive Publication Date: 2026-07-31NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2023-09-12
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies are slow in loading terrain in spherical virtual scenes, consume high manpower and time costs, and are not suitable for loading terrain in spherical virtual scenes.

Method used

By acquiring the first LOD model with the lowest model accuracy from the multi-level LOD models of multiple terrain regions, a target large model matching the spherical virtual scene is generated, and the target large model is rendered in the spherical virtual scene, maintaining its display on the top layer even when the distance between the camera and the spherical virtual scene exceeds a specified threshold.

Benefits of technology

It reduces system resource consumption, decreases memory performance overhead, improves terrain loading speed and efficiency, alleviates screen lag issues, and enhances the realism and loading efficiency of virtual scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117205554B_ABST
    Figure CN117205554B_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, computer-readable storage medium, and electronic device for loading terrain in a spherical virtual scene, relating to the field of computer technology. The spherical virtual scene includes multiple terrain regions, each terrain region including a corresponding multi-level Level of Detail (LOD) model, and each LOD model corresponding to a model precision. The method includes: obtaining the first LOD model with the lowest model precision among the multi-level LOD models of the multiple terrain regions; generating a target large model matching the spherical virtual scene based on the first LOD models corresponding to the multiple terrain regions, wherein the target large model includes model patches for describing the terrain features of the multiple terrain regions; rendering the target large model to maintain its display in the spherical virtual scene, and maintaining the target large model displayed at the top layer when the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds a specified threshold. This disclosure improves the terrain loading efficiency in spherical virtual scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method for loading terrain in a spherical virtual scene, a device for loading terrain in a spherical virtual scene, a computer-readable storage medium, and an electronic device. Background Technology

[0002] Virtual terrain is often used as an indispensable part of film, game, and animation scenes. By loading virtual terrain, realistic and beautiful virtual scenes can be created.

[0003] In related technologies, workers usually need to manually create terrain blocks, which are then pieced together to form the virtual terrain for display when loading the terrain in the virtual scene. However, this method is not suitable for loading terrain in spherical virtual scenes. In addition, this method results in slow terrain loading speed and requires high manpower and time costs, making the terrain loading process inefficient for spherical virtual scenes. Summary of the Invention

[0004] This disclosure provides a method for loading terrain in a spherical virtual scene, a device for loading terrain in a spherical virtual scene, a computer-readable storage medium, and an electronic device, thereby improving the terrain loading efficiency in a spherical virtual scene to at least a certain extent.

[0005] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part by practice of this disclosure.

[0006] According to a first aspect of this disclosure, a terrain loading method for a spherical virtual scene is provided. The spherical virtual scene includes multiple terrain regions, each terrain region includes a corresponding multi-level LOD model, and each LOD model corresponds to a model precision. The method includes: obtaining a first LOD model with the lowest model precision among the multi-level LOD models of the multiple terrain regions; generating a target large model matching the spherical virtual scene based on the first LOD model corresponding to the multiple terrain regions, wherein the target large model includes model patches for describing the terrain features of the multiple terrain regions; rendering the target large model to maintain its display in the spherical virtual scene, and maintaining the target large model displayed on the top layer when the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds a specified threshold.

[0007] According to a second aspect of this disclosure, a terrain loading device for a spherical virtual scene is provided. The spherical virtual scene includes multiple terrain regions, each terrain region includes a corresponding multi-level LOD model, and each LOD model corresponds to a model precision. The device includes: a first LOD model acquisition module configured to acquire the first LOD model with the lowest model precision among the multi-level LOD models of the multiple terrain regions; a target large model acquisition module configured to generate a target large model matching the spherical virtual scene based on the first LOD model corresponding to the multiple terrain regions, wherein the target large model includes model patches for describing the terrain features of the multiple terrain regions; and a target large model rendering module configured to render the target large model to maintain the target large model displayed in the spherical virtual scene, and to maintain the target large model displayed on the top layer when the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds a specified threshold.

[0008] According to a third aspect of this disclosure, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the terrain loading method for the spherical virtual scene described in the first aspect above, and possible implementations thereof.

[0009] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor. The processor is configured to execute the terrain loading method for a spherical virtual scene of the first aspect and possible implementations thereof by executing the executable instructions.

[0010] The technical solution disclosed herein has the following beneficial effects:

[0011] On the one hand, by generating and rendering a target large model for the spherical virtual scene using the lowest-precision LOD model among all terrain regions' LOD models, this method avoids consuming excessive system resources when loading the target large model, reducing the system's operational pressure on terrain loading, significantly decreasing runtime memory performance overhead, effectively improving the terrain loading speed of the spherical virtual scene, and to some extent alleviating the screen stuttering problem during terrain loading, making the terrain loading process smoother and further enhancing the realism of the virtual scene, thereby improving the terrain loading efficiency of the spherical virtual scene. On the other hand, it reduces the manpower and time costs consumed in terrain loading within the spherical virtual scene, further improving the terrain loading efficiency of the spherical virtual scene.

[0012] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0013] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0014] Figure 1 This illustrates the system operating architecture of this exemplary embodiment;

[0015] Figure 2 A flowchart illustrating a terrain loading method for a spherical virtual scene in this exemplary embodiment is shown;

[0016] Figure 3 This diagram illustrates a method for loading a target terrain region in a spherical virtual scene according to an exemplary embodiment of the present invention.

[0017] Figure 4 This diagram illustrates the cracks that appear when a terrain block model is pieced together using terrain block models obtained by directly reducing the number of faces from the original terrain block model.

[0018] Figure 5 This illustrates a flowchart of a method for reducing the surface area of ​​an original terrain block model in this exemplary embodiment.

[0019] Figure 6A , Figure 6B and Figure 6C The following are terrain diagrams showing the distance between the camera and the spherical virtual scene in this exemplary embodiment, from near to far.

[0020] Figure 7 This illustration shows a schematic diagram of a spherical virtual scene where the camera is far from the spherical virtual scene, and the terrain to be displayed is shown on top of the target large model.

[0021] Figure 8 A schematic diagram illustrating a terrain with deep conflict in this exemplary embodiment is shown;

[0022] Figure 9 This diagram illustrates the structure of a terrain loading device for a spherical virtual scene in this exemplary embodiment.

[0023] Figure 10 A schematic diagram of the structure of an electronic device in this exemplary embodiment is shown. Detailed Implementation

[0024] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0025] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0026] In related technologies, workers usually create terrain blocks manually. When loading terrain in a virtual scene, these terrain blocks are pieced together to form a virtual terrain for display. However, this method is not suitable for loading terrain in spherical virtual scenes. In addition, this method results in slow terrain loading speed and requires high manpower and time costs, making the terrain loading process in spherical virtual scenes inefficient.

[0027] In view of one or more of the above-mentioned problems, this disclosure first provides an exemplary embodiment of a terrain loading method for a spherical virtual scene. The following describes the method in conjunction with... Figure 1 The system architecture of the operating environment for this exemplary embodiment will be described.

[0028] refer to Figure 1As shown, the system architecture 100 may include a terminal device 110 and a server 120. The terminal device 110 may be an electronic device such as a smartphone, tablet, or desktop computer, and can be used to acquire the target LOD model. The server 120 generally refers to the backend system that provides target tracking-related services in this exemplary embodiment, such as a server implementing a terrain loading method for a spherical virtual scene. The server 120 may be a single server or a cluster of multiple servers; this disclosure does not limit this. The terminal device 110 and the server 120 can be connected via a wired or wireless communication link for data interaction.

[0029] The terrain loading method for a spherical virtual scene of this exemplary embodiment can be executed by the terminal device 110. For example, the virtual scene may include a spherical game scene, and the terminal device 110 may be an electronic device used by staff to create the game scene. If it is necessary to load the terrain in the game scene, the terminal device 110 can execute the terrain loading method for a spherical virtual scene to obtain the first LOD models corresponding to multiple terrain regions included in the spherical game scene, and obtain a target large model based on the first LOD models corresponding to the multiple terrain regions, so as to keep displaying the target large model when the distance between the camera in the virtual scene and the game scene exceeds a specified threshold, thereby realizing the loading of the spherical game scene.

[0030] In one implementation, the terminal device 110 can determine multiple terrain regions in the spherical virtual scene and send the information of the multiple terrain regions to the server 120. After receiving the information of the multiple terrain regions, the server 120 obtains the first LOD model with the lowest model accuracy among the multi-level LOD models of the multiple terrain regions, and generates a target large model that matches the spherical virtual scene based on the first LOD model corresponding to the multiple terrain regions. The rendering information of the target large model is sent to the terminal device 110 so that the terminal device 110 renders the target large model, thereby ensuring that the target large model is still displayed when the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds a specified threshold.

[0031] As can be seen from the above, the terrain loading method for the spherical virtual scene in this exemplary embodiment can be executed by the aforementioned terminal device 110 or server 120.

[0032] The following is combined Figure 2 The method for loading terrain in a spherical virtual scene is described. The spherical virtual scene includes multiple terrain regions, each terrain region includes a corresponding multi-level LOD model, and each level of LOD model corresponds to a model precision. Figure 2 An exemplary flow of a terrain loading method for a spherical virtual scene is shown, including the following steps S210 to S230:

[0033] Step S210: Obtain the first LOD model with the lowest model accuracy among the multi-level LOD models of multiple terrain regions;

[0034] Step S220: Based on the first LOD model corresponding to multiple terrain regions, generate a target large model that matches the spherical virtual scene, wherein the target large model includes model patches used to describe the terrain features of multiple terrain regions;

[0035] Step S230: Render the target large model to keep the target large model displayed in the spherical virtual scene, and keep the target large model displayed on the top layer when the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds a specified threshold.

[0036] Based on the above method, on the one hand, a target large model of the spherical virtual scene is generated from the first LOD model with the lowest accuracy among all terrain region LOD models, and this target large model is rendered. Compared with the method of directly loading terrain regions, this disclosure does not require excessive system resources when loading the target large model, reducing the system's operational pressure for loading terrain, greatly reducing runtime memory performance overhead, effectively improving the terrain loading speed of the spherical virtual scene, and to a certain extent improving the problem of screen stuttering when loading terrain, making the terrain loading process smoother, further enhancing the realism of the virtual scene, and thus improving the terrain loading efficiency of the spherical virtual scene. On the other hand, it reduces the manpower and time costs consumed in loading terrain in the spherical virtual scene, further improving the terrain loading efficiency of the spherical virtual scene.

[0037] In step S210, the first LOD model with the lowest model accuracy among the multi-level LOD models of multiple terrain regions is obtained.

[0038] The terrain region can be a part of the terrain in a spherical virtual scene. The LOD (Levels of Detail) model can include different levels of precision corresponding to the terrain region, that is, plot models with different numbers of faces.

[0039] By obtaining the first LOD model with the lowest model accuracy among the multi-level LOD models, and generating the target large model based on the first LOD model in subsequent steps, the loading speed of the target large model can be effectively improved.

[0040] Continue to refer to Figure 2 In step S220, a target large model matching the spherical virtual scene is generated based on the first LOD model corresponding to multiple terrain regions. The target large model includes model patches used to describe the terrain features of multiple terrain regions.

[0041] In one implementation, generating a target large model that matches the spherical virtual scene based on a first LOD model corresponding to multiple terrain regions may include the following steps:

[0042] The first LOD model is stitched together based on its position information. Duplicate vertices and faces in the first LOD model are removed, and the intersecting parts between the first LOD models are trimmed or merged to generate the target large model.

[0043] By generating a low-precision target large model, the problem of incomplete terrain display when zooming in on the camera in a spherical virtual scene is effectively solved. At the same time, because the target large model has low precision and few faces, even if the target large model is displayed continuously, it will not increase the performance consumption too much. In addition, the target large model can roughly display the terrain overview of the spherical virtual scene, ensuring the realism of the terrain in the spherical virtual scene when zooming in on the camera, thereby effectively improving the terrain loading efficiency of the spherical virtual scene.

[0044] Continue to refer to Figure 2 In step S230, the target large model is rendered to keep the target large model displayed in the spherical virtual scene, and the target large model is kept displayed on the top layer when the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds a specified threshold.

[0045] By maintaining a large target model in the spherical virtual scene, the problem of incomplete terrain display in the spherical virtual scene can be effectively avoided when the distance between the camera in the virtual scene and the spherical virtual scene exceeds a specified threshold. Furthermore, due to the low precision and fast loading speed of the large target model, the terrain loading efficiency of the spherical virtual scene can be effectively improved.

[0046] In one implementation, reference Figure 3 As shown, the above method may further include steps S310 to S340:

[0047] Step S310: Determine the target terrain region to be loaded from multiple terrain regions;

[0048] Step S320: Obtain the target LOD model corresponding to the target terrain region to be loaded, and determine the terrain to be displayed based on all target LOD models of the target terrain region to be loaded;

[0049] Step S330: Stack the target large model and the terrain to be displayed in sequence to load the terrain of the target terrain region to be loaded, wherein the terrain to be displayed is displayed on the top layer;

[0050] In step S340, if the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds a specified threshold, and / or the spherical virtual scene rotates, the terrain to be displayed is hidden, and the target large model is kept displayed on the top layer.

[0051] The following is about Figure 3 Each step in the process will be explained in detail.

[0052] refer to Figure 3 In step S310, the target terrain region to be loaded is determined among multiple terrain regions.

[0053] The target terrain area to be loaded can include the camera's shooting area in the virtual scene.

[0054] Continue to refer to Figure 3 In step S320, the target LOD model corresponding to the target terrain region to be loaded is obtained, and the terrain to be displayed is determined based on all target LOD models of the target terrain region to be loaded.

[0055] The target LOD model can be a LOD model selected from the LOD models to form the terrain to be displayed. It should be noted that the number of faces of the target LOD models in the target terrain area can be the same or different. The terrain to be displayed can be used to display the terrain when the virtual camera is close to the virtual scene, so as to show more terrain details.

[0056] To obtain the target LOD model, it is first necessary to obtain LOD models of multiple levels corresponding to the terrain region, that is, LOD models with multiple face counts. Therefore, in one implementation, the original terrain block model corresponding to the terrain region is subjected to face reduction processing to obtain an LOD model with a preset face count corresponding to the original terrain block model.

[0057] The original terrain block model can include a high-precision original terrain block model, or a model with more faces than the LOD model. For example, in the case of a spherical scene, the original terrain block model created by the artists can be bent to fit the surface of the spherical scene. The preset face count is used to determine the level of the LOD model. By setting different preset face counts, multiple levels of LOD models can be obtained, that is, LOD models with different precision.

[0058] By reducing the number of faces in the original terrain block model, LOD models with various face counts are obtained, resulting in LOD models with different accuracies. This allows for the loading of LOD models with different accuracies based on the distance between the virtual scene's camera and the original terrain block model when determining the terrain to be displayed. This enables loading of higher-accuracy LOD models when the terrain area is close to the camera and lower-accuracy LOD models when the terrain area is far from the virtual camera, thereby effectively improving terrain loading speed and further reducing system performance consumption.

[0059] Because it easily alters the edges of the original terrain block model, thus causing... Figure 4 The original terrain block models shown cannot be perfectly stitched together. Therefore, in one implementation, the original terrain block models corresponding to the terrain region are subjected to polygon reduction processing to obtain a LOD model with a preset number of polygons corresponding to the original terrain block models. (Refer to...) Figure 5 As shown, the following steps S510 to S550 may be included:

[0060] Step S510: Obtain the normal vector of each face in the original terrain block model;

[0061] Step S520: Determine the target model surface in the original terrain block model that is furthest from the preset terrain block boundary;

[0062] Step S530: Calculate the angle between the target model surface and the adjacent surface to be merged based on the normal vector of the target model surface and its corresponding normal vector of the adjacent surface to be merged.

[0063] Step S540: Merge the adjacent faces to be merged corresponding to the smallest included angle to obtain the intermediate LOD model;

[0064] Step S550: Redetermine the target model faces and adjacent faces to be merged for the intermediate LOD model until the number of faces in the intermediate LOD model is the same as the preset number of faces.

[0065] based on Figure 5 The method identifies the face in the original terrain block model that is furthest from the preset terrain block boundary as the target model face, thereby reducing the number of faces in the original terrain block model. This can improve the model to some extent. Figure 4 The issue of cracks appearing in LOD models obtained by subtracting polygons when stitching together shapes was addressed by improving the efficiency of obtaining LOD models by keeping the edges unchanged after subtracting polygons.

[0066] It should be noted that many game engines integrate [this feature]. Figure 5There are various methods for reducing the number of polygons in models, such as the Simplygon LOD plugin in Unreal Engine 4 (UE4), which can reduce polygons while preserving the edges. Therefore, in practical applications, these plugins can be used directly to reduce the number of polygons in a model.

[0067] The following describes two methods for obtaining the target LOD model of the target terrain region to be loaded.

[0068] After obtaining LOD models with multiple preset face counts, i.e., multiple levels of LOD models, in one implementation, each terrain region corresponds to an M-level LOD model, where M is a positive integer. Obtaining the target LOD model corresponding to the target terrain region to be loaded includes:

[0069] If the shooting range of the camera corresponding to the j-th level LOD model intersects with the bounding box corresponding to the terrain region, the j-th level LOD model is determined as the target LOD model, where j is an integer greater than or equal to 0 and less than M.

[0070] Hidden terrain areas are created when the shooting range corresponding to an M-level LOD model is far from the bounding box.

[0071] The number of faces differs among LOD models of different j-levels, resulting in varying precision. The shooting range can be the radiation area of ​​the camera in the virtual scene when shooting the j-th LOD model; for example, the shooting range can be a virtual sphere. Since terrain regions vary in shape, a bounding box can be used to wrap the terrain block model. The bounding box can be a virtual basic cube used to wrap terrain block models of different shapes. This disclosure does not impose any special limitations on the shape of the bounding box; for example, the bounding box can be a sphere, a cuboid, etc.

[0072] By using bounding boxes to replace complex terrain areas, it is possible to determine whether there are intersections between the LOD model and the corresponding shooting range. This can effectively reduce the amount of computation when determining intersections and further improve the terrain loading speed.

[0073] In one implementation, the bounding box has N vertices. When the shooting range of the camera corresponding to the j-th level LOD model intersects with the bounding box corresponding to the terrain region, determining the j-th level LOD model as the target LOD model may include the following steps:

[0074] When j is 0, the position of the camera in the spherical virtual scene is taken as the first center of the sphere, and the distance between the camera and the level 0 LOD model is taken as the first radius to construct the first shooting range. When the first shooting range intersects with the bounding box, the level 0 LOD model is determined as the target LOD model.

[0075] When j is greater than 0, obtain N second sphere centers corresponding to N vertices, and based on any one of the second sphere centers and the second radius rj obtained from the distance between the virtual camera and the j-th level LOD model, construct N second shooting ranges. When any one of the second shooting ranges intersects with the bounding box, determine the j-th level LOD model as the target LOD model, where N is a positive integer.

[0076] Among them, the first shooting range is the radiation range of the viewport of the camera corresponding to the 0-th level LOD model, and the second shooting range includes the radiation range of the viewport of the camera corresponding to the j-th level LOD model when j > 0. Since when j > 0, it is necessary to determine the second shooting range according to the vertices of the bounding box of the j-th level LOD model, therefore, if the bounding box has N vertices, the j-th level LOD model will have N second shooting ranges.

[0077] For example, a certain terrain area corresponds to including the j-th level LOD model. If it is necessary to determine the first LOD model corresponding to this terrain area, it is necessary to traverse each level LOD model and its corresponding bounding box of this terrain area in turn. When j = 0, the 0-th level LOD model, that is, the original terrain block model made by the staff above, has the most faces and the highest accuracy. When determining whether the 0-th level LOD model is the target LOD model, the position C of the camera in the virtual scene can be used as the first sphere center, and the distance d0 between the camera and the 0-th level LOD model can be used as the first radius, and the obtained virtual sphere S0 is determined as the first shooting range. If the virtual sphere S0 has an intersection with the bounding box, directly display the original terrain block model, that is, the 0-th level LOD model; otherwise, let j = j + 1, and continue to judge whether the j-th level LOD model is the target LOD model. When j > 0, the N vertices P i (0 <= i < N) corresponding N second sphere centers Q i can be obtained first, and then N virtual spheres S ij are constructed according to the second radius rj obtained from the distance between the camera and the j-th level LOD model. For example, if i = 1 and j = 2, then S 12 represents a virtual sphere constructed with the second sphere center Q2 corresponding to the bounding box vertex P2 as the sphere center and the distance d2 between the 2-nd level LOD model and the camera as the radius. When the second shooting range S ij has an intersection with the bounding box, the j-th level LOD model corresponding to S ij is determined as the target LOD model; if the second shooting range S ij has no intersection with the bounding box, let i = i + 1, and continue to judge S ijDoes it intersect with the bounding box? If any of the N second shooting ranges intersects with the bounding box, then the j-th level LOD model is determined to be visible, that is, the j-th level LOD model is the target LOD model.

[0078] By traversing each level of the LOD model and determining whether there is an intersection between the virtual camera's shooting range and the bounding box corresponding to each level of the LOD model, the target LOD model can be identified. This allows for a more accurate assessment of the distance between the virtual camera and the j-th level LOD model, thereby determining the LOD model suitable for display. Figures 6A to 6C The diagram sequentially illustrates how the target LOD model in the terrain region to be loaded decreases in precision and face count as the distance between the camera and the virtual scene increases from near to far. This achieves loading LOD models of varying precision based on the distance between the terrain block model and the virtual camera. Specifically, a higher precision LOD model is loaded when the virtual camera is closer to the terrain block model, and a lower precision LOD model is loaded when the virtual camera is farther away. This ensures that the total face count of the target LOD model in the terrain region to be loaded does not become excessive, effectively reducing system performance consumption and further improving terrain loading speed.

[0079] In one implementation, obtaining the N second sphere centers corresponding to the N vertices may include the following steps:

[0080] Based on the distance between any of the N vertices of the bounding box and the center point of the spherical virtual scene, and the position of the virtual camera, determine the N second sphere centers.

[0081] For example, in a spherical virtual scene, the bounding box of a terrain region can have 8 vertices P. i If (0 <= i < 8), then we can first obtain the distance between each vertex Pi and the center of the spherical virtual scene. Then, normalize the vector corresponding to the position C of the camera relative to the center (0,0,0) of the spherical virtual scene. and Q obtained by multiplication i Vertex P is determined to be... i The corresponding second center of the ball.

[0082] The second sphere center is determined based on the vertices of the bounding box to generate the second shooting range. This allows for a more comprehensive determination of whether the j-th level LOD model intersects with the bounding box, further improving the accuracy of acquiring the target LOD model.

[0083] In one implementation, when j is greater than 0, obtaining N second sphere centers corresponding to N vertices, and constructing N second shooting ranges based on any second sphere center and the second radius obtained from the distance between the camera and the j-th level LOD model, and determining the j-th level LOD model as the target LOD model when any second shooting range intersects with the bounding box, further includes:

[0084] Given that the N second shooting ranges are all separate from the bounding box, determine that the j-th level LOD model is hidden, and then continue to determine whether the (j+1)-th level LOD model is the target LOD model.

[0085] For example, when j>0, the bounding box of the terrain region has N vertices. If the N second shooting ranges of the j-th level LOD model do not intersect with the bounding box, then the j-th level LOD model is set to invisible, and it is further determined whether the (j+1)-th level LOD model corresponding to the terrain region is the target LOD model. If the shooting ranges of all LOD models corresponding to the terrain region do not intersect with the bounding box, then the terrain region is determined to be invisible, and the display status of the terrain region needs to be set to hidden.

[0086] Only when all N second shooting ranges have no intersection with the bounding box is it determined that the j-th level LOD model is hidden, which can effectively improve the accuracy of determining whether the j-th level LOD model is hidden.

[0087] Furthermore, in one embodiment, the position of the camera in the virtual scene, the center position of the terrain region, and the center position of its corresponding LOD model can be projected onto a two-dimensional plane. The distance between the camera and the terrain region and its corresponding LOD model is calculated on this two-dimensional plane, and the target LOD model is determined based on this distance within the LOD model corresponding to the terrain region. This achieves the effect of loading high-precision terrain blocks when the terrain block model is close to the virtual camera, and loading low-precision terrain blocks when the terrain block model is far from the virtual camera.

[0088] In one implementation, the identified hidden LOD model can be unloaded from memory to further reduce the performance consumption when the system loads terrain and improve system operating efficiency.

[0089] Continue to refer to Figure 3 In step S330, the target large model and the terrain to be displayed are stacked sequentially to load the terrain of the target terrain region to be loaded, wherein the terrain to be displayed is displayed on the top layer.

[0090] For example, a preset terrain base, a target large model, and the terrain to be displayed can be stacked to load the terrain of a spherical virtual field, wherein the preset terrain base is located at the bottom layer of the target large model and its shape can be spherical.

[0091] In step S340, if the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds a specified threshold, and / or the spherical virtual scene rotates, the terrain to be displayed is hidden, and the target large model is kept displayed on the top layer.

[0092] To enhance the realism of terrain display in virtual scenes, the target large model and the terrain to be displayed are stacked sequentially. This allows for the display of the terrain with detailed information when the camera is close to the spherical virtual scene, and the display of the terrain with more detailed information when the camera is farther away. Figure 7 The terrain display effect shown ensures the integrity of the terrain display when the distance is far; and hides the terrain to be displayed when the distance is even further, so that the user can see the target large model located on the upper layer of the preset terrain base. This achieves a variety of terrain display effects based on the different distances between the camera in the spherical virtual scene and the spherical virtual scene, thereby improving the realism of the terrain display in the virtual scene.

[0093] Because the target model is continuously displayed during terrain loading, the colors of the terrain to be displayed and the target model at the same location can easily overlap, leading to depth conflict (Z-fighting) issues. (See reference...) Figure 8 To mitigate Z-fighting issues to some extent, in one implementation of the above-mentioned method of sequentially stacking the target large model and the terrain to be displayed, the area enclosed in the box may further include the following steps:

[0094] Adjust the rendering depth of the preset terrain base of the target large model and spherical virtual scene using depth offset values.

[0095] The depth offset value can be used to maintain a gap between the terrain to be displayed, the target large model, and the preset terrain base plate. This avoids the Z-Fighting problem to a certain extent, while ensuring that the terrain to be displayed is displayed on top of the target large model, the target large model is displayed on top of the preset base plate, and the display effect of each layer does not interfere with each other.

[0096] Based on the above methods, the terrain loading speed in spherical virtual scenes is effectively improved, the realism of the terrain in spherical virtual scenes is enhanced, thereby improving the terrain loading efficiency in spherical virtual scenes and improving the user experience.

[0097] Exemplary embodiments of this disclosure also provide a terrain loading device for a spherical virtual scene. For example... Figure 9 As shown, the spherical virtual scene includes multiple terrain regions, each terrain region includes a corresponding multi-level LOD model, and each level of LOD model corresponds to a model precision. The terrain loading device 900 of the spherical virtual scene may include:

[0098] The first LOD model acquisition module 910 is configured to acquire the first LOD model with the lowest model accuracy among the multi-level LOD models of multiple terrain regions;

[0099] The target large model acquisition module 920 is configured to generate a target large model that matches the spherical virtual scene based on the first LOD model corresponding to multiple terrain regions. The target large model includes model patches used to describe the terrain features of multiple terrain regions.

[0100] The target large model rendering module 930 is configured to render the target large model to maintain the display of the target large model in the spherical virtual scene, and to keep the target large model displayed on the top layer when the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds a specified threshold.

[0101] In one embodiment, the above-mentioned apparatus may further include:

[0102] Determine the target terrain region to be loaded from multiple terrain regions;

[0103] Obtain the target LOD model corresponding to the target terrain region to be loaded, and determine the terrain to be displayed based on all target LOD models of the target terrain region to be loaded;

[0104] The target large model and the terrain to be displayed are stacked sequentially to load the terrain of the target terrain region, with the terrain to be displayed shown on the top layer;

[0105] If the distance between the camera and the spherical virtual scene exceeds a specified threshold, and / or the spherical virtual scene rotates, hide the terrain to be displayed and keep the target large model displayed on the top layer.

[0106] In one implementation, each of the above terrain regions corresponds to an M-level LOD model, where M is a positive integer. Obtaining the target LOD model corresponding to the target terrain region to be loaded includes:

[0107] If the shooting range of the camera corresponding to the j-th level LOD model intersects with the bounding box corresponding to the terrain region, the j-th level LOD model is determined as the target LOD model, where j is an integer greater than or equal to 0 and less than M.

[0108] Hidden terrain areas are created when the shooting range corresponding to an M-level LOD model is far from the bounding box.

[0109] In one implementation, the bounding box has N vertices. When the shooting range of the camera corresponding to the j-th level LOD model intersects with the bounding box corresponding to the terrain region, determining the j-th level LOD model as the target LOD model can include:

[0110] When j is 0, the position of the camera in the spherical virtual scene is taken as the first center of the sphere, and the distance between the camera and the level 0 LOD model is taken as the first radius to construct the first shooting range. When the first shooting range intersects with the bounding box, the level 0 LOD model is determined as the target LOD model.

[0111] When j is greater than 0, obtain N second sphere centers corresponding to N vertices, and construct N second shooting ranges based on any second sphere center and the second radius obtained from the distance between the camera and the j-th level LOD model. If any second shooting range intersects with the bounding box, determine the j-th level LOD model as the target LOD model, where N is a positive integer.

[0112] In one implementation, obtaining the N second sphere centers corresponding to the N vertices may include:

[0113] Based on the distance between any of the N vertices of the bounding box and the center point of the spherical virtual scene, and the position of the camera, determine the N second sphere centers.

[0114] In one implementation, when j is greater than 0, obtaining N second sphere centers corresponding to N vertices, and constructing N second shooting ranges based on any second sphere center and the second radius obtained from the distance between the camera and the j-th level LOD model, and determining the j-th level LOD model as the target LOD model when any second shooting range intersects with the bounding box, may further include:

[0115] Given that the N second shooting ranges are all separate from the bounding box, determine that the j-th level LOD model is hidden, and then continue to determine whether the (j+1)-th level LOD model is the target LOD model.

[0116] In one embodiment, when the target large model and the terrain to be displayed are stacked sequentially, the above-mentioned apparatus may further include:

[0117] Adjust the rendering depth of the preset terrain base of the target large model and spherical virtual scene using depth offset values.

[0118] In one implementation, generating a target large model that matches the spherical virtual scene based on the first LOD model corresponding to multiple terrain regions may include:

[0119] The first LOD model is stitched together based on its position information. Duplicate vertices and faces in the first LOD model are removed, and the intersecting parts between the first LOD models are trimmed or merged to generate the target large model.

[0120] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation, and therefore will not be repeated here.

[0121] Exemplary embodiments of this disclosure also provide a computer-readable storage medium that can be implemented as a program product including program code, which, when run on an electronic device, causes the electronic device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. In an alternative embodiment, the program product can be implemented as a portable compact disc read-only memory (CD-ROM) including program code and can run on an electronic device, such as a personal computer. However, the program product of this disclosure is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0122] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0123] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0124] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0125] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0126] Exemplary embodiments of this disclosure also provide an electronic device. The electronic device may include a processor and a memory. The memory stores executable instructions for the processor, such as program code. The processor executes the executable instructions to perform the methods of this exemplary embodiment.

[0127] The following is for reference. Figure 10 The electronic device is illustrated by way of a general-purpose computing device. It should be understood that... Figure 10 The electronic device 1000 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.

[0128] like Figure 10 As shown, the electronic device 1000 may include: a processor 1010, a memory 1020, a bus 1030, an I / O (input / output) interface 1040, and a network adapter 1050.

[0129] The processor 1010 may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a display processing unit (DPU), a graphics processing unit (GPU), an image signal processor (ISP), a controller, an encoder, a decoder, a digital signal processor (DSP), a baseband processor, an artificial intelligence processor, etc. In one embodiment, the artificial intelligence processor can obtain the first LOD model with the lowest model accuracy among multi-level LOD models of multiple terrain regions; then, based on the first LOD models corresponding to the multiple terrain regions, a target large model matching the spherical virtual scene is generated, wherein the target large model includes model patches used to describe the terrain features of the multiple terrain regions; finally, the target large model is rendered to maintain its display in the spherical virtual scene, and to keep the target large model displayed on the top layer when the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds a specified threshold.

[0130] The memory 1020 may include volatile memory, such as RAM 1021 and cache unit 1022, and may also include non-volatile memory, such as ROM 1023. The memory 1020 may also include one or more program modules 1024, such program modules 1024 including, but not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. For example, program module 1024 may include the modules in the aforementioned device 900.

[0131] Bus 1030 is used to connect different components of electronic device 1000, and may include data bus, address bus and control bus.

[0132] Electronic device 1000 can communicate with one or more external devices 1100 (such as keyboard, mouse, external controller, etc.) through I / O interface 1040.

[0133] Electronic device 1000 can communicate with one or more networks via network adapter 1050. For example, network adapter 1050 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. Network adapter 1050 can communicate with other modules of electronic device 1000 via bus 1030.

[0134] although Figure 10 Other hardware and / or software modules, including but not limited to: displays, microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, may also be configured in the electronic device 1000.

[0135] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0136] Those skilled in the art will understand that various aspects of this disclosure can be implemented as systems, methods, or program products. Therefore, various aspects of this disclosure can be embodied in entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuit,” “module,” or “system.” Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0137] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is defined only by the appended claims.

Claims

1. A method for loading terrain in a spherical virtual scene, characterized in that, The spherical virtual scene includes multiple terrain regions, each terrain region includes a corresponding multi-level LOD model, and each level of LOD model corresponds to a model precision. The method includes: Obtain the first LOD model with the lowest model accuracy among the multi-level LOD models of the multiple terrain regions; Based on the first LOD model corresponding to the multiple terrain regions, a target large model matching the spherical virtual scene is generated, wherein the target large model includes model patches for describing the terrain features of the multiple terrain regions; Render the target large model to keep it displayed in the spherical virtual scene, and keep the target large model displayed on the top layer when the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds a specified threshold; The target large model and the terrain to be displayed are stacked sequentially to load the terrain of the target terrain region, wherein the terrain to be displayed is displayed on the top layer; if the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds the specified threshold, and / or the spherical virtual scene rotates, the terrain to be displayed is hidden, and the target large model is kept displayed on the top layer.

2. The method according to claim 1, characterized in that, The method further includes: Determine the target terrain region to be loaded from the multiple terrain regions; Obtain the target LOD model corresponding to the target terrain region to be loaded, and determine the terrain to be displayed based on all target LOD models of the target terrain region to be loaded.

3. The method according to claim 2, characterized in that, Each terrain region corresponds to an M-level LOD model, where M is a positive integer. Obtaining the target LOD model corresponding to the target terrain region to be loaded includes: If the shooting range of the camera corresponding to the LOD model at level j intersects with the bounding box corresponding to the terrain region, the LOD model at level j is determined as the target LOD model, where j is an integer greater than or equal to 0 and less than M. When the shooting range corresponding to the M-level LOD model is far from the bounding box, the terrain area is hidden.

4. The method according to claim 3, characterized in that, The bounding box has N vertices. When the shooting range of the camera corresponding to the j-th level LOD model intersects with the bounding box corresponding to the terrain region, determining the j-th level LOD model as the target LOD model includes: When j is 0, the position of the camera in the spherical virtual scene is taken as the first sphere center, and the distance between the camera and the level 0 LOD model is taken as the first radius to construct the first shooting range. When the first shooting range intersects with the bounding box, the level 0 LOD model is determined as the target LOD model. When j is greater than 0, obtain N second sphere centers corresponding to the N vertices, and construct N second shooting ranges based on any second sphere center and the second radius obtained from the distance between the camera and the j-th level LOD model. When any second shooting range intersects with the bounding box, determine the j-th level LOD model as the target LOD model, where N is a positive integer.

5. The method according to claim 4, characterized in that, The step of obtaining the N second sphere centers corresponding to the N vertices includes: The N second sphere centers are determined based on the distance between any of the N vertices of the bounding box and the center point of the spherical virtual scene, and the position of the camera.

6. The method according to claim 4, characterized in that, When j is greater than 0, the method further includes obtaining N second sphere centers corresponding to the N vertices, and constructing N second shooting ranges based on any second sphere center and the second radius obtained from the distance between the camera and the j-th level LOD model. If any of the second shooting ranges intersects with the bounding box, the j-th level LOD model is determined to be the target LOD model. If all N second shooting ranges are disjoint from the bounding box, it is determined that the LOD model at level j is hidden, and it is further determined whether the LOD model at level j+1 is the target LOD model.

7. The method according to claim 2, characterized in that, When stacking the target large model and the terrain to be displayed sequentially, the method further includes: The rendering depth of the target large model and the preset terrain base of the spherical virtual scene is adjusted using the depth offset value.

8. The method according to claim 1, characterized in that, The step of generating a target large model that matches the spherical virtual scene based on the first LOD model corresponding to the multiple terrain regions includes: Based on the position information of the first LOD model, the first LOD model is stitched together, duplicate vertices and duplicate faces in the first LOD model are removed, and the intersecting parts between the first LOD models are trimmed or merged to generate the target large model.

9. A terrain loading device for a spherical virtual scene, characterized in that, The spherical virtual scene includes multiple terrain regions, each terrain region includes a corresponding multi-level LOD model, and each level of LOD model corresponds to a model precision. The device includes: The first LOD model acquisition module is configured to acquire the first LOD model with the lowest model accuracy among the multi-level LOD models of the multiple terrain regions. The target large model acquisition module is configured to generate a target large model that matches the spherical virtual scene based on the first LOD model corresponding to the multiple terrain regions, wherein the target large model includes model patches for describing the terrain features of the multiple terrain regions; The target large model rendering module is configured to render the target large model to maintain the display of the target large model in the spherical virtual scene, and to maintain the target large model displayed on the top layer when the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds a specified threshold; The display layer processing module is configured to stack the target large model and the terrain to be displayed sequentially to load the terrain of the target terrain region to be loaded, wherein the terrain to be displayed is displayed on the top layer; if the distance between the camera in the spherical virtual scene and the spherical virtual scene exceeds the specified threshold, and / or the spherical virtual scene rotates, the terrain to be displayed is hidden, and the target large model is kept displayed on the top layer.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 8.

11. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 8 by executing the executable instructions.