Rendering method and device, computer equipment and storage medium

The rendering method optimizes map rendering by using programmatic textures to determine vertex styles, reducing storage needs and improving performance by decoupling drawing units, thus enhancing efficiency and accuracy.

CN120318369APending Publication Date: 2025-07-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410057401.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-15
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

The prior art renders a map scene with a huge amount of data due to the addition of color information to the vertex attributes, which consumes a lot of storage resources, and re-modeling is required during scene switching, which affects the rendering efficiency.

Method used

By storing style identifiers in the drawing unit and using programmatic textures to find the target texture style of the vertex, the color information storage in the vertex attributes is reduced, and the rendering effect is decoupled, and the multiplexing of the drawing unit during scene switching is supported.

Benefits of technology

Reduces memory resource consumption, improves rendering performance and efficiency, supports no need to remodel when switching scenes, and improves the flexibility and efficiency of rendering effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318369A_ABST
    Figure CN120318369A_ABST
Patent Text Reader

Abstract

The invention relates to a rendering method and device and computer equipment. The embodiment of the invention can be applied to various scenes such as maps, navigation, smart traffic, auxiliary driving, film and television production, virtual reality and the like, and the method comprises the following steps: in response to an image display operation, obtaining a to-be-rendered target grid and a current rendering level; for any target grid, obtaining a rendering unit matched with the target network; the rendering unit comprises a plurality of vertexes, and the vertex attributes of the vertexes comprise style identifiers; obtaining a programmed texture matched with the current rendering; texture styles corresponding to different style identifiers and different rendering levels are stored in the programmed texture; determining a target texture style matched with each vertex from the programmed texture based on the current rendering level and the style identifier corresponding to each vertex; and rendering the rendering unit based on the target texture style matched with each vertex to obtain a rendering result. By adopting the method, the rendering efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technologies, and particularly to a rendering method, apparatus, computer device, storage medium, and computer program product. Background Art

[0002] With the development of computer technologies, rendering has become one of the key technologies in multiple fields. For example, in the usage scenario of maps, a map interface is usually rendered and displayed based on grid data.

[0003] In related technologies, when performing rendering related to map scenes, a color information is often directly appended to the vertex attributes of each vertex. Since there are often tens of thousands of vertices in a map, the amount of data to be processed during the rendering process is extremely large, and a large amount of storage resources are required. Summary of the Invention

[0004] Based on this, it is necessary to provide a rendering method, apparatus, computer device, computer-readable storage medium, and computer program product for the above technical problems.

[0005] On the one hand, this application provides a rendering method, including:

[0006] Responding to an image display operation, obtaining a target tile to be rendered and a current rendering level;

[0007] Obtaining a drawing unit corresponding to each of the target tiles; the drawing unit includes a plurality of vertices, and a style identifier is included in the attributes of the vertices;

[0008] Obtaining a procedural texture matching the current scene; different texture styles corresponding to different style identifiers and different rendering levels are stored in the procedural texture;

[0009] Based on the current rendering level and the style identifier corresponding to each vertex, determining a target texture style matching each vertex from the procedural texture;

[0010] Rendering based on the target texture style matching each vertex and the drawing unit to obtain a rendering result matching the current scene.

[0011] On the other hand, this application also provides an image rendering apparatus, including:

[0012] A response module, configured to obtain a target tile to be rendered and a current rendering level;

[0013] A first obtaining module, configured to obtain a drawing unit corresponding to each of the target tiles; the drawing unit includes a plurality of vertices, and a style identifier is included in the attributes of the vertices;

[0014] A second acquisition module, configured to acquire a procedural texture that matches the current scene; different texture styles corresponding to different style identifiers and different rendering levels are stored in the procedural texture;

[0015] A determination module, configured to determine, based on the current rendering level and the style identifier corresponding to each vertex, a target texture style that matches each vertex from the procedural texture;

[0016] A rendering module, configured to perform rendering based on the target texture styles matched by each vertex and the drawing unit to obtain a rendering result that matches the current scene.

[0017] On the other hand, the present application further provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0018] Acquire a target tile to be rendered and the current rendering level;

[0019] In response to an image display operation, acquire a target tile to be rendered and the current rendering level;

[0020] Acquire a drawing unit corresponding to each of the target tiles; the drawing unit includes a plurality of vertices, and a style identifier is included in the attributes of the vertices;

[0021] Acquire a procedural texture that matches the current scene; different texture styles corresponding to different style identifiers and different rendering levels are stored in the procedural texture;

[0022] Based on the current rendering level and the style identifier corresponding to each vertex, determine a target texture style that matches each vertex from the procedural texture;

[0023] Perform rendering based on the target texture styles matched by each vertex and the drawing unit to obtain a rendering result that matches the current scene.

[0024] On the other hand, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0025] In response to an image display operation, acquire a target tile to be rendered and the current rendering level;

[0026] Acquire a drawing unit corresponding to each of the target tiles; the drawing unit includes a plurality of vertices, and a style identifier is included in the attributes of the vertices;

[0027] Acquire a procedural texture that matches the current scene; different texture styles corresponding to different style identifiers and different rendering levels are stored in the procedural texture;

[0028] Determine a target texture style matching each vertex from the procedural texture based on the current rendering level and the style identifier corresponding to each vertex;

[0029] Render based on the target texture style matched by each vertex and the drawing unit to obtain a rendering result matching the current scene.

[0030] On the other hand, the present application also provides a computer program product, including a computer program, which when executed by a processor implements the following steps:

[0031] Obtain a target tile to be rendered and the current rendering level;

[0032] Obtain the drawing unit corresponding to each of the target tiles; the drawing unit includes a plurality of vertices, and the attributes of the vertices include style identifiers;

[0033] Obtain a procedural texture matching the current scene; the procedural texture stores texture styles corresponding to different style identifiers and different rendering levels;

[0034] Determine a target texture style matching each vertex from the procedural texture based on the current rendering level and the style identifier corresponding to each vertex;

[0035] Render based on the target texture style matched by each vertex and the drawing unit to obtain a rendering result matching the current scene.

[0036] The above rendering method, device, computer device, storage medium and computer program product obtain the target grid to be rendered and the current rendering level, ensuring the accuracy and pertinence of the data required for rendering; then, for each target, determine the drawing unit matching it, and the attributes of each vertex in the drawing unit include style identifiers. Furthermore, when vertex coloring is required, the target texture style of the vertex can be quickly and accurately found from the procedural texture matching the current scene based on the style identifier of the vertex and the current rendering level for coloring and rendering. In this way, by storing the style identifier in the attributes of each vertex in the drawing unit, compared with the method of storing color information in vertex attributes, since the identifier information requires less storage space than color information, the video memory resources can be greatly saved. In addition, since the data volume of the drawing unit itself is reduced, the rendering performance can also be improved during rendering.

[0037] Moreover, since the target texture style of the vertex is obtained based on the query operation for the procedural texture, the color information that originally needed to be stored in the vertex attribute is separately stored in the procedural texture, realizing the decoupling of the drawing unit and the rendering effect. When the displayed content remains unchanged but only the scene is switched, the drawing unit can be reused without re-modeling, which can greatly improve the rendering efficiency. Brief Description of the Drawings

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings required for use in the description of the embodiments or the related art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0039] Figure 1 It is an application environment diagram of the rendering method in an embodiment;

[0040] Figure 2 It is a schematic flowchart of the rendering method in an embodiment;

[0041] Figure 3 It is a simplified schematic diagram of a map tile in an embodiment;

[0042] Figure 4 It is a schematic diagram of style information stored in the form of a two-dimensional table in an embodiment;

[0043] Figure 5 It is a schematic flowchart of the construction method of the procedural texture in any scene in an embodiment;

[0044] Figure 6 It is an interaction schematic diagram between the CPU, GPU, and the procedural texture in an embodiment;

[0045] Figure 7 It is a schematic flowchart of the rendering method of the rendering result of any scene in an embodiment;

[0046] Figure 8 It is a schematic flowchart of the construction method of the procedural texture in any scene in an embodiment;

[0047] Figure 9 It is a structural block diagram of the rendering method device in an embodiment;

[0048] Figure 10 It is an internal structure diagram of a computer device that executes the rendering method in an embodiment. Detailed Embodiments

[0049] In order to make the objectives, technical solutions, and advantages of this application more clear and understandable, the following further elaborates on this application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely used to explain this application and are not used to limit this application.

[0050] The rendering results obtained through the rendering method in the embodiments of this application can be used in artificial intelligence technology and computer vision technology. Among them, the rendering results can be displayed in the form of visual images, and the visual images include at least one of the following: two-dimensional (2D) images and three-dimensional (3D) images. For the rendering operation of three-dimensional scene rendering, the corresponding rendering result displayed in the display view is a three-dimensional view image, that is, a 3D image; for the rendering result of two-dimensional scene rendering, the corresponding rendering result displayed in the display view is a two-dimensional view image, that is, a 2D image.

