Virtual world rendering method and device, electronic equipment and storage medium

By dividing the virtual world into detail level areas and introducing a distance buffer mechanism, the virtual world rendering method is optimized, solving the problem of excessive usage of computing resources and network resources, and improving rendering efficiency and user experience.

CN120689479APending Publication Date: 2025-09-23CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510706004.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

When existing LOD technology is used to render objects in the virtual world, it causes excessive usage of computing and network resources, and the level of detail of objects changes frequently, causing users to notice it.

Method used

By dividing the virtual world into multiple level-of-detail areas, objects in each area use the same level of detail, and introducing a distance buffer mechanism, the frequency of level-of-detail switching is optimized, reducing computing and network resource usage.

Benefits of technology

This reduces the computing and network resource usage when switching the level of detail of objects in virtual world rendering, avoids obvious user perception, and improves resource loading speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120689479A_ABST
    Figure CN120689479A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a virtual world rendering method and device, electronic equipment and a storage medium, and the method comprises the steps: determining a target distance value between a target detail layer region and a rendering camera when a first detail layer is used in the target detail layer region; when the target spacing value is greater than a first threshold value, switching the object in the target detail level area to a second detail level for rendering; the first threshold value is the sum value of the first switching distance and the buffer distance; when the target spacing value is smaller than a second threshold value, switching the object in the target detail level area to a third detail level for rendering; the second threshold value is a difference value between the second switching distance and the buffer distance; wherein the second detail level and the third detail level are detail levels adjacent to the first detail level. Through the embodiment of the invention, the occupation of computing resources and network resources occupied when the detail levels of the object are switched in virtual world rendering can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of rendering, and in particular to a rendering method, device, electronic device and storage medium for a virtual world. Background Art

[0002] LOD (Level of Detail) technology dynamically switches the mesh data of an object based on the distance between the rendering camera and the object in the virtual world. The farther the rendering camera is from the object, the fewer polygons are contained in the mesh data used, which means the level of detail is reduced.

[0003] Switching mesh data causes changes in the object's rendering level of detail. Objects near the threshold for switching between adjacent levels of detail will experience frequent changes in level of detail, which can be noticeable to the observer. Furthermore, frequent loading of mesh data consumes a significant amount of computer I / O resources, reducing virtual world rendering efficiency. Summary of the Invention

[0004] In view of the above problems, a method, apparatus, electronic device, and storage medium for rendering a virtual world are proposed to overcome or at least partially solve the above problems, including:

[0005] A method for rendering a virtual world, wherein the virtual world includes a plurality of level-of-detail regions, each level-of-detail region being divided into at least one object, the method comprising:

[0006] When a first level of detail is used in a target level of detail region, determining a target spacing value between the target level of detail region and a rendering camera;

[0007] When the target distance value is greater than a first threshold, switching the object in the target detail level area to the second detail level for rendering; the first threshold is the sum of the first switching distance and the buffer distance;

[0008] When the target distance value is less than a second threshold, switching the object in the target detail level area to a third detail level for rendering; the second threshold is a difference between the second switching distance and the buffer distance;

[0009] The second level of detail and the third level of detail are levels of detail adjacent to the first level of detail.

[0010] Optionally, the method further includes:

[0011] Determine the bounding box data of the target object;

[0012] The detail level region to which the target object belongs is determined according to the bounding box data of the target object.

[0013] Optionally, determining the level-of-detail region to which the target object belongs based on the bounding box data of the target object includes:

[0014] Determine the distance between the center point of the area corresponding to the bounding box data of the target object and the center point of each level of detail area;

[0015] The detail level area with the smallest distance is used as the detail level area to which the target object belongs.

[0016] Optionally, the method further includes:

[0017] After switching the object object in the target detail level area to the second detail level for rendering, when the target spacing value is less than the third threshold, switching the object object in the target detail level area to the first detail level for rendering, and the third threshold is the difference between the first switching distance and the buffer distance.

[0018] Optionally, the method further includes:

[0019] The data corresponding to the object in the target detail layer area are packaged in a folder.

[0020] Optionally, the method further includes:

[0021] Upload the folder to the server.

[0022] Optionally, the target level-of-detail region is one level-of-detail region, or is formed by splicing multiple level-of-detail regions;

[0023] Wherein, when the target detail level region is formed by splicing multiple detail level regions, the target detail level region includes an object.

[0024] An embodiment of the present invention further provides a virtual world rendering device, wherein the virtual world includes multiple level-of-detail regions, each level-of-detail region is divided into at least one object, and the device includes:

[0025] a spacing determination module, configured to determine a target spacing value between the target detail layer region and a rendering camera when a first detail level is used in the target detail layer region;

[0026] A first switching module is configured to switch the object in the target detail level area to a second detail level for rendering when the target distance value is greater than a first threshold value; the first threshold value is the sum of the first switching distance and the buffer distance;

[0027] a second switching module, configured to switch the object in the target detail level area to a third detail level for rendering when the target spacing value is less than a second threshold value, wherein the second threshold value is a difference between the second switching distance and the buffer distance;

[0028] The second level of detail and the third level of detail are levels of detail adjacent to the first level of detail.

[0029] Optionally, the device further comprises:

[0030] The region determination module is used to determine the bounding box data of the target object; and determine the detail level region to which the target object belongs based on the bounding box data of the target object.

[0031] Optionally, the area determination module is used to determine the distance between the center point of the area corresponding to the bounding box data of the target object and the center point of each detail level area; and take the detail level area with the smallest distance as the detail level area to which the target object belongs.

[0032] Optionally, the second switching module is also used to switch the object objects in the target detail level area to the first detail level for rendering after switching the object objects in the target detail level area to the second detail level for rendering when the target spacing value is less than the third threshold, and the third threshold is the difference between the first switching distance and the buffer distance.

[0033] Optionally, the device further comprises:

[0034] The packaging module is used to package the data corresponding to the object in the target detail layer area into a folder.

[0035] Optionally, the packaging module is further used to upload the folder to a server.

[0036] Optionally, the target level-of-detail region is one level-of-detail region, or is formed by splicing multiple level-of-detail regions;

[0037] Wherein, when the target detail level region is formed by splicing multiple detail level regions, the target detail level region includes an object.

[0038] An embodiment of the present invention further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the above virtual world rendering method when executed by the processor.

[0039] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for rendering a virtual world as described above is implemented.

[0040] The embodiments of the present invention have the following advantages:

[0041] In an embodiment of the present invention, when the first detail level is used in a target detail level region, a target spacing value between the target detail level region and a rendering camera is determined; when the target spacing value is greater than a first threshold, objects in the target detail level region are switched to a second detail level for rendering; the first threshold is the sum of the first switching distance and the buffer distance; when the target spacing value is less than a second threshold, objects in the target detail level region are switched to a third detail level for rendering; the second threshold is the difference between the second switching distance and the buffer distance; wherein the second detail level and the third detail level are detail levels adjacent to the first detail level. Through the embodiments of the present invention, the computing resources and network resources occupied by switching the detail levels of objects in virtual world rendering can be reduced; and the frequent switching of the detail levels of objects causing noticeable user perception can also be avoided.

[0042] In addition, the embodiment of the present invention can reduce the consumption of computing resources by dividing one or more object objects into detail level areas of the same detail level, and at the same time optimize the mesh data storage method, that is, the meshes of object objects in the same detail level area can be packaged into the same file, reducing the number of engineering resource files and increasing the resource loading speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the description of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0044] Figure 1 This is a flowchart of the steps of a method for rendering a virtual world according to an embodiment of the present invention;

[0045] Figure 2a is a flowchart of another method for rendering a virtual world according to an embodiment of the present invention;

[0046] Figure 2b is a schematic diagram of a virtual world according to an embodiment of the present invention;

[0047] Figure 3 is a flowchart of the steps of another method for rendering a virtual world according to an embodiment of the present invention;

[0048] Figure 4 is a flowchart of steps of another method for rendering a virtual world according to an embodiment of the present invention;

[0049] Figure 5 It is a structural diagram of a virtual world rendering device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0050] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments described are only a portion of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are also within the scope of protection of the present invention.

[0051] Reference Figure 1 , which shows a flowchart of a method for rendering a virtual world according to an embodiment of the present invention, may include the following steps:

[0052] Step 101: When a first level of detail is used in a target level of detail region, a target distance value between the target level of detail region and a rendering camera is determined.

[0053] Level of Observation (LOD) is a commonly used virtual world rendering optimization technique. It primarily relies on reducing the number of polygons in the rendered mesh to reduce the computer's general purpose computing unit (GCU), graphics processing unit (GPU), and memory consumption. In virtual world rendering, objects farther from the rendering camera have a smaller screen-to-body ratio. Since most polygons don't affect the rendering result, using low-polygon meshes for distant objects doesn't result in noticeable rendering loss.

[0054] In practice, LOD technology dynamically switches the mesh data of an object based on the distance between the rendering camera and the object in the virtual world. The farther the rendering camera is from the object, the fewer polygons are contained in the mesh data used, that is, the fewer levels of detail are.

