Scene rendering method and device, readable medium, electronic equipment and program product

By merging voxels based on distance and generating optimized mesh models, the method addresses performance issues in voxel-based game rendering, ensuring efficient and distortion-free scene rendering.

CN120318397APending Publication Date: 2025-07-15BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510370098.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

After the voxel game has a longer viewing distance, the rendering pressure caused by voxel data expansion increases. The existing technology such as the octree merging method causes the model to deform and the number of faces too much, which is not suitable for mobile operation.

Method used

By spatially dividing the target scene, merging voxels in preset spatial units, generating merged voxels, and obtaining merged attribute data, combining mesh Mesh model to optimize rendering, using greedy algorithms and POP Buffer algorithms to reduce the number of faces and control memory growth.

Benefits of technology

Effectively control the voxel data memory growth brought by distance-of-sight, optimize the rendering effect, reduce model deformation, reduce rendering pressure, and achieve smooth operation of the mobile platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318397A_ABST
    Figure CN120318397A_ABST
Patent Text Reader

Abstract

The invention discloses a scene rendering method and device, a readable medium, electronic equipment and a program product. For each preset space unit corresponding to a to-be-rendered target scene, obtaining a distance between the preset space unit and a current visual angle; determining a target space unit from preset space units according to a preset distance threshold value and the distance; voxels corresponding to each preset number of preset space subunits in the target space unit are combined to obtain a plurality of combined voxels, combined attribute data corresponding to each combined voxel are obtained, and the combined attribute data comprise spatial position information of each voxel before combination; the preset space subunits are obtained by performing space division on the target space unit; and rendering the target scene according to the merged attribute data corresponding to each merged voxel in the target space unit and the attribute data of each voxel in each preset space unit except the target space unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of scene rendering, and specifically, to a scene rendering method, apparatus, readable medium, electronic device, and program product. Background Art

[0002] In the construction of the game scene world of voxel games, it is entirely composed of voxel data. Each voxel expresses information on space and material, and the entire game scene is dynamically constructed based on this.

[0003] The scenes of voxel games usually have extremely strong real-time performance, but this also brings performance challenges. Especially when the player's viewing distance is pulled back and more voxel content is required to be seen, this will lead to the rapid expansion of voxel data and the uncontrollability of the number of scene faces, thereby increasing the rendering pressure on the game scene. Therefore, how to reduce the rendering pressure on the game scene after the viewing distance is pulled back is crucial for improving the performance of voxel games. Summary of the Invention

[0004] This Summary of the Invention section is provided to introduce concepts in a concise form that will be described in detail in the following Detailed Description section. This Summary of the Invention section is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, the present disclosure provides a scene rendering method, and the method includes:

[0006] For each preset spatial unit corresponding to the target scene to be rendered, obtain the distance between the preset spatial unit and the current viewing angle, where the preset spatial unit is obtained by dividing the spatial area where the target scene is located;

[0007] Determine a target spatial unit from the preset spatial units according to a preset distance threshold and the distance;

[0008] Merge the voxels corresponding to every preset number of preset spatial sub-units in the target spatial unit to obtain a plurality of merged voxels, and obtain merged attribute data corresponding to each of the merged voxels, where the merged attribute data includes the spatial position information of each voxel before merging; the preset spatial sub-unit is obtained by dividing the target spatial unit;

[0009] Render the target scene according to the merged attribute data corresponding to each of the merged voxels in the target spatial unit, and the attribute data of each voxel in each preset spatial unit except the target spatial unit.

[0010] In a second aspect, the present disclosure provides a scene rendering apparatus, and the apparatus includes:

[0011] An acquisition module, configured to acquire, for each preset spatial unit corresponding to a target scene to be rendered, a distance between the preset spatial unit and a current viewing angle, where the preset spatial unit is obtained by spatially dividing a spatial area where the target scene is located;

[0012] A determination module, configured to determine target spatial units from the preset spatial units according to a preset distance threshold and the distance, where the target spatial units are preset spatial units whose distance is greater than or equal to the preset distance threshold;

[0013] A merging module, configured to merge voxels corresponding to every preset number of preset spatial sub-units in the target spatial units to obtain a plurality of merged voxels, and acquire merged attribute data respectively corresponding to each of the merged voxels, where the merged attribute data includes spatial position information of each voxel before merging; the preset spatial sub-units are obtained by spatially dividing the target spatial unit;

[0014] A rendering module, configured to render the target scene according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial units and the attribute data of each voxel in each preset spatial unit other than the target spatial unit.

[0015] In a third aspect, the present disclosure provides a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processing device, the steps of the method in the first aspect of the present disclosure are implemented.

[0016] In a fourth aspect, the present disclosure provides an electronic device, including:

[0017] A storage device, on which a computer program is stored;

[0018] A processing device, configured to execute the computer program in the storage device to implement the steps of the method in the first aspect of the present disclosure.

[0019] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the method in the first aspect of the present disclosure are implemented.

[0020] Through the above technical solution, for each preset spatial unit corresponding to the target scene to be rendered, the distance between the preset spatial unit and the current viewing angle is obtained, where the preset spatial unit is obtained by spatially dividing the spatial region where the target scene is located; the target spatial unit is determined from the preset spatial units according to a preset distance threshold and the distance; the voxels corresponding to every preset number of preset spatial sub-units in the target spatial unit are merged to obtain a plurality of merged voxels, and the merged attribute data corresponding to each of the merged voxels is obtained, where the merged attribute data includes the spatial position information of each voxel before merging; the preset spatial sub-unit is obtained by spatially dividing the target spatial unit; the target scene is rendered according to the merged attribute data corresponding to each merged voxel in the target spatial unit and the attribute data of each voxel in each preset spatial unit other than the target spatial unit. In this way, when performing scene rendering, voxel merging can control the memory growth of voxel data caused by the viewing distance being pulled away. At the same time, the merged attribute data after voxel merging includes the spatial position information of each voxel before merging. In this way, when rendering the target scene based on the merged attribute data corresponding to each merged voxel, the generated rendering model can restore the spatial structure of the original model as much as possible, avoid a large degree of model deformation problems, and optimize the rendering effect of the scene.

[0021] Other features and advantages of the present disclosure will be described in detail in the subsequent specific implementation part. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In combination with the accompanying drawings and with reference to the following specific implementation manners, the above and other features, advantages and aspects of the various embodiments of the present disclosure will become more obvious. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the original elements and elements are not necessarily drawn to scale. In the drawings:

[0023] Figure 1 is a flowchart of a scene rendering method shown according to an exemplary embodiment.

[0024] Figure 2 is a schematic diagram of a scene of voxel merging shown according to an exemplary embodiment.

[0025] Figure 3 is according to Figure 2 the shown embodiment shows a model diagram of merged voxels.

[0026] Figure 4 is according to Figure 1 the shown embodiment shows a flowchart of a scene rendering method.

[0027] Figure 5 is according toFigure 4 Flowchart of a scene rendering method shown in the illustrated embodiment.

[0028] Figure 6 It is according to Figure 2 Schematic diagram of the generation of a Mesh model shown in the illustrated embodiment.

[0029] Figure 7 Schematic diagram of the process of reducing the number of faces of a Mesh model using a greedy algorithm shown in an exemplary embodiment.

[0030] Figure 8 and Figure 9 Schematic diagram of the process of implementing face reduction of a Mesh model based on the POP Buffer algorithm shown in an exemplary embodiment.

[0031] Figure 10 Schematic diagram of two adjacent MergedCubes shown in an exemplary embodiment.

[0032] Figure 11 It is according to Figure 5 Flowchart of a scene rendering method shown in the illustrated embodiment.

[0033] Figure 12 Schematic diagram of a Section merge management shown in an exemplary embodiment.

[0034] Figure 13 It is according to Figure 11 Flowchart of another scene rendering method shown in the illustrated embodiment.

[0035] Figure 14 Schematic diagram of a scene of Section state transformation shown in an exemplary embodiment.

