Scene image rendering method and device, electronic equipment and storage medium

Through pre-computing and binary tree structure storage methods, the problem of high hardware requirements for real-time rendering of large-scale scenarios in the prior art is solved, and lower computing overhead and higher rendering efficiency are achieved.

CN119888058AActive Publication Date: 2025-04-25NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art deals with large-scale, detailed game or metacosmic scenarios, the hardware requirements for real-time computing are high, resulting in increased rendering pressure on electronic devices, especially inappropriate on mobile devices.

Method used

By precalculating the visibility information of the virtual object, a binary tree structure is generated. The leaf nodes of each scene area record the visibility information of potentially obscured objects, query the target visibility information based on the position of the controlled virtual object, and generate scene images of the corresponding perspective.

Benefits of technology

It reduces the real-time computing overhead of electronic devices and reduces the hardware requirements, so that games or metaverses can be targeted at more users, and improves the rendering efficiency of scene images through the binary search characteristics of binary tree structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888058A_ABST
    Figure CN119888058A_ABST
Patent Text Reader

Abstract

The invention provides a scene image rendering method and device, electronic equipment and a storage medium, and relates to the technical field of image processing. The method comprises the following steps: obtaining binary tree structures of a plurality of scene areas in a preset virtual scene, wherein a plurality of leaf nodes in the binary tree structure of each scene area correspond to a plurality of unit spaces in each scene area; the leaf node records visibility information of a potential shielded object relative to a unit space in the preset virtual scene; according to the position of the controlled virtual object in the preset virtual scene, determining a corresponding target scene area and a target unit space; determining target visibility information recorded by the target leaf node from a binary tree structure of the target scene area according to the target scene area and the target unit space; and according to the target visibility information, generating a scene image of a visual angle corresponding to the controlled virtual object. According to the method and the device, scene image rendering can be realized through the pre-calculated visibility information of the virtual object, and the real-time calculation overhead of the electronic equipment is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a scene image rendering method, device, electronic device and storage medium. Background Art

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

[0003] The existing occlusion culling solution calculates the visibility information of virtual objects within the field of view of the player's virtual camera in real time, so as to render the scene image according to the visibility information calculated in real time to obtain a real-time scene image.

[0004] However, as the scale of scenes in applications such as games and the metaverse becomes larger and the details become richer, the rendering pressure of electronic devices also increases. Real-time computing has high hardware requirements for electronic devices, and the overhead of the central processing unit (CPU), graphics processing unit (GPU) and memory of electronic devices is large, which is not suitable for mobile electronic devices. Summary of the invention

[0005] The purpose of the present invention is to provide a scene image rendering method, device, electronic device and storage medium to address the deficiencies in the above-mentioned prior art, so as to realize 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 purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0007] In a first aspect, an embodiment of the present application provides a scene image rendering method, the method comprising:

[0008] Obtain a binary tree structure of multiple scene areas in a preset virtual scene, wherein multiple leaf nodes in the binary tree structure of each scene area respectively correspond to multiple unit spaces in each scene area; each leaf node records: visibility information of a potentially obscured object in the preset virtual scene relative to a corresponding unit space;

[0009] Determining, according to the position of the controlled virtual object in the preset virtual scene, a target scene area and a target unit space corresponding to the position of the controlled virtual object;

[0010] Determining target visibility information recorded by a target leaf node from a binary tree structure of the target scene area according to the target scene area and the target unit space;

[0011] A scene image corresponding to the viewing angle of the controlled virtual object is generated according to the target visibility information.

[0012] In a second aspect, an embodiment of the present application further provides a scene image rendering device, the device comprising:

[0013] A binary tree acquisition module is used to acquire a binary tree structure of multiple scene areas in a preset virtual scene, wherein multiple leaf nodes in the binary tree structure of each scene area respectively correspond to multiple unit spaces in each scene area; each leaf node records: visibility information of a potential obscured object in the preset virtual scene relative to a corresponding unit space;

[0014] A position determination module, used to determine a target scene area and a target unit space corresponding to the position of the controlled virtual object according to the position of the controlled virtual object in the preset virtual scene;

[0015] A visibility information determination module, configured to determine target visibility information recorded by a target leaf node from a binary tree structure of the target scene area according to the target scene area and the target unit space;

[0016] A scene image generation module is used to generate a scene image corresponding to the viewing angle of the controlled virtual object according to the target visibility information.

[0017] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: 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 one of the first aspects.

[0018] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the scene image rendering method as described in any one of the first aspects are executed.

[0019] The beneficial effects of this application are:

[0020] The scene image rendering method, device, electronic device and storage medium to be provided by the present application obtain a binary tree structure of multiple scene areas in a preset virtual scene, and multiple leaf nodes in the binary tree structure of each scene area correspond to multiple unit spaces in each scene area respectively; each leaf node records: visibility information of potential obscured objects in the preset virtual scene relative to the corresponding unit space, based on the target scene area 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 area, so as to generate a scene image of the corresponding perspective of the controlled virtual object according to 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, and the hardware requirements for the electronic device can be reduced, so that the game or metaverse can be oriented to more users; on the other hand, by using a binary tree structure to store visibility information, the binary search characteristics of the binary tree structure can be used to query the target visibility information with higher query efficiency, thereby improving the rendering efficiency of the scene image. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application;

[0023] Figure 2 Schematic diagram of the process of scene image rendering method provided in the embodiment of the present application Figure 1 ;

[0024] Figure 3 Schematic diagram of the process of scene image rendering method provided in the embodiment of the present application Figure 2 ;

[0025] Figure 4 Schematic diagram of the process of scene image rendering method provided in the embodiment of the present application Figure 3 ;

[0026] Figure 5 A schematic diagram of segmenting a virtual three-dimensional geometric model provided in an embodiment of the present application;

[0027] Figure 6 A binary tree structure provided in an embodiment of the present application;

[0028] Figure 7Schematic diagram of the process of scene image rendering method provided in the embodiment of the present application Figure 4 ;

[0029] Figure 8 Schematic diagram of the process of scene image rendering method provided in the embodiment of the present application Figure 5 ;

[0030] Fig. 9 Schematic diagram of the process of scene image rendering method provided in the embodiment of the present application Figure 6 ;

[0031] Fig.10 Schematic diagram of the process of scene image rendering method provided in the embodiment of the present application Figure 7 ;

[0032] Fig.11 Schematic diagram of the process of scene image rendering method provided in the embodiment of the present application Figure 8 ;

[0033] Fig.12 A schematic diagram of mesh merging of potential obscured objects provided in an embodiment of the present application;

[0034] Fig.13 A dependency diagram of potential obscured objects provided by an embodiment of the present application;

