Tree rendering processing method, device, medium and program product

By determining the grid coordinates of trees in the target image using virtual reality technology, the workload of calculating the visible tree set is reduced, and the tree rendering efficiency and scene fluency are improved.

CN114359455BActive Publication Date: 2025-10-10NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111582995.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2025-10-10
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

Existing tree rendering methods are inefficient in calculating the visible tree set, resulting in low tree rendering efficiency and poor scene smoothness.

Method used

By determining the grid coordinates of the trees to be rendered in the target image, and comparing the grid coordinates with the spatial coordinates of the visible area, the trees in the visible area are determined, and draw call instructions are generated for rendering, reducing the computational workload and improving efficiency.

Benefits of technology

Improved tree rendering efficiency and scene smoothness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114359455B_ABST
    Figure CN114359455B_ABST
Patent Text Reader

Abstract

The application provides a tree rendering processing method, device, medium and program product. The method comprises the following steps: determining the grid coordinates of a tree to be rendered in a target image; determining the trees in a visible region in the tree to be rendered according to the grid coordinates; generating drawing call instructions according to the drawing information corresponding to the trees in the visible region, and sending the drawing call instructions to a rendering execution module, so that the rendering execution module renders the tree to be rendered according to the drawing call instructions; wherein the drawing information comprises position information, scaling information and rotation information. According to the method, the trees in the visible region are determined by determining the grid coordinates of the tree to be rendered in the target image, which can reduce the workload of calculating the trees in the visible region, improve the work efficiency, improve the tree rendering efficiency, and improve the scene fluency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtual reality technology, and in particular to a tree rendering processing method, device, medium and program product. Background Art

[0002] With the development of science and technology, virtual reality technology is being used more and more widely in various fields. In virtual reality technology, the rendering of natural scenes is particularly important, and trees are an important component of natural scenes. Therefore, tree rendering largely determines the realism of the entire scene.

[0003] Existing tree rendering methods use a central processing unit (CPU) to calculate the set of visible trees in a target image. After calculating the visible tree set, it generates a draw call instruction and sends it to the graphics processing unit (GPU). Upon receiving the draw call instruction, the GPU renders the target image according to the draw call instruction to create a 3D scene. The data for each tree in the image is generated into a tree-like data structure, the root node of which stores the data for all trees. As the position of a person in the image changes, the camera's view frustum segments the image, creating a new scene to give the person a sense of "movement." After the view frustum segmentation, some trees in the image are visible while others are not. This fragments the originally continuous tree data structure, breaking up the root node and requiring the CPU to continuously calculate the visible tree set. This process requires the CPU to traverse each node of the tree data structure and repeatedly call the camera's view frustum to determine whether a tree at a particular node is visible. This is a labor-intensive and time-consuming process, and the efficiency of calculating the visible tree set is low, resulting in inefficient tree rendering and a lack of scene smoothness.

[0004] However, existing tree rendering methods cannot solve the above technical problems. Summary of the Invention

[0005] The present application provides a tree rendering processing method, device, medium and program product to solve the problem that the existing tree rendering method is inefficient in calculating the visible tree set, resulting in low tree rendering efficiency and low scene fluency.

[0006] In a first aspect, the present application provides a tree rendering processing method, comprising:

[0007] Determine the grid coordinates of the trees to be rendered in the target image;

[0008] Determining trees in a visible area among the trees to be rendered according to the grid coordinates;

[0009] generating a draw call instruction according to the drawing information corresponding to the trees in the visible area, and sending the draw call instruction to a rendering execution module, so that the rendering execution module renders the trees to be rendered according to the draw call instruction;

[0010] The drawing information includes: position information, scaling information and rotation information.

[0011] In a possible design, determining the grid coordinates of the trees to be rendered in the target image specifically includes:

[0012] Determining three-level grid coordinates of trees to be rendered in a target image, the three-level grid coordinates including a first grid coordinate, a second grid coordinate, and a third grid coordinate, the second grid coordinate being within the first grid coordinate, the third grid coordinate being within the second grid coordinate, and the grid space corresponding to the third grid coordinate being a grid space that accommodates only one tree; and a first distance between any two third grid coordinates in the second grid coordinates being less than or equal to a preset distance;

[0013] or,

