A method for rendering a three-dimensional virtual scene and related apparatus

By updating objects through multi-layered environment mapping geometry and mapping methods, the problem of excessive hardware load in 3D virtual scene rendering is solved, and a more efficient rendering process is achieved.

CN121600144BActive Publication Date: 2026-04-28HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
Filing Date
2026-01-28
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

The existing 3D virtual scene rendering process suffers from excessive hardware load due to the real-time dynamic updating of a large number of objects.

Method used

The rendering process employs multi-layered environment mapping geometry. A set of objects to be rendered is generated through scene segmentation technology. The geometry that needs to be updated is determined based on the virtual camera position and object repetition rate, and then updated using texture mapping.

Benefits of technology

It reduces the hardware load of the rendering process, improves the efficiency and simplicity of the update frequency, and reduces unnecessary computation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121600144B_ABST
    Figure CN121600144B_ABST
Patent Text Reader

Abstract

The application discloses a rendering method of a three-dimensional virtual scene and related devices, and relates to the technical field of three-dimensional virtual scene rendering, and comprises the following steps: determining a plurality of environment map geometries each having a set of objects to be rendered according to a current position of a virtual camera of a three-dimensional virtual scene, wherein the plurality of environment map geometries are all centered on the current position of the virtual camera, and the sizes of the plurality of environment map geometries are different from each other; determining an environment map geometry that needs to be updated according to the current position of the virtual camera and the set of objects to be rendered; and updating the rendering objects of the environment map geometry that needs to be updated based on the set of objects to be rendered of each of the determined environment map geometries that needs to be updated. The application can render objects through a plurality of layers of environment map geometries. Since the update frequency of updating the objects by using the environment map geometries is lower than that of real-time dynamic updating, and the update process is simpler, the load on hardware caused by the rendering process can be greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of three-dimensional virtual scene rendering technology, and in particular to a three-dimensional virtual scene rendering method and related apparatus. Background Technology

[0002] In fields such as 3D games and virtual reality (VR), it is often necessary to render 3D virtual scenes multiple times. For example, as a character moves in a 3D game, a large number of objects displayed in the 3D virtual scene also need to be dynamically updated in real time.

[0003] In 3D virtual scene rendering, real-time dynamic updates of displayed objects refer to the process by which the state (position, pose, material, etc.) of objects in the scene (such as models, particles, UI, etc.) changes with data sources or user interactions, and these changes are reflected on the screen within milliseconds. Its core objective is to ensure that the virtual world remains synchronized with real-world data or user actions while maintaining a high frame rate. While real-time dynamic updates increase the refresh rate of objects, they also lead to excessive hardware load.

[0004] In 3D virtual scenes, the existing rendering process requires real-time dynamic updates of a large number of objects every time a rendering is performed, which results in excessive hardware load. Summary of the Invention

[0005] In view of the above problems, this application provides a rendering method and related apparatus for a three-dimensional virtual scene to reduce the hardware load caused by the rendering process. The specific solution is as follows:

[0006] The first aspect of this application provides a method for rendering a three-dimensional virtual scene, including:

[0007] Based on the current position of the virtual camera in the 3D virtual scene, a set of objects to be rendered for each of the multiple environment map geometries is determined. The multiple environment map geometries are all centered on the current position of the virtual camera and the sizes of the multiple environment map geometries are different.

[0008] Based on the current position of the virtual camera and the set of objects to be rendered, determine the environment texture geometry that needs to be updated;

[0009] Based on the determined set of rendering objects for each environment map geometry that needs to be updated, the rendering objects of each environment map geometry that needs to be updated are updated.

[0010] In one possible implementation, determining the environment map geometry to be updated based on the current position of the virtual camera and the set of objects to be rendered includes:

[0011] Determine the distance between the current position of the virtual camera and the current position of the virtual camera when the rendering object of the environment map geometry was last updated; determine the repetition rate of the rendering objects included in the set of rendering objects of the environment map geometry and the set of rendering objects used when the rendering object of the environment map geometry was last updated; and determine the environment map geometry that needs to be updated based on the distance and the repetition rate.

[0012] In one possible implementation, determining the environment map geometry to be updated based on the current position of the virtual camera and the set of objects to be rendered includes:

[0013] The environment map geometry with the largest size is designated as the current environment map geometry;

[0014] The current environment texture geometry is processed as follows:

[0015] Determine the distance between the current position of the virtual camera and the current position of the virtual camera when the rendering object of the current environment map geometry was last updated; determine the repetition rate of the rendering objects included in the set of objects to be rendered of the environment map geometry and the set of objects to be rendered used when the rendering object of the environment map geometry was last updated; and determine whether the rendering object of the current environment map geometry needs to be updated based on the distance and the repetition rate.