[0055] To create an immersive experience in the virtual world, which usually contains a large number of objects, existing LOD technology needs to calculate the distance between each object and the rendering camera, which consumes a lot of performance of the computer's general computing unit. At the same time, a large number of detail level mesh files will be generated. The growth of the number of random files, network transmission, verification and encoding and decoding will occupy a lot of computing resources and network resources.

[0056] Furthermore, mesh data switching causes changes in the object's rendering level of detail. Objects near the threshold for switching between adjacent levels of detail will experience frequent changes in level of detail, which can be noticeable to the observer. Furthermore, frequent mesh data loading consumes a significant amount of computer I / O resources, reducing virtual world rendering efficiency.

[0057] To reduce the computing and network resource usage associated with switching levels of detail for objects in virtual world rendering, and to prevent frequent switching of levels of detail from causing noticeable changes to the user's perception, embodiments of the present invention provide a virtual world rendering method that pre-divides the virtual world into multiple level-of-detail regions, each containing at least one object. This division can evenly divide the virtual world into multiple level-of-detail regions of equal size, or it can be divided based on the size of the objects, for example, dividing a larger object into a single level-of-detail region, although embodiments of the present invention do not impose any restrictions on this.

[0058] In order to reduce the amount of calculation, the embodiment of the present invention can be designed to always use the same detail level for objects in the same detail level area; compared with calculating the distance of all object objects, the embodiment of the present invention can reduce the consumption of computing resources by calculating by area.

[0059] When switching the level of detail of an object, the embodiment of the present invention can optimize the switching frequency of the level of detail by setting a distance buffer, thereby reducing the computing resources consumed by the switching and reducing the occupation of network resources by the switching. Specifically:

[0060] First, any unprocessed LOD region can be identified from all LOD regions as a target LOD region. Then, a target spacing value between the target LOD region and the rendering camera can be determined, i.e., the distance between the target LOD region and the rendering camera. This target spacing value can be calculated based on the center point of the target LOD region or other locations within the target LOD region, and this is not limited in this embodiment of the present invention.

[0061] Step 102: When the target distance value is greater than a first threshold, the object in the target detail level area is switched to the second detail level for rendering; the first threshold is the sum of the first switching distance and the buffer distance.

[0062] After determining the target distance value between the target detail level area and the rendering camera, it can be determined whether the detail level used by the target detail level area needs to be switched based on the target distance value.

[0063] In some feasible embodiments, if the target distance value is greater than a first threshold, the object in the target detail level area may be switched from the first detail level to the second detail level before rendering.

[0064] The first threshold may be the sum d1+σ of the first switching distance d1 and the buffer distance σ.

[0065] Step 103: When the target spacing value is less than a second threshold, the object in the target detail level area is switched to the third detail level for rendering; the second threshold is the difference between the second switching distance and the buffer distance; wherein the second detail level and the third detail level are detail levels adjacent to the first detail level.

[0066] In some feasible embodiments, if the target spacing value is less than the second threshold, the object in the target detail level area may be switched from the first detail level to the third detail level before rendering.

[0067] The second threshold may be a difference d2-σ between the second switching distance d2 and the buffer distance σ.

[0068] When the target spacing value is close to the switching distance set for the detail level, the detail level switching will not be triggered frequently, thereby reducing the computing resources and network resources occupied when switching the detail level of objects in the virtual world rendering; it can also avoid the user's obvious perception caused by the frequent switching of the detail level of objects.

[0069] In an embodiment of the present invention, when the first detail level is used in a target detail level region, a target spacing value between the target detail level region and a rendering camera is determined; when the target spacing value is greater than a first threshold, objects in the target detail level region are switched to a second detail level for rendering; the first threshold is the sum of the first switching distance and the buffer distance; when the target spacing value is less than a second threshold, objects in the target detail level region are switched to a third detail level for rendering; the second threshold is the difference between the second switching distance and the buffer distance; wherein the second detail level and the third detail level are detail levels adjacent to the first detail level. Through the embodiments of the present invention, the computing resources and network resources occupied by switching the detail levels of objects in virtual world rendering can be reduced; and the frequent switching of the detail levels of objects causing noticeable user perception can also be avoided.

[0070] In addition, the embodiment of the present invention can reduce the consumption of computing resources by dividing one or more object objects into detail level areas of the same detail level, and at the same time optimize the mesh data storage method, that is, the meshes of object objects in the same detail level area can be packaged into the same file, reducing the number of engineering resource files and increasing the resource loading speed.