[0014] Secondary grid coordinates of a tree to be rendered in a target image are determined, where the secondary grid coordinates include a first grid coordinate and a third grid coordinate, the third grid coordinate is within the first grid coordinate, and a grid space corresponding to the third grid coordinate is a grid space that accommodates only one tree.

[0015] In a possible design, when the grid coordinates are third-level grid coordinates, determining the trees in the visible area among the trees to be rendered according to the grid coordinates specifically includes:

[0016] Determining whether a first grid space corresponding to the first grid coordinates is located within a camera viewing cone or intersects with the camera viewing cone;

[0017] When the first grid space is located inside the camera viewing cone, the trees in the first grid space are trees in the visible area;

[0018] When the first grid space intersects with the camera visual cone area, determine whether the second grid space corresponding to the second grid coordinate in the first grid coordinate is located inside the camera visual cone area or intersects with the camera visual cone area; if the second grid space is located inside the camera visual cone area, the trees in the second grid space are trees in the visible area; if the second grid space intersects with the camera visual cone area, determine whether the third grid space corresponding to the third grid coordinate in the second grid coordinate is located inside the camera visual cone area or intersects with the camera visual cone area; if the third grid space is located inside the camera visual cone area or intersects with the camera visual cone area, the trees in the third grid space are trees in the visible area.

[0019] In one possible design, determining whether the third grid space corresponding to the third grid coordinate in the second grid coordinate is located within the camera's viewing cone area or intersects with the camera's viewing cone area specifically includes:

[0020] In the same time period, it is determined according to multiple sets of third grid coordinates whether each of the third grid spaces is located inside the camera's visual cone area or intersects with the camera's visual cone area.

[0021] In one possible design, the first grid coordinates and the second grid coordinates are generated in the following manner:

[0022] Dividing the three-dimensional space corresponding to the target image according to a first side length to generate a plurality of first grid spaces and first grid coordinates corresponding to the first grid spaces;

[0023] Each of the first grid spaces is divided according to a second side length to generate a plurality of second grid spaces and second grid coordinates corresponding to the second grid spaces, wherein the first side length is greater than the second side length.

[0024] In a possible design, generating a draw call instruction according to the drawing information corresponding to the trees in the visible area specifically includes:

[0025] Determining drawing information corresponding to each tree according to the grid coordinates corresponding to the trees in the visible area;

[0026] determining a second distance between each tree and the camera position according to position information in the drawing information corresponding to each tree;

[0027] A draw call instruction is generated according to the drawing information corresponding to each tree and the second distance.

[0028] In a possible design, generating a draw call instruction according to the drawing information corresponding to each tree and the second distance specifically includes:

[0029] determining whether there is a same second distance in the second distances; if there is, generating a drawing call instruction according to the drawing information corresponding to the same second distance, and generating a drawing call instruction according to the drawing information corresponding to each of the different second distances respectively; if there is not, generating a drawing call instruction according to the drawing information corresponding to each tree respectively;

[0030] Or,

[0031] determining a distance level corresponding to each tree according to the second distance; and generating a drawing call instruction according to the drawing information corresponding to the trees in the same distance level.

[0032] In a second aspect, the present application provides a tree rendering processing device, comprising a processor and a memory in communication connection with the processor;

[0033] The memory stores computer execution instructions;

[0034] The processor executes the computer execution instructions stored in the memory to implement the method described above.

[0035] In a third aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by a processor to implement the method described above.

[0036] In a fourth aspect, the present application provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the method described above.

[0037] The tree rendering processing method provided by the present application can determine the specific spatial position of the tree to be rendered in the target image by determining the grid coordinates of the tree to be rendered in the target image. Each grid coordinate can represent the specific position of the corresponding grid space in the target image, thereby improving the convenience and efficiency of determining the spatial position of the tree to be rendered. After determining the grid coordinates, the trees in the visible region among the trees to be rendered can be determined by comparing the grid coordinates with the spatial coordinates of the visible region. Through such a setting, the workload of calculating the trees in the visible region can be reduced, the work efficiency can be improved, the tree rendering efficiency can be improved, and the scene fluency can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0038] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the application.

[0039] Figure 1 is an existing tree data structure diagram;

[0040] Figure 2This is a flowchart of a tree rendering processing method according to an embodiment of the present application;

[0041] Figure 3 A three-level grid coordinate diagram according to an embodiment of the present application;

