Scene image rendering methods, devices, electronic equipment and storage media

By using a pre-computed binary tree structure to store visibility information in games and the metaverse, the hardware overhead caused by real-time computing is solved, enabling more efficient scene image rendering and adapting to more user devices.

CN119888058BActive Publication Date: 2025-11-14NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311382695.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-24
Publication Date
2025-11-14
Estimated Expiration
2043-10-24

AI Technical Summary

Technical Problem

In interactive scenarios such as games and metaverses, existing occlusion culling schemes require real-time calculation of the visibility information of virtual objects, resulting in high CPU, GPU, and memory overhead for electronic devices, making it difficult to meet the hardware requirements of mobile devices.

Method used

By pre-compiling the binary tree structure of multiple scene regions in the virtual scene, recording the visibility information of each leaf node, querying the target visibility information based on the position of the controlled virtual object, and generating scene images.

Benefits of technology

It reduces the computational overhead of electronic devices, improves the rendering efficiency of scene images, and is compatible with more users' devices, especially mobile devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888058B_ABST
    Figure CN119888058B_ABST
Patent Text Reader

Abstract

This application provides a scene image rendering method, apparatus, electronic device, and storage medium, relating to the field of image processing technology. The method includes: acquiring a binary tree structure of multiple scene regions in a preset virtual scene, where multiple leaf nodes in the binary tree structure of each scene region correspond to multiple unit spaces in each scene region; the leaf nodes record visibility information of potentially occluded objects in the preset virtual scene relative to the unit spaces; determining the corresponding target scene region and target unit space based on the position of a controlled virtual object in the preset virtual scene; determining the target visibility information recorded by the target leaf nodes from the binary tree structure of the target scene region based on the target scene region and target unit space; and generating a scene image from the perspective corresponding to the controlled virtual object based on the target visibility information. This application can achieve scene image rendering through pre-calculated virtual object visibility information, reducing the real-time computational overhead of electronic devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically, to a scene image rendering method, apparatus, electronic device, and storage medium. Background Technology

[0002] In interactive scenarios such as games and the metaverse, occlusion culling refers to canceling the rendering of a virtual object when it is occluded by other objects in the scene, making it invisible to the player's virtual camera.

[0003] Existing occlusion culling schemes calculate the visibility information of virtual objects within the player's virtual camera's field of view in real time, and then render the scene based on the real-time calculated visibility information to obtain a real-time scene image.

[0004] However, as the scale and detail of in-app scenarios such as games and metaverses increase, the rendering pressure on electronic devices also increases. Real-time computing places high demands on the hardware of electronic devices, and the overhead of the central processing unit (CPU), graphics processing unit (GPU), and memory of electronic devices is large, making them very unsuitable for mobile electronic devices. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of the prior art by providing a scene image rendering method, apparatus, electronic device, and storage medium, so as to achieve scene image rendering through pre-calculated visibility information of virtual objects and reduce the real-time computing overhead of electronic devices.

[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:

[0007] In a first aspect, embodiments of this application provide a scene image rendering method, the method comprising:

[0008] Obtain the binary tree structure of multiple scene regions in a preset virtual scene, wherein multiple leaf nodes in the binary tree structure of each scene region correspond to multiple unit spaces in each scene region; each leaf node records the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space;

[0009] Based on the position of the controlled virtual object in the preset virtual scene, determine the target scene area and target unit space corresponding to the position of the controlled virtual object;

[0010] Based on the target scene region and the target unit space, determine the target visibility information recorded in the target leaf nodes from the binary tree structure of the target scene region;

[0011] Based on the target visibility information, a scene image corresponding to the viewpoint of the controlled virtual object is generated.

[0012] Secondly, embodiments of this application also provide a scene image rendering apparatus, the apparatus comprising:

[0013] The binary tree acquisition module is used to acquire the binary tree structure of multiple scene regions in a preset virtual scene. The multiple leaf nodes in the binary tree structure of each scene region correspond to multiple unit spaces in each scene region. Each leaf node records the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space.

[0014] The location determination module is used to determine the target scene area and target unit space corresponding to the location of the controlled virtual object in the preset virtual scene;

[0015] The visibility information determination module is used to determine the target visibility information recorded in the target leaf node from the binary tree structure of the target scene area based on the target scene area and the target unit space.

[0016] The scene image generation module is used to generate a scene image from the perspective corresponding to the controlled virtual object based on the target visibility information.

[0017] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the scene image rendering method as described in any of the first aspects.

[0018] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the scene image rendering method as described in any of the first aspects.

[0019] The beneficial effects of this application are:

[0020] This application proposes a scene image rendering method, apparatus, electronic device, and storage medium. It obtains a binary tree structure of multiple scene regions within a preset virtual scene. Multiple leaf nodes in the binary tree structure of each scene region correspond to multiple unit spaces within that scene region. Each leaf node records the visibility information of potentially occluded objects in the preset virtual scene relative to their corresponding unit spaces. Based on the target scene region and target unit space corresponding to the controlled virtual object in the preset virtual scene, the target visibility information recorded by the target leaf node is determined from the binary tree structure of the target scene region. This allows for the generation of a scene image from the perspective of the controlled virtual object based on the target visibility information. By obtaining a pre-calculated binary tree structure storing visibility information, the computational overhead of the electronic device can be reduced, lowering the hardware requirements and allowing the game or metaverse to reach a wider audience. Furthermore, using a binary tree structure to store visibility information leverages the binary search property of the binary tree structure to retrieve target visibility information with high query efficiency, thereby improving the rendering efficiency of the scene image. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 A schematic diagram illustrating the application scenarios provided in the embodiments of this application;

[0023] Figure 2 A flowchart illustrating the scene image rendering method provided in this application embodiment. Figure 1 ;

[0024] Figure 3 A flowchart illustrating the scene image rendering method provided in this application embodiment. Figure 2 ;

[0025] Figure 4 A flowchart illustrating the scene image rendering method provided in this application embodiment. Figure 3 ;

[0026] Figure 5 A schematic diagram of the segmentation of the virtual three-dimensional geometric model provided in the embodiments of this application;

[0027] Figure 6 The binary tree structure provided in the embodiments of this application;

[0028] Figure 7A flowchart illustrating the scene image rendering method provided in this application embodiment. Figure 4 ;

[0029] Figure 8 A flowchart illustrating the scene image rendering method provided in this application embodiment. Figure 5 ;

[0030] Figure 9 A flowchart illustrating the scene image rendering method provided in this application embodiment. Figure 6 ;

[0031] Figure 10 A flowchart illustrating the scene image rendering method provided in this application embodiment. Figure 7 ;

[0032] Figure 11 A flowchart illustrating the scene image rendering method provided in this application embodiment. Figure 8 ;

[0033] Figure 12 This is a schematic diagram of mesh merging for potentially occluded objects provided in an embodiment of this application;

[0034] Figure 13 A hierarchy diagram of potentially occluded objects provided for embodiments of this application;

[0035] Figure 14 A flowchart illustrating the scene image rendering method provided in this application embodiment. Figure 9 ;

[0036] Figure 15 This is a schematic diagram of the structure of the scene image rendering apparatus provided in the embodiments of this application;

[0037] Figure 16 A schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0039] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0040] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Additionally, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0041] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.

[0042] This application provides a scene image rendering method. In one embodiment of this application, the scene image rendering method can run on a local terminal device or a server. When the scene image rendering method runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0043] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of scene image rendering methods are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the information processing is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses game screen data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.

[0044] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.

[0045] In an optional implementation, this disclosure provides a scene image rendering method that provides a graphical user interface through a terminal device, wherein the terminal device may be the aforementioned local terminal device or a client device in the aforementioned cloud interaction system.

[0046] Among them, the object Occluder that plays the role of occlusion participates in the calculation of the visibility information of the potential occluded object Occludee, but does not need to record its visibility information, while the potential occluded object Occludee is the object whose visibility information needs to be recorded.