[0036] Figure 15 Flowchart of a scene rendering method shown in an exemplary embodiment.

[0037] Figure 16 It is according to Figure 15 Schematic diagram of the process of generating a Mesh model by frame shown in the illustrated embodiment.

[0038] Figure 17 Block diagram of a scene rendering device shown in an exemplary embodiment.

[0039] Figure 18 Schematic diagram of the structure of an electronic device shown in an exemplary embodiment. Detailed implementation manners

[0040] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Instead, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.

[0041] It should be understood that the various steps recited in the method embodiments of the present disclosure can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.

[0042] The term "including" and its variations used herein are open-ended, that is, "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0043] It should be noted that the concepts such as "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions executed by these devices, modules or units or their interdependent relationships.

[0044] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".

[0045] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0046] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0047] For example, when responding to receiving an active request from the user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server or a storage medium that executes the operation of the technical solution of the present disclosure according to the prompt message.

[0048] As an optional but non-limiting implementation, in response to receiving an active request from a user, the way to send a prompt message to the user can be, for example, in the form of a pop-up window, and the prompt message can be presented in text in the pop-up window. In addition, the pop-up window can also carry a selection space for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0049] It can be understood that the above notification and user authorization acquisition process is only illustrative and does not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations can also be applied to the implementation of the present disclosure.

[0050] At the same time, it can be understood that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of corresponding laws, regulations and related provisions.

[0051] The present disclosure is mainly applied to the real-time rendering of a three-dimensional scene. The three-dimensional scene can, for example, include a game scene corresponding to a voxel game. The core of a voxel game is to use voxels as basic building units. A voxel can be regarded as a three-dimensional pixel and is usually used to represent an object or terrain in space.

[0052] Taking voxel data as an example, when the player's viewing distance is pulled back, more voxel content in the game scene is required to be seen, which will lead to the rapid expansion of voxel data and the uncontrollability of the number of scene faces, thereby increasing the rendering pressure of the scene. Related technologies (such as Minecraft) manage the voxel world by merging it in the form of an octree, that is, every 2*2*2 voxels are combined into one voxel, which serves as the parent node of an octree, and different octree levels are selected for rendering according to the distance from the player to achieve the purpose of controlling the number of scene faces. However, there are the following problems in related technologies:

[0053] First, only a simple octree merge of voxel data is performed. For example, one voxel is selected from 2*2*2 voxels to represent the original 8 voxels. Although the merged data is mainly used to generate a distant view, there are obvious differences between these data and the original data, which will lead to a large deformation of the finally generated model.

[0054] Second, the number of model faces generated by the octree for scene rendering is still very large and will still reach millions on the PC side, which is not suitable for running on mobile devices.

[0055] To solve the above problems, the present disclosure provides a scene rendering method, device, readable medium, electronic device and program product. The following will describe the specific implementation of the present disclosure in detail with reference to the accompanying drawings.

[0056] Figure 1It is a flowchart of a scene rendering method shown according to an exemplary embodiment. As Figure 1 shown, the method includes the following steps:

[0057] In step S101, for each preset space unit corresponding to the target scene to be rendered, obtain the distance between the preset space unit and the current view point, where the preset space unit is obtained by spatially dividing the space area where the target scene is located.

[0058] Among them, the target scene may, for example, include a virtual game scene of a voxel game, or other 3D scenes that can be represented by voxel data. In actual scene rendering, the target scene can be spatially divided according to a preset division granularity to obtain a plurality of the preset space units, and the preset space unit can be a space model composed of a plurality of preset space sub-units. For example, assuming that the preset space unit is represented as Section and the preset space sub-unit is represented as Block, in this way, 16*16*16 Blocks can form a Section.

[0059] The current view point may, for example, include the view point of a game player or the view point of a virtual camera in the scene of a voxel game. It can be understood that in the target scene, the distance between the preset space unit where the position of the current view point is located and the current view point is 0, and the distances between other preset space units and the current view point are generally greater than 0. When the distance is greater than or equal to a preset distance threshold, it indicates that the voxels in the corresponding preset space unit are distant view voxels.

[0060] In step S102, determine the target space unit from the preset space unit according to the preset distance threshold and the distance.

[0061] Exemplarily, the preset space unit with the distance greater than or equal to the preset distance threshold can be used as the target space unit. The preset distance threshold may, for example, be 3. In this way, the preset space unit with the distance greater than or equal to 3 can be used as the target space unit.

[0062] In step S103, merge the voxels corresponding to every preset number of preset space sub-units in the target space unit to obtain a plurality of merged voxels, and obtain the merged attribute data corresponding to each of the merged voxels, where the merged attribute data includes the spatial position information of each voxel before merging.

[0063] Before executing this step, the voxel data within a preset distance range around the current view point can be loaded with the current view point as the central position point.

[0064] Among them, the preset space sub-unit can be understood as a small space unit obtained by spatially dividing the target space unit. Exemplarily, assuming that the target space unit is a large cube, the preset space sub-unit is each small cube obtained by spatially dividing the target space unit.

[0065] Every preset number of preset space sub-units in the target space unit are adjacent preset number of preset space sub-units. For ease of description, the preset space sub-unit will be referred to as Block hereinafter.

[0066] Since the target space unit is a preset space unit whose distance from the current perspective is greater than or equal to a preset distance threshold, the target space unit can be regarded as a distant view. To address the problem of the extremely rapid expansion of voxel data when dealing with distant views, which in turn leads to excessive voxel data memory, a feasible approach is to merge the Blocks of the distant view and the corresponding data representations to compress the memory and represent the content of the distant view with a lower precision.

[0067] In one implementation, voxel merging can be performed in the following manner: for every preset number of preset space sub-units in the target space unit, octree merging is performed on the voxels corresponding to the preset number of preset space sub-units to obtain the merged voxels.

[0068] In the process of obtaining the merged attribute data corresponding to each of the merged voxels, for each of the merged voxels, the merged attribute data can be determined according to the position information of each preset space sub-unit in the preset number of preset space sub-units and the attribute data of each voxel participating in the merging. Among them, the attribute data of each voxel participating in the merging can include data such as the position, material, and shape of the corresponding voxel.

[0069] It should be noted that the target scene to be rendered is composed of voxel data. After spatially dividing the spatial region where the target scene is located, a plurality of preset space units are obtained. These plurality of preset space units may include the following three categories. The first category is the spatial region where the corresponding spatial region is all the spatial region of the target scene. The second category is the empty region outside the target scene (which can be regarded as air). The third category is the spatial region where the corresponding spatial region is partially the spatial region of the target scene and the other part is the empty region. It can be understood that if the target space unit is the first category, each preset space sub-unit in the target space unit corresponds to a voxel (one or more voxels may be corresponding in each preset space sub-unit). If the target space unit is the second category, there are no voxels in each preset space sub-unit in the target space unit. If the target space unit is the third category, some preset space sub-units in the target space unit correspond to voxels and some preset space sub-units do not have voxels.

[0070] In the process of merging the voxel octree for the target space unit, the preset quantity can be 8. In this way, the voxels corresponding to every 8 preset space sub-units in the preset space unit can be merged in the octree. Specifically, for the voxels corresponding to every 8 preset space sub-units, the merging of the voxels can be achieved by merging these 8 preset space sub-units.