[0051] Artificial Intelligence (AI) is to use a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, and is a theory, method, technology, and application system that can perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines to enable the machines to have the functions of perception, reasoning, and decision-making.

[0052] Artificial intelligence technology is an interdisciplinary subject with a wide range of fields, including both hardware-level technologies and software-level technologies. Artificial intelligence basic technologies generally include, for example, sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics, etc. Among them, the pre-trained model is also called the large model or the basic model, and can be widely applied to downstream tasks in various major directions of artificial intelligence after fine-tuning. Artificial intelligence software technology mainly includes several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0053] Computer Vision Technology (CV) Computer vision is a science that studies how to enable machines to "see". More specifically, it refers to machine vision that uses cameras and computers to replace human eyes for tasks such as object recognition, detection, and measurement, and further performs graphic processing to make the computer-processed images more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies and attempts to build artificial intelligence systems that can obtain information from images or multi-dimensional data. Computer vision technology usually includes technologies such as image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, etc.

[0054] The rendering method provided by the embodiments of the present application can also be applied to various scenarios, including but not limited to scenarios such as maps, navigation, intelligent transportation, assisted driving, film and television production, 2D games, 3D games, virtual reality, etc. implemented based on computer vision technology.

[0055] The rendering method provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store style texture data, scene data to be rendered, etc. that the server 104 needs to process. The data storage system can be set separately, integrated on the server 104, or placed on the cloud or other network servers. An application client that supports image rendering and display based on tiles is deployed in the terminal 102. The application client can be a client for various business scenarios such as maps, navigation, intelligent transportation, assisted driving, film and television production, 2D games, 3D games, virtual reality, etc., such as a game client, a map client, a navigation client, etc. During the operation of the application client, the terminal determines the content to be displayed on the screen, sends a data acquisition request for the content to be displayed to the server, and receives the target tiles to be rendered corresponding to the content to be displayed and the current rendering level returned by the server based on the data acquisition request; obtains the drawing units corresponding to each target tile; each drawing unit includes multiple vertices, and the attributes of the vertices include style identifiers; obtains the procedural texture matching the current scene; the procedural texture stores texture styles corresponding to different style identifiers and different rendering levels; based on the current rendering level and the style identifiers corresponding to each vertex, determines the target texture style matching each vertex from the procedural texture; renders based on the target texture styles matching each vertex and the drawing unit to obtain a rendering result matching the current scene, and can display the rendering result on the screen of the terminal in the form of a visual image.

[0056] Among them, the terminal 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart in-vehicle devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers, or can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.

[0057] To facilitate the understanding of the technical solutions provided in the embodiments of the present application, some key terms used in the embodiments of the present application are explained here:

[0058] 1) Image rendering: It refers to the process of converting a three-dimensional scene or graphic data into a two-dimensional image. In computer graphics, image rendering involves calculating and simulating the geometric shapes, lighting, materials, etc. in the scene, and finally generating the final image result. The main goal of image rendering is to produce a realistic two-dimensional image with effects such as shadows, reflections, refractions, textures, etc., to simulate the lighting and material properties of the real world, and is used in fields such as visual presentation and animation production.

[0059] 2) Tiled rendering (also known as Tile-based rendering) is also called block-based rendering or small square-based rendering. It is a process of subdividing a computer graphics image through a regular grid in the optical space and rendering each part of the tile (tile) separately.

[0060] In some embodiments, as Figure 2 shown, a rendering method is provided. In this embodiment, the method is described by taking the application of the method to the Figure 1 terminal as an example. The terminal is deployed with an application client that supports rendering based on tiles and displaying the rendering result. The terminal realizes the rendering method of this embodiment through the cooperation of its own central processing unit CPU and graphics processing unit GPU. It can be understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is realized through the interaction between the terminal and the server. In this embodiment, the method includes the following steps 202 to step 210, where:

[0061] Step 202, obtain the target tile to be rendered and the current rendering level.

[0062] Among them, the target tile to be rendered is the tile corresponding to the content to be displayed on the current terminal screen. The rendering level is used to represent different rendering qualities or detail levels for the target tile to be rendered, and the rendering level can be determined based on the zoom level of the image displayed on the terminal screen. As the rendering level increases, the details and clarity of the image will also increase accordingly. The current rendering level is the rendering level in the current display state.

[0063] In some embodiments, tiles can be divided into two-dimensional tiles and three-dimensional tiles according to different spatial dimensions (such as two-dimensional space or three-dimensional space, etc.). Among them, a two-dimensional tile (Tile) is a format for displaying two-dimensional scene data, which is obtained by cutting a two-dimensional scene (such as a two-dimensional map, a two-dimensional game, etc.) with a regular grid (such as a quadrilateral, etc.). A three-dimensional tile (3DTiles) is a format for displaying large-scale three-dimensional scene data. It can cut a three-dimensional scene such as a city or terrain into a large number of block data according to geographical location or function, and organize and manage them using a hierarchical structure. The three-dimensional tile adds height information on the basis of the two-dimensional tile, that is, the three-dimensional tile has volume and depth information compared with the two-dimensional tile.

[0064] In some embodiments, the terminal deploys an application client that supports rendering based on tiles and displaying the rendering results. The application client can be a game client, a map client, a navigation client, etc. The rendering results can be displayed in the form of visual images on the display interface of the terminal. If it is a rendering of a two-dimensional scene, the visual image is a two-dimensional image; if it is a rendering of a three-dimensional scene, the visual image is a three-dimensional image. In a game client, the terminal obtains and displays the visual images of at least part of the game scene based on the tile rendering method. If it is a two-dimensional game, the visual images related to the game displayed are two-dimensional game scene images; if it is a three-dimensional game, the visual images displayed are three-dimensional game scene images. In a map client, the terminal obtains and displays the visual images of at least part of the map based on tile rendering. If it is a two-dimensional map, the visual images related to the map displayed are two-dimensional map images; if it is a three-dimensional map, the visual images related to the map displayed are three-dimensional map images. The terminal determines the content to be displayed based on the corresponding application client, determines the target tiles to be rendered corresponding to the content to be displayed, and the current rendering level for the content to be displayed, generates a data acquisition request corresponding to the content to be displayed at the current rendering level, then receives the tiles corresponding to the content to be displayed returned by the server, and uses these tiles as the target tiles to be rendered. In a map client, the content to be displayed refers to the image corresponding to the geographical range of the map that can be selected and displayed by the screen of the terminal. After the terminal performs a rendering operation on the target tiles to be rendered, it obtains at least part of the visual images that can be displayed on the terminal screen. By responding to the image display operation, the terminal obtains the target tiles to be rendered corresponding to the content to be displayed and the current rendering level, ensuring the accuracy and pertinence of the rendering and providing the necessary data and parameters for the subsequent rendering process.

[0065] In some embodiments, the rendering level is related to the zoom level of the visual image displayed by the terminal. The rendering quality and rendering details of the visual image are different at different zoom levels. As the zoom level increases, the details and clarity of the visual image to be displayed will also increase accordingly, and the corresponding rendering level will be higher. In a map application client, the rendering level for the map can be regarded as the level indicated by the map scale. For each rendering level, the map is sliced to obtain the tiles at the corresponding rendering level, and the terminal stores the tiles in a target form, such as the tiles can be stored in the buffer space of the terminal, the database associated with the terminal, or stored in the local file system.

[0066] In some embodiments, the method for obtaining the target tiles to be rendered is described. When obtaining the target tiles to be rendered, if the tiles at the current rendering level already exist in the local cache space, they are directly read from the local cache. In this way, the acquisition efficiency of the tiles can be improved. For example Figure 3As shown, each small cell in the figure is a single tile at the current rendering level.

[0067] In some embodiments, the trigger event for the terminal to perform the acquisition operation of the target tile to be rendered can be triggered based on a function item in the graphical interface of the relevant application client, such as an adjustment operation for the scale in the graphical interface, or a zoom-in / zoom-out operation for the displayed graphical interface, or a trigger operation for the style switching function item displayed in the graphical interface, or an image loading operation, etc.

[0068] In some embodiments, a specific determination method for the target tile to be rendered is described. According to the screen size of the terminal and using the camera parameters, the range of the visual image framed by the terminal screen is deduced. The shape of the range of the visual image is usually a rectangular frame, and the terminal determines the target tile to be rendered within the range of the visual image. In the map application client, the range of the visual image framed by the terminal screen refers to the geographical range framed by the terminal screen.

[0069] In some embodiments, each tile usually can also include multiple Areas of Interest (AOIs). An AOI is a polygon composed of multiple vertices, and the vertex attributes of each vertex at least include position attributes. Each AOI belongs to a corresponding tile. An AOI can be used to represent an area, and this area can be filled with different colors. For example, in map tiles, AOIs can be community AOIs, park AOIs, school AOIs, lake AOIs, etc., all rendered with different colors. Since the two-dimensional space is a planar space, the position information of vertices in the planar space does not include height (or elevation, depth, etc.) information. Since the three-dimensional space refers to a space with three independent dimensions, the position information of vertices in the three-dimensional space includes height (or elevation, depth, etc.) information. Taking the coordinate system established by the right-hand rule of the spatial coordinate system as an example, the position information of vertices in the two-dimensional space includes the X component and the Y component, and the position information of vertices in the three-dimensional space includes the X component, the Y component, and the Z component, where the Z component represents the height information of the vertices.