[0016] If it is determined that there is no need to update the rendering object of the current environment map geometry, then the next environment map geometry that is adjacent to the current environment map geometry and located inside the current environment map geometry is determined as the current environment map geometry, and the process returns to the step of processing the current environment map geometry as follows;

[0017] If it is determined that the rendering object of the current environment map geometry needs to be updated, then the current environment map geometry and at least a portion of the environment map geometry located inside the current environment map geometry are identified as the environment map geometry that needs to be updated.

[0018] In one possible implementation, determining whether the rendering object of the current environment texture geometry needs to be updated based on the distance and the repetition rate includes:

[0019] Determine whether the distance is greater than the update distance threshold of the current environment texture geometry. If it is greater, then determine that the rendering object of the current environment texture geometry needs to be updated.

[0020] Determine whether the repetition rate is less than the repetition rate threshold of the current environment texture geometry. If it is less, then determine that the rendering object of the current environment texture geometry needs to be updated.

[0021] In one possible implementation, determining the set of objects to be rendered for each of the multiple environment map geometries based on the current position of the virtual camera in the 3D virtual scene includes:

[0022] For each environment map geometry: using scene segmentation technology, in the 3D virtual scene, with the current position of the virtual camera as the center, the rendering objects are captured according to the size of the environment map geometry to generate an initial set of objects to be rendered;

[0023] Each environment map geometry is processed sequentially from the inside out as the environment map geometry of this layer, as follows:

[0024] Determine whether the initial set of objects to be rendered of the current layer's environment map geometry intersects with the initial set of objects to be rendered of the inner layer's adjacent environment map geometry. If there is an intersection, remove the intersection from the initial set of objects to be rendered of the current layer's environment map geometry to obtain the set of objects to be rendered of the current layer's environment map geometry. The inner layer's adjacent environment map geometry is adjacent to the current layer's environment map geometry and is located inside the current layer's environment map geometry.

[0025] In one possible implementation, the environment map geometry that needs to be updated does not include the smallest environment map geometry;

[0026] The method further includes:

[0027] The rendering object of the smallest environment map geometry is dynamically updated in real time.

[0028] A second aspect of this application provides a rendering apparatus for a three-dimensional virtual scene, comprising:

[0029] The object set determination unit is configured to determine a set of objects to be rendered for each of a plurality of environment map geometries based on the current position of the virtual camera in the 3D virtual scene, wherein the plurality of environment map geometries are all centered on the current position of the virtual camera and the sizes of the plurality of environment map geometries are different.

[0030] The environment map geometry determination unit is configured to determine the environment map geometry that needs to be updated based on the current position of the virtual camera and the set of objects to be rendered;

[0031] The object update unit is configured to update the rendering objects of each environment map geometry based on a determined set of objects to be rendered for each environment map geometry that needs to be updated.

[0032] A third aspect of this application provides a computer program product, including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement the rendering method of a three-dimensional virtual scene described in the first aspect or any implementation thereof.

[0033] A fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:

[0034] The memory is used to store computer programs;

[0035] The processor is used to execute the computer program so that the electronic device can implement the rendering method of the three-dimensional virtual scene of the first aspect or any implementation thereof.

[0036] The fifth aspect of this application provides a computer storage medium carrying one or more computer programs, which, when executed by an electronic device, enable the electronic device to render a three-dimensional virtual scene according to the first aspect or any implementation thereof.

[0037] By means of the above technical solution, the rendering method and related apparatus for the three-dimensional virtual scene provided in this application can render objects through multi-layer environment map geometry. Since updating objects using environment map geometry has a lower update frequency and a simpler update process than real-time dynamic updates, the load on the hardware during the rendering process can be greatly reduced. Attached Figure Description

[0038] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0039] Figure 1 This is a schematic diagram of an environment mapping geometry provided in this application;

[0040] Figure 2 A schematic diagram of another environment mapping geometry provided in this application;

[0041] Figure 3 A schematic diagram of another environment mapping geometry provided in this application;

[0042] Figure 4 A flowchart illustrating a rendering method for a three-dimensional virtual scene provided in this application;

[0043] Figure 5A schematic diagram of another environment mapping geometry provided in this application;

[0044] Figure 6 A flowchart illustrating another method for rendering a three-dimensional virtual scene provided in this application;

[0045] Figure 7 A schematic diagram illustrating the specific process for determining the environment map geometry that needs to be updated, as provided in this application;

[0046] Figure 8 A schematic diagram of the structure of a rendering device for a three-dimensional virtual scene provided in an embodiment of this application;