[0035] Fig.14 Schematic diagram of the process of scene image rendering method provided in the embodiment of the present application Figure 9 ;

[0036] Fig.15 A schematic diagram of the structure of a scene image rendering device provided in an embodiment of the present application;

[0037] Fig.16 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.

[0039] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0040] In addition, the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0041] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.

[0042] The present application provides a scene image rendering method. In one embodiment of the present application, the scene image rendering method can be run on a local terminal device or a server. When the scene image rendering method is run 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 can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the running body of the game program and the game screen presentation body are separated. The storage and operation of the scene image rendering method are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is used for information processing. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.

[0044] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0045] In an optional implementation, an embodiment of the present disclosure provides a scene image rendering method, which provides a graphical user interface through a terminal device, wherein the terminal device can be the local terminal device mentioned above, or can be a client device in the cloud interaction system mentioned above.

[0046] Among them, the object Occluder that plays an occluding role participates in the visibility information calculation of the potential occluded object Occludee, but does not need to record its visibility information. The potential occluded object Occludee is an object that needs to record visibility information.

[0047] The existing occlusion culling solution calculates the visibility information of virtual objects within the field of view of the player's virtual camera in real time, so as to render the scene image according to the visibility information calculated in real time to obtain a real-time scene image.

[0048] However, as the scale of scenes within applications such as games and the metaverse becomes larger and the details become richer, 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, which is not suitable for mobile electronic devices.

[0049] Based on this, the present application intends to provide a scene image rendering method, device, electronic device and storage medium, by obtaining a binary tree structure of multiple scene areas in a preset virtual scene, multiple leaf nodes in the binary tree structure of each scene area respectively correspond to multiple unit spaces in each scene area; each leaf node records: visibility information of potential obscured objects in the preset virtual scene relative to the corresponding unit space, so as to determine the target visibility information recorded by the target leaf node from the binary tree structure of the target scene area based on the target scene area and target unit space corresponding to the controlled virtual object in the preset virtual scene, so as to generate a scene image of the corresponding perspective of the controlled virtual object according to 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, and the hardware requirements for the electronic device can be reduced, so that the game or metaverse can be oriented to more users; on the other hand, by using a binary tree structure to store visibility information, the binary search characteristics of the binary tree structure can be used to query the target visibility information with higher query efficiency, thereby improving the rendering efficiency of the scene image.

[0050] Below, before introducing the scene image rendering method, device, electronic device and storage medium provided by the present application, the application scenario of the present application is first described.

[0051] Please refer to Figure 1 , which is a schematic diagram of an application scenario provided by an embodiment of the present application, such as Figure 1 As shown, the application scenario includes: a client 10 and a server 20, wherein the client 10 can be a personal computer, a tablet computer, a smart phone, a virtual reality (VR) terminal, etc. running a game application or a cloud universe application; the server 20 can be a server, a server cluster or a cloud computing platform, and the server 20 can calculate the visibility information of potential occluded objects for multiple scene areas in a preset virtual scene, and generate a binary tree structure for each scene area, and send the binary tree structure for each scene area to the client 10, so that the client 10 can render the scene image based on the visibility information stored in the binary tree structure when running the game application or the cloud universe application.

[0052] Among them, the server 20 can take the binary tree structure of each scene area as a data packet, package it as part of the application and send it to the client 10 when the client 10 downloads the game application or the cloud universe application, or send it to the client 10 as incremental update content when the client 10 updates the game application or the cloud universe application. There is no limitation here.

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

[0054] The following describes possible implementations of the scene image rendering method, device, electronic device, and storage medium provided in the present application in combination with embodiments.

[0055] Please refer to Figure 2 , which is a flow chart of the scene image rendering method provided in the embodiment of the present application Figure 1 ,like Figure 2 As shown, the method may include:

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

[0057] Among them, multiple leaf nodes in the binary tree structure of each scene area correspond to multiple unit spaces in each scene area respectively; each leaf node records: visibility information of potential obscured 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 a 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 an occluding object Occluder that plays an occluding role and a potential occluded object Occludee. Among them, the occluding object Occluder that plays an occluding role is used to occlude the potential occluded object Occludee in the preset virtual scene, and its visibility information does not need to be recorded. The potential occluded object Occludee is a virtual object that needs to record visibility information.

[0059] In some embodiments, the occlusion property of an object as an occluding object or a potential occluded object may be specified by a designer. Generally, a larger object is defined as an occluding object, and a smaller object is defined as a potential occluded object.

[0060] According to the size of the preset virtual scene, the preset virtual scene is divided into multiple scene areas, and for each scene area, each scene area is divided into multiple unit spaces. According to the division process of each scene area, multiple unit spaces are obtained, and a binary tree structure corresponding to each scene area is generated, wherein the binary tree structure of each scene area includes: a root node, at least one level of intermediate nodes, and multiple leaf nodes, wherein the root node corresponds to the scene area, and after the root node are two first-level intermediate nodes, corresponding to the two spaces into which the scene area is divided; after each first-level intermediate node are two intermediate-level intermediate nodes, corresponding to the two subspaces into which each space is divided; after the last intermediate-level intermediate node are two leaf nodes, corresponding to the two unit spaces into which each subspace is divided, and multiple leaf nodes correspond to the multiple unit spaces of the scene area. Among them, nodes at the same layer are brother nodes, and the upper-level node of each node is the father node of each node.

[0061] For each unit space, the visibility information of the potential occluded object 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 the binary tree structure. The visibility information includes: whether the potential occluded object is visible relative to the unit space, wherein if the potential occluded object is visible relative to the unit space, it is necessary to render the potential occluded object in the scene image, and if the potential occluded object is not visible relative to the unit space, it is not necessary to render the potential occluded object in the scene image.

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

[0063] It should be noted that, since the visibility information of the potential obscured object in the unit space is used to indicate the visible state information of the controlled virtual object controlled by the player or the virtual image of the player when it is in the unit space, the multiple scene areas in the preset virtual scene must be areas that the controlled virtual object controlled by the player or the virtual image of the player can reach or walk. Among them, whether the scene area is a reachable or walkable area can be determined based on whether there is a virtual object in the scene area. For example, the preset virtual scene is composed of a large number of cells, and a virtual object can be placed on each cell. When there is a virtual object on the cell, the cell is determined to be an unreachable or unwalkable cell. When there is no virtual object on the cell, the cell is determined to be a reachable or walkable cell. According to whether there is a virtual object on the cell, an indication mark of each cell is generated; according to the indication mark of each cell, the reachable area or walkable area in the preset virtual scene is determined. The reachable area or walkable area is a three-dimensional space area including multiple reachable or walkable cells and a preset range above them.