[0042] Figure 4 This is a flowchart of a tree rendering method according to another embodiment of the present application;

[0043] Figure 5 FIG. 1 is a structural diagram of a tree rendering processing device according to an embodiment of the present application.

[0044] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0045] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0046] First, let’s explain the terms involved in this application:

[0047] Camera frustum: refers to the area that the perspective camera can see when rendering the image, that is, the visible area.

[0048] With the advancement of technology, virtual reality (VR) is increasingly being used in various fields, such as online gaming. After rendering a 2D image, game engineers use VR technology to construct a 3D scene map and character map within the 2D image. Rendering is the final step in 3D modeling, ensuring that the image is more realistic than the 3D scene. Trees are a crucial component of natural scenes, and therefore, tree rendering significantly impacts the overall realism of the scene.

[0049] In existing tree rendering methods, the game engine's central processing unit (CPU) calculates the set of visible trees in a target image. After calculating the visible tree set, it generates a draw call instruction and sends it to the graphics processing unit (GPU). Upon receiving the draw call instruction, the GPU renders the target image according to the draw call instruction to generate a 3D game scene. To improve tree rendering efficiency, improving the efficiency of calculating the visible tree set is particularly important.

[0050] In the prior art, the relevant data of each tree in the image will generate a tree data structure, such as Figure 1 As shown, leaf nodes store data on several trees, and several leaf nodes are merged into an intermediate node, where the intermediate node stores all the data of the leaf nodes to which it belongs. Intermediate nodes continue to merge into higher-level intermediate nodes until they merge into a root node, which stores data on all the trees in the image. As the position of the game character in the image changes, the camera's view cone will segment the image, generating new scenes to create a "sense of movement" for the character. After the view cone is segmented, some trees in the image are visible while others are not. The originally continuous tree data structure is broken up, and the root node is no longer visible. The CPU needs to continuously calculate the set of visible trees.

[0051] When calculating the visible tree set in the prior art, the CPU first retrieves the data from the root node of the image and uses this data to determine whether all trees corresponding to the root node are visible. If all trees are visible, a draw call instruction is generated based on the root node data and sent to the GPU. If not all trees are visible, the CPU retrieves the data from the first-level intermediate node closest to the root node and uses this data to determine whether all trees corresponding to that node are visible. This process traverses each node of the tree data structure until all trees corresponding to a node are visible, or the result reaches a leaf node.

[0052] However, the existing tree rendering method has a large workload and a long time to calculate the visible tree set, and the efficiency of calculating the visible tree set is low, resulting in low tree rendering efficiency and low scene smoothness.

[0053] The tree rendering processing method provided in this application is intended to solve the above technical problems of the prior art. The tree rendering processing method obtained by using this method can determine the specific spatial position of the trees to be rendered in the target image by determining the grid coordinates of the trees to be rendered in the target image. Each grid coordinate can represent the specific position of its corresponding grid space in the target image, thereby improving the convenience and efficiency of determining the spatial position of the trees to be rendered. After determining the grid coordinates, the trees in the visible area among the trees to be rendered can be determined by comparing them with the spatial coordinates of the visible area. Through such a setting, the workload of calculating the trees in the visible area can be reduced, and work efficiency can be improved, thereby improving the efficiency of tree rendering and enhancing the smoothness of the scene.

[0054] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0055] Example 1

[0056] Figure 2 This is a flowchart of a tree rendering processing method provided by an embodiment of the present application. This embodiment describes the tree rendering processing method with the execution subject being a central processing unit. Figure 2 As shown, the tree rendering processing method may include the following steps:

[0057] S101: Determine the grid coordinates of the trees to be rendered in the target image.

[0058] In one possible embodiment, determining the grid coordinates of the trees to be rendered in the target image may include: determining three-level grid coordinates of the trees to be rendered in the target image, the three-level grid coordinates including a first grid coordinate, a second grid coordinate, and a third grid coordinate, the second grid coordinate being within the first grid coordinate, the third grid coordinate being within the second grid coordinate, and the grid space corresponding to the third grid coordinate being a grid space that accommodates only one tree; and a first distance between any two third grid coordinates in the second grid coordinate is less than or equal to a preset distance.