[0047] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0048] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0049] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0050] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0051] like Figure 1 As shown, traditional environment mapping geometry is a classic technique in 3D graphics used to simulate an "infinitely distant environment." By wrapping a large geometric shape around a virtual camera and applying panoramic textures such as sky, mountains, and stars, an immersive background effect is created. As the background of the scene, environment mapping geometry effectively solves the visual problem of the "world edge." Optionally, the environment mapping geometry can be a cube, sphere, octahedron, etc. In an optional embodiment, the environment mapping geometry can be a skybox. Figure 2As shown, the distance between the spherical environment map geometry 006 and the current position 001 of the virtual camera is the radius. To allow environment map geometry 006 to simulate an "infinitely far environment," the radius is set very large. While the distant view displayed through the environment map geometry does not require frequent updates or even any updates at all, other objects within the environment map geometry need to be dynamically updated in real-time at a higher frequency. For example... Figure 2 Objects 002 to 005 in the model need to be dynamically updated in real time at a high frequency, such as according to the rendering frame rate.

[0052] This application provides a method for rendering a 3D virtual scene that can use multiple environment map geometries to update the rendered object. For example... Figure 3 As shown, this application sets multiple environment map geometries between the outermost environment map geometry 006 (with a radius of R7) and the current position of the virtual camera 001. The radii of these environment map geometries range from R0 to R6. This application can use these environment map geometries to update at least one of objects 002 to 005. Since updating objects using environment map geometry has a lower update frequency and a simpler update process (updating via texture mapping) compared to real-time dynamic updates, the hardware load on the rendering process can be significantly reduced.

[0053] The following section, with reference to the accompanying drawings, details a method for rendering a three-dimensional virtual scene provided in this application.

[0054] like Figure 4 As shown, the rendering method for a three-dimensional virtual scene provided in this application may include:

[0055] S100. Determine the set of objects to be rendered for each of the multiple environment map geometries based on the current position of the virtual camera in the 3D virtual scene. The multiple environment map geometries are all centered on the current position of the virtual camera and have different sizes.

[0056] Optionally, the environment mapping geometry in this application can be a regular polyhedron or a sphere. If it is a regular polyhedron, the size of the environment mapping geometry can be the distance between any face of the regular polyhedron and the current position of the virtual camera; if it is a sphere, the size of the environment mapping geometry can be the radius of the sphere.

[0057] Optionally, if the environment map geometry is a sphere, then the radii of each environment map geometry are arranged in ascending order as follows: R0, R1, R2, R3...R k-1 Furthermore, as the radius increases, the difference in radius between two adjacent environment map geometries also increases, for example: R k-1 -R k-2 >Rk-2 -R k-3 > ... > R3-R2 > R2-R1 > R1-R0. This scheme optimizes the efficiency of view frustum culling. Specifically: For inner (small radius) environment map geometry, the smaller layer spacing allows for more precise matching of the nearby scene, quickly eliminating non-intersecting areas and reducing unnecessary rendering calls. For outer (large radius) environment map geometry, the larger layer spacing allows for quick determination of whether large distant areas are outside the view frustum, achieving "one-stroke" culling. This forms an efficient filtering mechanism: the closer to the camera, the finer the filtering; the farther away, the coarser the filtering, thus significantly reducing computation. Simultaneously, this scheme can control the visual impact of errors. Specifically: For inner (small radius) environment map geometry, the close proximity of objects makes small positional errors easily noticeable. Smaller radius differences mean smoother layer transitions, better matching the actual geometry and reducing errors. For outer (large radius) environment map geometry, the greater distance between objects means the same geometric error has minimal visual impact. A larger radius difference can effectively "absorb" these errors, preventing distant objects from flickering or shaking.

[0058] Virtual camera pose refers to the real-time coordinates and orientation of a virtual camera within a 3D virtual scene, determining the user's perspective. In real-time rendering, the virtual camera's pose (including its current position) is typically updated every frame based on user input (such as keyboard, mouse, or VR controller input) or program logic. This update frequency is consistent with the rendering frame rate to ensure smooth and synchronized visuals.

[0059] In an optional embodiment of this application, each environment map geometry may only render a portion of the objects. For example, each environment map geometry may only render the objects between that environment map geometry and its outermost adjacent environment map geometry. The outermost adjacent environment map geometry is adjacent to and located outside the current environment map geometry. Figure 3 As shown, the environment map geometry with radius R0 renders only object 003, the environment map geometry with radius R1 renders only object 004, and the environment map geometry with radius R2 renders only object 005. This ensures that each environment map geometry renders a different object, thus avoiding duplicate rendering of the same object.

[0060] It should be noted that the object mentioned in the embodiments of this application can be a complete virtual item, virtual animal, virtual plant, etc., or it can be a part of a virtual item, virtual animal, or virtual plant. For example, the object mentioned in the embodiments of this application can be a complete sphere or a part of a sphere. Figure 5Taking object 003 as an example, since object 003 is relatively large, a part of object 003 is rendered by an environment map geometry with radius R0 (the part located between two environment map geometries with radii of R0 and R1 respectively), and another part of object 003 and object 004 are rendered by an environment map geometry with radius R1.