[0047] Existing occlusion culling schemes calculate the visibility information of virtual objects within the player's virtual camera's field of view in real time, and then render the scene based on the real-time calculated visibility information to obtain a real-time scene image.

[0048] However, as the scale and detail of in-app scenarios such as games and metaverses increase, the rendering pressure on electronic devices also increases. Real-time computing places high demands on the hardware of electronic devices, and the CPU, GPU and memory overhead of electronic devices are large, making them very unsuitable for mobile electronic devices.

[0049] Based on this, this application proposes to provide a scene image rendering method, apparatus, electronic device, and storage medium. It obtains a binary tree structure of multiple scene regions in a preset virtual scene. Multiple leaf nodes in the binary tree structure of each scene region correspond to multiple unit spaces within that scene region. Each leaf node records the visibility information of potentially occluded objects in the preset virtual scene relative to their corresponding unit spaces. Based on the target scene region and target unit space corresponding to the controlled virtual object in the preset virtual scene, the target visibility information recorded by the target leaf node is determined from the binary tree structure of the target scene region. This allows for the generation of a scene image from the perspective of the controlled virtual object based on the target visibility information. By obtaining a pre-calculated binary tree structure storing visibility information, on the one hand, the computational overhead of the electronic device can be reduced, lowering the hardware requirements and allowing the game or metaverse to reach more users. On the other hand, using a binary tree structure to store visibility information allows for the efficient retrieval of target visibility information using the binary search property of the binary tree structure, thereby improving the rendering efficiency of the scene image.

[0050] Before introducing the scene image rendering method, apparatus, electronic device and storage medium provided in this application, the application scenario of this application will be explained first.

[0051] Please refer to Figure 1 The above is a schematic diagram of an application scenario provided in the embodiments of this application, such as... Figure 1 As shown, the application scenario includes: client 10 and server 20. Client 10 can be a personal computer, tablet, smartphone, virtual reality (VR) terminal, etc., running a game application or cloud universe application. Server 20 can be a server, server cluster, or cloud computing platform. Server 20 can calculate the visibility information of potentially occluded objects for multiple scene regions in a preset virtual scene, generate a binary tree structure for each scene region, and send the binary tree structure of each scene region to client 10 so that client 10 can render scene images based on the visibility information stored in the binary tree structure when running the game application or cloud universe application.

[0052] The server 20 can use the binary tree structure of each scene area as a data packet, and send it to the client 10 as part of the application when the client 10 downloads the game application or cloud universe application. Alternatively, it can send it to the client 10 as incremental update content when the client 10 updates the game application or cloud universe application. There are no restrictions on this.

[0053] In an alternative implementation, the client 10 and the server 20 can be electronic devices.

[0054] The following describes possible implementations of the scene image rendering method, apparatus, electronic device, and storage medium provided in this application, with reference to specific embodiments.

[0055] Please refer to Figure 2 This is a flowchart illustrating the scene image rendering method provided in the embodiments of this application. Figure 1 ,like Figure 2 As shown, the method may include:

[0056] S101: Obtain the binary tree structure of multiple scene regions in the preset virtual scene.

[0057] In this context, the multiple leaf nodes in the binary tree structure of each scene region correspond to multiple unit spaces in each scene region; each leaf node records the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space.

[0058] The preset virtual scene is a virtual environment constructed in a game or metaverse. The preset virtual scene includes multiple virtual objects. When designing the preset virtual scene, the multiple virtual objects in the preset virtual scene are divided into occluder objects that play an occluding role and potential occluded objects that are occluded. The occluder objects that play an occluding role are used to occlude the potential occluded objects in the preset virtual scene and do not need to record their visibility information. The potential occluded objects that are occluded are virtual objects whose visibility information needs to be recorded.

[0059] In some embodiments, the occlusion property of an object as an occluder or a potential occluded object can be specified by the designer. Generally, larger objects are defined as occluders, and smaller objects are defined as potential occluded objects.

[0060] Based on the size of the preset virtual scene, the preset virtual scene is divided into multiple scene regions. Each scene region is further divided into multiple unit spaces. This division process generates a binary tree structure for each scene region. Each scene region's binary tree structure includes: a root node, at least one level of intermediate nodes, and multiple leaf nodes. The root node corresponds to the scene region; following the root node are two first-level intermediate nodes, corresponding to the two spaces that divide the scene region; each first-level intermediate node is followed by two intermediate-level intermediate nodes, corresponding to the two subspaces that divide each space; and the last intermediate-level intermediate node is followed by two leaf nodes, corresponding to the two unit spaces that divide each subspace. Multiple leaf nodes correspond to multiple unit spaces within the scene region. Nodes at the same level are sibling nodes, and the parent node of each node is its parent node.

[0061] For each unit space, the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space is calculated, and the visibility information is stored in the leaf node corresponding to the unit space in a binary tree structure. The visibility information includes whether the potentially occluded object is visible relative to the unit space. If the potentially occluded object is visible relative to the unit space, it needs to be rendered in the scene image; if the potentially occluded object is not visible relative to the unit space, it does not need to be rendered in the scene image.

[0062] The process of generating the binary tree structure of multiple scene regions in the preset virtual scene can be completed in advance on the server side. When the client runs the game application or metaverse application, it only needs to obtain and load the data corresponding to the binary tree structure of multiple scene regions from the server side.

[0063] It should be noted that, since the visibility information of potentially occluded objects within a unit space is used to indicate the visibility status of the player-controlled virtual object or the player's virtual avatar within that unit space, multiple scene areas within the preset virtual scene must be areas that the player-controlled virtual object or the player's virtual avatar can reach or walk on. Whether a scene area is reachable or walkable can be determined based on the presence of virtual objects within that area. For example, the preset virtual scene consists of numerous cells, each of which can contain virtual objects. When a virtual object is present in a cell, that cell is determined to be inaccessible or unwalkable; when no virtual object is present, that cell is determined to be reachable or walkable. Based on the presence or absence of virtual objects in a cell, indicator markers are generated for each cell. Based on these indicator markers, reachable or walkable areas within the preset virtual scene are determined. These reachable or walkable areas comprise multiple reachable or walkable cells and a three-dimensional spatial region within a preset range above them.

[0064] Based on the size of the preset virtual scene, the accessible or walkable area is divided into multiple scene areas, and the size of each scene area can be the same or different.

[0065] S102: Based on the position of the controlled virtual object in the preset virtual scene, determine the target scene area and target unit space corresponding to the position of the controlled virtual object.

[0066] In this embodiment, when the player controls the controlled virtual object or the player's virtual avatar to walk in the reachable or walkable area of ​​the preset virtual scene, the target scene area to which the cell where the controlled virtual object or the player's virtual avatar is located is determined based on the cell where the controlled virtual object or the player's virtual avatar is located in the preset virtual scene, and the regional position of the controlled virtual object or the player's virtual avatar within the target scene area is determined. The regional position of the controlled virtual object or the player's virtual avatar within the target scene area is used to indicate the target unit space where the controlled virtual object or the player's virtual avatar is located in the target scene area.

[0067] In the metaverse, the controlled virtual objects that players control can be the player's own virtual avatar.

[0068] A cell is formed by dividing a two-dimensional plane of a preset virtual scene into units. The cell corresponding to the position of the controlled virtual object or the player's virtual image in the preset virtual scene is determined. A unit space is formed by dividing a three-dimensional area of ​​the target scene into units. The target unit space corresponding to the area position is determined based on the area position of the controlled virtual object or the player's virtual image in the target scene area.

[0069] S103: Based on the target scene area and the target unit space, determine the target visibility information recorded in the target leaf node from the binary tree structure of the target scene area.

[0070] In this embodiment, the target leaf node corresponding to the target unit space is determined according to the unit space corresponding to each leaf node in the binary tree structure corresponding to the target scene area. The visibility information recorded in the target leaf node is used as the target visibility information. The target visibility information is the visibility state of each potentially occluded object Occludee to the controlled virtual object or the player's virtual object when the controlled virtual object or the player's virtual image is in the area position of the target scene area.