[0071] Exemplarily, considering that usually in a voxel engine, each Block can be represented by a 32-bit ID. Among them, bits 0 to 7 represent the state of the Block, mainly including information such as the rotation of the Block, and bits 8 to 31 represent the type information of the Block, mainly including information such as the shape and material of the Block. In order to merge 2×2×2 Blocks, and try to restore the shape of the original scene model as much as possible and approximate the original material, the ID of the merged Block can be used to represent the spatial position information, shape, material, etc. of each voxel before merging. For the type of the merged Block (i.e., BlockType), the type of the most Blocks among the 8 original Blocks can be used as the type of the merged Block. In order to be able to restore the spatial structure of the original scene model after voxel merging, the present disclosure can record the spatial position information of each voxel before merging in the ID of the merged Block. For example, the positions of the original 8 Blocks can be mapped to the 8 bits representing the state in the ID of the Block, and each bit corresponds to the state of a original Block, and this state represents whether there is a voxel at the position of the corresponding Block. Figure 2 is a schematic diagram of a voxel merging scenario shown according to an exemplary embodiment. As Figure 2 shown, the 8 vertices on the cube can be regarded as 8 Blocks. Among them, there are no voxels at the Blocks corresponding to the three vertices represented as Air. After merging the 8 Blocks as Figure 2 shown, the ID of the merged Block is T0-0b10001111. This ID represents that the type of the merged Block is T0, and the state data of the 8 bits is 0b10001111. Among them, 1 represents that there is a voxel at the position of the corresponding Block, and 0 represents that the position of the corresponding Block is air (i.e., there is no voxel). Figure 3 is a schematic model diagram of the merged voxels shown according to the Figure 2 shown embodiment. Based on the ID of the merged Block: T0-0b10001111, the merged voxels of the corresponding 5 voxels among the 8 Blocks can be determined as Figure 3 shown, where one Cube or HalfCube represents the spatial model corresponding to a voxel. The above examples are only for illustration, and the present disclosure is not limited thereto.

[0072] It should be noted that, taking the above example as an example, the IDs of the original 8 Blocks before merging all need to be represented by a 32-bit data. The IDs of the 8 Blocks, that is, 8 * 32-bit data are required to represent the Block IDs. After the Blocks are merged in the present disclosure, the ID of the merged Block can be represented by only one 32-bit data, thereby reducing the memory occupation of the voxel data corresponding to the Block.

[0073] In the process of obtaining the merged attribute data corresponding to each merged voxel, based on the mapping relationship between the 8 status bits (i.e., bit bits) of the ID of the merged Block corresponding to each merged voxel and the Block, and combining the position information of the Block where the voxel exists, the spatial position information of the pre-merged voxel corresponding to the merged voxel can be recorded. The type information of the merged voxel can also be determined based on the ID of the merged Block. In this way, the recorded spatial position information of each pre-merged voxel and the type information of the merged voxel can be used as the merged attribute data of the merged voxel.

[0074] It should also be noted that in the actual scene rendering process, voxel merging can be performed when loading a Chunk. Among them, a Chunk can be composed of a plurality of adjacent preset spatial units (i.e., Sections). For example, 16 Sections form a Chunk. In addition, when loading a Chunk, 4 Chunks can be loaded at one time, and all Block data in these 4 Chunks can be traversed, and some preset models (such as the scene models of specific materials that have been completed by the art) can be filtered out, and then these 4 Chunks can be merged into one Chunk. Assuming that one Section corresponds to 16 * 16 * 16 Blocks, 16 Sections form a Chunk, and when every 8 Blocks are merged into one Block, the size of the Chunk after merging the four Chunks is 16 * 128 * 16. It can be understood that the data in the original Chunk before merging is 16 layers of Sections, so the Chunk after merging becomes 8 layers of Section data, and the internal implementation of the Chunk after merging is the same as that of the original Chunk.

[0075] In step S104, the target scene is rendered according to the merged attribute data corresponding to each merged voxel in the target spatial unit and the attribute data of each voxel in each preset spatial unit except the target spatial unit.

[0076] In this step, a Mesh model can be generated based on the merging attribute data corresponding to each merged voxel in the target spatial unit and the attribute data of each voxel in each preset spatial unit except the target spatial unit; the target scene can be rendered based on this Mesh model.

[0077] Among them, for each merged voxel, the merging attribute data of the merged voxel includes the spatial position information of each voxel before synthesis corresponding to the merged voxel and the type of the merged voxel. The type of the merged voxel can include information such as the shape and material of the merged voxel.

[0078] In the scene rendering of voxel games, the Mesh model is the basic structure for constructing and representing 3D objects, and the Mesh model is another three-dimensional spatial representation further constructed on the basis of voxels. The mesh model is composed of vertices, edges, and faces. A vertex is a point in three-dimensional space, an edge is a line connecting two vertices, and a face is a plane surrounded by three or more vertices. In voxel games, the Mesh model can be used to characterize the appearance and geometric shape of more complex objects composed of multiple voxels.

[0079] When performing the scene rendering of voxel games, the computational burden during rendering can be reduced based on the Mesh model because some optimization techniques (such as level of detail techniques) can be used to manage the mesh details at different distances. Using the Mesh model can also achieve more efficient rendering. By merging adjacent voxels into a large mesh block, the number of scene faces to be rendered can be significantly reduced, thereby improving performance.

[0080] During the execution of this step, in one implementation, for each target spatial unit, a Mesh model corresponding to the target spatial unit can be generated based on the merging attribute data corresponding to each merged voxel corresponding to the target spatial unit, and for each preset spatial unit except the target spatial unit, a Mesh model corresponding to the preset spatial unit can be generated based on the attribute data of each voxel in the preset spatial unit. In this way, each Mesh model is sent to a preset scene rendering platform (such as Unity), and the target scene is rendered based on each Mesh model by the preset scene rendering platform.

[0081] Using the above method, when performing scene rendering, voxel merging can control the memory growth of voxel data caused by the far - away view distance. At the same time, the merged attribute data after voxel merging includes the spatial position information of each voxel before merging. In this way, during the rendering process of the target scene based on the merged attribute data corresponding to each merged voxel respectively, the generated rendering model can restore the spatial structure of the original model as much as possible, avoid a large degree of model deformation problems, and optimize the rendering effect of the scene.

[0082] Figure 4 is based on Figure 1 The flowchart of a scene rendering method shown in the illustrated embodiment is as Figure 4 shown, and step S104 includes the following sub - steps:

[0083] In step S1041, according to the merged attribute data corresponding to each merged voxel in the target space unit, and the attribute data of each voxel in each preset space unit except the target space unit, a mesh Mesh model is generated.

[0084] Among them, the Mesh model includes the first Mesh model corresponding to each target space unit respectively, and the second Mesh model corresponding to each preset space unit except the target space unit respectively.

[0085] In step S1042, according to the Mesh model, the target scene is rendered.

[0086] During the execution of this step, the first Mesh model corresponding to each target space unit respectively, and the second Mesh model corresponding to each preset space unit except the target space unit respectively, can be sent to a preset scene rendering platform respectively, and the target scene is rendered based on the first Mesh model and the second Mesh model by the preset scene rendering platform.

[0087] Figure 5 is based on Figure 4 The flowchart of a scene rendering method shown in the illustrated embodiment is as Figure 5 shown, and step S1041 includes the following sub - steps:

[0088] In step S10411, for each target space unit, according to the merged attribute data corresponding to each merged voxel in the target space unit, a merged space model corresponding to each merged voxel is generated.

[0089] In this step, for each merged voxel in each target space unit, according to the merged attribute data of the merged voxel, the target space sub-unit where voxels exist can be determined from 8 preset space sub-units, and then a Cube (which can be understood as a cube) can be used in the corresponding target space sub-unit to represent the spatial model of the corresponding voxel, and the merged spatial model can be generated by combining the shape and material information of each voxel in the merged voxel. For each merged voxel, the merged spatial model can be understood as a combination of Cubes corresponding to several voxels before merging corresponding to the merged voxel (i.e., MergedCube).

[0090] Considering that each merged Block (which can also be called "MergedBlock") corresponding to each merged voxel is originally for expressing the long view, it is allowed that there are some differences between the generation results of this part of the Mesh and the original Mesh. In addition, the semantics of the status bits of the MergedBlock and the original Block have changed. The current State represents the status information of the original 8 Blocks, that is, it is only possible to know whether there are Blocks at the original 8 positions. For these two reasons, the shape information in the Block type can be discarded, only the material information saved in it is used, and at the same time, all 8 original Blocks are considered as Cubes to generate the Mesh, and the State of the MergedBlock is used to determine which positions have Cubes.