[0059] In this embodiment, if Figure 3As shown, the grid coordinates of the trees in the target image can be three-level grid coordinates divided according to the spatial area. The grid space corresponding to the third grid coordinate can only accommodate one tree, so that each third grid coordinate corresponds to a tree, so as to facilitate the determination of the spatial position of each tree. In real scenes, multiple adjacent trees are usually gathered into a tree cluster, and multiple tree clusters are gathered into a forest. Since the spatial positions of the trees in the tree cluster are similar, the grid space corresponding to the second grid coordinate can be a grid space composed of multiple adjacent trees, so as to further improve the convenience and efficiency of determining the spatial position of the trees. Through such a setting, the efficiency of the subsequent work of determining the tree position according to the grid coordinates can be improved and the workload can be reduced.

[0060] In this embodiment, those skilled in the art can flexibly set the preset distance as needed, and no limitation is imposed here.

[0061] In this embodiment, the first grid coordinates and the second grid coordinates can be generated in the following manner: dividing the three-dimensional space corresponding to the target image according to the first side length to generate multiple first grid spaces and first grid coordinates corresponding to the first grid spaces; dividing each first grid space according to the second side length to generate multiple second grid spaces and second grid coordinates corresponding to the second grid spaces, and the first side length is greater than the second side length.

[0062] In this embodiment, the three-dimensional space corresponding to the target image can be spatially hashed according to the first side length to divide it into a plurality of first grid spaces. The corresponding first grid coordinates can be obtained based on the spatial position and first side length of the first grid space. Subsequently, the first grid space can be spatially hashed again according to the second side length to divide it into a plurality of second grid spaces. The corresponding second grid coordinates can be obtained based on the spatial position and second side length of the second grid space. This arrangement allows for simple and convenient grid space division and grid coordinate determination.

[0063] In this embodiment, those skilled in the art can flexibly set the first side length and the second side length as needed, without any limitation, as long as the first side length is greater than the second side length.

[0064] In another possible embodiment, determining the grid coordinates of the trees to be rendered in the target image may include: determining secondary grid coordinates of the trees to be rendered in the target image, the secondary grid coordinates including first grid coordinates and third grid coordinates, the third grid coordinates being within the first grid coordinates, and the grid space corresponding to the third grid coordinates being a grid space that accommodates only one tree.

[0065] In this embodiment, the grid coordinates of the trees in the target image may be secondary grid coordinates. The grid space corresponding to the third grid coordinate can only accommodate one tree, so each third grid coordinate corresponds to a tree, facilitating the determination of the spatial position of each tree. By dividing the grid coordinates in the target image into secondary grid coordinates, the accuracy of determining the spatial position of each tree can be improved.

[0066] S102: Determine trees in the visible area among the trees to be rendered according to the grid coordinates.

[0067] In this embodiment, when the grid coordinates are third-level grid coordinates, determining the trees in the visible area among the trees to be rendered according to the grid coordinates may include:

[0068] It is determined whether a first grid space corresponding to the first grid coordinate is located within the camera's viewing cone area or intersects the camera's viewing cone area.

[0069] When the first grid space is located inside the camera's viewing cone, the trees in the first grid space are trees in the visible area.

[0070] When the first grid space intersects with the camera's visual cone area, determine whether the second grid space corresponding to the second grid coordinate in the first grid coordinate is located inside the camera's visual cone area or intersects with the camera's visual cone area; if the second grid space is located inside the camera's visual cone area, the trees in the second grid space are trees in the visible area; if the second grid space intersects with the camera's visual cone area, determine whether the third grid space corresponding to the third grid coordinate in the second grid coordinate is located inside the camera's visual cone area or intersects with the camera's visual cone area; if the third grid space is located inside the camera's visual cone area or intersects with the camera's visual cone area, the trees in the third grid space are trees in the visible area.

[0071] In this implementation, the camera's view frustum is the visible area; trees outside of it do not need to be rendered. If a grid space is within the camera's view frustum, all trees within it are visible. If a grid space intersects the camera's view frustum, only a portion of the trees within it are visible, requiring further culling of the invisible trees. After determining the third-level grid coordinates of the trees to be rendered, the camera's view frustum is used to determine the trees within the visible area. This reduces the number of camera view frustum calls and improves the efficiency of determining trees within the visible area.