[0061] Optional, such as Figure 6 As shown, step S100 specifically includes:

[0062] S110. For each environment map geometry: Using scene segmentation technology, in the 3D virtual scene, with the current position of the virtual camera as the center, the rendering objects are captured according to the size of the environment map geometry to generate an initial set of objects to be rendered.

[0063] This application can divide the environment map geometry into multiple concentric spheres or cubes centered on the current position of the virtual camera, based on the size of the environment map geometry, to achieve the effect of multi-layered environment map geometry. The space between two adjacent layers of environment map geometry is a portion of the content segmented from the 3D virtual scene. Then, the rendering objects inside the space between each pair of adjacent layers of environment map geometry are captured to generate an initial set of objects to be rendered. The initial set of objects to be rendered for each environment map geometry consists of the objects between that environment map geometry and its outermost adjacent environment map geometry. The outermost adjacent environment map geometry is adjacent to and located outside of that environment map geometry. The initial set of objects to be rendered for the outermost environment map geometry consists of the objects between the outermost environment map geometry and infinity.

[0064] like Figure 5 As shown, a rendering object snap is performed on the environment map geometry (sphere) with radius R0 to generate an initial set of objects to be rendered containing a part of object 003; a rendering object snap is performed on the environment map geometry with radius R1 to generate an initial set of objects to be rendered containing the other part of object 003 and object 004; a rendering object snap is performed on the environment map geometry with radius R2 to generate an initial set of objects to be rendered containing object 005; and so on.

[0065] S120. Following the order from the inside out, process each environment map geometry as the environment map geometry of this layer as follows:

[0066] Determine whether the initial set of objects to be rendered for the current layer's environment map geometry intersects with the initial set of objects to be rendered for the adjacent inner layer's environment map geometry. If there is an intersection, remove the intersection from the initial set of objects to be rendered for the current layer's environment map geometry to obtain the set of objects to be rendered for the current layer's environment map geometry. The adjacent inner layer's environment map geometry is adjacent to the current layer's environment map geometry and is located inside the current layer's environment map geometry.

[0067] For some objects, they may span multiple environment map geometries. In this case, to ensure a tighter connection between objects rendered by adjacent environment map geometries, the content already rendered by the inner environment map geometries can be removed from the initial set of objects to be rendered in that layer of environment map geometries, thus avoiding duplicate rendering of the same content. For example: Figure 5 Point A is a pixel contained in the initial set of objects to be rendered for the environment map geometry with radius R1. If the initial set of objects to be rendered for the environment map geometry with radius R2 includes point A, then point A is removed from the initial set of objects to be rendered for the environment map geometry with radius R2 to avoid rendering point A for both the environment map geometry with radius R1 and the environment map geometry with radius R2.

[0068] S200. Based on the current position of the virtual camera and the set of objects to be rendered, determine the environment map geometry that needs to be updated.

[0069] Optionally, step S200 may specifically include:

[0070] Determine the distance between the current position of the virtual camera and the current position of the virtual camera when the rendering object of the environment map geometry was last updated. Determine the repetition rate of the rendering objects included in the set of objects to be rendered by the environment map geometry and the set of objects to be rendered used when the rendering object of the environment map geometry was last updated. Determine the environment map geometry that needs to be updated based on the distance and the repetition rate.

[0071] Although updating environment map geometry is relatively quick, to further reduce the burden on the system during the rendering process, this application can determine some environment map geometries as those that need updating based on the aforementioned distance and repetition rate, and only update the environment map geometries that need updating. For example, if the aforementioned distance of a certain environment map geometry is greater than a preset distance, or the repetition rate is less than a preset repetition rate, then that environment map geometry can be determined as the environment map geometry that needs updating.

[0072] In practical applications, each environment map geometry can correspond to a preset distance and a preset repetition rate. The preset distances and repetition rates for each environment map geometry can be the same or different. Optionally, larger environment map geometries have larger preset distances and smaller preset repetition rates. This results in larger environment map geometries updating less frequently and smaller environment map geometries updating more frequently. This approach achieves faster refresh for nearby objects and slower refresh for distant objects, providing users with a better viewing experience of nearby object refreshes while effectively reducing the system load caused by frequent refreshes of distant objects.

[0073] S300: Based on the determined set of rendering objects for each environment map geometry that needs to be updated, update the rendering objects for each environment map geometry that needs to be updated.

[0074] The environment map geometry updates objects through texture updates. Specifically, each environment map geometry can be a mesh composed of multiple cells, each cell being a triangle. Before applying the texture, images to be applied to each cell are created based on the current position of the virtual camera and the set of objects to be rendered. Then, each image is applied to its corresponding cell, thus completing the texture update.