[0091] Exemplarily, Figure 6 is a schematic diagram showing the generation of a Mesh model according to the embodiment shown in Figure 2 As shown, corresponding to the 8 Blocks shown in Figure 6 The Mesh generated based on the original BlockID of these 8 Blocks is as shown in the left figure of Figure 2 After omitting the shape information of each voxel, the Mesh generated based on the merged BlockID is as shown in the right figure of Figure 6 That is to say, after merging the 8 Blocks in Figure 6 The merged spatial model corresponding to the merged voxel obtained is as shown in the right figure of Figure 2 The 8 Blocks in Figure 6 Shown in the right figure, this is only an example, and the present disclosure does not limit this.

[0092] In step S10412, for each preset space unit except the target space unit, according to the attribute data of each voxel in the preset space unit, a non-merged spatial model corresponding to each voxel is generated.

[0093] During the execution of this step, the position, shape, and material information of each voxel can be determined based on the attribute data of the voxel. Then, after using a Cube to represent the voxel and its corresponding shape and material information, the non-merged space model corresponding to the voxel is obtained. In other words, the non-merged space model corresponding to each voxel can be understood as a Cube model in three-dimensional space.

[0094] In step S10413, the first Mesh model is generated based on each merged space model corresponding to the target space unit, and the second Mesh model is generated based on each non-merged space model corresponding to the preset space unit.

[0095] In this step, the attribute information of each face of each non-merged space model in the merged space model and the non-merged space model can be obtained. The merged space model is composed of multiple non-merged space models. According to the attribute information of each face, face reduction processing is performed on each combined space model respectively to obtain the first space model. The combined space model includes the first combined model corresponding to each target space unit and the second combined model corresponding to each preset space unit except the target space unit. Among them, for each target space unit, the first combined model is composed of multiple merged space models of the target space unit. For each preset space unit except the target space unit, the second combined model is composed of multiple non-merged space models of the preset space unit. In this way, the first Mesh model can be generated based on the first space model corresponding to the target space unit, and the second Mesh model can be generated based on the first space model corresponding to the preset space unit.

[0096] Among them, each face of the non-merged space model, for example, includes Figure 6 a square face of a small cube (i.e., a Cube) in the MergedCube shown in the right figure. The attribute information of each face can include at least one of the material, orientation, and position information of the face in the orientation.

[0097] When rendering a scene based on a Mesh model, each face in the Mesh model is rendered. Therefore, the more faces there are, the greater the rendering pressure. Considering a characteristic of the Mesh composed of MergedCube: all faces are small squares of the same size composed of a pair of triangles, except that the positions and materials of these squares may be different, that is, these small squares may be merged into a large rectangle for representation. Therefore, in order to reduce the rendering pressure, the present disclosure can merge faces according to information such as the position, material, and orientation of each face, so as to reduce the number of faces during scene rendering. Therefore, the present disclosure can perform face reduction processing on each combined space model according to the attribute information of each face to obtain a first space model corresponding to each combined space model. Specifically, for each combined space model, faces with the same attribute information in the combined space model can be merged.

[0098] Exemplarily, Figure 7 is a schematic diagram of a process for performing face reduction processing on a Mesh model using a greedy algorithm according to an exemplary embodiment, as Figure 7 shown, the material, orientation, and coordinates in that orientation of each square can be used as the classification basis. In this way, in different dimensional orientations, all squares located in a 2D plane and with the same material can be merged into one face. For example, as Figure 7 shown, for two squares P1 and P2 with the same material located in the Z0 plane and with the positive Z-axis direction as the orientation, they can be merged into a plane P'. Here is just an example, and the present disclosure does not limit this.

[0099] In this way, based on the greedy algorithm, faces with the same orientation, position, and material are merged into one face according to the attribute information of each face, thereby reducing the number of faces of the Mesh model and reducing the scene rendering pressure.

[0100] In addition, decimation is performed on each combined space model respectively to obtain a first space model corresponding to each combined space model. Since the combined space model includes a first combined model corresponding to each target space unit and a second combined model corresponding to each preset space unit except the target space unit, the first space model can include a first space model corresponding to each target space unit and a first space model corresponding to each preset space unit except the target space unit. In this way, for each target space unit, a corresponding first Mesh model can be generated according to the first space model corresponding to the target space unit (for example, the first space model corresponding to the target space unit can be used as the first Mesh model). For each preset space unit except the target space unit, a corresponding second Mesh model can be generated according to the first space model corresponding to the preset space unit (for example, the first space model corresponding to the preset space unit can be used as the second Mesh model).

[0101] In order to further reduce the number of faces of the Mesh model, the present disclosure can perform further processing based on the POP Buffer (i.e., Progressively Ordered Primitive Buffer) algorithm to eliminate too small faces in the model. In this way, without significantly reducing the quality of the long-distance view model, the number of faces can be minimized as much as possible, enabling the voxel game to meet the requirement of smooth operation on mobile platforms.

[0102] Considering that MergedCube has the following characteristics: the Mesh is composed of Cubes, that is, all triangles on each face of the Mesh appear in pairs, and each pair forms a rectangular patch or a square patch, and it also has the characteristics of a voxel game, and the vertices of all triangles fall on the whole grid. Considering these two points, the POP Buffer algorithm can be referred to to implement further decimation processing of the Mesh model.

[0103] In a possible implementation, for each first space model, the following method can be used to continue decimation processing on the basis of the first space model to obtain a second space model: the first space model is divided into grids according to multiple preset granularities respectively to obtain multiple space models with different display levels, and different display levels have different display resolutions; according to the current required display level and the size of the triangles corresponding to each face of the first space model, decimation processing is performed on the first space model to obtain a second space model; in this way, the Mesh model can be generated according to each second space model (for example, the multiple second space models can be combined to obtain the Mesh model).

[0104] Among them, the preset granularity may, for example, include multiple granularities such as 0.2, 0.5, 0.8, etc. Among them, the larger the preset granularity, the smaller the display resolution of the display level corresponding to the Mesh model. The current required display level can be determined according to the detailed display level of the current scene.

[0105] In the process of performing face reduction on the first spatial model according to the current required display level and the size of each triangle corresponding to each face of the first spatial model to obtain the second spatial model, the target display level corresponding to each face can be determined from the different display levels according to the size of each triangle corresponding to each face of the first spatial model; according to the current required display level, the faces corresponding to the first display level are deleted, and the first display level is the display level whose display resolution is greater than the display resolution of the current required display level; the second spatial model is generated according to the faces corresponding to the second display level, and the second display level is the display level whose display resolution is less than or equal to the display resolution of the current required display level.

[0106] In the process of generating the second spatial model according to the faces corresponding to the second display level, for each second display level, according to the preset granularity corresponding to the second display level, the area of each triangle on each face corresponding to the second display level is increased to obtain the face with increased area; the second spatial model is generated according to each face with increased area.

[0107] Exemplarily, Figure 8 and Figure 9 is a schematic diagram of the process of implementing face reduction of the Mesh model based on the POP Buffer algorithm shown in an exemplary embodiment. First, each Mesh model (i.e., each first spatial model) is meshed (which can be understood as "voxelization") according to different preset granularities. According to the size of each triangle in the Mesh model, see which granularity the largest triangle can fall on, and cluster them into different display levels accordingly. As Figure 8As shown, assume there are two triangles, ABC and BED. With a preset granularity of 0.5 for voxelization, when each vertex of each triangle is extended to the center of the corresponding voxel, it can be found that vertices B and E of triangle BED will both be extended to point F, and vertex D of triangle BED is extended to point O. So at this time, triangle BED becomes a line, that is, triangle BED should be located at a display level with a smaller preset granularity. Of course, triangle ABC can fall on the display level corresponding to the preset granularity of 0.5. In this way, after clustering each triangle in the Mesh model into different display levels, based on the current required display level, triangles with a display resolution greater than the current required display level can be removed, and triangles with a display resolution less than or equal to the current required display level are retained. After triangle restoration, they are assembled into a new decimated Mesh model. As Figure 9 shown, the corresponding retained Figure 8 triangle ABC as shown. After expanding triangle ABC, the three vertices of triangle ABC can be pushed to the vertices of the corresponding voxel grid to compensate for the removed triangle BEF. The above examples are only for illustration, and the present disclosure is not limited thereto.