[0071] Reference Figure 2a , shows a flowchart of another method for rendering a virtual world according to an embodiment of the present invention, which may include the following steps:

[0072] Step 201: Determine the bounding box data of the target object.

[0073] Bounding box data is the basic data structure used in 3D graphics and physics engines for fast collision detection, frustum clipping, and spatial queries. It is generally divided into two types:

[0074] AABB (Axis-Aligned Bounding Box)

[0075] OBB (Oriented Bounding Box)

[0076] AABB is the simplest bounding box, whose edges are aligned with the XYZ axes of the world coordinate system and is defined only by a minimum point (min) and a maximum point (max).

[0077] An OBB can be rotated arbitrarily and is more accurate than an AABB, but the calculations are more complex. Its data structure typically includes: a center point (Center), three axes (Orientation, usually represented by a 3×3 matrix or three basis vectors), and half-lengths (Extents, which is half the length of each axis).

[0078] In some feasible embodiments, bounding box data pre-set for the target object may be obtained first.

[0079] Step 202: Determine the level of detail region to which the target object belongs based on the bounding box data of the target object.

[0080] Then, based on the position information of the target object represented by the bounding box data of the target object, the detail level region where the position of the target object is located can be determined.

[0081] In one embodiment of the present invention, the target detail level region is one detail level region, or is formed by stitching together multiple detail level regions; wherein, when the target detail level region is formed by stitching together multiple detail level regions, the target detail level region includes an object.

[0082] In some feasible embodiments, the target detail level region is one detail level region; in other feasible embodiments, the target detail level region may also be formed by splicing multiple detail level regions.

[0083] Among them, when the target detail level area is composed of multiple detail level areas, the target detail level area may include an object, which can span multiple detail level areas and be used as a whole (i.e., a target detail level area) using a unified detail level.

[0084] For example, Figure 2b As shown, the virtual world 20 may be divided into a chessboard to obtain a plurality of LOD regions 210 , wherein a square is an LOD region and a circle is an object.

[0085] For a large object 220a, the multiple LOD regions where it is located can be used as the target level of detail region 230a (bold large squares).

[0086] For a small object 220b, an LOD region where the object is located can be used as a target level of detail region 230b (bold square);

[0087] Step 203 : When the first level of detail is used in the target level of detail region, a target distance value between the target level of detail region and the rendering camera is determined.

[0088] Then, when the target level of detail region is rendered using the first level of detail region, a target spacing value between the target level of detail region and the rendering camera can be determined, i.e., the distance between the target level of detail region and the rendering camera. This target spacing value can be calculated based on the center point of the target level of detail region or based on other locations in the target level of detail region, and this is not limited in this embodiment of the present invention.

[0089] Step 204: When the target distance value is greater than a first threshold, the object in the target detail level area is switched to the second detail level for rendering; the first threshold is the sum of the first switching distance and the buffer distance.

[0090] After determining the target distance value between the target detail level area and the rendering camera, it can be determined whether the detail level used by the target detail level area needs to be switched based on the target distance value.

[0091] In some feasible embodiments, if the target distance value is greater than a first threshold, the object in the target detail level area may be switched from the first detail level to the second detail level before rendering.

[0092] The first threshold may be the sum d1+σ of the first switching distance d1 and the buffer distance σ.

[0093] Step 205: When the target distance value is less than a second threshold, the object in the target detail level area is switched to the third detail level for rendering; the second threshold is the difference between the second switching distance and the buffer distance.

[0094] In some feasible embodiments, if the target spacing value is less than the second threshold, the object in the target detail level area may be switched from the first detail level to the third detail level before rendering.

[0095] The second threshold may be a difference d2-σ between the second switching distance d2 and the buffer distance σ.

[0096] In an embodiment of the present invention, bounding box data of a target object is determined; based on the bounding box data of the target object, a detail level area to which the target object belongs is determined; when the first detail level is used in the target detail level area, a target spacing value between the target detail level area and a rendering camera is determined; when the target spacing value is greater than a first threshold, the object in the target detail level area is switched to the second detail level for rendering; the first threshold is the sum of the first switching distance and the buffer distance; when the target spacing value is less than a second threshold, the object in the target detail level area is switched to the third detail level for rendering; the second threshold is the difference between the second switching distance and the buffer distance.

[0097] Through the embodiments of the present invention, the computing resources and network resources occupied when switching the detail level of objects in virtual world rendering can be reduced; it can also avoid the user's obvious perception caused by frequent switching of the detail level of objects.