[0072] In addition, in this embodiment, each grid space no longer stores the relevant information of the trees therein, but only corresponds to the grid coordinates that can represent the position of the inner space, thereby further reducing the workload of calculation and improving the efficiency of determining the trees in the visible area.

[0073] In this embodiment, determining whether the third grid space corresponding to the third grid coordinate in the second grid coordinate is located inside the camera cone area or intersects with the camera cone area may include: determining whether each third grid space is located inside the camera cone area or intersects with the camera cone area according to multiple groups of third grid coordinates in the same time period.

[0074] In this embodiment, the position of the third grid space can be determined in batches, that is, each time the camera cone is called, the positions of multiple third grid spaces are determined according to multiple sets of third grid coordinates in the same period, further reducing the number of times the camera cone is called and reducing the workload of calculation.

[0075] S103: Generate a draw call instruction based on the drawing information corresponding to the trees in the visible area, and send the draw call instruction to the rendering execution module, so that the rendering execution module renders the trees to be rendered according to the draw call instruction; wherein the drawing information includes: position information, scaling information, and rotation information.

[0076] In this embodiment, the rendering execution module may be a graphics processing unit (GPU). The drawing information includes but is not limited to: position information, scaling information, and rotation information, and may also include relevant information for subsequent rendering work.

[0077] In this embodiment, after determining the trees in the visible area, the central processing unit (CPU) retrieves the drawing information corresponding to the trees and generates a draw call instruction based on the information. The CPU then sends the draw call instruction to the GPU. After receiving the draw call instruction, the GPU renders the trees in the target image accordingly.

[0078] The specific content of generating the draw call instruction according to the drawing information corresponding to the trees in the visible area in S103 will be described in detail below using the second embodiment.

[0079] Example 2

[0080] Figure 4 This is a flowchart of a tree rendering processing method provided by another embodiment of the present application. This embodiment uses the execution subject as the central processing unit to illustrate the tree rendering processing method. Figure 4 As shown, the CPU method may include the following steps:

[0081] S201: Determine the drawing information corresponding to each tree according to the grid coordinates corresponding to the trees in the visible area.

[0082] In this embodiment, the drawing information for each tree in the image can be stored in a memory pool, and each grid space no longer stores the tree data within it. After determining the grid coordinates of a tree in the visible area, the corresponding drawing information can be called based on the grid coordinates. This configuration can improve the efficiency of draw call instruction generation, thereby improving tree rendering efficiency and enhancing scene smoothness.

[0083] S202: Determine a second distance between each tree and the camera position according to the position information in the drawing information corresponding to each tree.

[0084] In this embodiment, the camera position corresponding to the image has been set, and the second distance between each tree and the camera position can be determined according to the position information of the trees.

[0085] S203: Generate a draw call instruction according to the drawing information corresponding to each tree and the second distance.

[0086] In one possible implementation, generating a draw call instruction based on the drawing information corresponding to each tree and the second distance may include: determining whether there are trees with the same second distance among the second distances; if so, generating a draw call instruction based on the drawing information corresponding to the trees with the same second distance, and generating a draw call instruction based on the drawing information corresponding to the trees with different second distances; if not, generating a draw call instruction based on the drawing information corresponding to each tree.

[0087] In this implementation, trees with the same second distance can be grouped together for batching, with draw call instructions generated based on their corresponding drawing information. This reduces the number of draw call instructions generated, thereby improving tree rendering efficiency and enhancing scene smoothness.

[0088] In another possible implementation, generating a draw call instruction based on the drawing information corresponding to each tree and the second distance may include: determining a distance level corresponding to each tree based on the second distance; and generating a draw call instruction based on the drawing information corresponding to trees at the same distance level.

[0089] In this embodiment, due to the different distances of trees from the camera position, the level of detail of the number of trees "seen" by the camera varies, and the corresponding rendering process and level of detail are also different. For example, the closer the tree is to the camera, the more detailed the "sight" is, and the better the rendering effect of the tree should be, and the higher the level of detail. Therefore, the second distance can be divided into distance levels, and trees at the same distance level can be batched together, and draw call instructions are generated based on their corresponding drawing information. Through this setting, the number of draw call instructions generated can be further reduced, and the efficiency of tree rendering can be further improved without affecting the rendering effect, thereby improving the smoothness of the scene.