[0070] Step 204, obtain the drawing unit corresponding to each target tile; the drawing unit includes multiple vertices, and the attributes of the vertices include style identifiers.

[0071] Among them, the drawing unit refers to the object to be processed in each rendering operation and is also the rendering mesh (Mesh) used by the graphics processor in the real-time rendering stage. The style identifier refers to the unique identifier for the style information used to render the vertices. The source of the style identifier of each vertex is the face style identifier of the AOI to which the corresponding vertex belongs.

[0072] In some embodiments, for each target tile, the terminal obtains a drawing unit that matches the targeted target tile. The drawing unit can be generated asynchronously by the CPU of the terminal through modeling before real-time rendering, or can be directly read from the cache space of the terminal (provided that the corresponding drawing unit already exists in the cache). The specific method for obtaining the drawing unit is as follows: If the drawing unit of the target tile already exists in the storage space (cache, local file system, associated database system, etc.) associated with the terminal, it can be directly obtained from the storage space; if not, it is necessary to regenerate the drawing unit that matches the targeted target tile.

[0073] In some embodiments, the generation process of the drawing unit is described. The drawing unit is obtained by polygon clipping for the target tile to be rendered. The polygon can be at least a triangle or a quadrilateral, etc. Each drawing unit consists of multiple vertices. These vertices not only have position information but also other attributes, such as style identifiers. The CPU of the terminal can render the corresponding vertices according to the texture style indicated by the style identifier. The texture style can include colors, textures, etc. The source of the style identifier can be the face style identifier of the AOI face to which the vertex belongs.

[0074] In some embodiments, taking the clipping of the target tile to be rendered into triangles as an example, the specific implementation process of generating the drawing unit Mesh corresponding to the target tile to be rendered is as follows: The CPU in the terminal identifies the AOI faces in the target tile to be rendered and obtains at least one AOI face that matches the target tile to be rendered; the CPU of the terminal performs triangle clipping on each identified AOI face using a preset triangulation algorithm. The preset triangulation algorithm, such as Delaunay triangle clipping, can generate a high-quality triangle mesh according to the geometric shape of the face; by performing triangle clipping, a series of triangles are obtained. These triangles can form a continuous mesh mesh, and the style identifier of the AOI face to which each vertex belongs is added to the vertex attributes of the targeted vertex to obtain the drawing unit that matches the target tile to be rendered. Finally, the generated drawing unit can be exported as a specific file format and stored in memory or on disk, or directly used in the application. It should be noted that after generating the initial mesh mesh, further processing and optimization can be performed, such as simplifying the mesh to reduce the number of triangles, fixing defects in the mesh, and adjusting the size and shape of the triangles.

[0075] In some embodiments, the CPU of the terminal can store the generated drawing unit in the storage space of the terminal, such as in memory or on disk, for the reuse of the drawing unit during subsequent rendering. The CPU of the terminal can also periodically clean up the drawing units in the storage space.

[0076] Step 206: Obtain a procedural texture that matches the current scene; the procedural texture stores texture styles corresponding to different style identifiers and different rendering levels.

[0077] Among them, the current scene is a visual image that can be presented on the screen after rendering the content to be currently displayed on the screen using at least one texture style. According to the different functions assigned to the content to be displayed, the scene can include day scenes and night scenes in different function modes.

[0078] In some embodiments, taking the map rendering of a map client as an example, the map is divided according to function modes and can be at least divided into a navigation map, a browsing map, etc. Correspondingly, the scene can include, but is not limited to: the day scene of the navigation map, the night scene of the navigation map, the day scene of the browsing map, the night scene of the browsing map, etc. Taking the game scene rendering of a game client as an example, the game scene can be divided into a day scene and a night scene for performing interactive operations with virtual objects, or a day scene and a night scene for displaying virtual objects, etc. For each scene, a procedural texture that matches the targeted scene can be set. The procedural texture, as a texture data set, contains various possible texture styles in any scene.

[0079] In some embodiments, the procedural texture contains texture styles corresponding to multiple style identifiers at multiple rendering levels for any scene. For each rendering level, through all the style identifiers involved at the targeted rendering level, the current scene at the targeted rendering level can be rendered. It can be understood that the procedural texture is determined based on at least two-dimensional parameters, namely the rendering level and the style identifier. A corresponding procedural texture can be set for each scene. The procedural texture is different from traditional art assets. The procedural texture is procedurally generated dynamically and is the texture style of any scene determined by two parameters, namely the rendering level and the style identifier. Therefore, the specific manifestation form of the procedural texture can be various. For example, the procedural texture can be represented by the row-column encoding of a two-dimensional texture. Among them, the two dimensions in the row-column encoding of the texture are the rendering level and the style identifier respectively. It can be rows for the rendering level and columns for the style identifier, or rows for the style identifier and columns for the rendering level. Each cell in the table is a specific texture style, indicating the texture style set for the specified style identifier at a rendering level. It should be noted that the rows and columns in the row-column encoding of the texture can be interchanged, and this application does not limit this.

[0080] It can be understood that the target cell can be determined in the row-column encoding of the texture through the style identifier and the rendering level. The target cell includes the texture style, and the texture style stores the vertex color of each vertex indicated by the corresponding style identifier at the specified rendering level, etc. Taking a map scenario as an example, the map style refers to performing a skin-changing operation on the map in different scenarios and configuring different effects for all elements in the map. For example, for the switching operation between the daytime scene and the nighttime scene of the navigation map, the procedural texture used will also change accordingly, and the new procedural texture matches the new map scene after the scene switch. It should be noted that when the map style changes, the style identifiers of the vertices in each drawing unit remain unchanged, and only the specific texture style corresponding to the style identifier of each vertex at the targeted rendering level needs to be updated to the new style information. For example, at the specified rendering level, when the map scene changes (i.e., the style changes), such as switching from the daytime scene to the nighttime scene of the navigation map, at this time, the terminal CPU regenerates the procedural texture corresponding to the nighttime scene of the navigation map. If the procedural texture is represented by the row-column encoding of a two-dimensional texture, the CPU only needs to update the texture style in the cell. There is no need to reconstruct the required drawing units because the scene switch only causes the transformation of the texture style determined by each style identifier and the corresponding rendering level, without changing the information of the drawing unit. Taking the procedural texture in two-dimensional form as an example, only the specific content of the cell determined by the rendering level and the style identifier needs to be updated. That is to say, when the content to be displayed remains unchanged and the style changes, the drawing unit does not need to be modified, and only the specific texture style in the procedural texture needs to be updated before the graphics processor queries the procedural texture.

[0081] In some embodiments, using the style identifier as the row and the rendering level as the column, all the style identifiers corresponding to each rendering level include the styles of all the faces included in the map at the targeted rendering level. That is to say, in the table, each cell represents a specific style configuration, which is used to specify the color or other attributes indicated by a certain style identifier at a certain rendering level. In this way, a small amount of data can be used to represent multiple texture configurations, and the appropriate style and rendering level can be selected as needed at runtime. As Figure 4 shown, the columns are the rendering levels involved in the map scene, from 10 - 19, and the rows are the style identifiers, and the specific style information is saved in the specific cells. The method of determining the texture through the row-column encoding method allows developers to dynamically adjust the texture and rendering quality to adapt to different hardware performances and visual requirements.

[0082] Step 208, based on the current rendering level and the style identifiers corresponding to each vertex, determine the target texture style that matches each vertex from the procedural texture.

[0083] In some embodiments, according to the current rendering level, the graphics processor of the terminal reads the style identifier in the vertex attributes of each vertex in the drawing unit for the targeted vertex (the style identifier is the vertex attribute of the vertex in the drawing unit, and the vertex attributes also include the position information of the vertex), and according to the style identifier of the targeted vertex and the current rendering level, looks up the target texture style matching each vertex from the procedural texture.

[0084] In practical applications, in a procedural texture in the form of a two-dimensional table, each cell is used to represent style information such as color indicated by a specified style identifier at a specified rendering level. Therefore, given the current rendering level and the style identifiers corresponding to each vertex, when the graphics processor of the terminal renders each vertex in the rendering unit, it can quickly determine the target texture style matching the targeted vertex from the procedural texture. Then, subsequent rendering and screen display processing for the drawing unit are performed based on the target texture style. That is, during the process when the graphics processor prepares for rendering, from the latest procedural texture, based on the vertex style of each vertex and the current rendering level, the target texture style of each vertex is determined.