[0098] In addition, the embodiment of the present invention can reduce the consumption of computing resources by dividing one or more object objects into detail level areas of the same detail level, and at the same time optimize the mesh data storage method, that is, the meshes of object objects in the same detail level area can be packaged into the same file, reducing the number of engineering resource files and increasing the resource loading speed.

[0099] Reference Figure 3 , shows a flowchart of the steps of another method for rendering a virtual world according to an embodiment of the present invention, which may include the following steps:

[0100] Step 301: Determine the bounding box data of the target object.

[0101] In some feasible embodiments, bounding box data pre-set for the target object may be obtained first.

[0102] Step 302: Determine the distance between the center point of the area corresponding to the bounding box data of the target object and the center point of each detail level area.

[0103] Then, based on the position information of the target object represented by the bounding box data of the target object, the detail level region where the position of the target object is located can be determined.

[0104] Specifically, the center point of the area corresponding to the bounding box data of the target object and the center points of the areas at each level of detail may be determined first.

[0105] Then, the distance between the center point of the area corresponding to the bounding box data of the target object and the center point of each detail level area can be calculated.

[0106] Step 303: The detail level region with the smallest distance is used as the detail level region to which the target object belongs.

[0107] After determining the distance between the center point of the area corresponding to the bounding box data of the target object and the center points of each detail level area, the detail level area corresponding to the center point with the smallest distance from the center point of the area corresponding to the bounding box data of the target object can be used as the detail level area to which the target object belongs.

[0108] Step 304 : When the first level of detail is used in the target level of detail region, a target distance value between the target level of detail region and the rendering camera is determined.

[0109] Then, when the target level of detail region is rendered using the first level of detail region, a target spacing value between the target level of detail region and the rendering camera can be determined, i.e., the distance between the target level of detail region and the rendering camera. This target spacing value can be calculated based on the center point of the target level of detail region or based on other locations in the target level of detail region, and this is not limited in this embodiment of the present invention.

[0110] Step 305: When the target distance value is greater than a first threshold, the object in the target detail level area is switched to the second detail level for rendering; the first threshold is the sum of the first switching distance and the buffer distance.

[0111] After determining the target distance value between the target detail level area and the rendering camera, it can be determined whether the detail level used by the target detail level area needs to be switched based on the target distance value.

[0112] In some feasible embodiments, if the target distance value is greater than a first threshold, the object in the target detail level area may be switched from the first detail level to the second detail level before rendering.

[0113] The first threshold may be the sum d1+σ of the first switching distance d1 and the buffer distance σ.

[0114] Step 306: When the target distance value is less than a second threshold, the object in the target detail level area is switched to the third detail level for rendering; the second threshold is the difference between the second switching distance and the buffer distance.

[0115] In some feasible embodiments, if the target spacing value is less than the second threshold, the object in the target detail level area may be switched from the first detail level to the third detail level before rendering.

[0116] The second threshold may be a difference d2-σ between the second switching distance d2 and the buffer distance σ.

[0117] In an embodiment of the present invention, bounding box data of a target object is determined; the center point of an area corresponding to the bounding box data of the target object and the distance from the center point of each detail level area are determined; the detail level area with the smallest distance is used as the detail level area to which the target object belongs; when the first detail level is used in the target detail level area, the target spacing value between the target detail layer area and the rendering camera is determined; when the target spacing value is greater than a first threshold, the object in the target detail level area is switched to the second detail level for rendering; the first threshold is the sum of the first switching distance and the buffer distance; when the target spacing value is less than the second threshold, the object in the target detail level area is switched to the third detail level for rendering; the second threshold is the difference between the second switching distance and the buffer distance.

[0118] Through the embodiments of the present invention, the computing resources and network resources occupied when switching the detail level of objects in virtual world rendering can be reduced; it can also avoid the user's obvious perception caused by frequent switching of the detail level of objects.

[0119] In addition, the embodiment of the present invention can reduce the consumption of computing resources by dividing one or more object objects into detail level areas of the same detail level, and at the same time optimize the mesh data storage method, that is, the meshes of object objects in the same detail level area can be packaged into the same file, reducing the number of engineering resource files and increasing the resource loading speed.

[0120] Reference Figure 4 , shows a flowchart of the steps of another method for rendering a virtual world according to an embodiment of the present invention, which may include the following steps:

[0121] Step 401: Determine the bounding box data of the target object.

[0122] In some feasible embodiments, bounding box data pre-set for the target object may be obtained first.

[0123] Step 402: Determine the distance between the center point of the area corresponding to the bounding box data of the target object and the center point of each detail level area.