[0071] S104: Generate a scene image from the perspective corresponding to the controlled virtual object based on the target visibility information.

[0072] In this embodiment, based on the target visibility information, potential occluded objects in the preset virtual scene that are in a visible state and an invisible state are identified. The rendering of potential occluded objects in the invisible state is canceled in the preset virtual scene, and only potential occluded objects in the visible state and objects that play an occluding role are rendered, resulting in a re-rendered preset virtual scene.

[0073] The perspective of the controlled virtual object or the player's virtual avatar is actually the perspective of the virtual camera in the preset virtual scene. Based on the perspective of the controlled virtual object or the player's virtual avatar, the scene image of the corresponding perspective is obtained from the rendered preset virtual scene.

[0074] In an optional implementation, the visibility information is the visibility information of all virtual objects in the preset virtual scene relative to each unit space. Based on the target visibility information, all potentially occluded objects in the preset virtual scene that are in a visible state and an invisible state are determined. The rendering of all potentially occluded objects in the invisible state in the preset virtual scene is canceled, and only all potentially occluded objects in the visible state and all objects that play an occluding role are rendered, resulting in a re-rendered preset virtual scene.

[0075] In another optional implementation, since the virtual camera has a fixed shooting range in the preset virtual scene, in order to improve rendering efficiency, based on the target visibility information and the shooting range of the virtual camera, the rendering of potentially occluded objects that are invisible within the shooting range of the preset virtual scene can be cancelled, and only potentially occluded objects and objects that play an occluding role that are visible within the shooting range can be rendered; all virtual objects in the preset virtual scene outside the shooting range are not rendered.

[0076] It should be noted that the position and viewpoint of the virtual camera change according to the position and viewpoint of the controlled virtual object or the player's virtual avatar.

[0077] In an optional implementation, the rendering of virtual objects in a preset virtual scene is generally performed by the GPU in the electronic device. Therefore, the CPU can execute the above S101-S103. The CPU executes the above S101-S103 to obtain target visibility information, submits the target visibility information to the GPU, and the GPU executes the above S104 to generate a scene image with the corresponding viewpoint based on the target visibility information and the viewpoint of the controlled virtual object. The scene image is then displayed in the graphical user interface of the electronic device.

[0078] The scene image rendering method provided in the above embodiments, by obtaining a pre-calculated binary tree structure storing visibility information, can reduce the computational overhead of electronic devices and lower the hardware requirements of electronic devices, making the game or metaverse available to more users. On the other hand, by using a binary tree structure to store visibility information, the binary search characteristic of the binary tree structure can be utilized to retrieve the target visibility information with high query efficiency, thereby improving the rendering efficiency of scene images.

[0079] The following examples illustrate possible implementations of obtaining the binary tree structure for each scene region.

[0080] Please refer to Figure 3 This is a flowchart illustrating the scene image rendering method provided in the embodiments of this application. Figure 2 ,like Figure 3 As shown, the binary tree structure of each scene region is obtained in the following way:

[0081] S201: Perform multi-level spatial segmentation on each scene region to generate a binary tree structure corresponding to each scene region.

[0082] In this embodiment, each scene region in the virtual scene is preset to be a three-dimensional spatial region. Based on the volume of each scene region, the number of levels for spatial segmentation of each scene region is determined. Based on the number of levels for spatial segmentation of each scene region, each scene region is segmented into multiple levels of spatial segmentation. Each level divides the corresponding spatial region into two spatial regions of equal size, until the last level of segmentation results in multiple unit spaces. Based on the hierarchical relationship between the spatial regions at each level, a binary tree structure corresponding to each scene region is generated.

[0083] For example, each scene region corresponds to a root node. The scene region is divided into two first-level spatial regions, which correspond to two first-level parent nodes under the root node. The two first-level spatial regions are then divided into two second-level spatial regions, which correspond to two second-level intermediate nodes under a first-level intermediate node. This division continues until the final division is completed. The final division results in two unit spaces corresponding to each penultimate spatial region, which correspond to two leaf nodes under the penultimate intermediate node. This gives us the binary tree structure corresponding to each scene region.

[0084] S202: Calculate the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space, and record the visibility information in the leaf node corresponding to each unit space.

[0085] In this embodiment, for each unit space, the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space is calculated, and the visibility information is stored in the leaf node corresponding to the unit space in a binary tree structure. The visibility information includes whether the potentially occluded object is visible relative to the unit space. If the potentially occluded object is visible relative to the unit space, it needs to be displayed in the scene image; if the potentially occluded object is not visible relative to the unit space, it does not need to be displayed in the scene image.

[0086] The scene image rendering method provided in the above embodiments generates a binary tree structure corresponding to each scene region by performing multi-level spatial segmentation on each scene region, and records the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space in the leaf node of the unit space in the binary tree structure, so that the binary search characteristics of the binary tree structure can be used to query the target visibility information with high query efficiency, thereby improving the rendering efficiency of the scene image.

[0087] In one possible implementation, please refer to Figure 4 This is a flowchart illustrating the scene image rendering method provided in the embodiments of this application. Figure 3,like Figure 4 As shown, the process of performing multi-level spatial segmentation on each scene region and generating a binary tree structure corresponding to each scene region in S201 can include:

[0088] S301: Create multiple virtual 3D geometric models within a preset virtual scene. The area where each virtual 3D geometric model is located in the preset virtual scene corresponds to a scene area.

[0089] S302: Perform multi-level spatial segmentation on each virtual 3D geometric model to obtain multi-level space, where the last level of space is the unit space.

[0090] S303: Generate a binary tree structure corresponding to each scene region based on the multi-level space and the relationship between each level of space.

[0091] In this embodiment, based on the multiple scene regions divided into accessible or walkable areas of the preset virtual scene, a virtual three-dimensional geometric model is generated in each scene region. According to the number of levels of spatial segmentation of each scene region, the virtual three-dimensional geometric model corresponding to each scene region is spatially segmented at multiple levels. Each level divides the corresponding virtual three-dimensional geometric model into two virtual three-dimensional geometric models of equal size until the last level of segmentation results in multiple unit geometric models. Based on the hierarchical relationship between the models at each level, a binary tree structure corresponding to each scene region is generated.

[0092] For example, please refer to Figure 5 This is a schematic diagram of the segmentation of the virtual three-dimensional geometric model provided in the embodiments of this application, as shown below. Figure 5 As shown, the virtual 3D geometric model is generally a cuboid. Multi-level recursive segmentation is performed along the longest side of the cuboid. Virtual 3D geometric model 1 is segmented into virtual 3D geometric model 2 and virtual 3D geometric model 3 along its longest side. Virtual 3D geometric model 2 is segmented into virtual 3D geometric model 4 and virtual 3D geometric model 5 along its longest side. Virtual 3D geometric model 3 is segmented in the same way as virtual 3D geometric model 2 to obtain virtual 3D geometric model 6 and virtual 3D geometric model 7. Virtual 3D geometric model 4, virtual 3D geometric model 5, virtual 3D geometric model 6, and virtual 3D geometric model 7 are further segmented along their longest sides until the number of segmentation levels reaches the number of segmentation levels corresponding to each scene region.

[0093] Assuming there are two levels of segmentation, the first level segments the virtual 3D geometric model 1 into virtual 3D geometric model 2 and virtual 3D geometric model 3. The second level segments virtual 3D geometric model 2 into virtual 3D geometric model 4 and virtual 3D geometric model 5, and virtual 3D geometric model 3 into virtual 3D geometric model 6 and virtual 3D geometric model 7. The space enclosed by virtual 3D geometric models 4, 5, 6, and 7 is the unit space cell.