[0108] It should be noted that since the triangles on each face of the Mesh model appear in pairs, half of the triangles can be skipped during the process of clustering the triangles into different display levels. In addition, when the POP Buffer algorithm restores the Mesh model, it will remap the triangle vertex positions to the corresponding voxel grid, which can better restore a better Mesh.

[0109] Thus, based on each first space model, further decimation processing can be performed to obtain a second space model. In this way, in the process of generating a first Mesh model according to the first space model corresponding to the target space unit and generating a second Mesh model according to the first space model corresponding to the preset space unit, for each target space unit, a corresponding first Mesh model can be generated according to the second space model corresponding to the target space unit, and for each preset space unit except the target space unit, a corresponding second Mesh model can be generated according to the second space model corresponding to the preset space unit.

[0110] Exemplarily, for each target space unit, the second space model corresponding to the target space unit can be used as the first Mesh model corresponding to the target space unit, and for each preset space unit except the target space unit, the second space model corresponding to the preset space unit can be used as the second Mesh model corresponding to the preset space unit.

[0111] It should also be noted that, as described above, every 8 Blocks in the target space unit can be regarded as a Cube to generate a Mesh. Figure 10 is a schematic diagram of two adjacent MergedCubes shown according to an exemplary embodiment. As Figure 10 shown, there will be mutual occlusion between two adjacent MergedCubes. For example, for Cube0, the MergedCube on its right will occlude the right face of Cube0. Therefore, the right face of Cube0 belongs to the occluded face and should be removed to reduce unnecessary face rendering in subsequent scene rendering.

[0112] Figure 11 is according to Figure 5 the flowchart of a scene rendering method shown according to the embodiment shown. As Figure 11 shown, the method further includes the following steps:

[0113] In step S105, for each target space model, remove the occluded face of the target space model, where the occluded face is the face occluded by other space models adjacent to the target space model in position, and the target space model includes the merged space model or the non-merged space model.

[0114] For the target space unit, the target space unit may include multiple merged space models (such as Figure 10 the two MergedCubes shown), and for the preset space unit other than the target space unit, the preset space unit includes multiple non-merged space models (that is, corresponding to one Cube). The target space model may include the merged space model or the non-merged space model.

[0115] Regarding the understanding of the occluded face, as Figure 10 shown, the left face of Cube0 in the left MergedCube will be occluded by CubeL, and the right face of Cube0 will be occluded by CubeR. Therefore, both the left face and the right face of Cube0 belong to the occluded face and do not need to be rendered during the target scene rendering. Thus, the left face and the right face of Cube0 can be removed.

[0116] In this step, when determining the occluded face, for each face of each non-merged space model of the target space model, when determining the direction corresponding to the position where the face is located and there are other non-merged space models adjacent to the non-merged space model, determine that the face is the occluded face and remove the occluded face.

[0117] Exemplarily, as Figure 10As shown in the figure, for the right side of one of the non - merged space models Cube0, there is another non - merged space model CubeR adjacent to Cube0 in the direction corresponding to the position of this right side. Therefore, it can be determined that the right side of Cube0 is an occluding surface. Similarly, for the left side of Cube0, there is another non - merged space model CubeL adjacent to Cube0 in the direction corresponding to the position of this left side. Therefore, it can be determined that the left side of Cube0 is an occluding surface. Among them, when determining whether there is a CubeR on the right side of Cube0, as Figure 10 shown, due to the following relationship: the position of CubeR in the MergedCube on the right side is the same as the position of CubeL in the MergedCube on the left side (i.e., both are located at the lower left corner of the respective MergedCube). Therefore, if you want to find out whether the right side of Cube0 is occluded, you can first find the Index where CubeL on the left side of Cube0 is located, and then you can find CubeR and judge the occlusion relationship.

[0118] In step S106, after generating the combined space model using the target space model with the occluding surface removed, perform a face - reduction process on the combined space model.

[0119] After removing the occluding surfaces of each target space model and then performing a face - reduction process on the combined space model generated by the target space models with the occluding surfaces removed, the processing efficiency can be improved and computing resources can be saved.

[0120] So far, the Mesh models corresponding to each target space unit and each preset space unit except the target space unit can be generated. After that, the Mesh model can be sent to the scene rendering platform for scene rendering.

[0121] Using the above - mentioned method, first cluster the faces of the Mesh model into different dimensions and merge the faces in each dimension through the greedy algorithm. After such processing, a large number of faces can be reduced; then further reduction is performed through the POP Buffer to hide the too - small faces in the model. In this way, without significantly reducing the quality of the long - distance view model, the number of model faces can be reduced to the minimum as much as possible, thereby minimizing the rendering pressure of the scene and meeting the requirement of smooth operation on the mobile platform. In addition, using the method provided in this disclosure, the viewing distance can be further pulled away by 50% on the mobile device while the rendering pressure remains unchanged.

[0122] The present disclosure can also manage the scene rendering through the presentation layer. On the one hand, the octree merging management of Sections can be performed. On the other hand, the status information of each Section can be managed. On yet another hand, the Mesh model corresponding to each Section is generated based on the Section frame generation strategy.

[0123] When performing the octree merging management of Sections, if the Sections with a distance greater than or equal to the preset distance threshold (i.e., target spatial units) are directly represented by the merged Sections (which can be expressed as "MergedSection"), the following problems will occur: there will be more MergedSections with duplicate rendering problems (i.e., Overdraw) at the boundaries. The reason for this problem is usually that a MergedSection may be a set of 8 original Sections, but the Sections located at the boundaries among these 8 original Sections may not meet the merging condition of a distance greater than or equal to the preset distance threshold. Therefore, for such Sections, two Mesh generation tasks will be started, resulting in the problem of duplicate rendering. To solve this problem, the present disclosure can manage every preset number of Sections (such as every 2*2*2 Sections) as a group uniformly, that is, each group of Sections is either all original Sections or a MergedSection.

[0124] Exemplarily, Figure 12 is a schematic diagram of a Section merging management shown according to an exemplary embodiment. As Figure 12 shown, with the world coordinates as a reference, starting from the Section at the position (0,0,0), every 8 Sections are clustered together, and when the distances of these 8 Sections to the current viewing angle all meet the threshold condition (i.e., are all greater than or equal to the preset distance threshold), this group of Sections will be replaced by a MergedSection. For example, the 4 Sections from (0,2) to (1,3) in (2), because the distance of (0,2) from the camera (i.e., the current viewing angle) is 2, which does not meet the switching condition of a distance greater than or equal to 3, so these four Sections will all generate their own Meshes separately, thus avoiding the problem that some Sections will be regenerated with Meshes repeatedly.

[0125] Figure 13 is according to Figure 11 shown in the embodiment, which shows a flowchart of another scene rendering method. The present disclosure can manage the status information of each Section through the steps as Figure 13 shown.

[0126] As Figure 13 shown, the method further includes the following steps:

[0127] In step S107, for each preset spatial unit, the status information of the preset spatial unit is recorded according to the distance, and the status information indicates whether the preset spatial unit is a target spatial unit.

[0128] In the present disclosure, the target spatial unit can be represented as MergedSection, and the preset spatial units other than the target spatial unit can be understood as the original unmerged Sections.

[0129] In step S108, in response to the generation of the target Mesh model corresponding to the preset spatial unit in the current state, the preset spatial unit is scene-rendered according to the target Mesh model, and the current state is the state indicated by the status information.