[0124] Then, the center point of the area corresponding to the bounding box data of the target object and the center point of each detail level area can be determined first.

[0125] Then, the distance between the center point of the area corresponding to the bounding box data of the target object and the center point of each detail level area can be calculated.

[0126] Step 403: The detail level region with the smallest distance is used as the detail level region to which the target object belongs.

[0127] After determining the distance between the center point of the area corresponding to the bounding box data of the target object and the center points of each detail level area, the detail level area corresponding to the center point with the smallest distance from the center point of the area corresponding to the bounding box data of the target object can be used as the detail level area to which the target object belongs.

[0128] Step 404: Pack the data corresponding to the object in the target detail layer area into a folder.

[0129] After determining the target detail level area to which each object belongs, the data corresponding to all the object objects divided in the target detail level area can be packaged in a folder; specifically, the mesh data of all the object objects divided in the target detail level area will be packaged into the same file to participate in network transmission, verification and encoding and decoding.

[0130] In one embodiment of the present invention, the above method may further include:

[0131] Upload the folder to the server.

[0132] In some feasible embodiments, the folder may be uploaded to the server and participate in network transmission, verification, and encoding and decoding.

[0133] Step 405 : When the first level of detail is used in the target level of detail region, a target distance value between the target level of detail region and the rendering camera is determined.

[0134] In some feasible embodiments, when a target level of detail region is rendered using a first level of detail region, a target spacing value between the target level of detail region and a rendering camera can be determined, i.e., the distance between the target level of detail region and the rendering camera. This target spacing value can be calculated based on the center point of the target level of detail region or based on other locations in the target level of detail region, and this is not limited in this embodiment of the present invention.

[0135] Step 406: When the target distance value is greater than a first threshold, the object in the target detail level area is switched to the second detail level for rendering; the first threshold is the sum of the first switching distance and the buffer distance.

[0136] After determining the target distance value between the target detail level area and the rendering camera, it can be determined whether the detail level used by the target detail level area needs to be switched based on the target distance value.

[0137] In some feasible embodiments, if the target distance value is greater than a first threshold, the object in the target detail level area may be switched from the first detail level to the second detail level before rendering.

[0138] The first threshold may be the sum d1+σ of the first switching distance d1 and the buffer distance σ.

[0139] Step 407: When the target spacing value is less than a second threshold, the object in the target detail level area is switched to the third detail level for rendering; the second threshold is the difference between the second switching distance and the buffer distance; wherein the second detail level and the third detail level are detail levels adjacent to the first detail level.

[0140] In some feasible embodiments, if the target spacing value is less than the second threshold, the object in the target detail level area may be switched from the first detail level to the third detail level before rendering.

[0141] The second threshold may be a difference d2-σ between the second switching distance d2 and the buffer distance σ.

[0142] Step 408: After switching the object in the target detail level area to the second detail level for rendering, when the target spacing value is less than a third threshold, switching the object in the target detail level area to the first detail level for rendering, where the third threshold is the difference between the first switching distance and the buffer distance.

[0143] In some feasible embodiments, after the object in the target detail level area is switched to the second detail level for rendering, the magnitude relationship between the inter-target distance and the first threshold and the second threshold may continue to be detected.

[0144] If the target spacing value is less than the first switching distance, in an embodiment of the present invention, the detail level area will not be switched to use the first detail level. Instead, when the target spacing value is less than the third threshold, the object in the target detail level area will be switched to the first detail level for rendering.

[0145] The third threshold is the difference d1 −σ between the first switching distance d1 and the buffer distance σ.

[0146] For example, unlike existing LOD technology methods that calculate the level of detail based on objects, the present invention introduces regions as a particle for calculating the level of detail. These regions are called LOD regions (i.e., level of detail regions). Each LOD region contains one or more objects, where all objects use the same level of detail.

[0147] LOD regions are created by dividing the virtual world into checkerboard patterns. When an object falls within a single LOD region, it is assigned to that region. For objects that span multiple LOD regions, their bounding box data is examined to determine whether they should be assigned to a specific LOD region or treated as a separate object (such as a large wall) for LOD calculations. For objects within the same LOD region, meshes with the same level of detail are packaged into the same file for network transmission, verification, and encoding / decoding.

[0148] LOD switching based on distance buffer:

[0149] The existing LOD technology uses distance as a judgment condition for switching the level of detail. For an object with n levels of detail meshes, the i-th switching distance between the level of detail i and the level of detail i-1 is recorded as d i , when the distance D between the rendering camera and the LOD area (object) is less than or equal to d i When , the LOD area (object) uses detail level i-1, otherwise it uses detail level i.