[0064] According to the size of the preset virtual scene, the reachable area or the walkable area is divided into multiple scene areas, and the sizes of the scene areas can be the same or different.

[0065] S102: According to the position of the controlled virtual object in the preset virtual scene, determine the target scene area and the 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 image to walk in a reachable area or a walkable area of ​​a preset virtual scene, the target scene area to which the cell where the controlled virtual object or the player's virtual image is located is determined according to the cell where the controlled virtual object or the player's virtual image is located in the preset virtual scene, and the regional position of the controlled virtual object or the player's virtual image in the target scene area is determined, and the regional position of the controlled virtual object or the player's virtual image in the target scene area is used to indicate the target unit space where the controlled virtual object or the player's virtual image is located in the target scene area.

[0067] Among them, in the metaverse, the controlled virtual object controlled by the player can be the player’s own virtual image.

[0068] The cells are formed by dividing the two-dimensional plane of the preset virtual scene into units. According to the position where the controlled virtual object or the player's virtual image stands in the preset virtual scene, the cell corresponding to the standing position is determined; the unit space is formed by dividing the three-dimensional area of ​​the target scene area into units. According to the regional position of the controlled virtual object or the player's virtual image in the target scene area, the target unit space corresponding to the regional position is determined.

[0069] S103: According to the target scene area and the target unit space, determine the target visibility information recorded by 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, and 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 potential 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 regional position in the target scene area.

[0071] S104: Generate a scene image corresponding to the viewing angle of the controlled virtual object according to the target visibility information.

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

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

[0074] In an optional embodiment, the visibility information is the visibility information of all virtual objects in a preset virtual scene relative to each unit space. According to the target visibility information, all potential occluded objects in a visible state and an invisible state in the preset virtual scene are determined, and the rendering of all potential occluded objects in an invisible state in the preset virtual scene is canceled. Only all potential occluded objects in a visible state and all objects that have an occluding effect are rendered to obtain the 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, according to the target visibility information and the shooting range of the virtual camera, in the preset virtual scene within the shooting range, the rendering of potential occluded objects that are invisible in the shooting range can be canceled, and only the potential occluded objects and objects that have an occluding effect and are visible in the shooting range are rendered; all virtual objects of the preset virtual scene outside the shooting range are not rendered.

[0076] It should be noted that the position and viewing angle of the virtual camera change according to the position and viewing angle of the controlled virtual object or the virtual image of the player.

[0077] In an optional implementation, the rendering of virtual objects in a preset virtual scene is generally performed by a GPU in an electronic device. Therefore, the above S101-S103 can be executed by the CPU, 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 of the corresponding perspective based on the target visibility information and the perspective of the controlled virtual object, and display the scene image in the graphical user interface of the electronic device.

[0078] The scene image rendering method provided in the above embodiment can reduce the computing overhead of electronic devices and the hardware requirements for electronic devices by obtaining a pre-calculated binary tree structure that stores visibility information, thereby 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 characteristics of the binary tree structure can be utilized to query the target visibility information with higher query efficiency, thereby improving the rendering efficiency of the scene image.

[0079] The following describes a possible implementation method for obtaining a binary tree structure for each scene area in conjunction with an embodiment.

[0080] Please refer to Figure 3 , which is a flow chart of the scene image rendering method provided in the embodiment of the present application Figure 2 ,like Figure 3 As shown, the binary tree structure of each scene area is a binary tree structure obtained in the following manner:

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

[0082] In this embodiment, each scene area in the preset virtual scene is a three-dimensional space area. According to the volume of each scene area, the number of levels of spatial division for each scene area is determined. According to the number of levels of spatial division for each scene area, each scene area is subjected to multi-level spatial division. Each level will correspond to two spatial areas of equal size until the last level of division results in multiple unit spaces. According to the hierarchical relationship between the spatial areas at each level, a binary tree structure corresponding to each scene area is generated.

[0083] For example, each scene area corresponds to a root node, and the scene area is divided at the first level to obtain two first-level space areas, and the two first-level space areas correspond to the two first-level father nodes under the root node; the two first-level space areas are divided at the second level to obtain two second-level space areas respectively, and every two second-level space areas correspond to two second-level intermediate nodes under a first-level intermediate node. The division is continued in this way until the last level of division is completed. The last level of division obtains two unit spaces corresponding to each reciprocal space area, and the reciprocal space area corresponds to two leaf nodes under the reciprocal intermediate node, thereby obtaining a binary tree structure corresponding to each scene area.

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

[0085] In this embodiment, for each unit space, the visibility information of the potential occluded object 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 the binary tree structure. The visibility information includes: whether the potential occluded object is visible relative to the unit space, wherein if the potential occluded object is visible relative to the unit space, it is necessary to display the potential occluded object in the scene image, and if the potential occluded object is not visible relative to the unit space, it is not necessary to display the potential occluded object in the scene image.

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

[0087] In one possible implementation, see Figure 4 , which is a flow chart of the scene image rendering method provided in the embodiment of the present application Figure 3,like Figure 4 As shown, the process of performing multi-level spatial segmentation on each scene area in S201 to generate a binary tree structure corresponding to each scene area may include:

[0088] S301: creating a plurality of virtual three-dimensional geometric models in a preset virtual scene, wherein an area where each virtual three-dimensional geometric model is located in the preset virtual scene corresponds to a scene area.

[0089] S302: Perform multi-level space segmentation on each virtual three-dimensional geometric model to obtain multi-level spaces, wherein the last level of space is a unit space.

[0090] S303: Generate a binary tree structure corresponding to each scene area according to the multi-level space and the association relationship between the spaces at each level.

[0091] In this embodiment, according to the multiple scene areas divided by the reachable area or the walkable area of ​​the preset virtual scene, a virtual three-dimensional geometric model is generated in each scene area, and according to the number of levels of spatial segmentation of each scene area, the virtual three-dimensional geometric model corresponding to each scene area is subjected to multi-level spatial segmentation, and 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 obtains multiple unit geometric models, and according to the hierarchical relationship of the combined models at each level, a binary tree structure corresponding to each scene area is generated.

[0092] For examples, please refer to Figure 5 , is a schematic diagram of segmenting a virtual three-dimensional geometric model provided in an embodiment of the present application, such as Figure 5 As shown, the virtual 3D geometric model is generally a cuboid, and multi-level recursive segmentation is performed along the longest side of the cuboid. The virtual 3D geometric model 1 is segmented into virtual 3D geometric model 2 and virtual 3D geometric model 3 according to the longest side, and the virtual 3D geometric model 2 is segmented into virtual 3D geometric model 4 and virtual 3D geometric model 5 according to the longest side. The virtual 3D geometric model 3 is segmented according to the segmentation method of the virtual 3D geometric model 2 to obtain virtual 3D geometric model 6 and virtual 3D geometric model 7. The virtual 3D geometric model 4, the virtual 3D geometric model 5, the virtual 3D geometric model 6 and the virtual 3D geometric model 7 are further segmented according to the longest side until the number of segmentation levels reaches the number of segmentation levels corresponding to each scene area.

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