[0130] When the current view changes, since the distance between the Section and the current view changes, LOD (Level of Detail) switching may occur, that is, some MergedSections will be converted into original Sections. Usually, for the Sections with changed status information, a generation task of SectionMesh can be started. After the Mesh is generated, the new Mesh is used to replace the Mesh at the original position to complete the LOD switching. However, this will cause the following problems: As Figure 14 shown, when the position of the current view moves from (0, 0) to (0, 2), the MergedSection at (0, 4) will switch to the original Section. Then, the generation tasks of SectionMesh at these positions are started. However, since the return order of the Mesh cannot be determined. For example, it is possible that S3 returns first, but at this time, it cannot be determined whether the MergedSection should be deleted. If it is deleted, there may be holes, and if it is not deleted, there will be Overdraw. To solve this problem, the present disclosure can assign a status information to each Section, that is, Normal or Merge, where Normal indicates that the corresponding Section is an original unmerged Section, and Merge indicates that the corresponding Section is a merged MergedSection. In this way, it is only necessary to respond to the generation of the target Mesh model corresponding to the Section in the current state (that is), and the preset spatial unit is scene-rendered according to the target Mesh model.

[0131] In addition, for each spatial unit, in response to a change in the distance between the spatial unit and the current viewing angle, the changed target distance is obtained. The spatial unit includes the target spatial unit or a preset spatial unit other than the target spatial unit. The status information is updated according to the magnitude relationship between the target distance and the preset distance threshold.

[0132] Exemplarily, assume that the preset distance threshold is 3. For a MergedSection, if the distance between the MergedSection and the current viewing angle becomes less than 3, at this time, the status information of the MergedSection needs to be updated from Merge to Normal; for a Section, if the distance between the Section and the current viewing angle becomes greater than or equal to 3, at this time, the status information of the Section needs to be updated from Normal to Merge. This is only an example, and the present disclosure does not make any limitations in this regard.

[0133] The present disclosure can also implement generating a Mesh model corresponding to each Section based on a Section frame generation strategy. When performing scene rendering, usually, all SectionMeshes within the full range are generated as soon as the scene enters, which will result in a very large generation task volume of the Mesh. To avoid this problem, the present disclosure can adopt a frame-by-frame generation strategy. The specific implementation is referred to Figure 15 .

[0134] Figure 15 is a flowchart of a scene rendering method shown according to an exemplary embodiment. As Figure 15 shown, the method further includes the following steps:

[0135] In step S1501, the position of the preset spatial unit where the current viewing angle is located is stored in a preset cache.

[0136] In step S1502, in response to the position of the preset spatial unit where the current viewing angle is located being placed in the preset cache, the position of the preset spatial unit where the current viewing angle is located is taken out from the preset cache, and this position is used as the first position.

[0137] In step S1503, the step of generating the Mesh model is repeatedly executed until the preset cache is empty.

[0138] Among them, the step of generating the Mesh model includes: starting the Mesh model generation task corresponding to the first position; storing the positions of other preset spatial units adjacent to the first position in the preset cache; taking out the position of another preset spatial unit from the preset cache as the updated first position.

[0139] Exemplarily, Figure 16 is according toFigure 15 Schematic diagram of a process for generating a Mesh model by frame division shown in the illustrated embodiment, as Figure 16 shown, when entering the scene, the Section position where the current perspective is located is injected into the OpenBuffer (i.e., the preset buffer), and then each time a position is taken out from the OpenBuffer as the first position, and the SectionMesh task of the first position is started, and the positions of other Sections adjacent to the taken-out first position are found and injected into the OpenBuffer, and then another position is taken out from the OpenBuffer as the updated first position, and the steps of generating the Mesh model are repeatedly executed until the positions stored in the OpenBuffer are empty. In this way, the frame division strategy is completely controllable, and the processing amount of each frame can be freely adjusted to meet the performance requirements; in addition, since the Section position where the current perspective is located is first injected into the preset buffer, the generation of SectionMesh will also spread from the current perspective to the distance, which helps to improve the user's sensory experience.

[0140] Figure 17 is a block diagram of a scene rendering device shown according to an exemplary embodiment, as Figure 17 shown, the device includes:

[0141] An acquisition module 1701, configured to obtain the distance between each preset spatial unit corresponding to the target scene to be rendered and the current perspective, where the preset spatial unit is obtained by spatially dividing the spatial area where the target scene is located;

[0142] A determination module 1702, configured to determine a target spatial unit from the preset spatial units according to a preset distance threshold and the distance;

[0143] A merging module 1703, configured to merge the voxels corresponding to each preset number of preset spatial sub-units in the target spatial unit to obtain a plurality of merged voxels, and obtain merged attribute data respectively corresponding to each of the merged voxels, where the merged attribute data includes the spatial position information of each voxel before merging; the preset spatial sub-unit is obtained by spatially dividing the target spatial unit;

[0144] A rendering module 1704, configured to render the target scene according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial unit, and the attribute data of each voxel in each preset spatial unit other than the target spatial unit.

[0145] Next, refer to Figure 18, which shows a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 18 The electronic device shown is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0146] As Figure 18 shown, the electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage device 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.

[0147] Generally, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 can allow the electronic device 600 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 18 the electronic device 600 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.

[0148] Particularly, according to the embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiments of the present disclosure are executed.

[0149] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0150] In some embodiments, the client can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0151] The above-mentioned computer-readable medium can be included in the above-mentioned electronic device; or it can exist separately and not be assembled into the electronic device.

[0152] The above computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: for each preset spatial unit corresponding to the target scene to be rendered, obtain the distance between the preset spatial unit and the current viewing angle, where the preset spatial unit is obtained by spatially dividing the spatial area where the target scene is located;

[0153] Determine a target spatial unit from the preset spatial units according to a preset distance threshold and the distance;

[0154] Merge the voxels corresponding to every preset number of preset spatial sub-units in the target spatial unit to obtain a plurality of merged voxels, and obtain merged attribute data respectively corresponding to each of the merged voxels, where the merged attribute data includes the spatial position information of each voxel before merging; the preset spatial sub-unit is obtained by spatially dividing the target spatial unit;

[0155] Render the target scene according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial unit, and the attribute data of each voxel in each preset spatial unit other than the target spatial unit.

[0156] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The above programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).

[0157] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.

[0158] The modules involved in the embodiments described in the present disclosure can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the module itself in some cases. For example, the acquisition module can also be described as "the module for acquiring distance".

[0159] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chip (SOCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0160] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include electrical connections based on one or more wires, portable computer disks, hard disks, Random Access Memory (RAM), Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM or Flash Memory), optical fibers, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0161] According to one or more embodiments of the present disclosure, Example 1 provides a scene rendering method, including:

[0162] For each preset spatial unit corresponding to the target scene to be rendered, obtain the distance between the preset spatial unit and the current view point, where the preset spatial unit is obtained by spatially dividing the spatial area where the target scene is located;

[0163] Determine target spatial units from the preset spatial units according to a preset distance threshold and the distance, where the target spatial units are the preset spatial units whose distance is greater than or equal to the preset distance threshold;

[0164] Merge the voxels corresponding to every preset number of preset spatial subunits in the target spatial unit to obtain a plurality of merged voxels, and obtain merged attribute data respectively corresponding to each of the merged voxels, where the merged attribute data includes the spatial position information of each voxel before merging; the preset spatial subunits are obtained by spatially dividing the target spatial unit;

[0165] Render the target scene according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial unit and the attribute data of each voxel in each preset spatial unit other than the target spatial unit.

[0166] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, where merging the voxels corresponding to every preset number of preset spatial subunits in the target spatial unit to obtain a plurality of merged voxels includes:

[0167] For every preset number of preset spatial subunits in the target spatial unit, perform octree merging on the voxels corresponding to the preset number of preset spatial subunits to obtain the merged voxels.

[0168] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, where rendering the target scene according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial unit and the attribute data of each voxel in each preset spatial unit other than the target spatial unit includes:

[0169] Generate a mesh Mesh model according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial unit and the attribute data of each voxel in each preset spatial unit other than the target spatial unit;

[0170] Render the target scene according to the Mesh model.