[0094] For example, please refer to Figure 6 The binary tree structure provided in the embodiments of this application is as follows: Figure 6 As shown, virtual 3D geometric model 1 corresponds to root node 1 in the binary tree structure, virtual 3D geometric model 2 and virtual 3D geometric model 3 correspond to intermediate nodes 2 and 3 in the binary tree structure, and virtual 3D geometric model 4, virtual 3D geometric model 5, virtual 3D geometric model 6 and virtual 3D geometric model 7 correspond to leaf nodes 4, 5, 6 and 7 in the binary tree structure.

[0095] The scene image rendering method provided in the above embodiments creates multiple virtual three-dimensional geometric models within a preset virtual scene. By performing multi-level segmentation on the virtual three-dimensional geometric models, a binary tree structure corresponding to each scene region is generated. The visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space is recorded in the leaf nodes of the unit space in the binary tree structure. This allows the binary search characteristic of the binary tree structure to be utilized to retrieve the target visibility information with high query efficiency, thereby improving the rendering efficiency of the scene image.

[0096] In one possible implementation, please refer to Figure 7 This is a flowchart illustrating the scene image rendering method provided in the embodiments of this application. Figure 4 ,like Figure 7 As shown, the process of performing multi-level spatial segmentation on each virtual 3D geometric model in step S302 to obtain multi-level space may include:

[0097] S401: Determine the unit space size of each scene area according to the preset segmentation standard.

[0098] S402: Based on the unit space size, perform multi-level spatial division on each virtual 3D geometric model until the size of the last level of space meets the unit space size, thus obtaining a multi-level space.

[0099] In this embodiment, a preset segmentation criterion is used to determine the stopping condition for segmenting the virtual 3D geometric model. The stopping condition can be the number of segmentation levels or the size of the last level of the virtual 3D geometric model, i.e., the size of the unit space. The preset segmentation criterion can be the number of potentially occluded objects included in the corresponding scene area, or the complexity of the occlusion relationship between the potentially occluded objects and the objects that perform the occlusion function in the corresponding scene area. In particular, the more potentially occluded objects there are, or the higher the complexity of the occlusion relationship between the potentially occluded objects and the objects that perform the occlusion function in the corresponding scene area, the more segmentation levels there are, or the smaller the size of the unit space.

[0100] In one optional implementation, the unit spatial size of each scene region is used as the stopping segmentation condition to perform multi-level spatial segmentation on the virtual three-dimensional geometric model corresponding to each scene region until the size of the sub-level virtual three-dimensional geometric model meets the unit spatial size, thus obtaining a multi-level virtual three-dimensional geometric model.

[0101] Specifically, the size of the virtual 3D geometric model at the child level can satisfy the requirement that the size of the virtual 3D geometric model at the child level is equal to the unit space size, or that the size of the virtual 3D geometric model at the previous level is greater than the unit space size, while the size of the virtual 3D geometric model at this level is less than the unit space size, with the space enclosed by the virtual 3D geometric model at this level serving as the unit space.

[0102] The scene image rendering method provided in the above embodiments determines the unit space size of each scene region according to a preset segmentation standard, performs multi-level spatial segmentation on each virtual three-dimensional geometric model according to the unit space size, until the size of the last level of space meets the unit space size, thus obtaining a multi-level space. By setting the unit space size for each scene region according to the preset segmentation standard, the unit space division of scene regions with a large number of objects or complex occlusion relationships can be more refined, while the unit space division of scene regions with a small number of objects or simple occlusion relationships can be relatively simple. This ensures that while reducing the number of unit spaces within the preset virtual scene region, the correctness of visibility calculation is not affected, thus guaranteeing the rendering effect of the scene image.

[0103] In one possible implementation, please refer to Figure 8 This is a flowchart illustrating the scene image rendering method provided in the embodiments of this application. Figure 5 ,like Figure 8 As shown, the process of calculating the visibility information of potentially occluded objects in a preset virtual scene relative to the corresponding unit space in step S202 can include:

[0104] S501: Obtain the target sampling points for each unit space.

[0105] In this embodiment, since the unit space is continuous, the computational amount of calculating the visibility information of each point in the unit space and the potentially occluded object is too large. Therefore, each unit space can be sampled to obtain the target sampling point of each unit space. The target sampling point can include multiple points.

[0106] The sampling methods include: mean sampling, random sampling, and low-difference sequence sampling.

[0107] S502: Generate multiple first emission rays starting from the target sampling point.

[0108] In this embodiment, starting from the target sampling point, multiple first emission rays are generated in multiple directions or multiple angles. The number of first emission rays can be set by the user or determined based on the number, complexity, density, etc. of potentially occluded objects in the preset virtual scene. The more potential occluded objects there are in the preset virtual scene, the higher the complexity and the greater the density, the more first emission rays there will be.

[0109] In some embodiments, rays with a uniform Earth-shaped distribution are emitted into a preset virtual scene, centered on the target sampling point.

[0110] S503: Based on multiple first emission rays, determine the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space.

[0111] In this embodiment, the visibility information of the potential occluded object relative to each unit space is determined by detecting whether multiple first emitted rays hit a potentially occluded object in a preset virtual scene.

[0112] In an optional implementation, the process of determining the visibility information of potentially occluded objects in a preset virtual scene relative to corresponding unit space based on multiple first emitted rays in step S503 may include:

[0113] If at least one of the multiple first emitted rays intersects with a potentially occluded object in a preset virtual scene, it is determined that the potentially occluded object is visible relative to the corresponding unit space.

[0114] Specifically, if the first emitted ray intersects with a potentially occluded object, it is determined that the first emitted ray has hit the potentially occluded object. If there is a first emitted ray that intersects with a potentially occluded object in a preset virtual scene, it is determined that the hit potentially occluded object is visible relative to that unit space.

[0115] For another optional real-time method, please refer to... Figure 9 This is a flowchart illustrating the scene image rendering method provided in the embodiments of this application. Figure 6 ,like Figure 9 As shown, the process of determining the visibility information of potentially occluded objects in a preset virtual scene relative to corresponding unit space based on multiple first emitted rays in step S503 may further include:

[0116] S601: If multiple first emitted rays do not intersect with potential occluded objects in the preset virtual scene, obtain multiple vertices of potential occluded objects in the preset virtual scene.

[0117] S602: Starting from the target sampling point, emit multiple second emission rays to multiple vertices.

[0118] S603: If at least one of the multiple second emission rays intersects at least one of the multiple vertices, it is determined that the potentially occluded object is visible relative to the corresponding unit space.

[0119] In this embodiment, if multiple first emission rays do not intersect with the potential occluded object, it is determined that the multiple first emission rays have not hit the potential occluded object. However, since the number of multiple first emission rays is limited, in order to ensure the accuracy of the judgment on the visibility of the potential occluded object, after multiple first emission rays have not hit the potential occluded object, multiple vertices of the potential occluded object in the preset virtual scene are obtained.

[0120] In this process, the potentially occluded object is composed of multiple triangular facets. By extracting the vertices of the triangular facets of the potentially occluded object, and using the extracted vertices as endpoints and the target sampling point as the starting point, multiple second emission rays are emitted in the directions of the multiple vertices according to the direction between the starting point and the multiple vertices. If at least one of the multiple second emission rays can reach at least one vertex of the potentially occluded object, it is determined that at least one second emission ray can hit the potentially occluded object. In this case, it can be determined that the potentially occluded object is still visible relative to the corresponding unit space.

[0121] If, after passing through S501-S503 and S601-S602, there are still potential occluded objects that have not been hit by the rays emitted from the target sampling point, then it is determined that the unhit potential occluded objects are invisible relative to the corresponding unit space.

[0122] The scene image rendering method provided in the above embodiments emits rays starting from sampling points in a unit space, and determines the visibility information of potential occluded objects relative to the unit space based on the intersection of the emitted rays with potential occluded objects, thereby realizing the visibility of potential occluded objects relative to each unit space, so as to realize the occlusion culling of invisible objects and improve rendering efficiency.