[0075] The rendering method for a three-dimensional virtual scene provided in this application embodiment can render objects through multi-layer environment map geometry. Since updating objects using environment map geometry has a lower update frequency and a simpler update process (updating through textures) compared to real-time dynamic updates, it can greatly reduce the hardware load of the rendering process.

[0076] like Figure 7 As shown, in another method for rendering a three-dimensional virtual scene provided in this embodiment of the invention, Figure 4 Step S200 shown may specifically include:

[0077] S210. Determine the environment map geometry with the largest size as the current environment map geometry;

[0078] S220. Perform the following processing on the current environment texture geometry:

[0079] Determine the distance between the current position of the virtual camera and the current position of the virtual camera when the rendering object of the current environment map geometry was last updated; determine the repetition rate of the rendering objects included in the set of objects to be rendered of the environment map geometry and the set of objects to be rendered used when the rendering object of the environment map geometry was last updated; and determine whether the rendering object of the current environment map geometry needs to be updated based on the distance and the repetition rate.

[0080] Optionally, determining whether to update the rendering object of the current environment map geometry based on distance and repetition rate may include:

[0081] Determine if the distance is greater than the update distance threshold of the current environment texture geometry. If it is greater, then determine that the rendering object of the current environment texture geometry needs to be updated.

[0082] Determine if the repetition rate is less than the repetition rate threshold of the current environment texture geometry. If it is less, then the rendering object of the current environment texture geometry needs to be updated.

[0083] This application can determine whether the rendering object of the current environment texture geometry needs to be updated based on distance and repetition rate. When the distance is greater than the update distance threshold of the current environment texture geometry, it indicates that the current position of the virtual camera is too far from the current position of the virtual camera when the rendering object of the current environment texture geometry was last updated. If it is not updated, it may cause visual problems, so the rendering object of the current environment texture geometry needs to be updated. Similarly, when the repetition rate is less than the repetition rate threshold of the current environment texture geometry, it indicates that the set of objects to be rendered by the current environment texture geometry is significantly different from the set of objects to be rendered used when the rendering object of the current environment texture geometry was last updated, so the rendering object of the current environment texture geometry also needs to be updated.

[0084] S230. If it is determined that there is no need to update the rendering object of the current environment map geometry, then the next environment map geometry that is adjacent to the current environment map geometry and located inside the current environment map geometry is determined as the current environment map geometry, and the process returns to step S220.

[0085] S240. If it is determined that the rendering object of the current environment map geometry needs to be updated, then the current environment map geometry and at least a portion of the environment map geometry located inside the current environment map geometry are determined as the environment map geometry that needs to be updated.

[0086] Figure 7 The steps shown enable analysis of environment map geometry from the outside in. When an environment map geometry is determined to need updating based on distance and repetition rate, all environment map geometries within it are also determined to need updating. This approach is particularly suitable for situations where "larger environment map geometries correspond to larger preset distances and smaller preset repetition rates." In this case, larger environment map geometries are updated less frequently, while smaller environment map geometries are updated more frequently. Therefore, when an environment map geometry is determined to need updating, it means that all environment map geometries within it need updating, and thus, all environment map geometries within it are also determined to need updating. This eliminates the need to perform step S220 on the individual environment map geometries within it.

[0087] Optionally, in another embodiment of this application, the environment map geometry to be updated does not include the smallest environment map geometry. Since the smallest environment map geometry is very close to the current position of the virtual camera, in order to improve the refresh rate, the rendering object can be updated in real time instead of using the smallest environment map geometry.

[0088] Optionally, the volume of the smallest environment map geometry can be 0, in which case the smallest environment map geometry represents the current position of the virtual camera. For example... Figure 3 As shown, if the current position of the virtual camera is 001, which is the environment map geometry with the smallest radius, then the object between the current position of the virtual camera 001 and the environment map geometry with radius R0 (such as object 002) will be dynamically updated in real time. Of course, the size of the aforementioned environment map geometry with the smallest size can also be a value greater than 0.

[0089] The following is a detailed implementation process of the method in this application, using a sphere as an example of an environment mapping geometry:

[0090] First, configure the following parameters in advance:

[0091] The number of scene levels, k;

[0092] radius vector ;

[0093] Update distance vector of environment map geometry ;

[0094] Repetition rate threshold vector of environment map geometry ;

[0095] Texture accuracy of environment mapping geometry .

[0096] The number of scene levels is the same as the number of environment map geometries; k environment map geometries can divide a 3D virtual scene into k+1 levels. For example, one environment map geometry divides the 3D virtual scene into two levels: the interior of the environment map geometry and the exterior of the environment map geometry. The radius vector is a vector composed of the radii of each environment map geometry, where... Minimum, Maximum. The update distance vector of the environment map geometry is a vector composed of the update distance thresholds for each environment map geometry. Representing radius The update distance threshold for environment map geometry is calculated using the same logic, and so on. The environment map geometry repetition rate threshold vector is a vector composed of the repetition rate threshold for each environment map geometry. Representing radius The repetition rate threshold for environment map geometry is calculated, and so on. The mapping precision of environment map geometry is the size of each texture, where... The width of the texture (in pixels). The height of the texture (in pixels).