[0171] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3. The Mesh model includes a first Mesh model corresponding to each of the target space units respectively, and a second Mesh model corresponding to each of the preset space units except the target space units respectively. Generating the mesh Mesh model according to the merging attribute data corresponding to each of the merged voxels in each of the target space units and the attribute data of each voxel in each of the preset space units except the target space units includes:

[0172] For each of the target space units, generate a merged space model corresponding to each of the merged voxels according to the merging attribute data corresponding to each of the merged voxels in the target space unit.

[0173] For each of the preset space units except the target space units, generate a non-merged space model corresponding to each voxel according to the attribute data of each voxel in the preset space unit.

[0174] Generate the first Mesh model according to each of the merged space models corresponding to the target space unit, and generate the second Mesh model according to each of the non-merged space models corresponding to the preset space unit.

[0175] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 4. Generating the first Mesh model according to each of the merged space models corresponding to the target space unit and generating the second Mesh model according to each of the non-merged space models corresponding to the preset space unit includes:

[0176] Obtain the attribute information of each face of each non-merged space model in the merged space model and the non-merged space models. The merged space model is composed of a plurality of non-merged space models.

[0177] According to the attribute information of each face, perform face reduction processing on each combined space model respectively to obtain a first space model. The combined space model includes a first combined model corresponding to each of the target space units respectively, and a second combined model corresponding to each of the preset space units except the target space units respectively. Wherein, for each of the target space units, the first combined model is composed of a plurality of the merged space models of the target space unit, and for each of the preset space units except the target space units, the second combined model is composed of a plurality of non-merged space models of the preset space unit.

[0178] Generate the first Mesh model according to the first space model corresponding to the target space unit, and generate the second Mesh model according to the first space model corresponding to the preset space unit.

[0179] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5. The process of performing face reduction on each combined space model according to the attribute information of each face includes:

[0180] For each combined space model, merge the faces with consistent attribute information in the combined space model;

[0181] Wherein, the attribute information includes at least one of the material corresponding to the face, the orientation, and the position information of the face in this orientation.

[0182] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 5. The method further includes:

[0183] Perform mesh division on the first space model according to multiple preset granularities respectively to obtain multiple space models with different display levels, and different display levels have different display resolutions;

[0184] Perform face reduction on the first space model according to the current required display level and the size of each triangle corresponding to each face of the first space model to obtain a second space model;

[0185] The process of generating the first Mesh model according to the first space model corresponding to the target space unit and generating the second Mesh model according to the first space model corresponding to the preset space unit includes:

[0186] Generate the first Mesh model according to the second space model corresponding to the target space unit, and generate the second Mesh model according to the second space model corresponding to the preset space unit.

[0187] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 7. The process of performing face reduction on the first space model according to the current required display level and the size of each triangle corresponding to each face of the first space model to obtain a second space model includes:

[0188] Determine the target display level corresponding to each face respectively from the different display levels according to the size of each triangle corresponding to each face of the first space model;

[0189] Delete the faces corresponding to the first display level according to the current required display level, where the first display level is the display level with a display resolution greater than the display resolution of the current required display level;

[0190] Generate the second spatial model according to the surface corresponding to the second display level, where the second display level is the display level whose display resolution is less than or equal to the display resolution of the current required display level.

[0191] According to one or more embodiments of the present disclosure, Example 9 provides the method of Example 8, and the generating the second spatial model according to the surface corresponding to the second display level includes:

[0192] For each second display level, increase the area of each triangle on each surface corresponding to the second display level according to the preset granularity corresponding to the second display level, to obtain the surface with increased area;

[0193] Generate the second spatial model according to each surface with increased area.

[0194] According to one or more embodiments of the present disclosure, Example 10 provides the method of Example 5, and the method further includes:

[0195] For each target spatial model, remove the occluded surface of the target spatial model, where the occluded surface is the surface occluded by other spatial models adjacent to the position of the target spatial model, and the target spatial model includes the merged spatial model or the non-merged spatial model;

[0196] After generating the combined spatial model using the target spatial model with the occluded surface removed, perform decimation on the combined spatial model.

[0197] According to one or more embodiments of the present disclosure, Example 11 provides the method of Example 10, and the removing the occluded surface of the target spatial model for each target spatial model includes:

[0198] For each surface of each non-merged spatial model of the target spatial model, when determining the direction corresponding to the position where the surface is located and there are other non-merged spatial models adjacent to the non-merged spatial model, determine the surface as the occluded surface and remove the occluded surface.

[0199] According to one or more embodiments of the present disclosure, Example 12 provides the method of any one of Examples 1-11, and the method further includes:

[0200] For each preset spatial unit, record the status information of the preset spatial unit according to the distance, where the status information represents whether the preset spatial unit is the target spatial unit;

[0201] In response to the generation of the target Mesh model corresponding to the preset spatial unit in the current state, perform scene rendering on the preset spatial unit according to the target Mesh model, where the current state is the state indicated by the status information.

[0202] According to one or more embodiments of the present disclosure, Example 13 provides the method of Example 12, and the method further includes:

[0203] For each spatial unit, in response to a change in the distance, obtain a changed target distance, where the spatial unit includes the target spatial unit or a preset spatial unit other than the target spatial unit;

[0204] Update the status information according to the magnitude relationship between the target distance and the preset distance threshold.

[0205] According to one or more embodiments of the present disclosure, Example 14 provides the method of any one of Examples 1-11, and the method further includes:

[0206] Store the position of the preset spatial unit where the current view is located in a preset cache;

[0207] In response to the position of the preset spatial unit where the current view is located being placed in the preset cache, take out the position of the preset spatial unit where the current view is located from the preset cache, and use the position as the first position;

[0208] Loop and execute the step of generating a Mesh model until the preset cache is empty;

[0209] The step of generating a Mesh model includes:

[0210] Start a Mesh model generation task corresponding to the first position;

[0211] Store the positions of other preset spatial units adjacent to the first position in the preset cache;

[0212] Take out the position of another preset spatial unit from the preset cache as the updated first position.

[0213] According to one or more embodiments of the present disclosure, Example 15 provides a scene rendering device, and the device includes:

[0214] An acquisition module, configured to obtain, for each preset spatial unit corresponding to a target scene to be rendered, the distance between the preset spatial unit and the current view, where the preset spatial unit is obtained by spatially dividing the spatial area where the target scene is located;

[0215] A determination module, configured to determine a target spatial unit from the preset spatial units according to a preset distance threshold and the distance, where the target spatial unit is a preset spatial unit whose distance is greater than or equal to the preset distance threshold;

[0216] A merging module is configured to merge voxels corresponding to every preset number of preset spatial sub-units in the target spatial unit to obtain a plurality of merged voxels, and acquire merged attribute data respectively corresponding to each of the merged voxels, where the merged attribute data includes spatial position information of each voxel before merging; the preset spatial sub-units are obtained by spatially dividing the target spatial unit.

[0217] A rendering module is configured to render the target scene according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial unit and the attribute data of each voxel in each preset spatial unit other than the target spatial unit.

[0218] According to one or more embodiments of the present disclosure, Example 16 provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processing device, the steps of the method described in any one of Examples 1-14 are implemented.

[0219] According to one or more embodiments of the present disclosure, Example 17 provides an electronic device, including:

[0220] A storage device having a computer program stored thereon;

[0221] A processing device is configured to execute the computer program in the storage device to implement the steps of the method described in any one of Examples 1-14.

[0222] According to one or more embodiments of the present disclosure, Example 18 provides a computer program product including a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of Examples 1-14 are implemented.

[0223] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, a technical solution formed by mutually replacing the above features with (but not limited to) technical features having similar functions disclosed in the present disclosure.

[0224] Moreover, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details were included in the foregoing discussion, these should not be construed as limitations on the scope of the present disclosure. Certain features that are described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features that are described in the context of a single embodiment may also be implemented separately or in any suitable subcombination in multiple embodiments.