[0094] For examples, please refer to Figure 6 , which is a binary tree structure provided in the embodiment of the present application, such as Figure 6 As shown, the virtual three-dimensional geometric model 1 corresponds to the root node 1 in the binary tree structure, the virtual three-dimensional geometric model 2 and the virtual three-dimensional geometric model 3 correspond to the intermediate node 2 and the intermediate node 3 in the binary tree structure, and the virtual three-dimensional geometric model 4, the virtual three-dimensional geometric model 5, the virtual three-dimensional geometric model 6 and the virtual three-dimensional geometric model 7 correspond to the leaf node 4, the leaf node 5, the leaf node 6 and the leaf node 7 in the binary tree structure.

[0095] The scene image rendering method provided in the above embodiment creates multiple virtual three-dimensional geometric models in a preset virtual scene, generates a binary tree structure corresponding to each scene area by multi-level segmentation of the virtual three-dimensional geometric models, and records the visibility information of potential occluded objects in the preset virtual scene relative to the corresponding unit space in the leaf node corresponding to the unit space in the binary tree structure, so that the binary search characteristics of the binary tree structure can be utilized to query the target visibility information with higher query efficiency, thereby improving the rendering efficiency of the scene image.

[0096] In one possible implementation, see Figure 7 , which is a flow chart of the scene image rendering method provided in the embodiment of the present application Figure 4 ,like Figure 7 As shown, the process of performing multi-level space segmentation on each virtual three-dimensional geometric model in S302 to obtain the multi-level space may include:

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

[0098] S402: According to 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, thereby obtaining a multi-level space.

[0099] In an embodiment, a preset segmentation criterion is used to determine a stop segmentation condition for segmenting the virtual three-dimensional geometric model, and the stop segmentation condition may be the number of segmentation levels or the size of the last level virtual three-dimensional geometric model, i.e., the unit space; the preset segmentation criterion may be the number of potential occluded objects included in the corresponding scene area, or the complexity of the occlusion relationship between the potential occluded objects and the occluding objects in the corresponding scene area, wherein, if the number of potential occluded objects is greater, or the complexity of the occlusion relationship between the potential occluded objects and the occluding objects in the corresponding scene area is higher, the number of segmentation levels will be greater, or the size of the unit space will be smaller.

[0100] In an optional embodiment, the unit space size of each scene area is used as a stopping condition, and the virtual three-dimensional geometric model corresponding to each scene area is subjected to multi-level spatial segmentation until the size of the sub-level virtual three-dimensional geometric model meets the unit space size, thereby obtaining a multi-level virtual three-dimensional geometric model.

[0101] Among them, until the size of the virtual three-dimensional geometric model of the child level meets the unit space size, the size of the virtual three-dimensional geometric model of the child level can be equal to the unit space size, or the size of the virtual three-dimensional geometric model of the previous level is larger than the unit space size, while the size of the virtual three-dimensional geometric model of this level is smaller than the unit space size, and the space enclosed by the virtual three-dimensional geometric model of this level is taken as the unit space.

[0102] The scene image rendering method provided in the above embodiment determines the unit space size of each scene area according to a preset segmentation standard, performs multi-level space 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, and obtains a multi-level space. The unit space size is set for each scene area according to the preset segmentation standard. This can make the unit space division of scene areas with a large number of objects or complex occlusion relationships more refined, and make the unit space division of scene areas with a small number of objects or simple occlusion relationships relatively simple, so as to reduce the number of unit spaces in the preset virtual scene area without affecting the correctness of the visibility calculation, thereby ensuring the rendering effect of the scene image.

[0103] In one possible implementation, see Figure 8 , which is a flow chart of the scene image rendering method provided in the embodiment of the present application Figure 5 ,like Figure 8 As shown, the process of calculating the visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space in S202 may include:

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

[0105] In this embodiment, since the unit space is continuous, the amount of calculation required to calculate the visibility information of each point in the unit space and the potential obscured object is too large. Therefore, each unit space can be sampled to obtain a target sampling point for each unit space, and the target sampling point may include multiple points.

[0106] Among them, the sampling methods include: mean sampling, random sampling, low-discrepancy sequence sampling, etc.

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

[0108] In this embodiment, taking the target sampling point as the starting point, multiple first emission rays are generated in multiple directions or multiple angles, wherein the number of first emission rays can be set by itself, or can be determined according to the number, complexity, density, etc. of potential occluded objects in a preset virtual scene, wherein the more the number, complexity, and density of potential occluded objects in the preset virtual scene, the more the number of first emission rays.

[0109] In some embodiments, rays evenly distributed in the shape of a globe are emitted toward a preset virtual scene with the target sampling point as the center of the sphere.

[0110] S503: Determine visibility information of a potential obscured object in a preset virtual scene relative to a corresponding unit space according to the plurality of first emitted rays.

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

[0112] In an optional implementation, the process of determining the visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space according to the plurality of first transmitted rays in S503 may include:

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

[0114] Specifically, if the first emitted ray intersects with the potential obstructed object, it is determined that the first emitted ray hits the potential obstructed object; if there is a first emitted ray that intersects with the potential obstructed object in the preset virtual scene, it is determined that the hit potential obstructed object is in a visible state relative to the unit space.

[0115] For an alternative real-time approach, see Fig. 9 , which is a flow chart of the scene image rendering method provided in the embodiment of the present application Figure 6 ,like Fig. 9 As shown, the process of determining the visibility information of the potential blocked object in the preset virtual scene relative to the corresponding unit space according to the plurality of first transmitted rays in S503 may also include:

[0116] S601: If the plurality of first emitted rays do not intersect with the potential obstructed object in the preset virtual scene, a plurality of vertices of the potential obstructed object in the preset virtual scene are obtained.

[0117] S602: Taking the target sampling point as a starting point, emitting a plurality of second emission rays to a plurality of vertices.

[0118] S603: If at least one of the plurality of second emission rays intersects with at least one of the plurality of vertices, determine that the potential blocked object is in a visible state relative to the corresponding unit space.

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

[0120] Among them, the potential obscured object is composed of multiple triangular facets. By extracting the vertices of the triangular facets of the potential obscured object, taking the extracted multiple vertices as the end point and the target sampling point as the starting point, multiple second emission rays are respectively emitted in the directions of the multiple vertices according to the direction between the starting point and the multiple vertices. If the multiple second emission rays include at least one second emission ray that can reach at least one vertex of the potential obscured object, it is determined that there is at least one second emission ray that can hit the potential obscured object. In this case, it can be determined that the potential obscured object is still in a visible state relative to the corresponding unit space.