[0085] In some embodiments, when the graphics processor receives the current rendering level and the drawing unit synchronously transmitted by the central processing unit, first, it determines the style identifier list according to the rendering level. If the rendering level is used as a column, the column corresponding to the current rendering level is the range of style identifiers corresponding to the style identifiers of each vertex in the drawing unit. Secondly, the graphics processing unit (GPU) of the graphics processor locates the target cell in the two-dimensional table at the current rendering level according to the style identifier of each vertex in the drawing unit, and reads the target texture style (usually referring to the vertex color) corresponding to the style identifier from the target cell.

[0086] Step 210: Render based on the target texture styles matching each vertex and the drawing unit to obtain a rendering result matching the current scene.

[0087] In some embodiments, the graphics processor of the terminal renders the rendering unit based on the target texture styles matching each vertex to obtain a rendering result. Among them, the rendering result is related to the tile to be rendered, and the rendering result is an image that can be displayed on the terminal screen. At the current zoom level, the geographical range framed in the image on the terminal screen is consistent with the geographical range described by the tile to be rendered at the current zoom level.

[0088] It should be noted that, to obtain the visual image corresponding to the rendering result displayed on the screen, multiple drawing operations are often required. Each drawing operation is called a DrawCall. The result of each DrawCall is at least a part of the visual image corresponding to the rendering result. The object of each DrawCall can be the drawing unit corresponding to the tile. Multiple DrawCalls can be executed sequentially or in parallel, and the embodiments of the present application do not limit this.

[0089] In some embodiments, each DrawCall can at least include three stages: the terminal CPU determines the drawing unit, the terminal GPU performs geometric processing on the drawing unit with vertices as the processing unit, and the terminal GPU performs rasterization processing on the data in the geometric processing stage.

[0090] In some embodiments, in the geometric processing stage, the vertex shader of the terminal GPU uses the vertices in the drawing unit as the processing unit to perform vertex coloring and vertex coordinate transformation. Among them, the vertex coloring process is as follows: the vertex shader looks up the style identifier carried by the currently processed vertex and the texture style information stored in the cell determined by the current rendering level from the aforementioned procedural texture, generally referring to the color information of the vertex, and then colors the vertex according to the found color information. The vertex coordinate transformation at least includes the following stages: model space - world space - view space - projection (clipping) space.

[0091] In some embodiments, after each vertex in the drawing unit is colored, if the drawing unit belongs to a two-dimensional space, the coordinates of the vertices of the drawing unit are directly transformed to obtain the vertices relative to the screen space.

[0092] If the drawing unit belongs to a three-dimensional space, a perspective projection is performed on the drawing unit, that is, the vertices including height in the drawing unit are projected onto a two-dimensional screen to determine the position of each vertex on the two-dimensional image and eliminate the height information in the vertices. During the process of projecting each vertex onto the two-dimensional image, since it is a three-dimensional space, multiple vertices may correspond to the same pixel. At this time, the distance of each vertex from the camera is recorded. If the newly projected vertex is closer to the camera than the previous vertex, it means that the previous vertex will be blocked; otherwise, it means that the new vertex will be blocked by the previous vertex. Therefore, a clipping operation can be performed, that is, the vertices that will not be seen by the camera can be excluded in advance through frustum culling to reduce the rendering workload. Then, the vertices of the projected drawing unit after clipping processing are transformed again to obtain the vertices relative to the screen space.

[0093] In some embodiments, after obtaining the vertices of the drawing unit with respect to the vertices in screen space, the rasterization processing stage is entered. In the rasterization processing stage, pixels are generated on the screen by receiving the data from the geometric processing stage, and the final rendering result, i.e., the visual image displayed on the terminal screen, is obtained.

[0094] In some embodiments, the frustum culling method is described during the rendering process of a three-dimensional scene. In three-dimensional graphics, the steps of frustum culling are roughly as follows: 1) Establish the view space: First, determine the position and orientation of the camera in the three-dimensional scene to construct the view space (view space), that is, determine which points in the three-dimensional space will be seen by the camera. 2) Project the vertices: Project the vertices of the objects in the three-dimensional space onto the two-dimensional image plane. This step determines the position of each vertex on the two-dimensional image. 3) Calculate the frustum: The frustum is determined by the camera position and the viewing angle, and can represent the volume space that the camera can see. The near clipping plane and the far clipping plane of the frustum define the nearest and farthest distances that the camera can see. 4) Clipping judgment: For each vertex, judge whether it is inside the frustum. This step can be determined by comparing the distance of each vertex from the camera. If a vertex, after being projected onto the image plane, has a Z coordinate (representing depth or distance) greater than the near clipping plane of the frustum and less than the far clipping plane, then this vertex is considered visible. 5) Occlusion judgment: If a new vertex, after being projected onto the image plane, has a smaller Z coordinate than the vertex at the same pixel position that has already been recorded (i.e., closer to the camera), then the new vertex will occlude the old vertex; if the Z coordinate is larger, then the old vertex will occlude the new vertex. This step can be used to determine which vertices are visible during the final rendering, thus avoiding unnecessary rendering work. 6) Perform clipping: According to the results of frustum culling and occlusion judgment, clip off the invisible vertices and the corresponding geometric parts, and only render the visible parts inside the frustum.

[0095] The above rendering method, which obtains the target mesh to be rendered and the current rendering level, ensures the accuracy and pertinence of the data required for rendering; then, for each target tile, the drawing unit that matches it is determined, and the attributes of each vertex in the drawing unit include a style identifier. Furthermore, when vertex coloring is required, the target texture style of the vertex can be quickly and accurately found from the procedural texture that matches the current scene based on the style identifier of the vertex and the current rendering level for coloring rendering. In this way, by storing the style identifier in the attributes of each vertex in the drawing unit, compared with the method of storing color information in vertex attributes, since the identifier information requires less storage space than color information, a large amount of video memory resources can be saved. In addition, since the data volume of the drawing unit itself is reduced, the rendering performance can also be improved during rendering.

[0096] Moreover, since the target texture style of the vertex is obtained based on the query operation for the procedural texture, the color information that originally needed to be stored in the vertex attributes is separately stored in the procedural texture, realizing the decoupling of the drawing unit and the rendering effect. When the displayed content remains unchanged but only the scene is switched, the drawing unit can be reused without re-modeling, which can greatly improve the rendering efficiency.

[0097] In some embodiments, obtaining the target tile to be rendered and the current rendering level includes: determining the geographical range framed by the screen according to the screen size, and determining the current rendering level; obtaining the target tile within the geographical range and corresponding to the current rendering level.

[0098] In some embodiments, the terminal determines the range of the visual image framed by the screen according to its own screen size. In a map application, the range of the visual image framed by the screen actually refers to the geographical range framed by the screen. And the current rendering level is determined, and the determination of the rendering level can be obtained by responding to the image display operation.

[0099] In some embodiments, in a map application, the terminal uses the camera parameters in the map engine of the current scene to determine the geographical range framed by the screen, and determines the target tiles within the geographical range and corresponding to the current rendering level. The target tiles can be some or all of the tiles at the current rendering level. In fact, the terminal performs a tile query index, that is, according to the geographical range, queries the tile index (a database or data structure storing tile information) to determine which tiles may be included in the selected geographical range. Among them, the image display operation responded by the terminal can be triggered by a function item in the graphical interface, such as the adjustment operation of the scale in the interface for displaying the map scene, or the zoom-in / zoom-out operation for the interface of the displayed map scene, etc. The triggering of the image display operation indicates the change of the visual image displayed on the screen terminal, that is, the graphics processor re-renders the image displayed on the screen. The change of the visual image at least includes the style change of the target image, such as switching from the day mode to the night mode, and the change of the elements (i.e., the specific content) in the visual image.

[0100] Exemplarily, during the process of the map client A displaying the map, when receiving the finger zoom-in operation of the user on the screen, the terminal first determines that after zooming in, at the scale after zooming in, it queries from the storage space for M (M is a positive integer greater than 1) tiles within the geographical range framed by the screen.

[0101] In this embodiment, by effectively managing and rendering tile data, efficient and high-quality visualization of geographical information can be achieved.

[0102] In some embodiments, obtaining the drawing units corresponding to each target tile includes: for any target tile, detecting whether there is a drawing unit corresponding to the target tile being targeted. If there is, directly obtain the drawing unit; if not, model based on the target tile being targeted to obtain the drawing unit.

[0103] In some embodiments, the terminal checks whether there is already a drawing unit corresponding to it in the storage space through the tile identifier of the target tile. If the check result indicates that there is a drawing unit corresponding to the target tile in the storage space, the terminal directly obtains these drawing units from the storage space for subsequent rendering processes. In this way, through the reusability of the drawing units of the target tile, the acquisition efficiency is improved. If the check result indicates that there is no drawing unit corresponding to the target tile in the storage space, the terminal regenerates the drawing unit of the target tile to be rendered through an asynchronous modeling method.