[0150] To solve the problem of frequent changes in the level of detail of the LOD area (object) generated by this method, we introduce a buffer distance σ (σ>0). When the LOD area (object) uses the detail level i-1, the condition for switching to the detail level i is D>d i +σ, when the LOD area (object) uses detail level i, the condition for switching to detail level i-1 is D≤d i -σ, when D is located at d i Level of detail switching is not triggered as frequently when nearby.

[0151] Region-based LOD division provides a method for managing the level of detail of a large number of adjacent small objects. The use of region-based distance calculation optimizes the distance calculation by object, reducing the consumption of a large amount of computing resources. At the same time, it can optimize the mesh data storage method, that is, the mesh data of the same level of detail of objects in the same LOD area can be packaged into the same file, reducing the number of project resource files and increasing the resource loading speed.

[0152] Distance buffer-based LOD switching introduces a buffer distance, optimizes the switching frequency of the detail level of the LOD area (object object) near the switching distance, and reduces the usage of computing resources and network resources.

[0153] In an embodiment of the present invention, bounding box data of a target object is determined; the distance between the center point of an area corresponding to the bounding box data of the target object and the center point of each detail level area is determined; the detail level area with the smallest distance is used as the detail level area to which the target object belongs; data corresponding to objects in the target detail level area are packaged in a folder; when the first detail level is used in the target detail level area, a target spacing value between the target detail level area and a rendering camera is determined; when the target spacing value is greater than a first threshold, the objects in the target detail level area are switched to a second detail level for rendering; the first threshold is the sum of a first switching distance and a buffer distance; when the target spacing value is less than a second threshold, the objects in the target detail level area are switched to a third detail level for rendering; the second threshold is the difference between the second switching distance and the buffer distance; wherein the second detail level and the third detail level are detail levels adjacent to the first detail level; after the objects in the target detail level area are switched to the second detail level for rendering, when the target spacing value is less than a third threshold, the objects in the target detail level area are switched to the first detail level for rendering, and the third threshold is the difference between the first switching distance and the buffer distance.

[0154] Through the embodiments of the present invention, the computing resources and network resources occupied when switching the detail level of objects in virtual world rendering can be reduced; it can also avoid the user's obvious perception caused by frequent switching of the detail level of objects.

[0155] In addition, the embodiment of the present invention can reduce the consumption of computing resources by dividing one or more object objects into detail level areas of the same detail level, and at the same time optimize the mesh data storage method, that is, the meshes of object objects in the same detail level area can be packaged into the same file, reducing the number of engineering resource files and increasing the resource loading speed.

[0156] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0157] Reference Figure 5 , shows a structural schematic diagram of a virtual world rendering device according to an embodiment of the present invention, wherein the virtual world includes multiple detail level areas, and each detail level area is divided into at least one object.

[0158] like Figure 5 As shown, the virtual world rendering device may include the following modules:

[0159] a spacing determination module 501 for determining a target spacing value between a target detail layer region and a rendering camera when a first detail level is used in the target detail layer region;

[0160] A first switching module 502 is configured to switch the object in the target detail level area to the second detail level for rendering when the target distance value is greater than a first threshold value; the first threshold value is the sum of the first switching distance and the buffer distance;

[0161] A second switching module 503 is configured to switch the object in the target detail level area to a third detail level for rendering when the target spacing value is less than a second threshold value, wherein the second threshold value is a difference between the second switching distance and the buffer distance;

[0162] The second level of detail and the third level of detail are levels of detail adjacent to the first level of detail.

[0163] In an optional embodiment of the present invention, the device further comprises:

[0164] The region determination module is used to determine the bounding box data of the target object; and determine the detail level region to which the target object belongs based on the bounding box data of the target object.

[0165] In an optional embodiment of the present invention, the area determination module is used to determine the distance between the center point of the area corresponding to the bounding box data of the target object and the center point of each detail level area; and the detail level area with the smallest distance is used as the detail level area to which the target object belongs.

[0166] In an optional embodiment of the present invention, the second switching module 503 is further used to switch the object objects in the target detail level area to the first detail level for rendering after switching the object objects in the target detail level area to the second detail level for rendering when the target spacing value is less than a third threshold, and the third threshold is the difference between the first switching distance and the buffer distance.

[0167] In an optional embodiment of the present invention, the device further comprises:

[0168] The packaging module is used to package the data corresponding to the object objects in the target detail layer area into a folder.

[0169] In an optional embodiment of the present invention, the packaging module is further used to upload the folder to the server.