[0121] If there are still potential obscured objects that are not hit by the rays emitted from the target sampling point after the above S501 - S503 and S601 - S602, it is determined that the potential obscured objects that are not hit are in an invisible state relative to the corresponding unit space.

[0122] The scene image rendering method provided in the above embodiment emits rays from the sampling point in the unit space as the starting point, determines the visibility information of the potential occluded object relative to the unit space according to the intersection of the emitted rays and the potential occluded object, and realizes the visibility of the potential occluded object relative to each unit space, so as to realize the occlusion culling of invisible objects and improve rendering efficiency.

[0123] In one possible implementation, see Fig.10 , which is a flow chart of the scene image rendering method provided in the embodiment of the present application Figure 7 ,like Fig.10 As shown, after the above S202 records the visibility information in the leaf node corresponding to each unit space, the method may further include:

[0124] S701: Determine leaf nodes to be pruned from the multiple leaf nodes according to visibility information recorded in the multiple leaf nodes in the binary tree structure, wherein the leaf nodes to be pruned are two leaf nodes having the same parent node and having the same recorded visibility information.

[0125] S702: Assign 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 a pruned binary tree structure.

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

[0127] In order to improve the efficiency of traversal queries, a pruning operation can be performed on the binary tree structure. The pruning operation is to delete the leaf nodes that meet the preset conditions in the binary tree structure, and record the visibility information recorded in the leaf node in the parent node of the leaf node one level above, to obtain a pruned binary tree structure. When querying the target visibility information in the pruned binary tree structure, the target visibility information can be obtained by traversing to the parent node, which reduces the number of traversal levels and improves the efficiency of traversal queries.

[0128] In an optional embodiment, the 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 the potential occluded objects in the preset virtual scene recorded in the two leaf nodes under a parent node relative to the corresponding unit space is the same, then the visibility status of the potential occluded objects seen by the controlled virtual object in the unit space corresponding to the two leaf nodes is the same. Therefore, the same visibility information recorded in the two leaf nodes can be recorded in the parent node corresponding to the two leaf nodes, and the two leaf nodes can be deleted from the binary tree structure to simplify the binary tree structure.

[0129] For example, Figure 6As shown, if the potential occluded object Occludee1 is visible relative to the unit space cell4 and cell5, and the potential occluded object Occludee2 is invisible relative to the unit space cell4 and cell5, then the visibility information recorded in leaf node 4 and leaf node 5 is the same, 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 completing the pruning of the leaf nodes, the visibility information recorded in the 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 father node is the same, then the two sibling nodes can be deleted, and the visibility information recorded in the two sibling nodes can be recorded in the parent nodes corresponding to the two sibling nodes. Through such operations, until the visibility information recorded in every two sibling nodes is different, the simplest binary tree structure is obtained.

[0131] For example, 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, if the visibility information in parent node 2 and parent node 3 is the same, then the same visibility information in parent node 2 and parent node 3 is recorded in the upper-level parent node, i.e., root node 1, and parent node 2 and parent node 3 are deleted.

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

[0133] The scene image rendering method provided by the above embodiment determines, from multiple leaf nodes, the leaf nodes to be pruned 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, assigns the visibility information recorded in the leaf nodes to be pruned to the father node corresponding to the leaf nodes to be pruned, and deletes the leaf nodes to be pruned to obtain a pruned binary tree structure, thereby simplifying the binary tree structure, reducing the number of traversal levels, and improving the efficiency of traversal queries.

[0134] In one possible implementation, see Fig.11 , which is a flow chart of the scene image rendering method provided in the embodiment of the present application Figure 8 ,like Fig.11 As shown, the process of recording visibility information in the leaf node corresponding to each unit space in S202 may include:

[0135] S801: Numbering potential obstructed objects in a preset virtual scene.

[0136] S802: According to the visibility information of the potential obscured objects in the preset virtual scene relative to the corresponding unit space and the serial number of the potential obscured objects, the visibility information is recorded in the leaf node corresponding to each unit space.

[0137] In this embodiment, all potential occluded objects in the preset virtual scene are sorted and numbered, and a bitmap is used to record the visibility status of the potential occluded objects in the preset virtual scene relative to the corresponding unit space, wherein the i-th bit value in the bitmap is 1, indicating that the i-th potential occluded object is visible to the unit space, and the i-th bit value is 0, indicating that the i-th potential occluded object is invisible to the unit space, that is, the visibility information of each potential occluded object is recorded by only one bit, so that the number of bytes of the total data capacity 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 potential occluded objects divided by 8.

[0138] The scene image rendering method provided in the above embodiment records the visibility information in the corresponding leaf node of each unit space according to 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, so as to reduce the memory occupied by the visibility information, optimize the consumption of spatial resources, and improve the benefits of the pre-calculated visibility information for the occlusion culling scheme.

[0139] In a possible implementation, before calculating the visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space in S202, the method may further include:

[0140] At least two potential occluded objects that meet a preset merging criterion in a preset virtual scene are merged into one potential occluded object.

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

[0142] In an optional embodiment, the preset merging criteria may be: at least two potential obscured objects within a preset range; or, at least two potential obscured objects within the preset range whose volume is smaller than a preset volume; or, multiple partial potential obscured objects that may constitute a potential obscured object, such as the lamp stand, lamp tassel, and handle of a lantern.

[0143] In some embodiments, the potential occluded objects are divided into two categories according to the mesh that constitutes the potential occluded objects. One category is composed of a single object, which has only one mesh; the other category is composed of multiple objects as a whole, which has multiple meshes. Since the mesh is the basic unit of ray detection and visibility calculation, the mesh and the potential occluded objects can be mapped one by one.

[0144] For a potential occluded object that is composed of multiple objects and has multiple network meshes, all of its meshes can be merged to generate an equivalent potential occluded object with one mesh, and visibility calculation is performed on the equivalent potential occluded object. The visibility information of the equivalent potential occluded object is recorded in a bitmap, and during rendering, the visible state of the equivalent potential occluded object can be reversely mapped back to the original visible state of the multiple potential occluded objects.

[0145] For examples, please refer to Fig.12 , is a schematic diagram of mesh merging of potential obscured objects provided in an embodiment of the present application, such as Fig.12 As shown, by merging the meshes, the number of potential occluded objects corresponding to the meshes in the scene can be reduced, thereby reducing the amount of visibility calculation and the additional space occupied.