[0104] In some embodiments, the modeling process for the drawing unit is as follows: The CPU of the terminal identifies all the AOI surfaces under the target tile to be rendered, and uses a preset polygon triangulation algorithm (such as the common Delaunay triangulation) to perform polygon triangulation on each identified AOI surface (common polygon triangulations can be triangle triangulation, quadrilateral triangulation, etc.) to generate a polygon mesh according to the geometric shape of the AOI surface. And add the surface style identifier of the AOI surface to which each vertex belongs to the vertex attribute of the vertex in the polygon mesh Mesh corresponding to the vertex, to obtain a drawing unit that matches the target tile to be rendered. Taking triangle triangulation as an example, through the Delaunay triangulation method, perform triangulation on the AOI surface of the target tile to be rendered to obtain a series of triangles, and these triangles can form a continuous triangle mesh. Add the surface style identifier of the AOI surface to which each vertex belongs to the corresponding vertex in the triangle mesh to obtain the drawing unit of the target tile to be rendered.

[0105] In this embodiment, through a reasonable data structure and query algorithm, the efficiency of retrieving and constructing drawing units can be optimized, thereby improving the response speed and performance of the system.

[0106] In some embodiments, as Figure 5 shown, modeling based on the target tile being targeted to obtain the drawing unit includes steps 502 to 506, where:

[0107] Step 502, determine the area of interest included in the target tile being targeted, and the area of interest includes at least one vertex.

[0108] In some embodiments, each tile includes at least one AOI surface, and each AOI surface includes a plurality of (three or more) vertices. The terminal identifies the AOI surface of the target tile to obtain the AOI surface that constitutes the target tile.

[0109] Step 504: Use the style identifier associated with the region of interest as the style identifier for each vertex of the region of interest.

[0110] In some embodiments, an AOI surface corresponds to a surface style identifier, and the terminal uses the surface style identifier of the AOI surface as the style identifier for each vertex in the AOI surface. Since the number of AOI surfaces in the map is limited, an integer type can be used to identify the style identifier of the AOI surface.

[0111] Step 506: Store the style identifier of each vertex into the attribute of the corresponding vertex to construct a drawing unit.

[0112] In some embodiments, the style identifier can be represented by a variable of integer type (i.e., Int type), and the style identifier is added to the attributes of each vertex. In an application, the data structure of a vertex is usually the position information Position of the vertex. In this embodiment, an additional variable of Int type can also be appended as the style identifier, such as styleId: 12, etc. It should be noted that since the defined style identifier is generally a positive integer, the style identifier variable of the vertex can specifically be represented by an unsigned integer (unsigned int). The unsigned integer type represents an integer greater than or equal to 0. To optimize the video memory data volume extremely, the value range space of the style representation can be limited within 256, and then it can be represented by 1 byte.

[0113] In this embodiment, from the perspective of the amount of data to be processed by the video memory, compared with the UV coordinates of the floating-point type (float) stored in the attributes of vertices in the existing texture rendering process, using the integer type style encoding as the source of the vertex color attribute can greatly reduce the amount of data to be processed by the video memory for map data including a large number of surfaces and improve the rendering efficiency.

[0114] In some embodiments, after the terminal obtains the current rendering level, it stores the current rendering level as a global variable; correspondingly, the process of determining the target texture style matching each vertex from the procedural texture based on the current rendering level and the style identifier corresponding to each vertex includes: obtaining the current rendering level from the global variable, and based on the current rendering level and the style identifier corresponding to each vertex, finding out the target texture style matching each vertex from the procedural texture.

[0115] In some embodiments, for the current image display operation, the corresponding current rendering level is fixed, that is, in subsequent rendering processes, the same rendering level is used. At the same time, since the change of the rendering level is usually caused by relevant operations triggered in the graphical user interface displayed on the terminal, considering this global characteristic of the rendering level, the current rendering level can be set as a global variable to facilitate real-time modification during the running of the application program. The global variable can be called by various application program interfaces and has sharing. Based on the change of the rendering level caused by the image display operation, only the value of this global variable needs to be updated. In this embodiment, the rendering level is mainly applied to image rendering and can be used as a parameter related to the shader running in the graphics processing unit (GPU). Therefore, the data type uniform for passing variables between shaders can be used to store the rendering level, that is, a variable of the uniform type is defined to store the rendering level.

[0116] In this embodiment, by saving the rendering level in the form of a global variable, the adjustment of the rendering level during the entire rendering process is conveniently achieved.

[0117] In some embodiments, based on the current rendering level and the style identifier corresponding to each vertex, determining the target texture style matching each vertex from the procedural texture includes: the central processing unit transmits the current rendering level and the style identifier corresponding to each vertex to the graphics processing unit; for each vertex, the graphics processing unit looks up and obtains the target texture style matching the vertex from the procedural texture according to the style identifier corresponding to the vertex and the current rendering level.

[0118] In some embodiments, the rendering method in this embodiment is usually executed jointly by the central processing unit (CPU) and the graphics processing unit (GPU). The specific process of their cooperation to determine the target texture style matching each vertex is as follows: the graphics processing unit (GPU) receives the current rendering level and the style identifier of each vertex from the central processing unit (CPU). These parameters are used to guide the GPU to process and render graphics. In the procedural texture, the GPU performs a lookup according to the style identifier of the vertex and the rendering level. By comparing the style identifier of the vertex and the rendering level with the information in the texture data, the GPU can find the target texture style matching the current vertex. Exemplarily, the interaction among the CPU, GPU, and procedural texture of the terminal is as Figure 6 shown.

[0119] In this embodiment, through a stable and efficient memory management and data transmission mechanism, it is ensured that the GPU can quickly obtain and process texture data. By using procedural textures, the rendering effect can be controlled more flexibly, and more rich and realistic graphic effects can be achieved.

[0120] In some embodiments, rendering is performed based on the target texture styles and drawing units matched by each vertex to obtain a rendering result that matches the current scene, including: through a graphics processor, performing texture mapping according to the target texture styles matched by each vertex in the drawing unit to assign the colors of the target texture styles to the vertices in the drawing unit, thereby achieving screen rendering; obtaining a rendering result that matches the current scene based on the result of each screen rendering.

[0121] In some embodiments, during the real-time rendering stage, the graphics processing unit (GPU) is responsible for performing the texture mapping operation. This process is based on the target texture styles matched by each vertex in the drawing unit. Through texture mapping, the GPU assigns the color values of the target texture styles to the vertices of the drawing unit. In this way, the vertices can have corresponding color information, preparing for the subsequent rasterization stage. Subsequently, the GPU uses these vertex data with color information to perform rendering and generate pixel data on the screen. This rendering process is based on the result of each rendering, ensuring the matching degree of the image with the current scene. Through continuous rendering iterations, a rendering result that matches the current scene is finally obtained.

[0122] In this embodiment, the graphics processing unit can perform rendering according to the texture styles matched by the vertices and obtain a final image that matches the scene, improving the accuracy of generating the rendering result.

[0123] In some embodiments, as Figure 7 shown, obtaining the drawing units corresponding to each target tile includes steps 702 to 704, where:

[0124] Step 702, traverse each target tile, and perform the current rendering based on the target texture styles matched by each vertex in the drawing unit corresponding to the target tile being targeted, as well as the drawing unit.

[0125] In some embodiments, the rendering process for the terminal to obtain the displayed visual image often includes multiple drawing operations (i.e., multiple DrawCalls). Each drawing operation can draw a part of the visual image. After multiple drawing operations, a complete view image is obtained. The operation unit of each drawing operation can be an AOI surface or a tile composed of multiple AOI surfaces. Considering the performance consumption of the terminal device, usually a single tile can be used as the operation unit, that is, one drawing operation can draw one tile. Before each drawing operation, the terminal determines the drawing unit associated with the target tile corresponding to the drawing operation.

[0126] Among them, the terminal obtains the drawing unit corresponding to each target tile, performs a traversal operation on multiple target tiles. For the currently traversed target tile, according to the tile identifier of the target tile, it searches for the corresponding drawing unit in the storage space. If it can be found, it directly uses the found drawing unit for subsequent rendering operations. If it cannot be found, it needs to initiate an asynchronous modeling task for the drawing unit of the target tile. Here, the asynchronous modeling task is used to perform polygon triangulation on multiple AOI surfaces under the target tile to generate the drawing unit corresponding to the target tile. After obtaining the drawing unit of the target tile by directly reading from the storage space or generating it through asynchronous modeling, the CPU initiates a drawing operation (DrawCall). In this operation, according to the target texture style matched by each vertex in the drawing unit corresponding to the target tile, the drawing unit is rendered for the current DrawCall.

[0127] Step 704, continue to traverse the next target tile, and return to the step of obtaining the drawing unit corresponding to the currently traversed target tile and continue to execute until the rendering of all target tiles is completed, obtaining a rendering result matching the current scene.

[0128] In some embodiments, continue to traverse the next target tile in the tile list, and return to the step of obtaining the drawing unit corresponding to the currently traversed target tile and continue to execute until the rendering of all target tiles is completed, obtaining a rendering result matching the current scene.