[0225] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims. With regard to the apparatus in the foregoing embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method and will not be elaborated herein.

Claims

1. A scene rendering method, characterized in that, The method includes: For each preset spatial unit corresponding to the target scene to be rendered, obtaining the distance between the preset spatial unit and the current viewing angle, where the preset spatial unit is obtained by spatially dividing the spatial area where the target scene is located; Determining a target spatial unit from the preset spatial units according to a preset distance threshold and the distance; Merging the voxels corresponding to every preset number of preset spatial subunits in the target spatial unit to obtain a plurality of merged voxels, and obtaining merged attribute data respectively corresponding to each of the merged voxels, where the merged attribute data includes the spatial position information of each voxel before merging; the preset spatial subunit is obtained by spatially dividing the target spatial unit; Rendering the target scene according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial unit, and the attribute data of each voxel in each preset spatial unit other than the target spatial unit.

2. The method according to claim 1, wherein The merging the voxels corresponding to every preset number of preset spatial subunits in the target spatial unit to obtain a plurality of merged voxels includes: For every preset number of preset spatial subunits in the target spatial unit, performing octree merging on the voxels corresponding to the preset number of preset spatial subunits to obtain the merged voxels.

3. The method according to claim 1, wherein The rendering the target scene according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial unit, and the attribute data of each voxel in each preset spatial unit other than the target spatial unit includes: Generating a mesh Mesh model according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial unit, and the attribute data of each voxel in each preset spatial unit other than the target spatial unit; Rendering the target scene according to the Mesh model.

4. The method according to claim 3, wherein The Mesh model includes a first Mesh model respectively corresponding to each of the target spatial units, and a second Mesh model respectively corresponding to each of the preset spatial units other than the target spatial unit; The generating a mesh Mesh model according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial unit, and the attribute data of each voxel in each preset spatial unit other than the target spatial unit includes: For each of the target spatial units, generating a merged spatial model respectively corresponding to each of the merged voxels according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial unit; For each preset spatial unit other than the target spatial unit, generating a non-merged spatial model respectively corresponding to each voxel according to the attribute data of each voxel in the preset spatial unit; Generating the first Mesh model according to each of the merged spatial models corresponding to the target spatial unit, and generating the second Mesh model according to each of the non-merged spatial models corresponding to the preset spatial unit.

5. The method according to claim 4, wherein Generating the first Mesh model according to each of the combined space models corresponding to the target space unit, and generating the second Mesh model according to each of the non-combined space models corresponding to the preset space unit includes: Obtaining the attribute information of each face of each non-combined space model in the combined space model and the non-combined space models, where the combined space model is composed of multiple non-combined space models; Performing face reduction processing on each combined space model respectively according to the attribute information of each face to obtain a first space model; the combined space model includes a first combined model corresponding to each of the target space units respectively, and a second combined model corresponding to each of the preset space units except the target space unit respectively; wherein, for each of the target space units, the first combined model is composed of multiple combined space models of the target space unit, and for each of the preset space units except the target space unit, the second combined model is composed of multiple non-combined space models of the preset space unit; Generating the first Mesh model according to the first space model corresponding to the target space unit, and generating the second Mesh model according to the first space model corresponding to the preset space unit.

6. The method according to claim 5, wherein The performing face reduction processing on each combined space model respectively according to the attribute information of each face includes: For each combined space model, merging the faces with the same attribute information in the combined space model; Wherein, the attribute information includes at least one of the material corresponding to the face, the orientation, and the position information of the face in the orientation.

7. The method according to claim 5, wherein The method further includes: Performing mesh division on the first space model respectively according to multiple preset granularities to obtain multiple space models with different display levels, and different display levels have different display resolutions; Performing face reduction processing on the first space model according to the current required display level and the size of the triangle corresponding to each face of the first space model to obtain a second space model; The generating the first Mesh model according to the first space model corresponding to the target space unit, and generating the second Mesh model according to the first space model corresponding to the preset space unit includes: Generating the first Mesh model according to the second space model corresponding to the target space unit, and generating the second Mesh model according to the second space model corresponding to the preset space unit.

8. The method according to claim 7, wherein The performing face reduction processing on the first space model according to the current required display level and the size of the triangle corresponding to each face of the first space model to obtain a second space model includes: Determining the target display level corresponding to each face respectively from the different display levels according to the size of the triangle corresponding to each face of the first space model; Deleting the faces corresponding to the first display level according to the current required display level, where the first display level is the display level with a display resolution greater than the display resolution of the current required display level; Generate the second spatial model based on the surface corresponding to the second display level, where the second display level is the display level with a display resolution less than or equal to the display resolution of the current required display level.

9. The method according to claim 8, characterized in that, The generating the second spatial model based on the surface corresponding to the second display level includes: For each second display level, increase the area of each triangle on each surface corresponding to the second display level according to a preset granularity corresponding to the second display level, to obtain a surface with an increased area; Generate the second spatial model based on each surface with an increased area.

10. The method according to claim 5, characterized in that, The method further includes: For each target spatial model, remove the occluding surface of the target spatial model, where the occluding surface is the surface occluded by other spatial models adjacent to the position of the target spatial model, and the target spatial model includes the merged spatial model or the non-merged spatial model; After generating the combined spatial model using the target spatial model with the occluding surface removed, perform decimation on the combined spatial model.

11. The method according to claim 10, wherein The removing the occluding surface of the target spatial model for each target spatial model includes: For each surface of each non-merged spatial model of the target spatial model, when determining that there is another non-merged spatial model adjacent to the non-merged spatial model at the direction corresponding to the position of the surface, determine the surface as the occluding surface and remove the occluding surface.

12. The method according to any one of claims 1-11, characterized in that, The method further includes: For each preset spatial unit, record the status information of the preset spatial unit according to the distance, where the status information indicates whether the preset spatial unit is the target spatial unit; In response to the generation of the target Mesh model corresponding to the preset spatial unit in the current state, perform scene rendering on the preset spatial unit according to the target Mesh model, where the current state is the state indicated by the status information.

13. The method according to claim 12, wherein The method further includes: For each spatial unit, in response to a change in the distance, obtain the changed target distance, where the spatial unit includes the target spatial unit or a preset spatial unit other than the target spatial unit; Update the status information according to the magnitude relationship between the target distance and the preset distance threshold.

14. The method according to any one of claims 1 to 11, characterized in that The method further includes: Store the position of the preset spatial unit where the current view is located into a preset cache; In response to the position of the preset spatial unit where the current view is located being placed in the preset cache, take out the position of the preset spatial unit where the current view is located from the preset cache and use the position as the first position; Loop and execute the step of generating the Mesh model until the preset cache is empty; The step of generating the Mesh model includes: Start the Mesh model generation task corresponding to the first position; Store the positions of other preset spatial units adjacent to the first position into the preset cache; Take out the position of another preset spatial unit from the preset cache as the updated first position.

15. A scene rendering device, characterized in that, The device includes: An acquisition module, configured to acquire, for each preset spatial unit corresponding to a target scene to be rendered, the distance between the preset spatial unit and the current viewing angle, where the preset spatial unit is obtained by spatially dividing the spatial area where the target scene is located; A determination module, configured to determine a target spatial unit from the preset spatial units according to a preset distance threshold and the distance; A merging module, configured to merge the voxels corresponding to every preset number of preset spatial subunits in the target spatial unit to obtain a plurality of merged voxels, and acquire merged attribute data respectively corresponding to each of the merged voxels, where the merged attribute data includes the spatial position information of each voxel before merging; the preset spatial subunit is obtained by spatially dividing the target spatial unit; A rendering module, configured to render the target scene according to the merged attribute data respectively corresponding to each of the merged voxels in the target spatial unit and the attribute data of each voxel in each preset spatial unit other than the target spatial unit.

16. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processing device, it implements the steps of the method according to any one of claims 1-14.

17. An electronic device, characterized in that, Comprising: A storage device, on which a computer program is stored; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1-14.

18. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-14.