[0146] Please refer to Fig.13 , which is a dependency diagram of potential obscured objects provided in an embodiment of the present application, such as Fig.13 As shown, for the potential occluded object yt_build_huge_49_t04(1), it is composed of yt_build_huge_49_t04a-yt_build_huge_49_t04g. By merging, a potential occluded object Clone_yt_build_huge_49_t04(1) with only one mesh can be obtained.

[0147] The scene image rendering method provided by the above embodiment can reduce the amount of calculation for the visibility of the potential occluded object on the one hand, and reduce the memory occupied by the visibility information of the electronic device on the other hand, by merging at least two potential occluded objects that meet the preset merging conditions into one potential occluded object.

[0148] In one possible implementation, see Fig.14 , which is a flow chart of the scene image rendering method provided in the embodiment of the present application Figure 9 ,like Fig.14 As shown, the process of determining the target visibility information recorded by the target leaf node from the binary tree structure of the target scene area according to the target scene area and the target unit space in S103 may include:

[0149] S901: Determine a binary tree structure of a target scene area according to a correspondence between multiple scene areas and binary tree structures.

[0150] S902: Determine a target leaf node corresponding to the target unit space according to a correspondence between a plurality of leaf nodes in a binary tree structure of the target scene area and a plurality of unit spaces in the target scene area.

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

[0152] In this embodiment, based on the correspondence between multiple scene areas and binary tree structures, the binary tree structure corresponding to the target scene area is determined, and based on the regional position of the controlled virtual object or the player's virtual image in the target scene area, the target space, the target subspace under the target space, and the target unit space under the target subspace to which the regional position belongs are determined in sequence, so that the binary tree structure of the target scene area can be sequentially determined through binary search to 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, so as to read the target visibility information of the potential occluded objects in the preset virtual scene relative to the target unit space from the target leaf node.

[0153] The scene image rendering method provided by the above embodiment determines the target leaf node corresponding to the target unit space based on the correspondence between the scene area and the binary tree structure, and 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 stores the visibility information in the form of a binary tree result, thereby realizing fast search of visibility information and improving the efficiency of scene image rendering.

[0154] Based on the above method embodiment, the present application embodiment also provides a scene image rendering device. Fig.15 , is a schematic diagram of the structure of a scene image rendering device provided in an embodiment of the present application, such as Fig.15 As shown, the device may include:

[0155] The binary tree acquisition module 101 is used to acquire a binary tree structure of multiple scene areas in a preset virtual scene, wherein multiple leaf nodes in the binary tree structure of each scene area respectively correspond to multiple unit spaces in each scene area; each leaf node records: visibility information of a potential obscured object in the preset virtual scene relative to a corresponding unit space;

[0156] A position determination module 102, configured to determine a target scene area and a target unit space corresponding to the position of the controlled virtual object according to the position of the controlled virtual object in the preset virtual scene;

[0157] A visibility information determination module 103, configured to determine target visibility information recorded by a target leaf node from a binary tree structure of the target scene area according to the target scene area and the target unit space;

[0158] The scene image generation module 104 is used to generate a scene image corresponding to the viewing angle of the controlled virtual object according to the target visibility information.

[0159] In a possible implementation, the binary tree structure of each scene area is a binary tree structure obtained by using the following apparatus:

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

[0161] The visibility calculation module is used to calculate the visibility information of the potential obscured 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.

[0162] In a possible implementation, the space segmentation module includes:

[0163] A geometric model creation unit, used to create multiple virtual three-dimensional geometric models in a preset virtual scene, wherein the area where each virtual three-dimensional geometric model is located in the preset virtual scene corresponds to a scene area;

[0164] A space segmentation unit is used to perform multi-level space segmentation on each virtual three-dimensional geometric model to obtain multi-level spaces, wherein 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 area according to the multi-level space and the association relationship between the spaces at each level.

[0166] In one possible implementation, the space segmentation unit is specifically used to determine the unit space size of each scene area according to a preset segmentation standard; according to the unit space size, multi-level space segmentation is performed on each virtual three-dimensional geometric model until the size of the last level of space meets the unit space size, thereby obtaining a multi-level space.

[0167] In a possible implementation, the visibility calculation module is specifically used to obtain a target sampling point in each unit space; generate multiple first emission rays with the target sampling point as the starting point; and generate multiple first emission rays with the target sampling point as the starting point.

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

[0169] In a possible implementation, the visibility calculation module is also used to obtain multiple vertices of the potential obscured object in the preset virtual scene if multiple first emission rays do not intersect with the potential obscured object in the preset virtual scene; take the target sampling point as the starting point, and emit multiple second emission rays to the 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 obscured object is visible relative to the corresponding unit space.

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

[0171] A pruning node determination module, used to determine the leaf nodes to be pruned from the multiple leaf nodes according to the visibility information recorded in the multiple leaf nodes in the binary tree structure, wherein the leaf nodes to be pruned are two leaf nodes having the same parent node and having 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 a pruned binary tree structure.

[0173] In a possible implementation, the visibility calculation module is also used to 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, the visibility information is recorded in the corresponding leaf node of each unit space.

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

[0175] The object merging module is used to merge at least two potential occluded objects that meet a preset merging standard in a preset virtual scene into one potential 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 the binary tree structure; 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 device provided by the above embodiment can reduce the computing overhead of the electronic device and the hardware requirements for the electronic device by obtaining a pre-calculated binary tree structure that stores visibility information, so that the game or metaverse can be oriented to more users; on the other hand, the binary tree structure is used to store visibility information, and the binary search characteristics of the binary tree structure can be utilized to query the target visibility information with higher query efficiency, thereby improving the rendering efficiency of the scene image.

[0178] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0179] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0180] Please refer to Fig.16 , is a schematic diagram of an electronic device provided in an embodiment of the present application, such as Fig.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 executable by the processor 201. When the electronic device 200 is running, the processor 201 and the storage medium 202 communicate through the bus, and the processor 201 executes the program instructions to execute the above-mentioned scene image rendering method.

[0181] Specifically, the processor executes the above-mentioned scene image rendering method in the following steps:

[0182] Obtain a binary tree structure of multiple scene areas in a preset virtual scene; determine a target scene area and a target unit space corresponding to the position of the controlled virtual object according to the position of the controlled virtual object in the preset virtual scene; determine target visibility information recorded by a target leaf node from the binary tree structure of the target scene area according to the target scene area and the target unit space; and generate a scene image of the corresponding perspective of the controlled virtual object according to the target visibility information.

[0183] In a possible implementation, the binary tree structure of each scene area is a binary tree structure obtained by the processor executing the following steps:

[0184] Perform multi-level spatial segmentation on each scene area to generate a binary tree structure corresponding to each scene area; calculate the visibility information of potential 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.