[0129] That is to say, the rendering operation for the visual image displayed on the terminal screen can be converted into a rendering operation for each tile in the tile list, which can be a sequentially executed process. Additionally, when the terminal computing resources permit, batch processing can also be adopted, that is, through a batch processor, a batch of DrawCalls are executed within one rendering batch to improve the rendering efficiency.

[0130] In this embodiment, the rendering operation for the visual image displayed on the terminal screen is converted into a rendering operation for multiple target tiles with finer granularity, and the target tiles already stored in the cache space are preferentially reused. In this way, the rendering efficiency of the tiles can be improved, thereby enhancing the rendering efficiency.

[0131] In some embodiments, the number of acquired procedural textures is multiple. Based on the current rendering level and the style identifiers corresponding to each vertex, determining the target texture style that matches each vertex from the procedural textures includes: traversing in the order of the multiple procedural textures; based on the current rendering level and the style identifiers corresponding to each vertex, determining the target texture style that matches each vertex from the currently traversed procedural texture; after obtaining the rendering result and displaying it as a visual image on the terminal screen, continue to traverse the next procedural texture, and return to the step of determining the target texture style that matches each vertex from the currently traversed procedural texture based on the current rendering level and the style identifiers corresponding to each vertex to continue execution, so as to implement a transition animation.

[0132] In some embodiments, the terminal can also acquire multiple procedural textures of the current scene, and there is an order of use for the multiple procedural textures. According to the order of the multiple procedural textures, when determining the target texture style that matches each vertex from the currently traversed procedural texture based on the current rendering level and the style identifiers corresponding to each vertex, after at least one draw call, a visual image displayed in the first style indicated by the traversed procedural texture is rendered. During the process of displaying the visual image in the first style, the graphics processor continues to traverse the next procedural texture, and returns to the step of determining the target texture style that matches each vertex from the currently traversed procedural texture based on the current rendering level and the style identifiers corresponding to each vertex to continue execution, so as to implement a transition animation.

[0133] Exemplarily, taking the number of procedural textures as two as an example, the mix function associated with the shader running on the graphics processor can be used to implement the fade-in and fade-out process from the current procedural texture to the next procedural texture. Obtain the color value of each vertex in the procedural texture, and interpolate to obtain a fade-in and fade-out process from the display style indicated by the current procedural texture to the display style characterized by the next procedural texture. When displayed, a fade-in and fade-out transition effect will be presented. The code snippet for implementing the relevant effect is as follows:

[0134] {

[0135] old_color = texture2d(Texture 1, style identifier, rendering level)

[0136] new_color = texture2d(Texture 2, style identifier, rendering level)

[0137] cur_color = mix( old_color, new_color, time )

[0138] }

[0139] Among them, two procedural textures at the same rendering level are received, namely texture 1 and texture 2, and corresponding colors, namely old_color and new_color, are generated respectively. Then, by calling the mix function, the transition effect from old_color to new_color is achieved.

[0140] In this embodiment, a transition animation of the map style in a specified map scene is realized through multiple procedural textures with a sequential relationship of use, enriching the application scenarios of image rendering.

[0141] The generation process of the procedural texture will be described. In some embodiments, as Figure 8 shown, the method for determining the procedural texture includes steps 802 to 806, where:

[0142] Step 802: For any scene, obtain all the face style sets under the targeted scene; the scene includes day scenes and night scenes in different functional modes.

[0143] Among them, any scene is a visual image that can be presented on the terminal screen after rendering the content to be displayed using at least one style. Each scene includes the face styles of multiple AOIs. According to the different functional modes assigned to the content to be displayed, the scene can include day scenes and night scenes in different functional modes. In map applications, divided by functional mode, the map can be at least divided into a navigation map and a browsing map, etc. Correspondingly, the scene can include the day scene of the navigation map, the night scene of the navigation map, the day scene of the browsing map, the night scene of the browsing map, etc. The terminal collects all the face style sets under the current scene. The face style refers to the style of the AOI, and the face style set is the collection of the face styles of all AOIs that make up the current scene. The specific content of the face style at least includes the position information of each vertex that makes up the AOI, as well as information such as the style identifier.

[0144] Step 804: For each face style, determine the corresponding fill color at different rendering levels for the targeted face style.

[0145] Among them, each face style includes style information at each rendering level, and the style information can be the fill color of the face.

[0146] Step 806: Construct the procedural texture under the targeted scene according to the style identifier of each face style and the corresponding fill color of the face style at different rendering levels.

[0147] In some embodiments, the terminal constructs a programmatic texture for the current scene in the target form according to the style identifier of each face style and the fill color corresponding to the face style at different rendering levels. When the tiles to be rendered exist as vector data, that is, in the process of describing any scene by vector data, the style effect of each face is a solid color. At this time, the texture style information determined for any rendering level and any style identifier can be represented by a pixel, and the color of the pixel is the color information of the face to which it belongs. In this way, the amount of data can be further reduced.

[0148] In this embodiment, for any scene, all face styles are combined to generate a full amount of procedural textures. By using procedural textures, the rendering effect can be controlled more flexibly to achieve richer and more realistic graphic effects.

[0149] In some embodiments, the generation process of the procedural texture is described, and the procedural texture for the scene is constructed according to the style identifier of each surface style and the fill color corresponding to the surface style at different rendering levels, including: generating a style sheet according to the style identifier of each surface style and the fill color corresponding to the surface style at different rendering levels; converting the style sheet into a texture map to obtain the procedural texture for the scene.

[0150] In some embodiments, during the rendering process of the graphics processor, the fill color of the vertex for the current rendering level is searched together according to the style identification attribute of the vertex and the current rendering level. That is, the fill color of each vertex is determined based on the two dimensions of the rendering level and the style identification. Therefore, a two-dimensional style table can be created with the two dimensions of the rendering level and the style identification to store and locate the fill color of each vertex at the corresponding rendering level. That is, the two dimensions of the two-dimensional style table are the rendering level and the style identification, respectively. The specific form can be the rendering level as the row and the style identification as the column, or the style identification as the row and the rendering level as the column. Each cell in the table is a specific texture style information, indicating the configuration color of each vertex of the specified style identification at the specified rendering level. It should be noted that the rows and columns in the two-dimensional style table can be interchangeable, and this application does not limit this. Finally, since the style table describes abstract color information, in order to use it during rendering, the style table can be converted into a texture map to obtain a programmatic texture for the scene. This process usually involves encoding the two-dimensional style table data into an image file, which can be called a texture map.

[0151] In this embodiment, by using procedural textures, the rendering effect can be controlled more flexibly. For example, the appearance of objects in the scene can be changed without modifying the program code, and only the style sheet needs to be modified. The same texture map can be shared by multiple faces, with high reusability, reducing the storage and bandwidth requirements and improving the rendering efficiency. During the map style switching process, only the style sheet needs to be modified, which makes the maintenance and modification of the map style simpler and more efficient.

[0152] To illustrate in detail the rendering method provided by this application, an embodiment is described below. In this embodiment, a client for displaying a two-dimensional or three-dimensional map scene is deployed on the terminal. The content to be rendered is the geographical range in the map selected by the terminal screen frame, that is, the geographical range to be displayed in the map is rendered to obtain a rendering result, and the rendering result is displayed on the terminal screen in the form of a visual image.

[0153] In the related art, the number of faces in the map is very large. In order to ensure the rendering performance during the real-time rendering stage, the conventional approach is to perform an operation of merging and modeling the AOI faces, that is, multiple AOI faces are merged into one Mesh (i.e., the drawing unit mentioned above), and the rendering operation is performed. At this time, only position information may be included in each vertex of the drawing unit, and the corresponding color is transmitted using the uniform protocol to achieve batch association of colors. In this way, since there is no color information in the vertices, the data volume of the drawing unit is the smallest, that is, as long as the computing power permits, any number of AOI faces can be merged arbitrarily. However, only one color can be assigned to each drawing unit, resulting in a large number of rendering batches. At the same time, since there may be dozens of colors in each tile, the number of drawing units and the number of rendering batches still cannot be controlled. Another way is to directly assign the color to the vertex attributes, that is, directly store the color information in the vertices. At this time, all drawing units with different colors can be merged, but the data volume is huge, and when the map style changes, the drawing units need to be regenerated. There is also a way to store the color separately using VBO. In this way, during the style switching process, the changed and unchanged parts can be distinguished. The color is placed in another VBO, and when the style is switched, the VBO is synchronously created and updated. However, in this solution, the drawing units still need to be regenerated during the style switching.

[0154] Based on this, the rendering method in the embodiment of this application is actually a rendering technology based on texture look-up tables for rendering various AOI faces in the map. The specific content is as follows: 1) During the drawing unit generation stage, an integer type style identifier styleid is stored in the vertex attributes of each vertex of the drawing unit; 2) During the real-time rendering stage, the CPU inputs the current rendering level to the graphics processing unit GPU; 3) The vertex shader Vertex Shader running in the graphics processing unit GPU determines the color attributes of each vertex to instruct the GPU to perform subsequent rendering operations.

