Rendering methods, devices, electronic equipment, and storage media for terrain tile data
By associating the location data of terrain tiles with the texture coordinates of the 3D target texture, efficient rendering of multiple terrain tiles is achieved, solving the problems of rendering smoothness and GPU performance in existing technologies, and improving rendering efficiency and smoothness.
Patent Information
- Application Number
- CN202111459579.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2041-12-02
AI Technical Summary
In existing technologies, geographic information 3D display platforms struggle to achieve high smoothness when rendering terrain tiles, leading to decreased GPU performance and frequent switching of texture objects impacting rendering efficiency.
By acquiring the tile data corresponding to the tile identifier, using it as the texture data of a pre-created 3D target texture, and rendering based on the correspondence between position data and texture coordinates, the rendering of multiple terrain tiles is achieved using the 3D target texture, avoiding texture object switching.
It improves rendering efficiency and GPU performance, ensures smooth rendering, reduces the interaction between the GPU and CPU, and enhances processing efficiency.
Smart Images

Figure CN114155332B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of geographic information technology, and more specifically, to a method, apparatus, electronic device, and storage medium for rendering terrain tile data. Background Technology
[0002] In recent years, 3D data visualization technology has become increasingly mature. This technology, with its strong controllability, high security, low cost, and intuitive and rich display information, has been favored by research institutions both domestically and internationally. However, due to limitations imposed by hardware and software conditions, current real-time 3D display platforms struggle to meet practical application requirements, and research on related technologies is currently insufficient. Therefore, autonomous and controllable 3D display platforms implemented using underlying graphics rendering technologies and related algorithms remain the mainstream solution. Depending on the implementation method and the underlying technologies utilized, the performance of 3D display platforms can vary significantly.
[0003] The display of geographic information is fundamental to the entire 3D display platform. Geographic information can be divided into two main categories from a rendering perspective: rasterized data and vector data. Rasterized data can be further divided into image data and elevation data. The vast range of detail levels required by 3D display platforms presents significant challenges to the management and display of rasterized data. For example, the display distance dimension for global geographic information, geographic information of a specific country, or geographic information of different regions can reach thousands or even tens of thousands of kilometers; while for close-range observation scenarios around a local area or a single radar station, the display dimension may shrink to a few kilometers or even hundreds of meters. Given such large dimensional variations, properly managing and optimizing display data is fundamental to the geographic information display capabilities of 3D display platforms.
[0004] In existing technologies, the 3D display of geographic information is usually achieved based on tile storage. Each terrain tile corresponds to a different range of location data. The higher the level of the terrain tile, the smaller the latitude and longitude range (display distance dimension) it corresponds to. During rendering, each terrain tile corresponds to a texture object. For different rendering requirements of terrain tiles, it is necessary to constantly switch the texture object corresponding to the terrain tile. This makes it difficult to achieve a high rendering speed, resulting in poor rendering smoothness and affecting the performance of the graphics processing unit (GPU). Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a method, apparatus, electronic device and storage medium for rendering terrain tile data, with the aim of solving the problem of how to improve GPU processing efficiency and performance.
[0006] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: a method for rendering terrain tile data, the method comprising:
[0007] Obtain a rendering request for the terrain tile to be rendered, which includes the tile identifier of the terrain tile to be rendered;
[0008] Based on the tile identifier, obtain the tile data corresponding to the tile identifier. The tile data includes location data and image data.
[0009] Use the image data corresponding to the tile identifier as the texture data of the pre-created 3D target texture;
[0010] Based on the position data corresponding to the tile identifier and the first correspondence, texture data is rendered using a three-dimensional target texture. The aforementioned first correspondence is the correspondence between each position data and each texture coordinate.
[0011] The beneficial effects of this invention are as follows: When rendering a terrain tile to be rendered, the tile data corresponding to the tile identifier can be obtained based on the tile identifier. Then, the image data corresponding to the tile identifier is used as the texture data of a pre-created 3D target texture. Based on the correspondence between the position data corresponding to the tile identifier and the texture coordinates of the 3D target texture, the texture data is rendered through the 3D target texture to achieve the rendering of the terrain tile to be rendered. Through the solution of this invention, since the image data corresponding to the tile identifier can be used as the texture data of the 3D target texture, and the position data of the terrain tile is associated with the texture coordinates of the 3D target texture, multiple terrain tiles can be rendered through a single 3D target texture. When rendering different terrain tiles, there is no need to switch texture objects, which not only ensures the smoothness of rendering but also improves rendering efficiency and GPU performance.
[0012] Based on the above technical solution, the present invention can be further improved as follows.
[0013] Furthermore, the above-mentioned rendering of texture data through a three-dimensional target texture based on the position data corresponding to the tile identifier and the first correspondence includes:
[0014] Based on the location data corresponding to the tile identifier and the first correspondence, determine the texture coordinates corresponding to the tile identifier;
[0015] Based on the texture coordinates corresponding to the tile identifier, texture data is rendered using a 3D target texture.
[0016] The beneficial effect of adopting the above-mentioned further solution is that when rendering according to the position data corresponding to the tile identifier, it is necessary to let the 3D target texture know where to render. Based on the first correspondence and the position data corresponding to the tile identifier, the position where the 3D target texture will render the texture data can be determined, that is, the texture coordinates corresponding to the tile identifier. This can render the terrain tile to be rendered more accurately.
[0017] Furthermore, the aforementioned location data includes geographic coordinates and layer number, and the texture coordinates include location texture coordinates and layer number texture coordinates; the aforementioned first correspondence includes a second correspondence between each geographic coordinate and each location texture coordinate, and a third correspondence between each layer number and each layer number texture coordinate;
[0018] The above-mentioned determination of the texture coordinates corresponding to the tile identifier based on the position data corresponding to the tile identifier and the first correspondence relationship includes:
[0019] Based on the geographic coordinates corresponding to the tile identifier and the second correspondence, determine the location texture coordinates corresponding to the tile identifier;
[0020] Based on the layer number corresponding to the tile identifier and the third correspondence, the layer number texture coordinates corresponding to the tile identifier are determined. The texture coordinates corresponding to the tile identifier include the position texture coordinates and the layer number texture coordinates.
[0021] The beneficial effect of adopting the above-mentioned further scheme is that, since the location data of terrain tiles includes information on both the number of layers and geographical location, when determining the texture coordinates of the three-dimensional target texture, the texture coordinates corresponding to the location data of the terrain tiles can be determined based on the corresponding correspondence, so that different terrain tiles can be rendered through a single three-dimensional target texture.
[0022] Furthermore, the tile data corresponding to the aforementioned tile identifiers is stored in the central processing unit (CPU). If the rendering request includes multiple tile identifiers, the tile data corresponding to each tile identifier is obtained based on the tile identifier, including:
[0023] For each tile identifier, the tile data corresponding to the tile identifier is obtained from the CPU based on the tile identifier;
[0024] Store the tile data corresponding to each tile identifier in the cache of the graphics processing unit (GPU);
[0025] The above-mentioned rendering of texture data through a 3D target texture based on the position data corresponding to the tile identifier and the first correspondence includes:
[0026] Read the texture data corresponding to the 3D target texture from the cache in sequence;
[0027] Based on the location data corresponding to the tile identifier and the first correspondence, the read texture data is rendered using a three-dimensional target texture.
[0028] The beneficial effect of adopting the above-mentioned further solution is that when multiple terrain tiles need to be rendered at once, the tile data corresponding to each tile identifier can be obtained from the CPU first, and these tile data can be stored in the GPU cache all at once. In this way, when rendering each terrain tile, it is not necessary for each terrain tile to request the required tile data from the CPU, thereby improving processing efficiency and GPU performance.
[0029] Furthermore, each terrain tile also corresponds to a spatial identifier, which represents the storage space occupied by the tile data corresponding to that terrain tile; the above-mentioned storage of the tile data corresponding to each tile identifier into the GPU cache includes:
[0030] Based on the spatial identifier of the terrain tile corresponding to each tile identifier, determine the storage space occupied by storing the tile data corresponding to each terrain tile;
[0031] Determine if there is free storage space in the GPU's cache;
[0032] If there is free storage space in the cache, the size of the free storage space is determined. Based on the storage space size corresponding to each terrain tile and the size of the free storage space, the tile data corresponding to the target number of terrain tiles is stored in the free storage space. The storage space size corresponding to the target number of terrain tiles is not greater than the size of the free storage space.
[0033] The beneficial effect of adopting the above-mentioned further solution is that, since the GPU's storage resources are limited, and storing too much data in the GPU will affect the GPU's performance, when storing the tile data corresponding to each tile identifier into the GPU's cache, it is necessary to consider whether there is free storage space in the cache to store this tile data. If there is free storage space, the tile data corresponding to the terrain tiles of the target data can be stored in the free storage space. Considering the GPU's storage space when storing tile data can ensure that the GPU runs smoothly.
[0034] Furthermore, if there is no free storage space in the aforementioned cache area, the method further includes:
[0035] Determine if any rendered terrain tiles exist in the cache.
[0036] If there are already rendered terrain tiles, delete the tile data corresponding to the rendered terrain tiles.
[0037] The advantage of adopting the above-mentioned further solution is that if there is no free storage space in the cache, it can be determined whether there is any storage space in the cache that can be released. If so, the space in the cache can be released, thereby making full use of the GPU's storage resources.
[0038] Furthermore, the aforementioned cache area includes multiple sub-storage spaces, each sub-storage space corresponds to a storage identifier, and each storage identifier corresponds to a stack-based index table;
[0039] The above determination of whether there is free storage space in the cache includes:
[0040] Determine if there are any unpopped storage identifiers in the index table;
[0041] If there are unpopped storage identifiers in the index table, it is determined that there is free storage space in the cache.
[0042] If there is no unpopped storage identifier in the index table, it is determined that there is no free storage space in the cache.
[0043] The beneficial effect of adopting the above-mentioned further scheme is that by using a stack-based index table to manage the storage space of the cache, the popping of a storage identifier indicates that the sub-storage space corresponding to that storage identifier has been occupied, and the push of a storage identifier indicates that the sub-storage space corresponding to that storage identifier has not been used. Therefore, based on whether there are any unpopped storage identifiers in the index table, it can be determined whether there is any free storage space in the cache. By managing each storage identifier through a stack-based index table, it is easier to manage the cache. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below.
[0045] Figure 1 This is a flowchart illustrating a method for rendering terrain tile data according to an embodiment of the present invention.
[0046] Figure 2 A flowchart illustrating a method for rendering terrain tile data, provided in yet another embodiment of the present invention;
[0047] Figure 3 This is a schematic diagram of a terrain tile data rendering device provided in one embodiment of the present invention;
[0048] Figure 4 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation
[0049] The principles and features of the present invention are described below. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0050] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0051] The solution provided in this invention can be applied to any application scenario that requires rendering terrain tiles. This invention provides a possible implementation method, such as... Figure 1 The diagram shows a flowchart of a method for rendering terrain tile data. This method can be executed by any electronic device, such as a GPU (Graphics Processing Unit), or by a GPU and a CPU (Central Processing Unit / Processor). For ease of description, the method provided in this embodiment will be described below using a GPU as the execution entity as an example. Figure 1 The flowchart shown indicates that the method may include the following steps:
[0052] Step S110: Obtain a rendering request for the terrain tile to be rendered, the rendering request including the tile identifier of the terrain tile to be rendered.
[0053] Step S120: Based on the tile identifier, obtain the tile data corresponding to the tile identifier. The tile data includes location data and image data.
[0054] Step S130: Use the image data corresponding to the tile identifier as the texture data of the pre-created three-dimensional target texture.
[0055] Step S140: Based on the position data corresponding to the tile identifier and the first correspondence, render texture data through the three-dimensional target texture. The first correspondence is the correspondence between each position data and each texture coordinate.
[0056] The method of this invention allows for the rendering of terrain tiles when a tile identifier is to be rendered. The tile data corresponding to the tile identifier is obtained, and the image data corresponding to the tile identifier is used as the texture data of a pre-created 3D target texture. Based on the correspondence between the position data corresponding to the tile identifier and the texture coordinates of the 3D target texture, the texture data is rendered using the 3D target texture, thus achieving the rendering of the terrain tile. Because the image data corresponding to the tile identifier can be used as the texture data of the 3D target texture, and the position data of the terrain tile can be associated with the texture coordinates of the 3D target texture, multiple terrain tiles can be rendered using a single 3D target texture. When rendering different terrain tiles, there is no need to switch texture objects, ensuring smooth rendering and improving rendering efficiency and GPU performance.
[0057] The following specific embodiments further illustrate the solution of the present invention. In this embodiment, a method for rendering terrain tile data may include the following steps:
[0058] Step S110: Obtain a rendering request for the terrain tile to be rendered, the rendering request including the tile identifier of the terrain tile to be rendered.
[0059] The aforementioned rendering request refers to a request to render the terrain tiles to be rendered. This request can be generated based on a user's trigger operation on the client interface of the terminal device. The specific form of this trigger operation can be configured as needed. For example, it could be a trigger action at a specific location on the application interface of the terminal device. In practice, the trigger operation can be a trigger selection operation based on a relevant trigger identifier. The specific form of the trigger identifier can be configured according to actual needs. For example, it could be a specified virtual button or input box on the client interface. Specifically, for example, it could be a virtual button displaying "XXX" on the client interface. Clicking this virtual button indicates that the user wants to view the geographic information corresponding to "XXX".
[0060] Among them, the tile identifier is used to identify the identity of the terrain tile, that is, to indicate which geographical location the terrain tile corresponds to. For the sake of convenience, the terrain tile is referred to as a tile below. Each tile corresponds to a unique tile identifier. The tile identifier can be at least one of numbers, characters or text. The specific form of the tile identifier is not limited in this invention, and all are within the protection scope of this invention.
[0061] The terrain tiles to be rendered can be tiles corresponding to map data, such as a map of a country, a map of a province, or a world map.
[0062] Step S120: Based on the tile identifier, obtain the tile data corresponding to the tile identifier. The tile data includes location data and image data.
[0063] Different tile identifiers correspond to different tile data. Location data includes the tile's geographic coordinates and layer number. Geographic coordinates represent the tile's geographical location, such as latitude and longitude coordinates. The layer number represents the latitude and longitude range corresponding to the tile; a larger layer number indicates a smaller latitude and longitude range. Different layer numbers distinguish the latitude and longitude ranges corresponding to tiles. The layer number can be at least one of numbers, characters, or text; the specific form of the layer number is not limited in this invention. Image data refers to the image corresponding to each tile, and different tiles correspond to different image data.
[0064] The above rendering request is received by the GPU. Tile data is usually stored in the CPU. Based on the rendering request, the GPU can obtain the tile data corresponding to the tile identifier and store the tile data in the GPU's cache.
[0065] The location data and image data corresponding to the above tile identifiers can be obtained separately or together. For example, the location data can be obtained first and then the image data, or the location data and image data can be obtained simultaneously.
[0066] If the rendering request includes multiple tile identifiers, meaning the user wants to view multiple tiles simultaneously, then the process of retrieving the tile data corresponding to each tile identifier can include:
[0067] For each tile identifier, the tile data corresponding to the tile identifier is obtained from the CPU based on the tile identifier;
[0068] Store the tile data corresponding to each tile identifier in the cache of the graphics processing unit (GPU);
[0069] The above-mentioned rendering of texture data through a 3D target texture based on the position data corresponding to the tile identifier and the first correspondence includes:
[0070] Read the texture data corresponding to the 3D target texture from the cache in sequence;
[0071] Based on the location data corresponding to the tile identifier and the first correspondence, the read texture data is rendered using a three-dimensional target texture.
[0072] When a rendering request includes multiple tile identifiers, the CPU can be consulted to obtain the tile data corresponding to each tile identifier. The tile data corresponding to each tile identifier is then stored in the GPU's cache all at once. When rendering is required, the tile data can be read sequentially from the GPU's cache. The image data in the read tile data is used as texture data. Based on the position data corresponding to the tile identifier and the first correspondence, the read texture data is rendered using a 3D target texture. This eliminates the need to request tile data from the CPU for each rendering, reducing the interaction between the GPU and the CPU and improving processing efficiency.
[0073] It is understandable that after storing the tile data corresponding to each tile identifier in the buffer, one possible way to use the image data corresponding to the tile identifier as the texture data of the 3D target texture is to sequentially use the image data corresponding to each tile identifier in the buffer as the texture data of the 3D target texture.
[0074] The texture data read above is image data. In practical applications, during rendering, the texture data corresponding to one tile can be read and rendered once, or the texture data corresponding to multiple tiles can be read and rendered simultaneously. The solution of this invention is not limited and can be set according to actual needs.
[0075] For 3D target textures, rendering involves rendering the data stored within the 3D target texture. Therefore, one possible way to use the image data corresponding to the tile identifiers as the texture data of the 3D target texture is to store the image data corresponding to the tile identifiers in the 3D target texture. During rendering, the 3D target texture can then directly render its stored data. In practical applications, 3D target textures typically run on a GPU.
[0076] The aforementioned image data and location data can be stored separately in different storage spaces within the GPU. For example, location data can be stored in the GPU's vertex storage space, and image data can be stored in the GPU's image storage space, to facilitate the management of image data and location data.
[0077] Given the limited storage space of the GPU, when multiple tiles need to be rendered simultaneously, it's necessary to first check if there is free storage space in the GPU cache to ensure normal rendering. Therefore, each terrain tile also corresponds to a spatial identifier, which represents the storage space occupied by the tile data corresponding to that terrain tile. The process of storing the tile data corresponding to each tile identifier into the GPU cache includes:
[0078] Based on the spatial identifier of the terrain tile corresponding to each tile identifier, determine the storage space occupied by storing the tile data corresponding to each terrain tile;
[0079] Determine if there is free storage space in the GPU's cache;
[0080] If there is free storage space in the cache, the size of the free storage space is determined. Based on the storage space size corresponding to each terrain tile and the size of the free storage space, the tile data corresponding to the target number of terrain tiles is stored in the free storage space. The storage space size corresponding to the target number of terrain tiles is not greater than the size of the free storage space.
[0081] Since GPUs have limited storage resources, and storing too much data in a GPU can affect its performance, it is necessary to consider whether there is free storage space in the cache when storing the tile data corresponding to each tile identifier into the GPU's cache. If there is free storage space, the tile data corresponding to the terrain tiles of the target data can be stored in the free storage space. Considering the GPU's storage space when storing tile data can ensure smooth GPU operation.
[0082] The target number refers to the number of terrain tiles stored in the free storage space, and it is an integer not less than 1. Understandably, if the number of requested terrain tiles exceeds the target number, the first target number of requested terrain tiles can be stored in the free storage space. After the target number of terrain tiles have been rendered, their data can be deleted, and then the later requested terrain tiles can be stored in the free storage space. Alternatively, rendered tiles can be deleted while rendering to free up cached storage space. The number of later terrain tiles does not need to exceed the target number. "First" and "nearest" refer to their rendering order.
[0083] The aforementioned spatial identifier can be represented by at least one of text, characters, or data. The present invention does not limit the specific form of the spatial identifier, and all of them are within the protection scope of the present invention.
[0084] If there is no free storage space in the cache, the method may further include:
[0085] Determine if any rendered terrain tiles exist in the cache.
[0086] If there are already rendered terrain tiles, delete the tile data corresponding to the rendered terrain tiles.
[0087] If there is no free storage space in the cache, it can be determined whether there is any storage space that can be released in the cache. If so, the space in the cache can be released, thereby making full use of the GPU's storage resources.
[0088] After storing the tile data for the already rendered terrain tiles, the tile data for the tiles to be rendered can be stored in the cache, such as the later terrain tiles in the requested terrain tiles described earlier. This allows for the release of cache storage space while rendering, ensuring smooth GPU operation.
[0089] Optionally, each terrain tile can also correspond to a timestamp, which represents the rendering time of that terrain tile. Therefore, when determining whether there are rendered terrain tiles in the cache, the specific tiles that are rendered can be determined based on the timestamps of each tile stored in the cache. The earlier the rendering time of a tile, the greater the probability that the tile is rendered.
[0090] In an optional embodiment of the present invention, the above-mentioned cache area includes multiple sub-storage spaces, each sub-storage space corresponds to a storage identifier, and each storage identifier corresponds to a stack-based index table;
[0091] Determine if there is free storage space in the cache, including:
[0092] Determine if there are any unpopped storage identifiers in the index table;
[0093] If there are unpopped storage identifiers in the index table, it is determined that there is free storage space in the cache.
[0094] If there is no unpopped storage identifier in the index table, it is determined that there is no free storage space in the cache.
[0095] The stack-based index table follows a Last-In-First-Out (LIFO) principle. Due to this principle, the cache storage space is pre-divided before use, with each sub-storage space corresponding to the tile data of one tile. Therefore, during initialization, the maximum number of stack nodes, i.e., the number of tiles that can be stored, or the number of sub-storage spaces, needs to be specified. If the 3D target texture can render multiple tiles at once, the corresponding number of layers, i.e., the number of tiles that can be rendered at once, needs to be pre-determined when creating the 3D target texture.
[0096] Based on the Last-In-First-Out (LIFO) principle, the storage identifier of the last-added tile corresponds to the tile data of the tile rendered first, and the storage identifier of the first-added tile corresponds to the tile data of the tile rendered later. Thus, for a rendered tile, it can be popped from the stack first, or the tile data at the top of the stack can be deleted first. During rendering, a storage identifier is popped from the stack according to the rendering order. The popping of this storage identifier indicates that the storage space corresponding to that identifier has been used, i.e., the corresponding tile data has been stored.
[0097] Optionally, if a new tile needs to be rendered, the data in the sub-storage space corresponding to the popped storage identifier can be deleted, and the popped storage identifier can be pushed onto the stack. At this time, the push of the storage identifier indicates that the sub-storage space corresponding to the storage identifier has not been used and has been released, so that the tile data of other tiles can be stored. Furthermore, due to the last-in-first-out principle, the storage identifier corresponding to the tile that has been rendered first can be popped from the stack first. When the storage identifier is pushed back onto the stack, it will still be at the top of the stack. Based on the last-in-first-out principle of the stack, it can be ensured that the rendering order of each tile is consistent with the arrangement order of the tiles.
[0098] As an example, a stack-based index table can be represented as [1~N], where N represents the number of storable tiles, and 1~N represent the storage identifiers corresponding to each tile. Following the rendering order, the image data corresponding to storage identifier 1 is rendered first, followed by storage identifier 2 and the image data corresponding to subsequent storage identifiers. During rendering, storage identifier 1 is popped from the stack, indicating that the sub-storage space corresponding to storage identifier 1 has been utilized. After rendering the image data corresponding to storage identifier 1, the tile data corresponding to storage identifier 1 can be deleted, releasing the sub-storage space. Then, storage identifier 1 can be pushed onto the stack, indicating that the sub-storage space corresponding to storage identifier 1 is now unused and can be used to store tile data for other tiles.
[0099] Step S130: Use the image data corresponding to the tile identifier as the texture data of the pre-created three-dimensional target texture.
[0100] Step S140: Based on the position data corresponding to the tile identifier and the first correspondence, render texture data through the three-dimensional target texture. The first correspondence is the correspondence between each position data and each texture coordinate.
[0101] Based on the foregoing description, one possible way to use the image data corresponding to the tile identifier as texture data for the 3D target texture is to store the image data corresponding to the tile identifier in the 3D target texture. Since tile data includes both position data and image data, the position data can also be stored in the 3D target texture.
[0102] The first correspondence described above maps the tile's position data to its texture coordinates, allowing the tile's position data to be matched with its corresponding texture coordinates, thus displaying the tile's image data. Different tile positions correspond to different texture coordinates. Both texture coordinates and position data can be represented by three-dimensional arrays. Therefore, the correspondence between position data and texture coordinates is the correspondence between the three-dimensional data corresponding to the position data and the three-dimensional array corresponding to the texture coordinates. For example, if the position data is represented by a three-dimensional array (x, y, z), and the texture coordinates are represented by a three-dimensional array (u, v, w), then the first correspondence is between (x, y, z) and (u, v, w).
[0103] In an optional embodiment of the present invention, the above-mentioned rendering of texture data through a three-dimensional target texture based on the position data corresponding to the tile identifier and the first correspondence relationship may include:
[0104] Based on the location data corresponding to the tile identifier and the first correspondence, determine the texture coordinates corresponding to the tile identifier;
[0105] Based on the texture coordinates corresponding to the tile identifier, texture data is rendered using a 3D target texture.
[0106] Different location data correspond to different texture coordinates. Based on the first correspondence, we can determine what the texture coordinates of the tile identifier are and where the image data corresponding to the tile identifier is rendered on the screen. This ensures that the display position of the tile is consistent with its actual position after rendering.
[0107] Since the location data includes geographic coordinates and layer number, the corresponding texture coordinates include location texture coordinates and layer number texture coordinates. The aforementioned first correspondence includes a second correspondence between each geographic coordinate and each location texture coordinate, and a third correspondence between each layer number and each layer number texture coordinate. Therefore, determining the texture coordinates corresponding to a tile identifier based on the location data corresponding to the tile identifier and the first correspondence includes:
[0108] Based on the geographic coordinates corresponding to the tile identifier and the second correspondence, determine the location texture coordinates corresponding to the tile identifier;
[0109] Based on the layer number corresponding to the tile identifier and the third correspondence, the layer number texture coordinates corresponding to the tile identifier are determined. The texture coordinates corresponding to the tile identifier include the position texture coordinates and the layer number texture coordinates.
[0110] In this context, geographic coordinates represent the geographical location of the tile, which can be expressed using latitude and longitude coordinates. The layer number represents the latitude and longitude range; the larger the layer number, the smaller the corresponding latitude and longitude range. For example, location data can be represented as (x, y, z), where (x, y) represents the geographic coordinates and z represents the layer number. Correspondingly, for texture coordinates (u, v, w), (u, v) can be the location texture coordinates corresponding to the geographic coordinates, and w is the layer texture coordinates corresponding to the layer number z.
[0111] The aforementioned 3D target textures can be created during initialization, and different underlying graphics display APIs provide corresponding support: for example, in OpenGL, glBindTexture is used to bind the texture to a GL_TEXTURE_2D_ARRAY or GL_TEXTURE_3D target to create a 3D texture (3D target texture); in Direct3D, CreateTexture2D is used to set the ArraySize in the texture parameter to a non-zero value to create a 3D texture (3D target texture).
[0112] In an optional embodiment of the present invention, the above-mentioned method of obtaining the tile data corresponding to the tile identifier based on the tile identifier may include: obtaining the position data corresponding to the tile identifier based on the tile identifier; and obtaining the image data corresponding to the tile identifier based on the first correspondence and the layer number corresponding to the tile identifier.
[0113] Optionally, the aforementioned tiles can be determined using the Mercator projection. The specific process is as follows: the global latitude and longitude range is projected onto a square region using the Mercator projection; the image corresponding to this square region is the initial level of detail (LOD0). This square region is then divided into four equal sub-square regions, with each sub-region corresponding to the next level of detail (LOD1). Here, LOD represents geographic coordinates. This process is repeated, continuously subdividing the square regions at each level to generate regions with higher levels of detail. In this process, the image corresponding to each square region is called a tile. The original data resolution of each tile is usually the same, but the corresponding geographic coordinate range differs; the higher the level of detail, the smaller the latitude and longitude range of the tile.
[0114] The rendering process described above involves determining the 3D target texture, setting the shader parameters, and then rendering based on those parameters.
[0115] Optionally, the tile location data may include three data members: a Vec4 type mcRange (geographic coordinates) (a quadruple consisting of four floating-point numbers x, y, z, w) representing the start and end values of the Mercator projection coordinates corresponding to the tile; a Vec4 type texRange (texture coordinates) representing the start and end values of the first two components (u, v) (position texture coordinates) of the texture coordinates corresponding to the tile; and a float type layerIndex (layer number) representing the third component w (layer number texture coordinates) of the texture coordinates corresponding to the tile.
[0116] To better illustrate and understand the principle of the method provided by this invention, the following description uses an optional specific embodiment to illustrate the solution of this invention. It should be noted that the specific implementation of each step in this specific embodiment should not be construed as a limitation of the solution of this invention. Other implementations that can be conceived by those skilled in the art based on the principle of the solution provided by this invention should also be considered within the scope of protection of this invention.
[0117] See Figure 2 The rendering process shown in the example diagram illustrates that, in this embodiment, multiple tiles are first obtained through Mercator projection. The position data of each tile can be represented as (x, y, z), where (x, y) represents the geographic coordinates and z represents the layer number.
[0118] During initialization, a 3D texture (three-dimensional target texture) is created, which can be represented as (u,v,w), where (u,v) are the location texture coordinates corresponding to geographic coordinates, and w is the layer texture coordinates corresponding to the layer number z. Based on the tile location data and texture coordinates, a first correspondence is established. The first correspondence includes a second correspondence between each geographic coordinate and each location texture coordinate, and a third correspondence between each layer and each layer texture coordinate.
[0119] Load all tile data into the CPU's local cache and determine whether there are any unrendered tiles (tile objects) in each tile corresponding to the above tile data.
[0120] If there are unprocessed tile objects, the GPU sends a rendering request to the CPU, and the rendering request includes multiple tile identifiers. For each tile identifier, the position data (x, y, z) corresponding to the tile identifier is obtained from the CPU. Based on the first correspondence and the layer number z corresponding to the tile identifier, the image data corresponding to the tile identifier is obtained.
[0121] The GPU cache comprises multiple sub-storage spaces, each corresponding to a storage identifier, and each storage identifier corresponds to a stack-based index table. The process involves determining if there are any unpopped storage identifiers in the index table; if so, it's determined that there is free storage space in the cache; otherwise, it's determined that there is no free storage space. If free storage space exists, its size is determined. Based on the space identifier of the terrain tile corresponding to each tile identifier, the storage space required to store the tile data for each terrain tile is determined. Based on the storage space size for each terrain tile and the available storage space, the target number of terrain tile data are stored in the available storage space. Figure 2 The CPU shown records the vertex coordinates (position data) and texture coordinates of the tiles to the local buffer (cache), wherein the storage space corresponding to the target number of terrain tiles is no larger than the size of the free storage space.
[0122] If there is no free storage space in the cache, it can also be determined whether there are already rendered terrain tiles in the cache; if there are already rendered terrain tiles, delete the tile data corresponding to the rendered terrain tiles and release the storage resources of the cache to store the tile data.
[0123] After storing the tile data corresponding to the target number of terrain tiles in the free storage space, the location texture coordinates corresponding to the tile identifier are determined according to the geographic coordinates corresponding to the tile identifier and the second correspondence; the layer number texture coordinates corresponding to the tile identifier are determined according to the layer number corresponding to the tile identifier and the third correspondence. The texture coordinates corresponding to the tile identifier include the location texture coordinates and the layer number texture coordinates.
[0124] For each tile, the image data corresponding to that tile is used as the texture data of the 3D target texture. During rendering, the texture data corresponding to each tile is read from the free storage space, and the read texture data is rendered through the 3D target texture according to the texture coordinates corresponding to each tile.
[0125] If no unprocessed tile objects exist, the CPU updates the tile data in its local cache and stores the updated tile data in the GPU's cache using the method described above (corresponding to...). Figure 2 The CPU->GPU process shown involves updating the local buffer to the GPU-instantiated vertex buffer (cache). Then, the tile data is bound to the 3D texture; that is, the updated image data is used as the texture data of the 3D target texture, and the updated position data is associated with the texture coordinates of the 3D target texture (corresponding to...). Figure 2The CPU->GPU (as shown in the diagram: binding 3D textures) stores the updated position data in the GPU's buffer (corresponding to...). Figure 2 The GPU shown here (binding instantiated vertex buffer) renders texture data based on position data using a 3D target texture (corresponding to...). Figure 2 The GPU shown is for instantiated rendering.
[0126] Based on the scheme in the above embodiments, performance tests were conducted on the scheme using a 3D display platform. A stable refresh rate of 60fps (V-Sync on) and a maximum of 71.2fps (V-Sync off) were achieved at 720p resolution. Under the same conditions, using conventional tile rendering, the highest frame rate at 720p resolution was 47.2fps, the lowest was 36.8fps, and the average was 44.1fps. Compared to the scheme of this invention, the rendering efficiency is lower. The hardware parameters corresponding to the above tests on the 3D platform are: Intel Core™ i3-2120 processor, 4GB 1333MHz memory, and NVIDIA GeForce GT420 graphics card. The above hardware parameters are merely examples and do not limit the scheme of this invention.
[0127] The method of this invention improves the overall rendering performance of terrain tiles by about 60%, and can run the method of this invention at an acceptable frame rate on the equipment hardware platform, reducing the hardware performance requirements of 3D software and making it feasible to introduce 3D situational awareness into equipment display and control software.
[0128] According to the solution of this invention, when rendering a terrain tile, the tile data corresponding to the tile identifier can be obtained based on the tile identifier. Then, the image data corresponding to the tile identifier is used as the texture data of a pre-created 3D target texture. Based on the correspondence between the position data corresponding to the tile identifier and the texture coordinates of the 3D target texture, the texture data is rendered through the 3D target texture to achieve the rendering of the terrain tile. Because the image data corresponding to the tile identifier can be used as the texture data of the 3D target texture, and the position data of the terrain tile is associated with the texture coordinates of the 3D target texture, multiple terrain tiles can be rendered using a single 3D target texture. When rendering different terrain tiles, there is no need to switch texture objects, which not only ensures the smoothness of rendering but also improves rendering efficiency and GPU performance. On the other hand, by managing the storage space of the cache using a stack-based index table, the storage space of the cache can be fully utilized.
[0129] Based on and Figure 1 Based on the same principle as the method shown, this embodiment of the invention also provides a terrain tile data rendering device 20, such as... Figure 3As shown, the rendering apparatus 20 for the terrain tile data may include a request acquisition module 210, a data acquisition module 220, a texture data determination module 230, and a rendering module 240, wherein:
[0130] The request acquisition module 210 is used to acquire a rendering request for the terrain tile to be rendered, and the rendering request includes the tile identifier of the terrain tile to be rendered.
[0131] The data acquisition module 220 is used to acquire the tile data corresponding to the tile identifier based on the tile identifier. The tile data includes location data and image data.
[0132] The texture data determination module 230 is used to use the image data corresponding to the tile identifier as the texture data of the pre-created three-dimensional target texture;
[0133] The rendering module 240 is used to render texture data through a three-dimensional target texture based on the position data corresponding to the tile identifier and the first correspondence relationship. The first correspondence relationship is the correspondence between each position data and each texture coordinate.
[0134] Optionally, when rendering texture data using a 3D target texture based on the position data corresponding to the tile identifier and the first correspondence, the rendering module 240 is specifically used for:
[0135] Based on the location data corresponding to the tile identifier and the first correspondence, determine the texture coordinates corresponding to the tile identifier;
[0136] Based on the texture coordinates corresponding to the tile identifier, texture data is rendered using a 3D target texture.
[0137] Optionally, the location data mentioned above includes geographic coordinates and layer number, and the texture coordinates include location texture coordinates and layer number texture coordinates; the first correspondence includes a second correspondence between each geographic coordinate and each location texture coordinate, and a third correspondence between each layer number and each layer number texture coordinate;
[0138] When the rendering module 240 determines the texture coordinates corresponding to the tile identifier based on the position data corresponding to the tile identifier and the first correspondence, it is specifically used for:
[0139] Based on the geographic coordinates corresponding to the tile identifier and the second correspondence, determine the location texture coordinates corresponding to the tile identifier;
[0140] Based on the layer number corresponding to the tile identifier and the third correspondence, the layer number texture coordinates corresponding to the tile identifier are determined. The texture coordinates corresponding to the tile identifier include the position texture coordinates and the layer number texture coordinates.
[0141] Optionally, the tile data corresponding to the aforementioned tile identifier is stored in the central processing unit (CPU). If the rendering request includes multiple tile identifiers, the data acquisition module 220, when acquiring the tile data corresponding to the tile identifier based on the tile identifier, specifically performs the following:
[0142] For each tile identifier, the tile data corresponding to the tile identifier is obtained from the CPU based on the tile identifier;
[0143] Store the tile data corresponding to each tile identifier in the cache of the graphics processing unit (GPU);
[0144] Based on the location data corresponding to the tile identifier and the first correspondence, texture data is rendered using a 3D target texture, including:
[0145] Read the texture data corresponding to the 3D target texture from the cache in sequence;
[0146] Based on the location data corresponding to the tile identifier and the first correspondence, the read texture data is rendered using a three-dimensional target texture.
[0147] Optionally, each terrain tile also corresponds to a spatial identifier, which represents the storage space occupied by the tile data corresponding to that terrain tile;
[0148] When the data acquisition module 220 stores the tile data corresponding to each tile identifier into the GPU's cache, it is specifically used for:
[0149] Based on the spatial identifier of the terrain tile corresponding to each tile identifier, determine the storage space occupied by storing the tile data corresponding to each terrain tile;
[0150] Determine if there is free storage space in the GPU's cache;
[0151] If there is free storage space in the cache, the size of the free storage space is determined. Based on the storage space size corresponding to each terrain tile and the size of the free storage space, the tile data corresponding to the target number of terrain tiles is stored in the free storage space. The storage space size corresponding to the target number of terrain tiles is not greater than the size of the free storage space.
[0152] Optionally, if there is no free storage space in the cache, the device further includes:
[0153] The storage space release module is used to determine whether there are rendered terrain tiles in the cache; if there are rendered terrain tiles, the tile data corresponding to the rendered terrain tiles is deleted.
[0154] Optionally, the above-mentioned cache area includes multiple sub-storage spaces, each sub-storage space corresponds to a storage identifier, and each storage identifier corresponds to a stack-based index table;
[0155] When determining whether there is free storage space in the cache, the aforementioned data acquisition module 220 is specifically used for:
[0156] Determine if there are any unpopped storage identifiers in the index table;
[0157] If there are unpopped storage identifiers in the index table, it is determined that there is free storage space in the cache.
[0158] If there is no unpopped storage identifier in the index table, it is determined that there is no free storage space in the cache.
[0159] The terrain tile data rendering device of this invention can execute the terrain tile data rendering method provided in this invention. The implementation principle is similar. The actions performed by each module and unit in the terrain tile data rendering device of each embodiment of this invention correspond to the steps in the terrain tile data rendering method of each embodiment of this invention. For detailed functional descriptions of each module of the terrain tile data rendering device, please refer to the descriptions in the corresponding terrain tile data rendering methods shown above. They will not be repeated here.
[0160] The aforementioned terrain tile data rendering device can be a computer program (including program code) running on a computer device, such as an application software; the device can be used to execute the corresponding steps in the method provided in the embodiments of the present invention.
[0161] In some embodiments, the terrain tile data rendering apparatus provided in this invention can be implemented using a combination of hardware and software. As an example, the terrain tile data rendering apparatus provided in this invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the terrain tile data rendering method provided in this invention. For example, the processor in the form of a hardware decoding processor can employ one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0162] In other embodiments, the terrain tile data rendering apparatus provided in this invention can be implemented in software. Figure 3 A rendering apparatus for terrain tile data stored in a memory is shown. It may be software in the form of programs and plug-ins, and includes a series of modules, including a request acquisition module 210, a data acquisition module 220, a texture data determination module 230, and a rendering module 240, for implementing the terrain tile data rendering method provided in the embodiments of the present invention.
[0163] The modules described in the embodiments of the present invention can be implemented in software or hardware. The names of the modules are not, in some cases, limiting the scope of the module itself.
[0164] Based on the same principles as the methods shown in the embodiments of the present invention, the embodiments of the present invention also provide an electronic device, which may include, but is not limited to: a processor and a memory; the memory for storing computer programs; and the processor for executing the methods shown in any embodiment of the present invention by invoking the computer programs.
[0165] In one alternative embodiment, an electronic device is provided, such as Figure 4 As shown, Figure 4 The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.
[0166] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 4001 may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0167] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0168] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0169] The memory 4003 stores the application code (computer program) for executing the present invention, and its execution is controlled by the processor 4001. The processor 4001 executes the application code stored in the memory 4003 to implement the content shown in the foregoing method embodiments.
[0170] Among these, electronic devices can also be terminal devices. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0171] This invention provides a computer-readable storage medium storing a computer program that, when run on a computer, enables the computer to execute the corresponding content in the aforementioned method embodiments.
[0172] According to another aspect of the present invention, a computer program product or computer program is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various embodiments described above.
[0173] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. These programming languages include object-oriented programming languages—such as Java, Smalltalk, and C++—and conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0174] It should be understood that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0175] The computer-readable storage medium provided in this invention can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0176] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the method shown in the above embodiments.
[0177] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.
Claims
1. A method for rendering terrain tile data, characterized in that, include: Obtain a rendering request for the terrain tile to be rendered, the rendering request including the tile identifier of the terrain tile to be rendered; Based on the tile identifier, obtain the tile data corresponding to the tile identifier, wherein the tile data includes location data and image data; The image data corresponding to the tile identifier is used as the texture data of the pre-created three-dimensional target texture; Based on the position data corresponding to the tile identifier and the first correspondence relationship, the texture data is rendered through the three-dimensional target texture, where the first correspondence relationship is the correspondence relationship between each position data and each texture coordinate. The three-dimensional target texture is created based on the underlying graphics display API during initialization; The step of rendering the texture data using the three-dimensional target texture based on the position data corresponding to the tile identifier and the first correspondence includes: Based on the location data corresponding to the tile identifier and the first correspondence, the texture coordinates corresponding to the tile identifier are determined; The texture data is rendered using the three-dimensional target texture based on the texture coordinates corresponding to the tile identifier. The location data includes geographic coordinates and layer number, and the texture coordinates include location texture coordinates and layer number texture coordinates; the first correspondence includes a second correspondence between each geographic coordinate and each location texture coordinate, and a third correspondence between each layer number and each layer number texture coordinate; The step of determining the texture coordinates corresponding to the tile identifier based on the location data corresponding to the tile identifier and the first correspondence includes: Based on the geographic coordinates corresponding to the tile identifier and the second correspondence, the location texture coordinates corresponding to the tile identifier are determined; Based on the layer number corresponding to the tile identifier and the third correspondence, the layer number texture coordinates corresponding to the tile identifier are determined, and the texture coordinates corresponding to the tile identifier include the position texture coordinates and the layer number texture coordinates; For each tile, the geographic coordinates represent the latitude and longitude coordinates corresponding to the tile, and the layer number represents the latitude and longitude range. For each of the aforementioned tiles, the specific determination process is as follows: The global latitude and longitude range is projected onto a square area using the Mercator projection. The image corresponding to this square area is the initial level of detail (LOD 0). This square area is then divided into four equal sub-square areas, and the image corresponding to each sub-square area is the next level of detail (LOD 1). Here, LOD represents geographic coordinates. Each sub-square area is continuously divided into equal parts, and the image corresponding to each equally divided square area is treated as a tile.
2. The method according to claim 1, characterized in that, The tile data corresponding to the tile identifier is stored in the central processing unit (CPU). If the rendering request includes multiple tile identifiers, obtaining the tile data corresponding to the tile identifier based on the tile identifier includes: For each tile identifier, the tile data corresponding to the tile identifier is obtained from the CPU based on the tile identifier; Store the tile data corresponding to each tile identifier in the cache of the graphics processing unit (GPU); The step of rendering the texture data using the three-dimensional target texture based on the position data corresponding to the tile identifier and the first correspondence includes: The texture data corresponding to the three-dimensional target texture is read sequentially from the cache area; Based on the location data corresponding to the tile identifier and the first correspondence, the read texture data is rendered using the three-dimensional target texture.
3. The method according to claim 2, characterized in that, Each terrain tile also corresponds to a spatial identifier, which represents the storage space occupied by the tile data corresponding to that terrain tile; The step of storing the tile data corresponding to each tile identifier into the GPU cache includes: Based on the spatial identifier of the terrain tile corresponding to each tile identifier, determine the storage space occupied by storing the tile data corresponding to each terrain tile; Determine if there is free storage space in the GPU's cache; If there is free storage space in the cache area, the size of the free storage space is determined. Based on the storage space size corresponding to each terrain tile and the size of the free storage space, the tile data corresponding to the target number of terrain tiles is stored in the free storage space. The storage space size corresponding to the target number of terrain tiles is not greater than the size of the free storage space.
4. The method according to claim 3, characterized in that If there is no free storage space in the cache area, it also includes: Determine whether there are already rendered terrain tiles in the cache area; If there are already rendered terrain tiles, delete the tile data corresponding to those rendered terrain tiles.
5. The method according to claim 3, characterized in that, The cache area includes multiple sub-storage spaces, each sub-storage space corresponds to a storage identifier, and each storage identifier corresponds to a stack-based index table; Determining whether there is free storage space in the cache includes: Determine whether there are any unpopped storage identifiers in the index table; If there are unpopped storage identifiers in the index table, then it is determined that there is free storage space in the cache area; If there are no unpopped storage identifiers in the index table, then it is determined that there is no free storage space in the cache area.
6. A rendering device for terrain tile data, characterized in that, The apparatus used in the rendering method for terrain tile data according to claim 1 includes: The request acquisition module is used to acquire a rendering request for a terrain tile to be rendered, wherein the rendering request includes the tile identifier of the terrain tile to be rendered; The data acquisition module is used to acquire the tile data corresponding to the tile identifier based on the tile identifier, wherein the tile data includes location data and image data; The texture data determination module is used to use the image data corresponding to the tile identifier as the texture data of a pre-created three-dimensional target texture; The rendering module is used to render the texture data through the three-dimensional target texture according to the position data corresponding to the tile identifier and the first correspondence relationship, wherein the first correspondence relationship is the correspondence relationship between each position data and each texture coordinate.
7. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method of any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1-5.
Citation Information
Patent Citations
Terrain rendering method, device and equipment and readable storage medium
CN109584366A
Map resource management method and device, computing device and storage medium
CN110570506A
Three-dimensional map generation method, terminal and server
CN110990510A