[0123] In one possible implementation, please refer to Figure 10 This is a flowchart illustrating the scene image rendering method provided in the embodiments of this application. Figure 7 ,like Figure 10 As shown, after recording visibility information in the leaf node corresponding to each unit space in S202, the method may further include:

[0124] S701: Based on the visibility information recorded in multiple leaf nodes in the binary tree structure, determine the leaf nodes to be pruned from the multiple leaf nodes, wherein the leaf nodes to be pruned are two leaf nodes that have the same parent node and record the same visibility information.

[0125] S702: Assign the visibility information recorded in the leaf node to be pruned to the parent node corresponding to the leaf node to be pruned, and delete the leaf node to be pruned to obtain the pruned binary tree structure.

[0126] Since the visibility information per unit space is recorded in the leaf nodes of the binary tree structure, when querying the target visibility information from the binary tree structure based on the target scene area and the target unit space, it is necessary to traverse to the leaf nodes of the binary tree structure in order to obtain the target visibility information.

[0127] To improve the efficiency of traversal queries, a pruning operation can be performed on the binary tree structure. The pruning operation involves deleting leaf nodes that meet preset conditions from the binary tree structure and recording the visibility information of the leaf node in the parent node one level above it, resulting in a pruned binary tree structure. When querying the visibility information of a target in the pruned binary tree structure, the target visibility information can be obtained by traversing to the parent node, reducing the number of traversal levels and improving the efficiency of traversal queries.

[0128] In an optional implementation, leaf nodes that meet the preset conditions are two leaf nodes that have the same parent node and record the same visibility information. That is, if the visibility information of a potentially occluded object in a preset virtual scene relative to the corresponding unit space is the same in two leaf nodes under a parent node, then the visibility state of the potentially occluded object seen by the controlled virtual object in the unit space corresponding to these two leaf nodes is the same. Therefore, the same visibility information recorded in these two leaf nodes can be recorded in the parent node corresponding to these two leaf nodes, and these two leaf nodes can be deleted from the binary tree structure to simplify the binary tree structure.

[0129] For example, such as Figure 6As shown, if the potentially occluded object Occludee1 is visible relative to cell4 and cell5 in the unit space, and the potentially occluded object Occludee2 is not visible relative to cell4 and cell5 in the unit space, then the visibility information recorded in leaf node 4 and leaf node 5 is the same. Therefore, leaf node 4 and leaf node 5 are deleted, and the same visibility information is recorded in the parent node 2 corresponding to leaf node 4 and leaf node 5.

[0130] Furthermore, after pruning the leaf nodes, the visibility information recorded in sibling nodes at the same level can be further judged. If the visibility information recorded in two sibling nodes at the same level and with the same parent node is the same, these two sibling nodes can be deleted, and the visibility information recorded in these two sibling nodes can be recorded in the parent node corresponding to these two sibling nodes. Through this operation, until the visibility information recorded in every pair of sibling nodes is different, the simplest binary tree structure is obtained.

[0131] For example, such as Figure 6 As shown, if the same visibility information in leaf node 4 and leaf node 5 is recorded in the corresponding parent node 2, and the same visibility information in leaf node 6 and leaf node 7 is recorded in the corresponding parent node 3, and the same visibility information in parent node 2 and parent node 3 is recorded in the parent node 1, then parent node 2 and parent node 3 are deleted.

[0132] It should be noted that, Figure 6 The binary tree structure shown is merely an exemplary binary tree structure and is not the only limiting structure of this application.

[0133] The scene image rendering method provided in the above embodiments determines the leaf nodes to be pruned from the multiple leaf nodes that have the same parent node and the same visibility information based on the visibility information recorded in multiple leaf nodes in the binary tree structure. The visibility information recorded in the leaf nodes to be pruned is assigned to the parent node corresponding to the leaf nodes to be pruned, and the leaf nodes to be pruned are deleted to obtain the pruned binary tree structure. This simplifies the binary tree structure, reduces the number of traversal levels, and improves the efficiency of traversal and query.

[0134] In one possible implementation, please refer to Figure 11 This is a flowchart illustrating the scene image rendering method provided in the embodiments of this application. Figure 8 ,like Figure 11 As shown, the process of recording visibility information in the leaf node corresponding to each unit space in S202 can include:

[0135] S801: Number the potentially occluded objects in the preset virtual scene.

[0136] S802: Based on the visibility information of potential occluded objects in the preset virtual scene relative to the corresponding unit space, and the number of the potential occluded objects, record the visibility information in the corresponding leaf node of each unit space.

[0137] In this embodiment, all potentially occluded objects in the preset virtual scene are sorted and numbered. A bitmap is used to record the visibility status of the potentially occluded objects in the preset virtual scene relative to the corresponding unit space. In the bitmap, a value of 1 for the i-th bit indicates that the i-th potentially occluded object is visible to the unit space, and a value of 0 for the i-th bit indicates that the i-th potentially occluded object is not visible to the unit space. That is, the visibility information of each potentially occluded object is recorded by only one bit. Thus, the total data capacity in bytes occupied by the visibility information of all scene areas in the preset virtual scene is the number of unit spaces multiplied by the number of potentially occluded objects and then divided by 8.

[0138] The scene image rendering method provided in the above embodiments records visibility information in the leaf node corresponding to each unit space based on the visibility information of potential occluded objects in the preset virtual scene relative to the corresponding unit space, and the number of the potential occluded objects. This reduces the memory occupied by the visibility information, optimizes the consumption of space resources, and improves the benefits of pre-computed visibility information for the occlusion culling scheme.

[0139] In one possible implementation, before calculating the visibility information of potentially occluded objects relative to corresponding unit space in the preset virtual scene in step S202 above, the method may further include:

[0140] Merge at least two potentially occluded objects in a preset virtual scene that meet the preset merging criteria into one potentially occluded object.

[0141] In this embodiment, the preset merging criterion is used to indicate that at least two potentially occluded objects that are independent of each other are merged into one potentially occluded object. Since there are a large number of potentially occluded objects in the preset virtual scene, in order to further reduce the memory occupation of visibility information on electronic devices, at least two potentially occluded objects in the preset virtual scene that meet the preset merging criterion can be merged into one potentially occluded object. After merging at least two potentially occluded objects into one potentially occluded object, the visibility state of this one potentially occluded object relative to the unit space is the visibility state of the corresponding at least two potentially occluded objects.

[0142] In an optional implementation, the preset merging criteria may be: at least two potentially occluded objects within a preset range; or, at least two potentially occluded objects within a preset range whose volume is smaller than a preset volume; or, multiple partially occluded objects that can constitute a potentially occluded object, such as the lamp frame, tassel, and handle that constitute a lantern.

[0143] In some embodiments, potential occluded objects are divided into two categories based on the mesh that constitutes them: one category consists of a single object with only one mesh; the other category consists of multiple objects forming a whole with multiple meshes. Since the mesh is the basic unit for ray detection and visibility calculation, the mesh and potential occluded objects can be mapped one by one.

[0144] For a potentially occluded object that consists of multiple objects forming a whole and has multiple meshes, all of its meshes can be merged to generate an equivalent potentially occluded object with one mesh. Visibility calculation is performed using this equivalent potentially occluded object, and the visibility information of this equivalent potentially occluded object is recorded in the bitmap. During rendering, the visibility state of the equivalent potentially occluded object can be used to backmap back to the visibility state of the original multiple potentially occluded objects.

[0145] For example, please refer to Figure 12 This is a schematic diagram of mesh merging for potentially occluded objects provided in an embodiment of this application, such as... Figure 12 As shown, merging meshes can reduce the number of potential occluded objects corresponding to meshes in the scene, thereby reducing the computational cost of visibility calculations and the additional space required.

[0146] Please refer to Figure 13 This is a hierarchy diagram of potentially occluded objects provided in the embodiments of this application, such as... Figure 13 As shown, for the potential occluded object yt_build_huge_49_t04(1), which is composed of yt_build_huge_49_t04a-yt_build_huge_49_t04g, by merging, we can obtain a potential occluded object Clone_yt_build_huge_49_t04(1) with only one mesh.