[0155] First, in the drawing unit generation stage, the procedural texture corresponding to the scene in each functional mode of the map will be created first. The functional modes of the map include at least navigation map and browsing map. The scenes in the corresponding functional modes include at least daytime scenes of navigation map, nighttime scenes of navigation map, daytime scenes of browsing map, nighttime scenes of browsing map, etc. A procedural texture is constructed at a specified rendering level for each map scene. The construction process of the procedural texture is as follows: obtain all style data of the current map scene in the form of a target, such as scene style data in JSON format. The scene style data records the style information under each style encoding at each rendering level. Among them, the two parameters that affect the specific style of the vertex are: style identifier and rendering level. Therefore, a two-dimensional style table can be constructed to store the style of each vertex in the current scene. The two-dimensional style table is a row and column encoding of a texture. The meaning of the row is the style identifier, and the meaning of the column is the rendering level. Each cell in the table is a style, which represents the configuration color at a rendering level. For example, Figure 4 As shown, it should be noted that rows and columns can also be interchanged. The premise is that the maximum texture size required by the rendering graphics library cannot be exceeded.

[0156] The specific generation method of the programmatic texture adapted to any map scene is described. The programmatic texture map adapted to any map scene can be called the style set color map. The specific implementation includes the following steps: a) Collect all the face style sets under the current map scene; 2) Determine the content of each face at each rendering level, where the fields are mainly fill colors; 3) Convert the style sheet to a programmatic one using row and column encoding. If the map scene changes, the map style will change. At this time, re-execute the above steps a)-c) to obtain the programmatic texture corresponding to the new map scene.

[0157] For the scenario of any specified functional mode of the map, after generating the corresponding procedural texture corresponding to the style identifier and rendering level, before performing real-time rendering, in response to the image display instruction corresponding to at least part of the content of the map, the CPU of the terminal calculates the geographical range of the rectangular shape selected by the screen frame according to the terminal screen size using the camera parameters, and then calculates the tile list within the screen. The tile list includes M*N tiles. Traverse each tile. If there is Mesh data for the tile in the storage space (such as in the database, cache, memory, etc.), directly render it. Otherwise, the CPU initiates an asynchronous modeling task. According to the tile ID, query whether there is data in the memory. If not, load it from the disk. If not, pull all the faces of the tile from the open source address of the map, perform triangulation to generate a triangular Mesh (i.e., the drawing unit mentioned above). During the process of generating the triangular Mesh, in the vertex attribute structure of each vertex, add an integer-type variable to represent the style identifier of the vertex, and add the style encoding of the face to which the vertex belongs to this variable. That is, the vertex attribute with the added style identifier includes at least the position information of the vertex and the style encoding of the vertex. The style encoding of the vertex is the face style encoding of the face to which the vertex belongs. It should be noted that the style identifiers of the vertices in each face are the same, and vertices are not shared between different faces.

[0158] It should be noted that the style identifier styleid in the vertex attribute structure is default represented by unsigned int. To optimize the data volume in the video memory extremely, the value range space of styleid can be limited within 256, and then it can be represented by 1 byte. Since there are tens of thousands of vertices Vertex in the AIO faces of the map mesh, if 2 floats can be saved for each vertex, a lot of video memory for one screen of content can also be saved. Therefore, compared with the way of directly storing the color information of the vertex in the vertex attribute, storing an integer-type style identifier in the vertex attribute can greatly reduce the data volume of the drawing unit and reduce the consumption of resources. At the same time, compared with the way of storing simplified color information in the vertex attribute, storing an integer-type style identifier in the vertex attribute can ensure the accuracy of the color precision of the vertex.

[0159] In the real-time rendering stage, for each vertex, restore the color attribute according to the procedural texture. Specifically:

[0160] 1) The CPU first detects the availability of the procedural texture. If the texture is unavailable, re-execute the aforementioned procedural texture generation process to synchronously generate an adapted texture and transfer it to the graphics processing unit GPU.

[0161] 2) Add a global variable of the uniform type to the vertex shader running on the GPU. Before each frame is rendered, save the currently synchronized rendering level from the CPU to this variable of the uniform type. In this way, the rendering level can be shared among different shaders during the GPU rendering stage.

[0162] 3) In the vertex shader, determine the target style of each vertex in real time. The shader determines the color of the targeted vertex from the procedural texture corresponding to the current map scene according to the rendering level scaleLevel stored in the uniform variable and the style identifier styleid of the targeted vertex, and uses it as the attribute of the current vertex. Specifically, a method texture2d method can be created to generate the specific color of each vertex according to the rendering level and the style identifier. The specific color of the vertex color = texture2d(style_attrib, vec2(styleid, scaleLevel)). Finally, it is passed to the fragment shader in the form of varying for coloring.

[0163] In actual implementation, for the map style, the map will change its skin under different scenarios, and different effects will be configured for all elements, such as the navigation scenarios during the day and at night. Therefore, when the currently displayed map style changes (such as from day to night), the geographical range selected by the current screen does not change. Therefore, the AOI surface of the geographical range and the corresponding vertices do not change. What changes is only the style content of the AOI surface, that is, the style content of the vertices. Since the style identifier is bound in the vertices, it is possible to update only the texture style determined by the style identifier and the rendering level of each vertex without reconstructing the drawing unit corresponding to the selected geographical range. That is, when the GPU renders, the procedural texture used changes. That is, for at least part of the map displayed on the screen, when the map scene changes (such as from day to night), the CPU does not need to regenerate the drawing unit, but only needs to regenerate the procedural texture in the new map scene, that is, only update the cell content in the row-column encoding of the style.

[0164] In addition, when the map style is switched, it is also possible to ensure that the base map of at least part of the map displayed on the screen does not flash, and at the same time, implement a transition animation between different map styles according to multiple input textures, such as fade-in and fade-out. The specific implementation method is as follows: Modify the vertex shader to support multiple texture inputs. The pseudocode is as follows:

[0165] old_color = texture2d(old_lut, styleid, scaleLevel)

[0166] new_color = texture2d(new_lut, styleid, scaleLevel)

[0167] cur_color = mix( old_color, new_color, time )

[0168] Applying the embodiments of the present application can achieve the following beneficial effects:

[0169] 1) Optimal performance. The decoupling of the two processes of generating the drawing unit and the rendering effect is realized, so that no re-modeling is required when switching the map style, and the rendering performance of the map style switching scenario is improved.

[0170] 2) When switching the map style, the drawing unit does not need to be updated, and only the texture resources need to be regenerated and the texture updated.

[0171] 3) Good scalability. When switching the map style, the base map does not flash, and multiple textures can be input at the same time, and the transition animation between different styles can be realized, such as fade-in and fade-out.

[0172] It should be noted that the method provided by the embodiments of the present application can also be applied to various other rendering scenarios except for rendering scenarios such as map classes (maps, navigation, etc.), including but not limited to rendering scenarios such as intelligent transportation, assisted driving, film and television production, virtual reality, etc. Exemplarily, in the map-related rendering scenario, through the rendering method of the embodiments of the present application, rendering processes including terrain rendering, vegetation rendering, water body rendering, building and structure rendering, shadow and light rendering, and special effect rendering are performed to generate a realistic and vivid high-precision map for display. In the game-related rendering scenario, the rendering method of the embodiments of the present application can also be used for the game screen rendering scenario to present the virtual scenes, characters, and special effects in the game in a realistic manner.

[0173] It can be understood that the above application scenarios are only used to schematically illustrate the rendering method of the present application and are not used to limit the application scenarios of the present application.

[0174] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.

[0175] Based on the same inventive concept, an embodiment of the present application further provides an image rendering device for implementing the above-mentioned rendering method. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the following image rendering device can refer to the limitations on the rendering method in the above text, and will not be repeated here.

[0176] In an exemplary embodiment, as Figure 9 shown, a rendering device 900 is provided, including: a response module 910, a first acquisition module 920, a second acquisition module 930, a determination module 940, and a rendering module 950, where:

[0177] The response module 910 is used to acquire a target tile to be rendered and the current rendering level.

[0178] The first acquisition module 920 is used to acquire the drawing unit corresponding to each target tile; the drawing unit includes a plurality of vertices, and the attributes of the vertices include style identifiers.

[0179] The second acquisition module 930 is used to acquire a procedural texture matching the current scene; the procedural texture stores texture styles corresponding to different style identifiers and different rendering levels.

[0180] The determination module 940 is used to determine the target texture style matching each vertex from the procedural texture based on the current rendering level and the style identifiers corresponding to the vertices.

[0181] The rendering module 950 is used to perform rendering based on the target texture styles matching the vertices and the drawing unit to obtain a rendering result matching the current scene.

[0182] In some embodiments, the response module is further used to determine the geographical range selected by the screen according to the screen size, and determine the current rendering level; acquire the target tiles within the geographical range and corresponding to the current rendering level.

[0183] In some embodiments, the first acquisition module is further configured to, for any target tile, detect whether there is a drawing unit corresponding to the target tile. If there is, directly acquire the drawing unit; if not, perform modeling based on the target tile to obtain the drawing unit.