[0170] In an optional embodiment of the present invention, the target level-of-detail region is a single level-of-detail region, or is formed by splicing multiple level-of-detail regions;

[0171] Wherein, when the target detail level region is formed by splicing multiple detail level regions, the target detail level region includes an object.

[0172] In an embodiment of the present invention, when the first detail level is used in a target detail level region, a target spacing value between the target detail level region and a rendering camera is determined; when the target spacing value is greater than a first threshold, objects in the target detail level region are switched to a second detail level for rendering; the first threshold is the sum of the first switching distance and the buffer distance; when the target spacing value is less than a second threshold, objects in the target detail level region are switched to a third detail level for rendering; the second threshold is the difference between the second switching distance and the buffer distance; wherein the second detail level and the third detail level are detail levels adjacent to the first detail level. Through the embodiments of the present invention, the computing resources and network resources occupied by switching the detail levels of objects in virtual world rendering can be reduced; and the frequent switching of the detail levels of objects causing noticeable user perception can also be avoided.

[0173] In addition, the embodiment of the present invention can reduce the consumption of computing resources by dividing one or more object objects into detail level areas of the same detail level, and at the same time optimize the mesh data storage method, that is, the meshes of object objects in the same detail level area can be packaged into the same file, reducing the number of engineering resource files and increasing the resource loading speed.

[0174] An embodiment of the present invention further provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the above virtual world rendering method is implemented.

[0175] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for rendering a virtual world as described above is implemented.

[0176] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0177] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0178] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0179] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the process in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0180] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0181] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0182] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0183] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0184] The above describes in detail the provided virtual world rendering method, device, electronic device, and storage medium. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only intended to help understand the method and core concept of the present invention. At the same time, for those skilled in the art, based on the concept of the present invention, there may be changes in the specific implementation methods and application scope. In summary, the contents of this specification should not be understood as limiting the present invention.

Claims

1. A method for rendering a virtual world, characterized in that: The virtual world includes a plurality of detail level areas, each detail level area is divided into at least one object, and the method includes: When a first level of detail is used in a target level of detail region, determining a target spacing value between the target level of detail region and a rendering camera; When the target distance value is greater than a first threshold, switching the object in the target detail level area to the second detail level for rendering; the first threshold is the sum of the first switching distance and the buffer distance; When the target distance value is less than a second threshold, switching the object in the target detail level area to a third detail level for rendering; the second threshold is a difference between the second switching distance and the buffer distance; The second level of detail and the third level of detail are levels of detail adjacent to the first level of detail.

2. The method according to claim 1, characterized in that The method further comprises: Determine the bounding box data of the target object; The detail level region to which the target object belongs is determined according to the bounding box data of the target object.

3. The method according to claim 2, characterized in that The determining, based on the bounding box data of the target object, the detail level region to which the target object belongs includes: Determine the distance between the center point of the area corresponding to the bounding box data of the target object and the center point of each level of detail area; The detail level area with the smallest distance is used as the detail level area to which the target object belongs.

4. The method according to claim 1, wherein The method further comprises: After switching the object in the target detail level area to the second detail level for rendering, when the target spacing value is less than a third threshold, switching the object in the target detail level area to the first detail level for rendering, and the third threshold is the difference between the first switching distance and the buffer distance.

5. The method according to claim 1, wherein The method further comprises: The data corresponding to the object in the target detail layer area are packaged in a folder.

6. The method according to claim 5, characterized in that The method further comprises: Upload the folder to the server.

7. The method according to claim 1, characterized in that The target level-of-detail region is one level-of-detail region, or is formed by splicing multiple level-of-detail regions; Wherein, when the target detail level region is formed by splicing multiple detail level regions, the target detail level region includes an object.

8. A virtual world rendering device, characterized in that: The virtual world includes a plurality of detail level areas, each detail level area is divided into at least one object, and the apparatus includes: a spacing determination module, configured to determine a target spacing value between the target detail layer region and a rendering camera when a first detail level is used in the target detail layer region; A first switching module is configured to switch the object in the target detail level area to a second detail level for rendering when the target distance value is greater than a first threshold value; the first threshold value is the sum of the first switching distance and the buffer distance; a second switching module, configured to switch the object in the target detail level area to a third detail level for rendering when the target spacing value is less than a second threshold value, wherein the second threshold value is a difference between the second switching distance and the buffer distance; The second level of detail and the third level of detail are levels of detail adjacent to the first level of detail.

9. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the method for rendering a virtual world according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for rendering a virtual world according to any one of claims 1 to 7 is implemented.