[0147] The scene image rendering method provided in the above embodiments can reduce the amount of computation required to calculate the visibility of potential occluded objects by merging at least two potentially occluded objects that meet the preset merging conditions into one potentially occluded object. On the other hand, it can reduce the memory usage of visibility information on electronic devices.

[0148] In one possible implementation, please refer to Figure 14 This is a flowchart illustrating the scene image rendering method provided in the embodiments of this application. Figure 9 ,like Figure 14 As shown, the process of determining the target visibility information recorded in the leaf nodes of the target scene region from the binary tree structure of the target scene region based on the target scene region and the target unit space can include:

[0149] S901: Determine the binary tree structure of the target scene area based on the correspondence between multiple scene areas and binary tree structures.

[0150] S902: Based on the correspondence between multiple leaf nodes in the binary tree structure of the target scene region and multiple unit spaces in the target scene region, determine the target leaf node corresponding to the target unit space.

[0151] S903: Obtain the target visibility information recorded in the target leaf node.

[0152] In this embodiment, based on the correspondence between multiple scene regions and binary tree structures, the binary tree structure corresponding to the target scene region is determined. Based on the regional position of the controlled virtual object or the player's virtual image within the target scene region, the target space to which the regional position belongs, the target subspace under the target space, and the target unit space under the target subspace are determined sequentially. This allows the binary tree structure of the target scene region to sequentially determine the first-level intermediate node corresponding to the target space, the second-level intermediate node corresponding to the target subspace under the first-level intermediate node, and the target leaf node corresponding to the target unit space under the second-level intermediate node through binary search. This enables the target visibility information of potentially occluded objects in the preset virtual scene relative to the target unit space to be read from the target leaf node.

[0153] The scene image rendering method provided in the above embodiments determines the target leaf node corresponding to the target unit space based on the correspondence between the scene region and the binary tree structure, as well as the correspondence between the leaf node and the unit space, so as to read the target visibility information recorded in the target leaf node and store the visibility information in the form of a binary tree result. This can realize the rapid lookup of visibility information and improve the efficiency of scene image rendering.

[0154] Based on the above method embodiments, this application also provides a scene image rendering apparatus. Please refer to... Figure 15 This is a schematic diagram of the scene image rendering apparatus provided in the embodiments of this application, as shown below. Figure 15 As shown, the device may include:

[0155] Binary tree acquisition module 101 is used to acquire the binary tree structure of multiple scene regions in a preset virtual scene. The multiple leaf nodes in the binary tree structure of each scene region correspond to multiple unit spaces in each scene region. Each leaf node records the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space.

[0156] The location determination module 102 is used to determine the target scene area and target unit space corresponding to the location of the controlled virtual object in the preset virtual scene based on the location of the controlled virtual object.

[0157] The visibility information determination module 103 is used to determine the target visibility information recorded in the leaf nodes of the target scene area from the binary tree structure of the target scene area based on the target scene area and the target unit space.

[0158] The scene image generation module 104 is used to generate scene images from the perspective of the controlled virtual object based on the target visibility information.

[0159] In one possible implementation, the binary tree structure for each scene region is a binary tree structure obtained using the following apparatus:

[0160] The spatial segmentation module is used to perform multi-level spatial segmentation on each scene region and generate a binary tree structure corresponding to each scene region.

[0161] The visibility calculation module is used to calculate the visibility information of potentially occluded objects in a preset virtual scene relative to the corresponding unit space, and record the visibility information in the leaf node corresponding to each unit space.

[0162] In one possible implementation, the spatial partitioning module includes:

[0163] The geometric model creation unit is used to create multiple virtual 3D geometric models within a preset virtual scene. The area where each virtual 3D geometric model is located in the preset virtual scene corresponds to a scene area.

[0164] Spatial segmentation unit is used to perform multi-level spatial segmentation on each virtual 3D geometric model to obtain multi-level space, where the last level of space is a unit space;

[0165] The binary tree generation unit is used to generate a binary tree structure corresponding to each scene region based on the multi-level space and the relationship between each level of space.

[0166] In one possible implementation, the spatial segmentation unit is specifically used to determine the unit spatial size of each scene region according to a preset segmentation standard; based on the unit spatial size, each virtual 3D geometric model is segmented into multiple levels of space until the size of the last level of space meets the unit spatial size, thus obtaining a multi-level space.

[0167] In one possible implementation, the visibility calculation module is specifically used to acquire the target sampling point for each unit space; generate multiple first emission rays starting from the target sampling point; and generate multiple first emission rays starting from the target sampling point.

[0168] In one possible implementation, the visibility calculation module is specifically used to determine that if at least one of the plurality of first emitted rays intersects with a potentially occluded object in a preset virtual scene, the potentially occluded object is visible relative to the corresponding unit space.

[0169] In one possible implementation, the visibility calculation module is further configured to: if multiple first emission rays do not intersect with a potentially occluded object in a preset virtual scene, obtain multiple vertices of the potentially occluded object in the preset virtual scene; emit multiple second emission rays from the target sampling point to the multiple vertices; and determine that the potentially occluded object is visible relative to the corresponding unit space if at least one of the multiple second emission rays intersects with at least one of the multiple vertices.

[0170] In one possible implementation, the device may further include:

[0171] The pruning node determination module is used to determine the leaf node to be pruned from multiple leaf nodes based on the visibility information recorded in multiple leaf nodes in the binary tree structure. The leaf nodes to be pruned are two leaf nodes that have the same parent node and have the same recorded visibility information.

[0172] The binary tree pruning module is also used to assign the visibility information recorded in the leaf node to be pruned to the parent node corresponding to the leaf node to be pruned, and delete the leaf node to be pruned to obtain the pruned binary tree structure.

[0173] In one possible implementation, the visibility calculation module is further used to number potential occluded objects in the preset virtual scene; based on the visibility information of the potential occluded objects in the preset virtual scene relative to the corresponding unit space, and the number of the potential occluded objects, the visibility information is recorded in the corresponding leaf node of each unit space.

[0174] In one possible implementation, the device may further include:

[0175] The object merging module is used to merge at least two potentially occluded objects in a preset virtual scene that meet the preset merging criteria into one potentially occluded object.

[0176] In one possible implementation, the visibility information determination module 103 is specifically used to determine the binary tree structure of the target scene area based on the correspondence between multiple scene areas and binary tree structures; determine the target leaf node corresponding to the target unit space based on the correspondence between multiple leaf nodes in the binary tree structure of the target scene area and multiple unit spaces in the target scene area; and obtain the target visibility information recorded in the target leaf node.

[0177] The scene image rendering apparatus provided in the above embodiments, by acquiring a pre-calculated binary tree structure storing visibility information, can reduce the computational overhead of electronic devices and lower the hardware requirements of electronic devices, making the game or metaverse available to more users. On the other hand, by using a binary tree structure to store visibility information, the binary search characteristic of the binary tree structure can be utilized to retrieve the target visibility information with high query efficiency, thereby improving the rendering efficiency of scene images.

[0178] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.

[0179] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).

[0180] Please refer to Figure 16 This is a schematic diagram of the electronic device provided in the embodiments of this application, such as... Figure 16 As shown, the electronic device 200 includes a processor 201, a storage medium 202, and a bus. The storage medium 202 stores program instructions that can be executed by the processor 201. When the electronic device 200 is running, the processor 201 communicates with the storage medium 202 through the bus, and the processor 201 executes the program instructions to perform the above-mentioned scene image rendering method.

[0181] Specifically, the steps by which the processor executes the above scene image rendering method include:

[0182] Obtain the binary tree structure of multiple scene regions in the preset virtual scene; determine the target scene region and target unit space corresponding to the position of the controlled virtual object in the preset virtual scene; determine the target visibility information recorded by the target leaf node from the binary tree structure of the target scene region based on the target scene region and the target unit space; generate the scene image of the corresponding view of the controlled virtual object based on the target visibility information.