[0097] The following explains some environment map geometry parameters that will be used in subsequent steps:

[0098] Texture is an environment texture geometry texture;

[0099] Position is the position of the environment map geometry;

[0100] Radius is the radius;

[0101] RadiusFar is the thickness between the current environment map geometry and the adjacent outer environment map geometry;

[0102] UpdateRadius updates the distance threshold;

[0103] RenderObjectSet is the set of objects to be rendered that was used during the last update;

[0104] UpdatingObjectSet is the set of objects to be rendered;

[0105] UpdateThreshold is the repetition rate threshold;

[0106] LowerLayer is a pointer to the environment map geometry of the innermost layer.

[0107] It is worth noting that because the k radius lengths divide the entire scene into k+1 parts, there are k+1 layers of objects. ObjectSet is the object covered by the current layer's environment map geometry.

[0108] in:

[0109] Formula 1;

[0110] Formula 2;

[0111] Formula 3;

[0112] Formula 4.

[0113] The initialization process is as follows:

[0114] Initialize the k+1 layer object, set the current position of the virtual camera to the Position object, and initialize the properties Radius, RadiusFar, UpdateRadius, and UpdateThreshold according to Formulas 1 to 4 above.

[0115] For each layer of object, create an environment map geometry mesh based on its radius, and then create k+1 textures based on the texture precision of the environment map geometry. And set it to the corresponding environment map geometry mesh.

[0116] For each environment map geometry object, scene segmentation technology will be used to collect all objects within a radius of Position (centered at RadiusFar) into RenderObjectSet and UpdatingObjectSet. After initialization, the RenderObjectSet and UpdatingObjectSet for each environment map geometry will contain the same objects.

[0117] For each environment map geometry, point its LowerLayer to the innermost environment map geometry.

[0118] For environment map geometry with index n not less than 1, scene capture will be enabled for objects contained in the following scene capture object set, CaptureObjectSet, and these objects will be stored in the texture. In this context, the calculation method for CaptureObjectSet is as follows:

[0119] Formula 5;

[0120] For environment map geometry with index n=0, its internal RenderObjectSet is drawn by dynamically updating in real time.

[0121] After the above initialization is performed, the following scene rendering and update cycle is executed.

[0122] Scene rendering process:

[0123] During the scene rendering stage, all environment map geometry objects are traversed from back to front. For environment map geometry with a radius greater than 0, the environment map geometry is placed at its position according to the radius, and its texture is mapped to it.

[0124] For environment map geometry with a radius of 0, objects in its RenderObjectSet are added to the real-time dynamically updated rendering process; other objects not in this set are not included in this rendering.

[0125] Update loop process:

[0126] Update the current location of the virtual camera. Update each based on the current position of the virtual camera New It is based on the current position of the virtual camera. This is a circle centered at RadiusFar, containing all scene objects.

[0127] The search proceeds from the outermost layer to the innermost layer to determine if the environment map geometry needs updating. The search method is as follows, and continues until the first environment map geometry that needs updating is found:

[0128] ;

[0129] ;

[0130] ;

[0131] in: This represents the distance between the current position of the virtual camera and the rendering object of the current environment map geometry at the time of the last update of the virtual camera. If the distance exceeds the update distance threshold... If it does, it means an update is needed. This indicates the overlap rate between the set of objects to be rendered from the environment map geometry and the set of objects to be rendered used when the environment map geometry was last updated. If this value is lower than our set overlap rate threshold... This also indicates that the environment texture geometry needs to be updated.

[0132] Once the first environment map geometry that needs updating is found, its Position, RenderObjectSet, and Texture are updated progressively inward from this environment map geometry.

[0133] use Update And move the position of its corresponding environment map geometry mesh.

[0134] use cover .

[0135] Use Formula 5 to find the latest render set and update its textures using the scene. .

[0136] pass Move to the inner layer and repeat this update process.

[0137] The above describes a method for rendering a three-dimensional virtual scene provided by an embodiment of this application. The following describes the apparatus for performing the above-described method for rendering a three-dimensional virtual scene.

[0138] Please see Figure 8 , Figure 8This is a schematic diagram of the structure of a rendering device for a three-dimensional virtual scene provided in an embodiment of this application. Figure 8 As shown, the rendering device for the three-dimensional virtual scene includes:

[0139] The object set determination unit 801 is configured to determine a set of objects to be rendered for each of a plurality of environment map geometries based on the current position of the virtual camera in the 3D virtual scene, wherein the plurality of environment map geometries are all centered on the current position of the virtual camera and the sizes of the plurality of environment map geometries are different.