[0185] In a possible implementation, the processor performs the above-mentioned multi-level spatial segmentation of each scene area to generate a binary tree structure corresponding to each scene area, which may include:

[0186] A plurality of virtual three-dimensional geometric models are created in a preset virtual scene, and the area where each virtual three-dimensional geometric model is located in the preset virtual scene corresponds to a scene area; a multi-level space segmentation is performed on each virtual three-dimensional geometric model to obtain a multi-level space, wherein the last level of space is a unit space; a binary tree structure corresponding to each scene area is generated according to the multi-level space and the association relationship between the spaces at each level.

[0187] In a possible implementation, the processor performs the above-mentioned multi-level space segmentation on each virtual three-dimensional geometric model to obtain the multi-level space, which may include:

[0188] According to the preset segmentation standard, the unit space size of each scene area is determined; according to the unit space size, each virtual three-dimensional geometric model is segmented into multiple levels of space until the size of the last level of space meets the unit space size, thereby obtaining a multi-level space.

[0189] In a possible implementation, the processor performs the above-mentioned process of calculating the visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space, which may include:

[0190] Obtain a target sampling point for each unit space; generate a plurality of first emission rays with the target sampling point as a starting point; and determine visibility information of a potential obscured object in a preset virtual scene relative to a corresponding unit space based on the plurality of first emission rays.

[0191] In a possible implementation, the processor executing the above process of determining the visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space according to the plurality of first emitted rays may include:

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

[0193] In a possible implementation, the processor performs the process of determining the visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space according to the plurality of first emission rays, and may further include:

[0194] If multiple first emission rays do not intersect with the potential occluded object in the preset virtual scene, obtain multiple vertices of the potential occluded object in the preset virtual scene; take the target sampling point as the starting point, emit multiple second emission rays to the 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 a possible implementation, after the processor executes the above-mentioned step of recording the visibility information in the leaf node corresponding to each unit space, the step of the scene image rendering method executed by the processor may further include:

[0196] According to 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, wherein the leaf nodes to be pruned are two leaf nodes with the same parent node and the same recorded visibility information; 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 a pruned binary tree structure.

[0197] In a possible implementation, the processor performs the above process of recording visibility information in the leaf node corresponding to each unit space, which may include:

[0198] The potential occluded objects in the preset virtual scene are numbered; and the visibility information is recorded in the leaf node corresponding to each unit space according to 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.

[0199] In a possible implementation, before the processor performs the above calculation of visibility information of a potential obscured object in a preset virtual scene relative to a corresponding unit space, the steps of the scene image rendering method performed by the processor may further include:

[0200] At least two potential occluded objects that meet a preset merging criterion in a preset virtual scene are merged into one potential occluded object.

[0201] In a possible implementation, the processor performs the above process of determining the target visibility information recorded by the target leaf node from the binary tree structure of the target scene area according to the target scene area and the target unit space, which may include:

[0202] According to the correspondence between multiple scene areas and the binary tree structure, the binary tree structure of the target scene area is determined; according to 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, the target leaf node corresponding to the target unit space is determined; and the target visibility information recorded in the target leaf node is obtained.

[0203] The scene image rendering method executed by the processor of the above-mentioned embodiment can reduce the computing overhead of the electronic device and the hardware requirements for the electronic device by obtaining a pre-calculated binary tree structure that stores visibility information, thereby making the game or metaverse accessible to more users. On the other hand, the binary tree structure is used to store visibility information, and the binary search characteristics of the binary tree structure can be utilized to query the target visibility information with higher query efficiency, thereby improving the rendering efficiency of the scene image.

[0204] Optionally, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned scene image rendering method is executed.

[0205] Specifically, the processor executes the above-mentioned scene image rendering method in the following steps:

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

[0207] In a possible implementation, the binary tree structure of each scene area is a binary tree structure obtained by the processor executing the following steps:

[0208] Perform multi-level spatial segmentation on each scene area to generate a binary tree structure corresponding to each scene area; calculate the visibility information of potential 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.

[0209] In a possible implementation, the processor performs the above-mentioned multi-level spatial segmentation of each scene area to generate a binary tree structure corresponding to each scene area, which may include:

[0210] A plurality of virtual three-dimensional geometric models are created in a preset virtual scene, and the area where each virtual three-dimensional geometric model is located in the preset virtual scene corresponds to a scene area; a multi-level space segmentation is performed on each virtual three-dimensional geometric model to obtain a multi-level space, wherein the last level of space is a unit space; a binary tree structure corresponding to each scene area is generated according to the multi-level space and the association relationship between the spaces at each level.

[0211] In a possible implementation, the processor performs the above-mentioned multi-level space segmentation on each virtual three-dimensional geometric model to obtain the multi-level space, which may include:

[0212] According to the preset segmentation standard, the unit space size of each scene area is determined; according to the unit space size, each virtual three-dimensional geometric model is segmented into multiple levels of space until the size of the last level of space meets the unit space size, thereby obtaining a multi-level space.

[0213] In a possible implementation, the processor performs the above-mentioned process of calculating the visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space, which may include:

[0214] Obtain a target sampling point for each unit space; generate a plurality of first emission rays with the target sampling point as a starting point; and determine visibility information of a potential obscured object in a preset virtual scene relative to a corresponding unit space based on the plurality of first emission rays.

[0215] In a possible implementation, the processor executing the above process of determining the visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space according to the plurality of first emitted rays may include:

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

[0217] In a possible implementation, the processor performs the process of determining the visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space according to the plurality of first emission rays, and may further include:

[0218] If multiple first emission rays do not intersect with the potential occluded object in the preset virtual scene, obtain multiple vertices of the potential occluded object in the preset virtual scene; take the target sampling point as the starting point, emit multiple second emission rays to the 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 a possible implementation, after the processor executes the above-mentioned step of recording the visibility information in the leaf node corresponding to each unit space, the step of the scene image rendering method executed by the processor may further include:

[0220] According to 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, wherein the leaf nodes to be pruned are two leaf nodes with the same parent node and the same recorded visibility information; 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 a pruned binary tree structure.

[0221] In a possible implementation, the processor performs the above process of recording visibility information in the leaf node corresponding to each unit space, which may include:

[0222] The potential occluded objects in the preset virtual scene are numbered; and the visibility information is recorded in the leaf node corresponding to each unit space according to 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.

[0223] In a possible implementation, before the processor performs the above calculation of visibility information of a potential obscured object in a preset virtual scene relative to a corresponding unit space, the steps of the scene image rendering method performed by the processor may further include:

[0224] At least two potential occluded objects that meet a preset merging criterion in a preset virtual scene are merged into one potential occluded object.