[0090] In this embodiment, those skilled in the art can flexibly set the distance level as needed. For example, the distance level can be divided into four levels: near, medium, far, and very far, or into three levels: near, medium, and far, which is not limited here.

[0091] In this embodiment, when generating draw call instructions based on the drawing information corresponding to trees at the same distance level, draw call instructions corresponding to different distance levels can be generated in batches. That is, multiple draw call instructions can be generated simultaneously based on the drawing information corresponding to multiple distance levels during the same period, further improving the efficiency of draw call instruction generation.

[0092] The tree rendering processing method of the present application is described below with reference to a specific embodiment.

[0093] Example 3

[0094] In a specific embodiment, during the 3D modeling process of an online game, when the game character moves within the scene, the game scene to be displayed also changes accordingly. The camera frustum segments the original scene image to produce a new 2D image, which then needs to be rendered. If trees are present in the image, they must also be rendered. First, the CPU determines the three-level grid coordinates of the trees to be rendered within the 2D image of the game scene.

[0095] Then, the trees to be rendered that are in the visible area are determined based on the three-level grid coordinates:

[0096] Determine whether a first grid space corresponding to the first grid coordinate is located within a camera frustum area of ​​the game scene or intersects with the camera frustum area.

[0097] When the first grid space is located inside the camera's viewing cone, the trees in the first grid space are trees in the visible area.

[0098] When the first grid space intersects with the camera's visual cone area, determine whether the second grid space corresponding to the second grid coordinate in the first grid coordinate is located inside the camera's visual cone area or intersects with the camera's visual cone area; if the second grid space is located inside the camera's visual cone area, the trees in the second grid space are trees in the visible area; if the second grid space intersects with the camera's visual cone area, determine whether the third grid space corresponding to the third grid coordinate in the second grid coordinate is located inside the camera's visual cone area or intersects with the camera's visual cone area; if the third grid space is located inside the camera's visual cone area or intersects with the camera's visual cone area, the trees in the third grid space are trees in the visible area.

[0099] Then, based on the grid coordinates of the trees in the visible area, the drawing information corresponding to each tree is retrieved from the memory pool. Based on the position information in the drawing information corresponding to each tree, a second distance between each tree and the camera position of the game scene is determined. Based on the second distance, a distance class corresponding to each tree is determined; and a draw call instruction is generated based on the drawing information corresponding to trees at the same distance class.

[0100] Finally, the draw call instructions are sent to the GPU, which renders the trees in the visible area according to the draw call instructions and generates a 3D scene graph corresponding to the movement of the game character.

[0101] Figure 5 This is a structural diagram of a tree rendering processing device according to an embodiment of the present application. Figure 5 As shown, the tree rendering processing device includes: a processor 101, and a memory 102 communicatively connected to the processor 101; the memory 102 stores computer-executable instructions; the processor 101 executes the computer-executable instructions stored in the memory 102 to implement the steps of the tree rendering processing method in the above-mentioned method embodiments.

[0102] The tree rendering processing device may be independent or part of a communication network, and the processor 101 and the memory 102 may adopt existing hardware of the communication network.

[0103] In the tree rendering processing device described above, memory 102 and processor 101 are directly or indirectly electrically connected to each other to enable data transmission or interaction. For example, these components may be electrically connected via one or more communication buses or signal lines, such as a bus connection. Memory 102 stores computer-executable instructions for implementing the data access control method, including at least one software functional module stored in memory 102 in the form of software or firmware. Processor 101 executes various functional applications and data processing by running the software programs and modules stored in memory 102.

[0104] The memory 102 can be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electric Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 102 is configured to store programs. The processor 101 executes the programs after receiving an execution instruction. Further, the software programs and modules in the memory 102 can also include an operating system, which can include various software components and / or drivers for managing system tasks, such as memory management, storage device control, power management, etc., and can communicate with various hardware or software components to provide an operating environment for other software components.

[0105] The processor 101 can be an integrated circuit chip having a processing capability of signals. The processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc. The processor 101 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0106] An embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores computer execution instructions. The computer execution instructions are executed by the processor to implement the steps of the method embodiments of the present application.

[0107] An embodiment of the present application further provides a computer program product, and the computer program product includes a computer program. The computer program is executed by the processor to implement the steps of the method embodiments of the present application.