[0140] The environment map geometry determination unit 802 is configured to determine the environment map geometry that needs to be updated based on the current position of the virtual camera and the set of objects to be rendered;

[0141] The object update unit 803 is configured to update the rendering objects of each environment map geometry that needs to be updated based on the determined set of rendering objects for each environment map geometry that needs to be updated.

[0142] In one possible implementation, the environment map geometry determination unit 802 is configured to perform: determining the distance between the current position of the virtual camera and the current position of the virtual camera when the rendering object of the environment map geometry was last updated; determining the repetition rate of the rendering objects included in the set of rendering objects of the environment map geometry and the set of rendering objects used when the rendering object of the environment map geometry was last updated; and determining the environment map geometry that needs to be updated based on the distance and the repetition rate.

[0143] In one possible implementation, the environment map geometry determination unit 802 is configured to perform: determining the environment map geometry with the largest size as the current environment map geometry;

[0144] The current environment texture geometry is processed as follows:

[0145] Determine the distance between the current position of the virtual camera and the current position of the virtual camera when the rendering object of the current environment map geometry was last updated; determine the repetition rate of the rendering objects included in the set of objects to be rendered of the environment map geometry and the set of objects to be rendered used when the rendering object of the environment map geometry was last updated; and determine whether the rendering object of the current environment map geometry needs to be updated based on the distance and the repetition rate.

[0146] If it is determined that there is no need to update the rendering object of the current environment map geometry, then the next environment map geometry that is adjacent to the current environment map geometry and located inside the current environment map geometry is determined as the current environment map geometry, and the process returns to the step of processing the current environment map geometry as follows;

[0147] If it is determined that the rendering object of the current environment map geometry needs to be updated, then the current environment map geometry and at least a portion of the environment map geometry located inside the current environment map geometry are identified as the environment map geometry that needs to be updated.

[0148] Optionally, the environment map geometry determination unit 802 determines whether the rendering object of the current environment map geometry needs to be updated based on the distance and the repetition rate, and is specifically configured as follows:

[0149] Determine whether the distance is greater than the update distance threshold of the current environment texture geometry. If it is greater, then determine that the rendering object of the current environment texture geometry needs to be updated.

[0150] Determine whether the repetition rate is less than the repetition rate threshold of the current environment texture geometry. If it is less, then determine that the rendering object of the current environment texture geometry needs to be updated.

[0151] In one possible implementation, the object set determination unit 801 is specifically configured to perform:

[0152] For each environment map geometry: using scene segmentation technology, in the 3D virtual scene, with the current position of the virtual camera as the center, the rendering objects are captured according to the size of the environment map geometry to generate an initial set of objects to be rendered;

[0153] Each environment map geometry is processed sequentially from the inside out as the environment map geometry of this layer, as follows:

[0154] Determine whether the initial set of objects to be rendered of the current layer's environment map geometry intersects with the initial set of objects to be rendered of the inner layer's adjacent environment map geometry. If there is an intersection, remove the intersection from the initial set of objects to be rendered of the current layer's environment map geometry to obtain the set of objects to be rendered of the current layer's environment map geometry. The inner layer's adjacent environment map geometry is adjacent to the current layer's environment map geometry and is located inside the current layer's environment map geometry.

[0155] In one possible implementation, the environment map geometry that needs to be updated does not include the smallest environment map geometry;

[0156] Figure 8 The device shown also includes:

[0157] The dynamic update unit is configured to perform real-time dynamic updates on the rendering object of the smallest environment map geometry.

[0158] This application also provides an electronic device in its embodiments. (See reference...) Figure 9The diagram illustrates a structural schematic of an electronic device suitable for implementing the rendering method of the three-dimensional virtual scene in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 9 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0159] like Figure 9 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, the RAM 603 also stores various programs and data required for the operation of the electronic device. The processing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0160] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, memory cards, hard drives, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0161] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the three-dimensional virtual scene rendering methods provided in this application.

[0162] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the three-dimensional virtual scene rendering methods provided in this application.

[0163] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0164] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0165] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0166] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A method for rendering a three-dimensional virtual scene, characterized in that, include: Based on the current position of the virtual camera in the 3D virtual scene, a set of objects to be rendered for each of the multiple environment map geometries is determined. The multiple environment map geometries are all centered on the current position of the virtual camera and the sizes of the multiple environment map geometries are different. Based on the current position of the virtual camera and the set of objects to be rendered, determine the environment texture geometry that needs to be updated; Based on the determined set of rendering objects for each environment map geometry that needs to be updated, the rendering objects of each environment map geometry that needs to be updated are updated. The step of determining the environment texture geometry that needs to be updated based on the current position of the virtual camera and the set of objects to be rendered includes: Determine the distance between the current position of the virtual camera and the current position of the virtual camera when the rendering object of the environment map geometry was last updated; determine the repetition rate of the rendering objects included in the set of rendering objects of the environment map geometry and the set of rendering objects used when the rendering object of the environment map geometry was last updated; and determine the environment map geometry that needs to be updated based on the distance and the repetition rate.