[0184] In some embodiments, the first acquisition module is further configured to determine the region of interest included in the target tile. The region of interest includes at least one vertex; use the style identifier associated with the region of interest as the style identifier for each vertex of the region of interest; store the style identifier of each vertex in the attribute of the corresponding vertex to construct a drawing unit.

[0185] In some embodiments, the response module is further configured to store the current rendering level as a global variable; correspondingly, the determination module is further configured to obtain the current rendering level from the global variable, and based on the current rendering level and the style identifiers corresponding to the vertices, find the target texture style that matches each vertex from the procedural texture.

[0186] In some embodiments, the determination module is further configured to the central processing unit transmit the current rendering level and the style identifiers corresponding to the vertices to the graphics processing unit; for each vertex, the graphics processing unit, according to the style identifier corresponding to the vertex and the current rendering level, find the target texture style that matches the targeted vertex from the procedural texture.

[0187] In some embodiments, the rendering module is further configured to, through the graphics processing unit, perform texture mapping according to the target texture styles that match the vertices in the drawing unit, so as to assign the color of the target texture style to the vertices in the drawing unit, implement scene rendering, and obtain a rendering result that matches the current scene.

[0188] In some embodiments, the first acquisition module is further configured to traverse each target tile, and for the currently traversed target tile, acquire the drawing unit corresponding to the target tile; correspondingly, the rendering unit is further configured to perform the current rendering based on the target texture styles that match the vertices in the drawing unit corresponding to the target tile and the drawing unit; continue to traverse the next target tile, and return to the step of acquiring the drawing unit corresponding to the currently traversed target tile and continue to execute until the rendering of all target tiles is completed to obtain a rendering result that matches the current scene.

[0189] In some embodiments, the number of acquired procedural textures is multiple. The first acquisition module is further configured to traverse in the order of the multiple procedural textures; based on the current rendering level and the style identifiers corresponding to each vertex, determine the target texture styles matching each vertex from the currently traversed procedural texture; after rendering the rendering result, continue to traverse the next procedural texture, and return to the step of determining the target texture styles matching each vertex from the currently traversed procedural texture based on the current rendering level and the style identifiers corresponding to each vertex to continue execution, so as to implement a transition animation.

[0190] In some embodiments, the second acquisition module is further configured to, for any scene, acquire all the face style sets under the targeted scene; the scene includes a daytime scene and a nighttime scene in different functional modes; for each face style, determine the filling colors corresponding to the targeted face style at different rendering levels; construct a procedural texture under the targeted scene according to the style identifiers of each face style and the filling colors corresponding to the face style at different rendering levels.

[0191] In some embodiments, the second acquisition module is further configured to generate a style sheet according to the style identifiers of each face style and the filling colors corresponding to the face style at different rendering levels; convert the style sheet into a texture map to obtain a procedural texture under the targeted scene.

[0192] Each module in the above rendering device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0193] In some embodiments, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 10As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. The computer program, when executed by the processor, implements a rendering method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0194] Those skilled in the art can understand that Figure 10 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.

[0195] In some embodiments, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0196] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0197] In some embodiments, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0198] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0199] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the various embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the various embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the various embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., and are not limited thereto.

[0200] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combinations of these technical features do not conflict, they should all be considered to be within the scope described in this specification.

[0201] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. A rendering method, characterized in that, The method includes: Obtaining a target tile to be rendered and the current rendering level; Obtaining a drawing unit corresponding to each of the target tiles; the drawing unit includes a plurality of vertices, and the attributes of the vertices include style identifiers; Obtaining a procedural texture matching the current scene; the procedural texture stores texture styles corresponding to different style identifiers and different rendering levels; Based on the current rendering level and the style identifiers corresponding to the vertices, determining a target texture style matching each vertex from the procedural texture; Rendering based on the target texture styles matching the vertices and the drawing unit to obtain a rendering result matching the current scene.

2. The method according to claim 1, wherein The obtaining of the target tile to be rendered and the current rendering level includes: Determining the geographical range framed by the screen according to the screen size and determining the current rendering level; Obtaining the target tiles within the geographical range and corresponding to the current rendering level.

3. The method according to claim 1, wherein The obtaining of the drawing unit corresponding to each of the target tiles includes: For any target tile, detecting whether there is a drawing unit corresponding to the target tile being targeted. If so, directly obtain the drawing unit; If not, modeling based on the target tile being targeted to obtain a drawing unit.

4. The method according to claim 3, characterized in that, The modeling based on the target tile being targeted to obtain a drawing unit includes: Determining the area of interest included in the target tile being targeted, and the area of interest includes at least one vertex; Taking the style identifier associated with the area of interest as the style identifier of each vertex of the area of interest; Storing the style identifiers of the vertices into the attributes of the corresponding vertices to construct a drawing unit.

5. The method according to claim 1, wherein After obtaining the current rendering level, the method further includes: Storing the current rendering level as a global variable; The determining of the target texture style matching each vertex from the procedural texture based on the current rendering level and the style identifiers corresponding to the vertices includes: Obtaining the current rendering level from the global variable, and based on the current rendering level and the style identifiers corresponding to the vertices, finding out the target texture style matching each vertex from the procedural texture.

6. The method according to claim 1, characterized in that, The determining of the target texture style matching each vertex from the procedural texture based on the current rendering level and the style identifiers corresponding to the vertices includes: The central processing unit transmits the current rendering level and the style identifiers corresponding to the vertices to the graphics processing unit; For each vertex, the graphics processing unit finds out the target texture style matching the vertex being targeted from the procedural texture according to the style identifier corresponding to the vertex and the current rendering level.

7. The method according to claim 6, wherein The rendering based on the target texture styles matching the vertices and the drawing unit to obtain a rendering result matching the current scene includes: Through the graphics processing unit, performing texture mapping according to the target texture styles matching the vertices in the drawing unit to assign the color of the target texture style to the vertices in the drawing unit, realizing screen rendering to obtain a rendering result matching the current scene.

8. The method according to claim 1, wherein The obtaining of the drawing unit corresponding to each of the target tiles includes: Traverse each target tile, and for the currently traversed target tile, obtain the drawing unit corresponding to the targeted target tile; Rendering based on the target texture styles matched by each vertex and the drawing unit to obtain a rendering result matching the current scene, including: Performing the current rendering based on the target texture styles matched by each vertex in the drawing unit corresponding to the targeted target tile and the drawing unit; Continue to traverse the next target tile, and return to the step of obtaining the drawing unit corresponding to the currently traversed target tile and continue to execute until the rendering of all target tiles is completed to obtain a rendering result matching the current scene.

9. The method according to claim 1, wherein The number of obtained procedural textures is multiple. Determining the target texture style matching each vertex from the procedural textures based on the current rendering level and the style identifiers corresponding to each vertex includes: Traverse in the order of multiple procedural textures; Based on the current rendering level and the style identifiers corresponding to each vertex, determine the target texture style matching each vertex from the currently traversed procedural texture; After rendering to obtain a rendering result, the method further includes: Continue to traverse the next procedural texture, and return to the step of determining the target texture style matching each vertex from the currently traversed procedural texture based on the current rendering level and the style identifiers corresponding to each vertex and continue to execute to implement a transition animation.

10. The method according to any one of claims 1 to 9, characterized in that, The method further includes: For any scene, obtain all the face style sets under the targeted scene; the scene includes a daytime scene and a nighttime scene in different functional modes; For each face style, determine the filling color corresponding to the targeted face style at different rendering levels; Construct a procedural texture for the targeted scene according to the style identifiers of each face style and the filling colors corresponding to the face style at different rendering levels.

11. The method according to claim 10, characterized in that, The constructing a procedural texture for the targeted scene according to the style identifiers of each face style and the filling colors corresponding to the face style at different rendering levels includes: Generate a style sheet according to the style identifiers of each face style and the filling colors corresponding to the face style at different rendering levels; Convert the style sheet into a texture map to obtain the procedural texture for the targeted scene.

12. A rendering device, characterized in that, The device includes: A response module, configured to obtain the target tile to be rendered and the current rendering level in response to an image display operation; A first obtaining module, configured to obtain the drawing unit corresponding to each of the target tiles; the drawing unit includes multiple vertices, and the attributes of the vertices include style identifiers; A second obtaining module, configured to obtain a procedural texture matching the current scene; the procedural texture stores texture styles corresponding to different style identifiers and different rendering levels; A determining module, configured to determine the target texture style matching each vertex from the procedural texture based on the current rendering level and the style identifiers corresponding to each vertex; A rendering module, configured to perform rendering based on the target texture styles matched by each vertex and the drawing unit to obtain a rendering result matching the current scene.

13. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 11.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method described in any one of claims 1 to 11.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method described in any one of claims 1 to 11.

Citation Information

Cited By

  • Two-dimensional and three-dimensional integrated rendering method and device for multi-type map services

    CN121280587A