[0225] In a possible implementation, the processor performs the above process of determining the target visibility information recorded by the target leaf node from the binary tree structure of the target scene area according to the target scene area and the target unit space, which may include:

[0226] According to the correspondence between multiple scene areas and the binary tree structure, the binary tree structure of the target scene area is determined; according to 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, the target leaf node corresponding to the target unit space is determined; and the target visibility information recorded in the target leaf node is obtained.

[0227] The scene image rendering method executed by the processor of the above-mentioned embodiment can reduce the computing overhead of the electronic device and the hardware requirements for the electronic device by obtaining a pre-calculated binary tree structure that stores visibility information, thereby making the game or metaverse accessible to more users. On the other hand, the binary tree structure is used to store visibility information, and the binary search characteristics of the binary tree structure can be utilized to query the target visibility information with higher query efficiency, thereby improving the rendering efficiency of the scene image.

[0228] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0229] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0230] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0231] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.

[0232] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A scene image rendering method, characterized in that: The method comprises: Obtain a binary tree structure of multiple scene areas in a preset virtual scene, wherein multiple leaf nodes in the binary tree structure of each scene area respectively correspond to multiple unit spaces in each scene area; each leaf node records: visibility information of a potentially obscured object in the preset virtual scene relative to a corresponding unit space; Determining, according to the position of the controlled virtual object in the preset virtual scene, a target scene area and a target unit space corresponding to the position of the controlled virtual object; Determining target visibility information recorded by a target leaf node from a binary tree structure of the target scene area according to the target scene area and the target unit space; A scene image corresponding to the viewing angle of the controlled virtual object is generated according to the target visibility information.

2. The method according to claim 1, characterized in that The binary tree structure of each scene area is a binary tree structure obtained in the following manner: Performing multi-level spatial segmentation on each scene area to generate a binary tree structure corresponding to each scene area; The visibility information of the potential obscured objects in the preset virtual scene relative to the corresponding unit space is calculated, and the visibility information is recorded in a leaf node corresponding to each unit space.

3. The method according to claim 2, characterized in that The multi-level spatial segmentation of each scene area to generate a binary tree structure corresponding to each scene area includes: Creating a plurality of virtual three-dimensional geometric models in the preset virtual scene, wherein an area where each virtual three-dimensional geometric model is located in the preset virtual scene corresponds to a scene area; Performing multi-level space segmentation on each virtual three-dimensional geometric model to obtain multi-level spaces, wherein the last level of space is a unit space; According to the multi-level space and the association relationship between each level of space, a binary tree structure corresponding to each scene area is generated.

4. The method according to claim 3, characterized in that The multi-level space segmentation of each virtual three-dimensional geometric model to obtain the multi-level space includes: Determining the unit space size of each scene area according to a preset segmentation standard; According to 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, thereby obtaining the multiple levels of space.

5. The method according to claim 2, characterized in that The calculating visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space includes: Obtaining the target sampling point of each unit space; Generate a plurality of first emission rays with the target sampling point as a starting point; Visibility information of a potential obscured object in the preset virtual scene relative to a corresponding unit space is determined according to the plurality of first emitted rays.

6. The method according to claim 5, characterized in that The determining, according to the plurality of first emitted rays, visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space includes: If at least one of the plurality of first emitted rays intersects with a potential obstructed object in the preset virtual scene, it is determined that the potential obstructed object is in a visible state relative to the corresponding unit space.

7. The method according to claim 6, characterized in that The determining, according to the plurality of first emitted rays, visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space further includes: If the plurality of first emitted rays do not intersect with the potential obstructed object in the preset virtual scene, obtaining a plurality of vertices of the potential obstructed object in the preset virtual scene; Taking the target sampling point as a starting point, emitting a plurality of second emission rays toward the plurality of vertices; If at least one of the plurality of second emission rays intersects with at least one of the plurality of vertices, it is determined that the potential blocked object is in a visible state relative to the corresponding unit space.

8. The method according to claim 2, characterized in that After recording the visibility information in the leaf node corresponding to each unit space, the method further includes: Determining to-be-pruned leaf nodes from the plurality of leaf nodes according to visibility information recorded in the plurality of leaf nodes in the binary tree structure, wherein the to-be-pruned leaf nodes are two leaf nodes having the same parent node and having 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 a pruned binary tree structure.

9. The method according to claim 2, characterized in that The recording of the visibility information in the leaf node corresponding to each unit space includes: Numbering the potentially obscured objects in the preset virtual scene; According to the visibility information of the potential obscured objects in the preset virtual scene relative to the corresponding unit space and the serial number of the potential obscured objects, the visibility information is recorded in the leaf node corresponding to each unit space.

10. The method according to claim 2, characterized in that Before calculating the visibility information of the potential obscured object in the preset virtual scene relative to the corresponding unit space, the method further includes: At least two potential occluded objects that meet a preset merging criterion in the preset virtual scene are merged into one potential occluded object.

11. The method according to claim 1, characterized in that According to the target scene area and the target unit space, determining target visibility information recorded by a target leaf node from a binary tree structure of the target scene area includes: Determining the binary tree structure of the target scene area according to the correspondence between the multiple scene areas and the binary tree structure; Determine a target leaf node corresponding to the target unit space according to a correspondence between a plurality of leaf nodes in a binary tree structure of the target scene area and a plurality of unit spaces in the target scene area; Obtain the target visibility information recorded in the target leaf node.

12. A scene image rendering device, characterized in that: The device comprises: A binary tree acquisition module is used to acquire a binary tree structure of multiple scene areas in a preset virtual scene, wherein multiple leaf nodes in the binary tree structure of each scene area respectively correspond to multiple unit spaces in each scene area; each leaf node records: visibility information of a potential obscured object in the preset virtual scene relative to a corresponding unit space; A position determination module, used to determine a target scene area and a target unit space corresponding to the position of the controlled virtual object according to the position of the controlled virtual object in the preset virtual scene; A visibility information determination module, configured to determine target visibility information recorded by a target leaf node from a binary tree structure of the target scene area according to the target scene area and the target unit space; A scene image generation module is used to generate a scene image corresponding to the viewing angle of the controlled virtual object according to the target visibility information.

13. An electronic device, characterized in that: include: 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 and the storage medium communicate 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 11.

14. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the scene image rendering method according to any one of claims 1 to 11 are executed.

Citation Information

Patent Citations

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

    CN101281654A

  • A voxel terrain management method

    CN109712227A

  • Large-scale three-dimensional scene webpage display method based on model compression and asynchronous loading

    CN110070613A

  • Scene model rendering method and device thereof, electronic equipment and storage medium

    CN113178014A

  • Browser WebGL large-scale scene rendering method and device, equipment and medium

    CN114663564A