2. The rendering method for a three-dimensional virtual scene according to claim 1, characterized in that, The step of determining the environment texture geometry that needs to be updated based on the current position of the virtual camera and the set of objects to be rendered includes: The environment map geometry with the largest size is designated as the current environment map geometry; The current environment texture geometry is processed as follows: Determine the distance between the current position of the virtual camera and the current position of the virtual camera when the rendering object of the current environment map geometry was last updated; determine the repetition rate of the rendering objects included in the set of objects to be rendered of the environment map geometry and the set of objects to be rendered used when the rendering object of the environment map geometry was last updated; and determine whether the rendering object of the current environment map geometry needs to be updated based on the distance and the repetition rate. If it is determined that there is no need to update the rendering object of the current environment map geometry, then the next environment map geometry that is adjacent to the current environment map geometry and located inside the current environment map geometry is determined as the current environment map geometry, and the process returns to the step of processing the current environment map geometry as follows; If it is determined that the rendering object of the current environment map geometry needs to be updated, then the current environment map geometry and at least a portion of the environment map geometry located inside the current environment map geometry are identified as the environment map geometry that needs to be updated.

3. The rendering method for a three-dimensional virtual scene according to claim 2, characterized in that, The step of determining whether the rendering object of the current environment texture geometry needs to be updated based on the distance and the repetition rate includes: Determine whether the distance is greater than the update distance threshold of the current environment texture geometry. If it is greater, then determine that the rendering object of the current environment texture geometry needs to be updated. Determine whether the repetition rate is less than the repetition rate threshold of the current environment texture geometry. If it is less, then determine that the rendering object of the current environment texture geometry needs to be updated.

4. The rendering method for a three-dimensional virtual scene according to claim 1, characterized in that, The process of determining the set of objects to be rendered for each of the multiple environment map geometries based on the current position of the virtual camera in the 3D virtual scene includes: For each environment map geometry: using scene segmentation technology, in the 3D virtual scene, with the current position of the virtual camera as the center, the rendering objects are captured according to the size of the environment map geometry to generate an initial set of objects to be rendered; Each environment map geometry is processed sequentially from the inside out as the environment map geometry of this layer, as follows: Determine whether the initial set of objects to be rendered of the current layer's environment map geometry intersects with the initial set of objects to be rendered of the inner layer's adjacent environment map geometry. If there is an intersection, remove the intersection from the initial set of objects to be rendered of the current layer's environment map geometry to obtain the set of objects to be rendered of the current layer's environment map geometry. The inner layer's adjacent environment map geometry is adjacent to the current layer's environment map geometry and is located inside the current layer's environment map geometry.

5. The rendering method for a three-dimensional virtual scene according to claim 1, characterized in that, The environment map geometry that needs to be updated does not include the smallest environment map geometry; The method further includes: The rendering object of the smallest environment map geometry is dynamically updated in real time.

6. A rendering device for a three-dimensional virtual scene, characterized in that, include: The object set determination unit is configured to determine a set of objects to be rendered for each of a plurality of environment map geometries based on the current position of the virtual camera in the 3D virtual scene, wherein the plurality of environment map geometries are all centered on the current position of the virtual camera and the sizes of the plurality of environment map geometries are different. The environment map geometry determination unit is configured to determine the environment map geometry that needs to be updated based on the current position of the virtual camera and the set of objects to be rendered; The object update unit is configured to update the rendering objects of each environment map geometry that needs to be updated based on a determined set of objects to be rendered for each environment map geometry that needs to be updated. The environment texture geometry determination unit determines the environment texture geometry that needs to be updated based on the current position of the virtual camera and the set of objects to be rendered, specifically for: Determine the distance between the current position of the virtual camera and the current position of the virtual camera when the rendering object of the environment map geometry was last updated; determine the repetition rate of the rendering objects included in the set of rendering objects of the environment map geometry and the set of rendering objects used when the rendering object of the environment map geometry was last updated; and determine the environment map geometry that needs to be updated based on the distance and the repetition rate.

7. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the rendering method for a three-dimensional virtual scene as described in any one of claims 1 to 5.

8. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the rendering method of the three-dimensional virtual scene as described in any one of claims 1 to 5.

9. A computer storage medium, characterized in that, The storage medium carries one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the rendering method of a three-dimensional virtual scene as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Virtual scene display method and device, equipment and storage medium

    CN112370784A

  • Three-dimensional scene updating method and device, storage medium and electronic equipment

    CN117808951A