[0108] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The application is intended to cover any variations, uses or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice in the art to which the application pertains. The specification and examples are to be regarded as exemplary only, and the true scope and spirit of the application are indicated by the following claims.

[0109] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A tree rendering processing method, characterized in that: include: Determine the grid coordinates of the trees to be rendered in the target image; Determining trees in a visible area among the trees to be rendered according to the grid coordinates; generating a draw call instruction according to the drawing information corresponding to the trees in the visible area, and sending the draw call instruction to a rendering execution module, so that the rendering execution module renders the trees to be rendered according to the draw call instruction; Wherein, the drawing information includes: position information, scaling information and rotation information; Determining the grid coordinates of the trees to be rendered in the target image specifically includes: Determining three-level grid coordinates of trees to be rendered in a target image, the three-level grid coordinates including a first grid coordinate, a second grid coordinate, and a third grid coordinate, the second grid coordinate being within the first grid coordinate, the third grid coordinate being within the second grid coordinate, and the grid space corresponding to the third grid coordinate being a grid space that accommodates only one tree; and a first distance between any two third grid coordinates in the second grid coordinates being less than or equal to a preset distance; or, Secondary grid coordinates of a tree to be rendered in a target image are determined, where the secondary grid coordinates include a first grid coordinate and a third grid coordinate, the third grid coordinate is within the first grid coordinate, and a grid space corresponding to the third grid coordinate is a grid space that accommodates only one tree.

2. The method according to claim 1, characterized in that When the grid coordinates are third-level grid coordinates, determining the trees in the visible area among the trees to be rendered according to the grid coordinates specifically includes: Determining whether a first grid space corresponding to the first grid coordinates is located within a camera viewing cone or intersects with the camera viewing cone; When the first grid space is located inside the camera viewing cone, the trees in the first grid space are trees in the visible area; When the first grid space intersects with the camera visual cone area, determine whether the second grid space corresponding to the second grid coordinate in the first grid coordinate is located inside the camera visual cone area or intersects with the camera visual cone area; if the second grid space is located inside the camera visual cone area, the trees in the second grid space are trees in the visible area; if the second grid space intersects with the camera visual cone area, determine whether the third grid space corresponding to the third grid coordinate in the second grid coordinate is located inside the camera visual cone area or intersects with the camera visual cone area; if the third grid space is located inside the camera visual cone area or intersects with the camera visual cone area, the trees in the third grid space are trees in the visible area.

3. The method according to claim 2, characterized in that The determining whether the third grid space corresponding to the third grid coordinate in the second grid coordinate is located inside the camera's visual cone area or intersects with the camera's visual cone area specifically includes: In the same time period, it is determined according to multiple sets of third grid coordinates whether each of the third grid spaces is located inside the camera's visual cone area or intersects with the camera's visual cone area.

4. The method according to claim 1, wherein The first grid coordinates and the second grid coordinates are generated in the following manner: Dividing the three-dimensional space corresponding to the target image according to a first side length to generate a plurality of first grid spaces and first grid coordinates corresponding to the first grid spaces; Each of the first grid spaces is divided according to a second side length to generate a plurality of second grid spaces and second grid coordinates corresponding to the second grid spaces, wherein the first side length is greater than the second side length.

5. The method according to any one of claims 1 to 4, characterized in that Generating a draw call instruction according to the drawing information corresponding to the trees in the visible area specifically includes: Determining drawing information corresponding to each tree according to the grid coordinates corresponding to the trees in the visible area; determining a second distance between each tree and the camera position according to position information in the drawing information corresponding to each tree; A draw call instruction is generated according to the drawing information corresponding to each tree and the second distance.

6. The method according to claim 5, characterized in that Generating a draw call instruction according to the drawing information corresponding to each tree and the second distance specifically includes: determining whether the same second distance exists in the second distances; if so, generating a draw call instruction based on the drawing information corresponding to the trees at the same second distance, and generating a draw call instruction based on the drawing information corresponding to the trees at different second distances; if not, generating a draw call instruction based on the drawing information corresponding to each tree; or, Determine a distance level corresponding to each tree according to the second distance; and generate a draw call instruction according to drawing information corresponding to trees at the same distance level.

7. A tree rendering processing device, comprising a processor and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

9. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Three-dimensional earth drawing method and device

    CN111899323A