[0183] In one possible implementation, the binary tree structure for each scene region is the binary tree structure obtained by the processor performing the following steps:

[0184] Each scene region is spatially segmented at multiple levels to generate a binary tree structure corresponding to each scene region; the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space is calculated, and the visibility information is recorded in the leaf node corresponding to each unit space.

[0185] In one possible implementation, the processor performing the above process of multi-level spatial segmentation of each scene region to generate a binary tree structure corresponding to each scene region may include:

[0186] Multiple virtual 3D geometric models are created within a preset virtual scene. The area where each virtual 3D geometric model is located in the preset virtual scene corresponds to a scene region. Each virtual 3D geometric model is divided into multiple levels of space to obtain multiple levels of space, where the last level of space is the unit space. Based on the multiple levels of space and the relationship between each level of space, a binary tree structure corresponding to each scene region is generated.

[0187] In one possible implementation, the processor performing the above-described process of multi-level spatial segmentation for each virtual 3D geometric model to obtain a multi-level space may include:

[0188] Based on the preset segmentation criteria, the unit spatial size of each scene region is determined; based on the unit spatial size, each virtual 3D geometric model is segmented into multiple levels of space until the size of the last level of space meets the unit spatial size, thus obtaining a multi-level space.

[0189] In one possible implementation, the process by which the processor performs the above-described calculation of the visibility information of potentially occluded objects in a preset virtual scene relative to the corresponding unit space may include:

[0190] Obtain the target sampling point for each unit space; generate multiple first emission rays starting from the target sampling point; determine the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space based on the multiple first emission rays.

[0191] In one possible implementation, the processor's process of determining the visibility information of potentially occluded objects in a preset virtual scene relative to corresponding unit space based on multiple first emitted rays may include:

[0192] If at least one of the multiple first emitted rays intersects with a potentially occluded object in a preset virtual scene, it is determined that the potentially occluded object is visible relative to the corresponding unit space.

[0193] In one possible implementation, the process by which the processor determines the visibility information of potentially occluded objects in a preset virtual scene relative to corresponding unit space based on multiple first emitted rays may further include:

[0194] If multiple first emission rays do not intersect with potential occluded objects in the preset virtual scene, obtain multiple vertices of potential occluded objects in the preset virtual scene; starting from the target sampling point, emit multiple second emission rays to multiple vertices; if at least one of the multiple second emission rays intersects with at least one of the multiple vertices, determine that the potential occluded object is visible relative to the corresponding unit space.

[0195] In one possible implementation, after the processor performs the above-described process of recording visibility information in the leaf nodes corresponding to each unit space, the steps of the scene image rendering method executed by the processor may further include:

[0196] Based on the visibility information recorded in multiple leaf nodes in the binary tree structure, the leaf nodes to be pruned are determined from the multiple leaf nodes. The leaf nodes to be pruned are two leaf nodes that have the same parent node and record the same visibility information. The visibility information recorded in the leaf nodes to be pruned is assigned to the parent node corresponding to the leaf node to be pruned, and the leaf nodes to be pruned are deleted to obtain the pruned binary tree structure.

[0197] In one possible implementation, the processor performing the process of recording visibility information in the leaf nodes corresponding to each unit space may include:

[0198] Number the potential occluded objects in the preset virtual scene; based on the visibility information of the potential occluded objects in the preset virtual scene relative to the corresponding unit space, and the number of the potential occluded objects, record the visibility information in the corresponding leaf node of each unit space.

[0199] In one possible implementation, before the processor performs the above-described calculation of the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space, the steps of the scene image rendering method executed by the processor may further include:

[0200] Merge at least two potentially occluded objects in a preset virtual scene that meet the preset merging criteria into one potentially occluded object.

[0201] In one possible implementation, the processor's execution of the process of determining the target visibility information recorded in the target leaf nodes from the binary tree structure of the target scene region based on the target scene region and the target unit space may include:

[0202] Based on the correspondence between multiple scene regions and binary tree structures, determine the binary tree structure of the target scene region; based on the correspondence between multiple leaf nodes in the binary tree structure of the target scene region and multiple unit spaces in the target scene region, determine the target leaf node corresponding to the target unit space; obtain the target visibility information recorded in the target leaf node.

[0203] The scene image rendering method executed by the processor in the above embodiment can reduce the computational overhead of electronic devices and lower the hardware requirements of electronic devices by obtaining a pre-calculated binary tree structure that stores visibility information, thus making the game or metaverse available to more users. On the other hand, by using a binary tree structure to store visibility information, the binary search characteristic of the binary tree structure can be utilized to find the target visibility information with high query efficiency, thereby improving the rendering efficiency of scene images.

[0204] Optionally, embodiments of this application also provide a computer-readable storage medium storing a computer program, which is executed by a processor to perform the above-described scene image rendering method.

[0205] Specifically, the steps by which the processor executes the above scene image rendering method include:

[0206] Obtain the binary tree structure of multiple scene regions in the preset virtual scene; determine the target scene region and target unit space corresponding to the position of the controlled virtual object in the preset virtual scene; determine the target scene region and target unit space corresponding to the position of the controlled virtual object based on the target scene region and the position of the controlled virtual object in the preset virtual scene, and determine the target visibility information recorded in the target leaf node from the binary tree structure of the target scene region; generate a scene image from the perspective corresponding to the controlled virtual object based on the target visibility information.

[0207] In one possible implementation, the binary tree structure for each scene region is the binary tree structure obtained by the processor performing the following steps:

[0208] Each scene region is spatially segmented at multiple levels to generate a binary tree structure corresponding to each scene region; the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space is calculated, and the visibility information is recorded in the leaf node corresponding to each unit space.

[0209] In one possible implementation, the processor performing the above process of multi-level spatial segmentation of each scene region to generate a binary tree structure corresponding to each scene region may include:

[0210] Multiple virtual 3D geometric models are created within a preset virtual scene. The area where each virtual 3D geometric model is located in the preset virtual scene corresponds to a scene region. Each virtual 3D geometric model is divided into multiple levels of space to obtain multiple levels of space, where the last level of space is the unit space. Based on the multiple levels of space and the relationship between each level of space, a binary tree structure corresponding to each scene region is generated.

[0211] In one possible implementation, the processor performing the above-described process of multi-level spatial segmentation for each virtual 3D geometric model to obtain a multi-level space may include:

[0212] Based on the preset segmentation criteria, the unit spatial size of each scene region is determined; based on the unit spatial size, each virtual 3D geometric model is segmented into multiple levels of space until the size of the last level of space meets the unit spatial size, thus obtaining a multi-level space.

[0213] In one possible implementation, the process by which the processor performs the above-described calculation of the visibility information of potentially occluded objects in a preset virtual scene relative to the corresponding unit space may include:

[0214] Obtain the target sampling point for each unit space; generate multiple first emission rays starting from the target sampling point; determine the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space based on the multiple first emission rays.

[0215] In one possible implementation, the processor's process of determining the visibility information of potentially occluded objects in a preset virtual scene relative to corresponding unit space based on multiple first emitted rays may include:

[0216] If at least one of the multiple first emitted rays intersects with a potentially occluded object in a preset virtual scene, it is determined that the potentially occluded object is visible relative to the corresponding unit space.

[0217] In one possible implementation, the process by which the processor determines the visibility information of potentially occluded objects in a preset virtual scene relative to corresponding unit space based on multiple first emitted rays may further include:

[0218] If multiple first emission rays do not intersect with potential occluded objects in the preset virtual scene, obtain multiple vertices of potential occluded objects in the preset virtual scene; starting from the target sampling point, emit multiple second emission rays to multiple vertices; if at least one of the multiple second emission rays intersects with at least one of the multiple vertices, determine that the potential occluded object is visible relative to the corresponding unit space.

[0219] In one possible implementation, after the processor performs the above-described process of recording visibility information in the leaf nodes corresponding to each unit space, the steps of the scene image rendering method executed by the processor may further include:

[0220] Based on the visibility information recorded in multiple leaf nodes in the binary tree structure, the leaf nodes to be pruned are determined from the multiple leaf nodes. The leaf nodes to be pruned are two leaf nodes that have the same parent node and record the same visibility information. The visibility information recorded in the leaf nodes to be pruned is assigned to the parent node corresponding to the leaf node to be pruned, and the leaf nodes to be pruned are deleted to obtain the pruned binary tree structure.

[0221] In one possible implementation, the processor performing the process of recording visibility information in the leaf nodes corresponding to each unit space may include:

[0222] Number the potential occluded objects in the preset virtual scene; based on the visibility information of the potential occluded objects in the preset virtual scene relative to the corresponding unit space, and the number of the potential occluded objects, record the visibility information in the corresponding leaf node of each unit space.

[0223] In one possible implementation, before the processor performs the above-described calculation of the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space, the steps of the scene image rendering method executed by the processor may further include:

[0224] Merge at least two potentially occluded objects in a preset virtual scene that meet the preset merging criteria into one potentially occluded object.

[0225] In one possible implementation, the processor's execution of the process of determining the target visibility information recorded in the target leaf nodes from the binary tree structure of the target scene region based on the target scene region and the target unit space may include:

[0226] Based on the correspondence between multiple scene regions and binary tree structures, determine the binary tree structure of the target scene region; based on the correspondence between multiple leaf nodes in the binary tree structure of the target scene region and multiple unit spaces in the target scene region, determine the target leaf node corresponding to the target unit space; obtain the target visibility information recorded in the target leaf node.

[0227] The scene image rendering method executed by the processor in the above embodiment can reduce the computational overhead of electronic devices and lower the hardware requirements of electronic devices by obtaining a pre-calculated binary tree structure that stores visibility information, thus making the game or metaverse available to more users. On the other hand, by using a binary tree structure to store visibility information, the binary search characteristic of the binary tree structure can be utilized to find the target visibility information with high query efficiency, thereby improving the rendering efficiency of scene images.

[0228] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0229] The units described as separate components may or may not be physically separate. 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 units can be selected to achieve the purpose of this embodiment according to actual needs.

[0230] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0231] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0232] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for rendering scene images, characterized in that, The method includes: Obtain the binary tree structure of multiple scene regions in a preset virtual scene, wherein multiple leaf nodes in the binary tree structure of each scene region correspond to multiple unit spaces in each scene region; each leaf node records the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space; Based on the position of the controlled virtual object in the preset virtual scene, determine the target scene area and target unit space corresponding to the position of the controlled virtual object; Based on the target scene region and the target unit space, determine the target visibility information recorded in the target leaf nodes from the binary tree structure of the target scene region; Based on the target visibility information, a scene image corresponding to the viewpoint of the controlled virtual object is generated; The visibility information recorded in each leaf node is obtained using the following method: Obtain the target sampling points for each unit space; Multiple first emission rays are generated starting from the target sampling point; Based on the multiple first emission rays, the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space is determined, and the visibility information is recorded in the leaf node corresponding to each unit space.

2. The method as described in claim 1, characterized in that, The binary tree structure of each scene region is obtained in the following manner: Each scene region is spatially segmented at multiple levels to generate a binary tree structure corresponding to each scene region.

3. The method as described in claim 2, characterized in that, The step of performing multi-level spatial segmentation on each scene region to generate a binary tree structure corresponding to each scene region includes: Multiple virtual 3D geometric models are created within the preset virtual scene, and the area where each virtual 3D geometric model is located in the preset virtual scene corresponds to a scene area. Each virtual 3D geometric model is divided into multiple levels of space to obtain a multi-level space, wherein the last level of space is a unit space; Based on the multi-level space and the relationships between each level of space, a binary tree structure corresponding to each scene region is generated.

4. The method as described in claim 3, characterized in that, The process of performing multi-level spatial segmentation on each virtual 3D geometric model to obtain a multi-level space includes: The unit space size of each scene region is determined according to the preset segmentation criteria; Based on the unit space size, each virtual three-dimensional geometric model is divided into multiple levels of space until the size of the last level of space meets the unit space size, thus obtaining the multi-level space.

5. The method as described in claim 1, characterized in that, The step of determining the visibility information of potentially occluded objects in the preset virtual scene relative to corresponding unit space based on the plurality of first emitted rays includes: If at least one of the plurality of first emitted rays intersects with a potentially occluded object in the preset virtual scene, it is determined that the potentially occluded object is visible relative to the corresponding unit space.

6. The method as described in claim 5, characterized in that, The step of determining the visibility information of potentially occluded objects in the preset virtual scene relative to corresponding unit space based on the plurality of first emitted rays further includes: If none of the multiple first emitted rays intersect with the potentially occluded object in the preset virtual scene, obtain multiple vertices of the potentially occluded object in the preset virtual scene; Starting from the target sampling point, multiple second emission rays are emitted toward the multiple vertices; If at least one of the plurality of second emission rays intersects at least one of the plurality of vertices, it is determined that the potentially occluded object is visible relative to the corresponding unit space.

7. The method as described in claim 1, characterized in that, After recording the visibility information in the leaf node corresponding to each unit space, the method further includes: Based on the visibility information recorded in multiple leaf nodes in the binary tree structure, leaf nodes to be pruned are determined from the multiple leaf nodes, wherein the leaf nodes to be pruned are two leaf nodes that have the same parent node and have the same recorded visibility information. The visibility information recorded in the leaf node to be pruned is assigned to the parent node corresponding to the leaf node to be pruned, and the leaf node to be pruned is deleted to obtain the pruned binary tree structure.

8. The method as described in claim 1, characterized in that, Recording the visibility information in the leaf node corresponding to each unit space includes: Number the potentially occluded objects in the preset virtual scene; Based on the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space, and the number of the potentially occluded objects, the visibility information is recorded in the leaf node corresponding to each unit space.

9. The method as described in claim 1, characterized in that, Before determining the visibility information of potentially occluded objects in the preset virtual scene relative to corresponding unit space based on the plurality of first emitted rays, the method further includes: Merge at least two potentially occluded objects within the preset virtual scene that meet the preset merging criteria into one potentially occluded object.

10. The method as described in claim 1, characterized in that, The step of determining the target visibility information recorded in the target leaf nodes from the binary tree structure of the target scene region based on the target scene region and the target unit space includes: Based on the correspondence between the multiple scene regions and the binary tree structure, the binary tree structure of the target scene region is determined; Based on the correspondence between multiple leaf nodes in the binary tree structure of the target scene region and multiple unit spaces in the target scene region, determine the target leaf node corresponding to the target unit space; Obtain the target visibility information recorded in the target leaf node.

11. A scene image rendering apparatus, characterized in that, The device includes: The binary tree acquisition module is used to acquire the binary tree structure of multiple scene regions in a preset virtual scene. The multiple leaf nodes in the binary tree structure of each scene region correspond to multiple unit spaces in each scene region. Each leaf node records the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space. The location determination module is used to determine the target scene area and target unit space corresponding to the location of the controlled virtual object in the preset virtual scene; The visibility information determination module is used to determine the target visibility information recorded in the target leaf node from the binary tree structure of the target scene area based on the target scene area and the target unit space. The scene image generation module is used to generate a scene image from the perspective corresponding to the controlled virtual object based on the target visibility information; The device further includes: The visibility calculation module is used to acquire target sampling points in each unit space; generate multiple first emission rays starting from the target sampling points; determine the visibility information of potentially occluded objects in the preset virtual scene relative to the corresponding unit space based on the multiple first emission rays, and record the visibility information in the leaf node corresponding to each unit space.

12. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores program instructions executed by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the scene image rendering method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, performs the steps of the scene image rendering method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Method for processing cosmically complex three-dimensional scene based on eight-fork tree

    CN101281654A

  • A voxel terrain management method

    CN109712227A