Rendering method and device based on dynamic atlas, equipment, storage medium and product

By segmenting the texture map into subtexture maps and saving them to the dynamic picture album, the problem of low space utilization of the dynamic picture album is solved, and a more efficient rendering effect is achieved.

CN119722896APending Publication Date: 2025-03-28TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311264696.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, the fixed grid size in the dynamic image atlas results in different sizes of the texture map, resulting in low space utilization. How to make full use of the space in the dynamic image atlas is an important issue.

Method used

By obtaining texture maps, splitting them into at least two subtexture maps, and saving these subtexture maps to the dynamic image atlas, rendering based on the subtexture maps in the dynamic image atlas.

Benefits of technology

By segmenting texture maps, the space of dynamic picture albums is fully utilized, the space utilization is improved, and a more efficient rendering effect is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119722896A_ABST
    Figure CN119722896A_ABST
Patent Text Reader

Abstract

The invention discloses a rendering method and device based on a dynamic atlas, equipment, a storage medium and a product, and belongs to the technical field of rendering. The method comprises the following steps: obtaining a texture map, wherein the texture map is used for representing a picture of any size required for rendering a display element; storing at least two sub-texture maps obtained by segmenting the texture map to the dynamic image set, wherein the dynamic image set is used for representing a set for dynamically storing the sub-texture maps during rendering; and rendering based on the sub-texture maps in the dynamic map set, and displaying the rendered display elements. According to the method, the texture map of any size is segmented, the at least two sub-texture maps obtained through segmentation are stored in the dynamic map set, rendering is carried out based on the sub-texture maps in the dynamic map set, the space of the dynamic map set is fully utilized through the segmented sub-texture maps, and the space utilization rate is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of rendering technology, and in particular to a rendering method, device, equipment, storage medium and product based on a dynamic atlas. Background Art

[0002] The user interface (UI) displayed in the terminal may be obtained by rendering a texture map, and the texture map is an art picture required for UI presentation.

[0003] In the related technology, all the texture maps needed by the current UI are immediately placed into the same dynamic atlas, which is divided into grids of different sizes. The corresponding placement position is selected according to the size of the texture map. When rendering, the batch rendering effect can be achieved only according to the dynamic atlas.

[0004] However, since the grid size in the dynamic atlas is fixed, the different sizes of texture maps will result in low space utilization of the grids in the dynamic atlas. Therefore, how to make full use of the space in the dynamic atlas is an important issue that needs to be solved urgently. Summary of the invention

[0005] The present application provides a rendering method, device, equipment, storage medium and product based on a dynamic atlas, and the technical solution is as follows:

[0006] According to one aspect of the present application, a rendering method based on a dynamic atlas is provided, the method comprising:

[0007] Obtain a texture map, where the texture map is used to represent an image of any size required for rendering a display element;

[0008] Saving at least two sub-texture maps obtained by segmenting the texture map into the dynamic atlas, wherein the dynamic atlas is used to represent a collection of the sub-texture maps dynamically saved during rendering;

[0009] Rendering is performed based on the sub-texture map in the dynamic atlas, and the rendered display element is displayed.

[0010] According to one aspect of the present application, a rendering device based on a dynamic atlas is provided, the device comprising:

[0011] An acquisition module, used to acquire a texture map, wherein the texture map is used to represent a picture of any size required for rendering a display element;

[0012] A segmentation module, used for saving at least two sub-texture maps obtained by segmenting the texture map into the dynamic atlas, wherein the dynamic atlas is used for representing a set of sub-texture maps dynamically saved during rendering;

[0013] A rendering module is used to render based on the sub-texture map in the dynamic atlas and display the rendered display element.

[0014] In some embodiments, a segmentation module is used to segment the texture map to obtain at least two sub-texture maps at a first height;

[0015] In some embodiments, the apparatus further comprises an inserting module, configured to insert at least two of the sub-texture maps at the first height into the dynamic atlas.

[0016] In some embodiments, a segmentation module is used to segment the texture map into n sub-texture maps at the first height when the ratio of the height of the texture map to the first height is a positive integer, where n is the ratio of the height of the texture map to the first height, and n is a positive integer.

[0017] In some embodiments, a segmentation module is used to segment the texture map into m sub-texture maps at the first height when the ratio of the height of the texture map to the first height is a non-positive integer, where m is a value obtained by rounding up the ratio of the height of the texture map to the first height, and m is a positive integer.

[0018] In some embodiments, an insertion module is used to divide the dynamic atlas into at least two sub-areas, where the height of the sub-areas is the first height; and insert the sub-texture map into the sub-areas of the dynamic atlas based on the length of the sub-texture map.

[0019] In some embodiments, the device further includes a release module, the release module being configured to release the position occupied by the sub-texture map in the sub-area when the sub-texture map in the dynamic atlas is not displayed, thereby obtaining a released area.

[0020] The release area is used to place the sub-texture map that is subsequently inserted.

[0021] In some embodiments, the device further comprises a merging module, the merging module being configured to merge the current released area with the released area to obtain a merged released area when there is a released area adjacent to the current released area.

[0022] The size of the merged release area is larger than the size of the release area, and the merged release area is used to place the sub-texture map that is subsequently inserted.

[0023] In some embodiments, an acquisition module is used to obtain position information corresponding to the sub-texture map, and the position information is used to indicate the position of the sub-texture map in the dynamic atlas; the position information and segmentation information are encapsulated to obtain sub-texture map description information, and the sub-texture map description information is information used to describe the sub-texture map in the dynamic atlas.

[0024] In some embodiments, an insertion module is used to insert the sub-texture map description information into an index list corresponding to the dynamic atlas.

[0025] Among them, the segmentation information includes sub-texture map information and texture map information, the sub-texture map information is used to represent the texture information of the sub-texture map, the texture map information is used to represent the texture information of the entire texture map, and the index list is used to represent the list of sub-texture map description information corresponding to each sub-texture map in the dynamic atlas.

[0026] In some embodiments, the acquisition module is used to obtain the sub-texture map description information in the index list.

[0027] In some embodiments, a rendering module is used to perform rendering based on the sub-texture map information in the sub-texture map description information, and display the rendered display element.

[0028] In some embodiments, a rendering module is used to construct vertices in a generated network according to the sub-texture map information to obtain a mapping area corresponding to the sub-texture map; map the pixel UV coordinates corresponding to the sub-texture map to the mapping area, and display the rendered sub-texture map on the display element; perform the above steps on each of the sub-texture maps to display the rendered display element.

[0029] In some embodiments, the acquisition module is used to acquire a rendering queue, where the rendering queue refers to an arrangement order of rendering tasks executed by a graphics processor GPU.

[0030] In some embodiments, the apparatus further comprises a processing module, the processing module being configured to batch process the font rendering tasks and the sub-texture map rendering tasks having the same rendering parameters in the rendering queue;

[0031] The batch processing refers to performing the font rendering task and the sub-texture map rendering task simultaneously.

[0032] In some embodiments, the segmentation module is used to save the texture map to the dynamic atlas when the height of the texture map is less than the first height.

[0033] According to another aspect of the present application, a computer device is provided, which includes: a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the dynamic atlas-based rendering method as described above.

[0034] According to another aspect of the present application, a computer storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the dynamic atlas-based rendering method as described above.

[0035] According to another aspect of the present application, a computer program product is provided, which includes a computer program stored in a computer-readable storage medium; the computer program is read and executed from the computer-readable storage medium by a processor of a computer device, so that the computer device executes the dynamic atlas-based rendering method as described above.

[0036] The beneficial effects of the technical solution provided by this application include at least:

[0037] By obtaining a texture map; saving at least two sub-texture maps obtained by segmenting the texture map into a dynamic atlas; rendering based on the sub-texture maps in the dynamic atlas, and displaying the rendered display element. The present application segments a texture map of any size, saves at least two sub-texture maps obtained by segmentation into a dynamic atlas, and renders based on the sub-texture maps in the dynamic atlas. The segmented sub-texture maps make full use of the space of the dynamic atlas, thereby improving space utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 is a schematic diagram of a rendering method based on a dynamic atlas provided by an exemplary embodiment of the present application;

[0040] Figure 2 is a schematic diagram of the architecture of a computer system provided by an exemplary embodiment of the present application;

[0041] Figure 3 is a flowchart of a rendering method based on a dynamic atlas provided by an exemplary embodiment of the present application;

[0042] Figure 4 is a flowchart of a rendering method based on a dynamic atlas provided by an exemplary embodiment of the present application;

[0043] Figure 5 is a schematic diagram of a segmented texture map provided by an exemplary embodiment of the present application;

[0044] Figure 6 is a schematic diagram of a segmented texture map provided by an exemplary embodiment of the present application;

[0045] Figure 7 is a schematic diagram of a dynamic atlas provided by an exemplary embodiment of the present application;

[0046] Figure 8 is a schematic diagram of a switching UI interface provided by an exemplary embodiment of the present application;

[0047] Fig. 9 is a schematic diagram of a dynamic atlas change provided by an exemplary embodiment of the present application;

[0048] Fig.10 is a schematic diagram of comparing execution time consumption between different schemes provided by an exemplary embodiment of the present application;

[0049] Fig.11 It is a schematic diagram of performance data under different UI interfaces provided by an exemplary embodiment of the present application;

[0050] Fig.12 is a flowchart of a rendering method based on a dynamic atlas provided by an exemplary embodiment of the present application;

[0051] Fig.13 is a block diagram of a rendering device based on a dynamic atlas provided by an exemplary embodiment of the present application;

[0052] Fig.14 is a structural schematic diagram of a computer device provided by an exemplary embodiment of the present application;

[0053] Fig.15 It is a structural diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0055] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0056] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0057] It should be understood that, although the terms first, second, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first parameter may also be referred to as the second parameter, and similarly, the second parameter may also be referred to as the first parameter. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0058] For ease of understanding, several terms involved in this application are explained below.

[0059] (1) UI: refers to the overall design of the software’s human-computer interaction, operating logic, and interface aesthetics. For example, in games, it generally refers to the game interface, which provides players with a medium for interacting with the game.

[0060] (2) Texture map: refers to the art picture required when rendering an object. This picture is an image that stores and expresses the display details of the object's surface.

[0061] (3) Texture: The texture of an object's surface includes the uneven grooves on the surface of the object, as well as the color pattern on the smooth surface of the object, or the representation of the map in the rendering engine.

[0062] (4) Atlas: refers to a collection of texture maps, which usually merges a certain number of texture maps into one image and provides a configuration that can index a single map.

[0063] (5) UV: UV is a two-dimensional texture coordinate point residing on the vertices of a polygonal mesh. They define a two-dimensional texture coordinate system, called UV texture space, which uses the letters U and V to define the coordinate axes.

[0064] (6) Game business module: generally refers to the characteristic gameplay in the game. Usually there are many gameplays in a game. Each characteristic gameplay has its own unique set of UIs. Each UI has a separate preset Prefab archived in the project.

[0065] (7) Texture memory: refers to the memory capacity required to load images into the device's running memory.

[0066] (8) Graphics programming interface Drawcall: refers to the central processing unit (CPU) calling the graphics programming interface, such as the multimedia programming interface DirectX or the graphics hardware software interface OpenGL, to command the graphics processing unit (GPU) to perform rendering operations. The more Drawcalls there are, the greater the performance cost of the device will be.

[0067] (9) Drawing: The texture map is passed from the CPU to the GPU and then drawn onto the device UI or model.

[0068] (10) Atlas division: Divide all texture maps in the game into different atlases, because each atlas has a size limit.

[0069] (11) Static atlas: refers to merging a group of texture maps into an image or collection offline, and providing a configuration file that can index a single texture map in it. It cannot be modified while the game is running.

[0070] (12) Texture segmentation: Split a texture map into multiple sub-texture maps according to fixed rules.

[0071] (13) Texture copy: copy the texture pixels of one texture map to another texture map.

[0072] (14) Texture segmentation with fixed height: The texture map is segmented into multiple sub-texture maps with fixed height in the vertical direction according to a fixed height. The fixed height in the embodiment of the present application is the first height.

[0073] (15) Atlas layout calculation: Calculate the position of an input texture map in the atlas.

[0074] (16) Dynamic atlas: A set of texture maps is merged into a single map or collection in real time at runtime, and memory data that can index individual texture maps is provided.

[0075] (17) Sprite: refers to the description method of a single texture map in an atlas, or refers to the map object used to describe the atlas in the game engine, including information such as the size of the map, the location of the map in the atlas, and the atlas texture reference. The rendering framework of the rendering engine obtains the texture information required for rendering based on it.

[0076] (18) Sub-texture map description information, also known as HeroSprite (HSprite): a substitute for the Sprite object, which has all the functions of Sprite and can be extended with various custom functions, such as storing texture map segmentation information and decoupling atlas binding dependencies.

[0077] (19) Index list: refers to the Sprite list corresponding to the atlas, which is used to query the specified Sprite.

[0078] (20) Image control: A component used in the game engine to render texture maps. Developers can use it to input some parameters to control how the texture map is displayed.

[0079] (21) Sub-texture map image control, also known as hero image control (HeroImage, HImage): a substitute for the Image control, with all the functions of the Image control, and supports the display of complete texture maps based on HSprite segmentation information.

[0080] (22) Atlas reconstruction: If there is not enough space when inserting a new texture map into the atlas, the atlas will be cleared, the texture map referenced by the existing Sprite will be reinserted, and the Image control being displayed will be notified to rebuild the mesh and render it, which consumes a lot of performance.

[0081] (23) Atlas expansion: After doubling or multiplying the size of an atlas, the atlas is rebuilt, which doubles the memory usage and consumes a lot of memory.

[0082] (24) DrawCall: refers to the process of sending drawing commands to the GPU in graphics rendering. Each time you draw an object (or a group of objects), you need to use a draw call to tell the GPU how to render. Draw calls incur some overhead, including CPU to GPU data transfer, state setting, vertex processing, etc. Therefore, reducing the number of draw calls can usually improve rendering performance.

[0083] (25) DrawCall merging: Merge restricted objects of the same rendering state that need to be drawn into a large mesh (or vertex buffer) and then send it to the GPU at one time. This can reduce the number of draw calls and improve efficiency.

[0084] (26) Batch rendering state: Before executing the draw call DrawCall, try to send the same rendering state (such as material, shader, blending mode, etc.) to the GPU continuously. This can reduce the overhead of state switching.

[0085] (27) Material: A set of parameters used in computer graphics to describe the properties and characteristics of an object's appearance. It defines how an object reacts to light and appears on the screen. The material defines the object's color, texture, lighting model, transparency, etc.

[0086] (28) Texture coordinate: A coordinate in texture space that defines the mapping relationship between a texture and a 3D model surface or any rendering primitive. Each vertex in the model is associated with a texture coordinate, indicating that the vertex needs to read the texture map data from this coordinate.

[0087] (29) Texture mapping: refers to accurately mapping each point on a 2D texture map to the surface of a 3D model object, UI interface, or other application scenarios.

[0088] (30) UV coordinates: A two-dimensional coordinate system used to describe texture mapping on the surface of a three-dimensional model. It is a method of mapping a two-dimensional texture to the surface of a three-dimensional model, so that the texture can be correctly attached to the surface of the model, thereby achieving a more realistic rendering effect. UV coordinates are usually represented by two floating-point numbers, representing the horizontal and vertical coordinates in the texture respectively. These coordinates are usually normalized to a range of 0 to 1, where (0, 0) represents the lower left corner of the texture image and (1, 1) represents the upper right corner of the texture image. In a three-dimensional model, each vertex has a corresponding UV coordinate that is used to determine the position of the vertex in the texture.

[0089] (31) GPU: refers to a special chip used in modern personal computers, servers, mobile devices, game consoles, etc. specifically for graphics and image processing devices.

[0090] The present application embodiment provides a schematic diagram of a rendering method based on a dynamic atlas, such as Figure 1 As shown, the method can be executed by a computer device, and the computer device can be a terminal or a server.

[0091] Exemplarily, the computer device obtains the texture map 30; saves at least two sub-texture maps 40 obtained by segmenting the texture map 30 into the dynamic atlas 20; renders based on the sub-texture maps 40 in the dynamic atlas 20, and displays the rendered display element.

[0092] The texture map 30 is used to represent an image of any size required for rendering a display element.

[0093] Sub-texture map 40 is a part of texture map 30; or, sub-texture map 40 is a picture obtained by cutting texture map 30; or, sub-texture map 40 is a picture obtained by cropping texture map 30; or, sub-texture map 40 is a picture obtained by masking a part of the area in texture map 30.

[0094] Optionally, the display element includes at least one of a UI interface and a three-dimensional model, but is not limited thereto and is not specifically limited in the embodiments of the present application.

[0095] Optionally, the texture map 30 is drawn manually, or the texture map 30 is automatically generated by a device, but is not limited thereto. The embodiment of the present application does not specifically limit the source of the texture map 30.

[0096] The dynamic atlas 20 is used to represent a collection of sub-texture maps 40 dynamically saved during rendering. Different from the static atlas, the sub-texture maps 40 saved in the dynamic atlas 20 will constantly change during the running process.

[0097] For example, taking the rendering of UI interface 10 as an example, when rendering the first UI interface, the dynamic atlas 20 stores at least two first sub-texture maps obtained by segmenting the texture map 30 in the first UI interface, and the computer device performs rendering based on the first sub-texture map in the dynamic atlas 20; when rendering the second UI interface, in addition to storing the retained sub-texture map in the first UI interface, the dynamic atlas 20 also adds and displays the second sub-texture map obtained by segmenting the newly added texture map 30 in the second UI interface, and the sub-texture map 40 that is not displayed in the second UI interface is deleted.

[0098] Retaining the sub-texture map means that the sub-texture map is displayed in both the first UI interface and the second UI interface.

[0099] Exemplarily, the computer device divides the texture map 30 to obtain at least two sub-texture maps 40 at a first height; the computer device inserts the at least two sub-texture maps 30 at the first height into the dynamic atlas 20 .

[0100] For example, Figure 1As shown in (a) of FIG. 1 , the UI interface 10 includes multiple objects to be rendered, including characters, virtual props, etc., and the texture map 30 corresponding to each object is obtained. For example, the texture map 30 corresponding to the character is obtained. The size of the texture map 30 is 219mm*300mm. Assuming that the first height is 100mm, the computer device divides the texture map 30 to obtain three sub-texture maps 40 under 100mm; the computer device inserts the three sub-texture maps 40 under 100mm into the dynamic atlas 20. After inserting the sub-texture map 40 into the dynamic atlas 20, the computer device renders the objects to be rendered in the UI interface 10 based on the sub-texture map 40 in the dynamic atlas 20, thereby displaying the rendered UI interface 10.

[0101] In some embodiments, the texture map is segmented in at least one of the following ways, but is not limited thereto. The embodiments of the present application do not specifically limit this:

[0102] When the ratio of the height of the texture map to the first height is a positive integer, the computer device evenly divides the texture map to obtain n sub-texture maps at the first height, where n is the ratio of the height of the texture map to the first height, and n is a positive integer;

[0103] For example, the size of the texture map 30 is 219 mm*300 mm. Assuming the first height is 100 mm, the computer device divides the texture map 30 evenly to obtain three sub-texture maps 40 of 219 mm*100 mm.

[0104] When the ratio of the height of the texture map to the first height is a non-positive integer, the computer device divides the texture map into m sub-texture maps at the first height, where m is a value obtained by rounding up the ratio of the height of the texture map to the first height, and m is a positive integer.

[0105] For example, the size of the texture map 30 is 219 mm*363 mm. Assuming that the first height is 100 mm, the computer device divides the texture map 30 to obtain four sub-texture maps 40 of 219 mm*100 mm.

[0106] In some embodiments, the step of inserting a sub-texture map into a dynamic atlas is as follows: a computer device divides the dynamic atlas into at least two sub-areas, wherein a height of the sub-area is a first height; and a computer device inserts the sub-texture map into the sub-area of ​​the dynamic atlas based on a length of the sub-texture map.

[0107] Optionally, the computer device inserts the sub-texture map into the dynamic atlas according to the length of the sub-texture map. Since the sub-texture maps are of the same height, the space of the dynamic atlas 20 is fully utilized by arranging the sub-texture maps in sequence, thereby improving the space utilization rate of the dynamic atlas 20.

[0108] In summary, the method provided in this embodiment obtains a texture map; saves at least two sub-texture maps obtained by segmenting the texture map into a dynamic atlas; renders based on the sub-texture maps in the dynamic atlas, and displays the rendered display element. The present application segments a texture map of any size, saves at least two sub-texture maps obtained by segmentation into a dynamic atlas, and renders based on the sub-texture maps in the dynamic atlas. The segmented sub-texture maps make full use of the space of the dynamic atlas, thereby improving space utilization.

[0109] Figure 2 The schematic diagram of the architecture of a computer system provided by an embodiment of the present application is shown. The computer system may include: a terminal 100 and a server 200.

[0110] The terminal 100 may be an electronic device such as a mobile phone, a tablet computer, a vehicle terminal (vehicle computer), a wearable device, a personal computer (PC), a home appliance, a vehicle terminal, an aircraft, an unmanned vending terminal, etc. The terminal 100 may be installed with a client that runs a target application, and the target application may be a reference application or other application that provides a palm rendering function, which is not limited in this application. In addition, this application does not limit the form of the target application, including but not limited to an application (Application, App) installed in the terminal 100, a mini-program, etc., and may also be in the form of a web page.

[0111] The server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services, cloud database, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and cloud servers providing basic cloud computing services such as big data and artificial palm image recognition platforms. The server 200 may be a backend server of the above-mentioned target application, used to provide backend services for the client of the target application.

[0112] Among them, cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to realize data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which is used on demand and flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.

[0113] In some embodiments, the above-mentioned server can also be implemented as a node in a blockchain system. Blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0114] The terminal 100 and the server 200 may communicate with each other via a network, such as a wired or wireless network.

[0115] In the rendering method based on dynamic atlas provided in the embodiment of the present application, the execution subject of each step may be a computer device, which refers to an electronic device with data calculation, processing and storage capabilities. Figure 2 Taking the implementation environment of the scheme shown as an example, the dynamic atlas-based rendering method can be executed by the terminal 100 (such as the client of the target application installed and running in the terminal 100 executes the dynamic atlas-based rendering method), or the dynamic atlas-based rendering method can be executed by the server 200, or the terminal 100 and the server 200 can interact and cooperate to execute it, and this application does not limit this.

[0116] Figure 3 1 is a flowchart of a rendering method based on a dynamic atlas provided by an exemplary embodiment of the present application. The method can be executed by a computer device, which can be a terminal or a server. The method includes:

[0117] Step 302: Get texture map.

[0118] Texture maps are used to represent images of any size required to render display elements.

[0119] Optionally, the display element includes at least one of a UI interface and a three-dimensional model, but is not limited thereto and is not specifically limited in the embodiments of the present application.

[0120] Optionally, the texture map is drawn manually, or the texture map is automatically generated by a device, but is not limited thereto. The embodiment of the present application does not specifically limit the source of the texture map.

[0121] Step 304: Save at least two sub-texture maps obtained by segmenting the texture map into a dynamic atlas.

[0122] Segmentation refers to cutting the texture map according to segmentation rules.

[0123] Optionally, the segmentation method includes at least one of the following methods, but is not limited thereto, and is not specifically limited in the embodiments of the present application:

[0124] Split the texture map into sub-texture maps of regular shapes;

[0125] Split the texture map into sub-texture maps of equal height;

[0126] Split the texture map into sub-texture maps of the same shape;

[0127] Split the texture map into sub-texture maps of the same size.

[0128] A sub-texture map is a part of a texture map; or, a sub-texture map is a map obtained by cutting a texture map; or, a sub-texture map is a map obtained by cropping a texture map; or, a sub-texture map is a map obtained by masking a part of an area in a texture map.

[0129] Dynamic atlas is used to represent a collection of sub-texture maps that are dynamically saved during rendering. It is different from static atlas. Static atlas is an atlas that has been configured before rendering. The texture maps in the static atlas are fixed and cannot be modified. They are used directly during the rendering process. The sub-texture maps saved in the dynamic atlas will continue to change during the entire rendering process.

[0130] For example, taking the rendering of a UI interface as an example, when rendering the first UI interface, the dynamic atlas stores at least two first sub-texture maps obtained by segmenting the texture map in the first UI interface, and the computer device performs rendering based on the first sub-texture maps in the dynamic atlas; when rendering the second UI interface, in addition to storing the retained sub-texture maps in the first UI interface, the dynamic atlas also adds and displays the second sub-texture map obtained by segmenting the newly added texture map in the second UI interface, and the sub-texture maps that are not displayed in the second UI interface are deleted.

[0131] Retaining the sub-texture map means that the sub-texture map is displayed in both the first UI interface and the second UI interface.

[0132] Step 306: Rendering is performed based on the sub-texture map in the dynamic atlas, and the rendered display element is displayed.

[0133] Rendering refers to restoring the sub-texture map for display; or, rendering refers to mapping the sub-texture map to the display element to generate a realistic image or animation.

[0134] Exemplarily, when rendering is required, the computer device selects a sub-texture map to be restored and displayed from a dynamic atlas, maps the sub-texture map to a corresponding position in a display element, and thus completes the rendering of the sub-texture map; repeats the above steps, selects different sub-texture maps for rendering, and finally obtains a rendered display element.

[0135] In summary, the method provided in this embodiment obtains a texture map; saves at least two sub-texture maps obtained by segmenting the texture map into a dynamic atlas; renders based on the sub-texture maps in the dynamic atlas, and displays the rendered display element. The present application segments a texture map of any size, saves at least two sub-texture maps obtained by segmentation into a dynamic atlas, and renders based on the sub-texture maps in the dynamic atlas. The segmented sub-texture maps make full use of the space of the dynamic atlas, thereby improving space utilization.

[0136] Figure 4 1 is a flowchart of a rendering method based on a dynamic atlas provided by an exemplary embodiment of the present application. The method can be executed by a computer device, which can be a terminal or a server. The method includes:

[0137] Step 402: Get texture map.

[0138] Texture maps are used to represent images of any size required to render display elements.

[0139] Optionally, the display element includes at least one of a UI interface and a three-dimensional model, but is not limited thereto and is not specifically limited in the embodiments of the present application.

[0140] Optionally, the texture map is drawn manually, or the texture map is automatically generated by a device, but is not limited thereto. The embodiment of the present application does not specifically limit the source of the texture map.

[0141] Step 404: split the texture map to obtain at least two sub-texture maps at a first height.

[0142] Segmentation refers to cutting the texture map according to segmentation rules.

[0143] Optionally, the segmentation method includes at least one of the following methods, but is not limited thereto, and is not specifically limited in the embodiments of the present application:

[0144] Split the texture map into sub-texture maps of regular shapes;

[0145] Split the texture map into sub-texture maps of equal height;

[0146] Split the texture map into sub-texture maps of the same shape;

[0147] Split the texture map into sub-texture maps of the same size.

[0148] A sub-texture map is a part of a texture map; or, a sub-texture map is a map obtained by cutting a texture map; or, a sub-texture map is a map obtained by cropping a texture map; or, a sub-texture map is a map obtained by masking a part of an area in a texture map.

[0149] The first height refers to the custom height corresponding to the sub-texture map.

[0150] Optionally, the first height is at least one of a specified height input by a user and a system default height, but is not limited thereto and is not specifically limited in the embodiments of the present application.

[0151] In some embodiments, when the ratio of the height of the texture map to the first height is a non-positive integer, the computer device divides the texture map into m sub-texture maps at the first height, where m is the value obtained by rounding up the ratio of the height of the texture map to the first height, and m is a positive integer.

[0152] For example, Figure 5The schematic diagram of the split texture map shown in the figure, the size of the texture map 501 in the figure is 219mm*363mm, assuming that the first height is 100mm, then the ratio of the height of the texture map 501 to the first height is 363 / 100=3.63, and the value obtained by rounding up the ratio of the height of the texture map 501 to the first height is 4. Therefore, the computer device splits the texture map 501 to obtain four 219mm*100mm sub-texture maps 502, and the four sub-texture maps 502 include Figure 5 Figures (a), (b), (c) and (d) in .

[0153] In some embodiments, when the ratio of the height of the texture map to the first height is a positive integer, the texture map is divided into n sub-texture maps at the first height, where n is the ratio of the height of the texture map to the first height, and n is a positive integer.

[0154] For example, Figure 6 The schematic diagram of the split texture map shown in the figure, the size of the texture map 601 in the figure is 219mm*300mm, assuming that the first height is 100mm, then the ratio of the height of the texture map 601 to the first height is 300 / 100=3, therefore, the computer device divides the texture map 601 evenly to obtain three 219mm*100mm sub-texture maps 602, the three sub-texture maps 602 include Figure 6 Figures (a), (b) and (c) in .

[0155] In some embodiments, when the height of the texture map is less than the first height, the computer device directly saves the texture map to the dynamic atlas without segmenting the texture map.

[0156] Step 406: Insert at least two sub-texture maps at the first height into the dynamic atlas.

[0157] Dynamic atlas is used to represent a collection of sub-texture maps that are dynamically saved during rendering. It is different from static atlas. Static atlas is an atlas that has been configured before rendering. The texture maps in the static atlas are fixed and cannot be modified. They are used directly during the rendering process. The sub-texture maps saved in the dynamic atlas will continue to change during the entire rendering process.

[0158] In some embodiments, the step of inserting a sub-texture map into a dynamic atlas is as follows: a computer device divides the dynamic atlas into at least two sub-areas, wherein a height of the sub-area is a first height; and a computer device inserts the sub-texture map into the sub-area of ​​the dynamic atlas based on a length of the sub-texture map.

[0159] Optionally, when the height of the dynamic atlas is greater than the height of the sub-region and the height of the dynamic atlas is less than twice the height of the sub-region, the computer device divides the dynamic atlas into a sub-region, wherein the height of the sub-region is a first height; and the computer device inserts the sub-texture map into the sub-region of the dynamic atlas based on the length of the sub-texture map.

[0160] Optionally, when the height of the dynamic atlas is greater than twice the height of the sub-area, the computer device divides the dynamic atlas into at least two sub-areas, wherein the height of the sub-area is a first height; and the computer device inserts the sub-texture map into the sub-area of ​​the dynamic atlas based on the length of the sub-texture map.

[0161] It should be noted that when inserting a sub-texture map into a sub-area of ​​a dynamic atlas, there is no need to consider the order of the sub-texture maps, and the texture map only needs to be inserted based on the length of the sub-texture map.

[0162] For example, Figure 7 The schematic diagram of the dynamic atlas shown includes four sub-areas in the dynamic atlas 701, such as the sub-texture map 702 selected by the dotted box in the figure. These three sub-texture maps 702 belong to the same texture map. When inserting these three sub-texture maps 702 into the sub-areas of the dynamic atlas 701, there is no need to consider the order of the sub-texture maps 702. The texture map only needs to be inserted based on the length of the sub-texture map 702.

[0163] In some embodiments, when the sub-texture map is not displayed in the dynamic atlas, the position occupied by the sub-texture map in the sub-region is released to obtain a released region.

[0164] The release area is used to place subsequently inserted sub-texture maps.

[0165] Optionally, the timing of releasing the position occupied by the sub-texture map in the sub-region includes at least one of the following methods, but is not limited thereto, and the embodiments of the present application do not specifically limit this:

[0166] When the sub-texture map is not displayed, the position occupied by the sub-texture map in the sub-area can be released;

[0167] For example, when a sub-texture map in a dynamic atlas is not displayed, the computer device immediately releases the position occupied by the sub-texture map in the sub-region to obtain a released region.

[0168] If there is no empty space for the newly added sub-texture map, the space occupied by the non-displayed sub-texture map in the sub-area is released.

[0169] For example, when a sub-texture map in a dynamic atlas is not displayed, the computer device will not immediately release the position occupied by the sub-texture map in the sub-region, and the non-displayed sub-texture map will still occupy a position in the sub-region; when a newly added sub-texture map is to be inserted into the dynamic atlas, but there is no empty position in the dynamic atlas, the computer device will release the position occupied by the non-displayed sub-texture map in the sub-region.

[0170] In some embodiments, when there is a released area adjacent to the current released area, the current released area is merged with the released area to obtain a merged released area. Since the occupied areas of the segmented sub-texture maps in the dynamic atlas are all of equal height, the occupied areas after release can be quickly merged in the horizontal direction, and the sub-texture maps of the new texture map to be inserted are also of the same height, so a suitable position can be quickly found.

[0171] The size of the merged release region is larger than the size of the release region.

[0172] The merge release area is used to place subsequently inserted sub-texture maps.

[0173] For example, Figure 8 The schematic diagram of the switching UI interface shown in the figure shows the first UI interface 801 of "Seven-Day Sign-in". The characters, virtual props and other objects in the first UI interface 801 all correspond to texture maps. The first UI interface 801 is displayed by rendering based on the texture maps corresponding to the objects in the first UI interface 801. In response to the triggering operation of the icon in the first UI interface 801, the second UI interface 802 is displayed. As can be seen from the figure, the icon in the second UI interface 802 has changed from a "character icon" to an "anime icon". For example, Fig. 9 The schematic diagram of the change of the dynamic atlas shown in the figure includes the first dynamic atlas 901 and the second dynamic atlas 902. The first dynamic atlas 901 is the dynamic atlas corresponding to the first UI interface 801. The first dynamic atlas 901 includes the sub-texture maps after the texture maps corresponding to the objects such as the characters and virtual props in the first UI interface 801 are divided. The second dynamic atlas 902 is the dynamic atlas corresponding to the second UI interface 802. After the first UI interface 801 is switched to the second UI interface 802, the icon in the second UI interface 802 changes from "character icon" to "anime icon". Then, the position occupied by the character sub-texture map 903 corresponding to the "character icon" in the first dynamic atlas 901 is released, and the newly added anime sub-texture map 904 corresponding to the "anime icon" is inserted into the second dynamic atlas 902.

[0174] It should be noted that the first dynamic atlas 901 and the second dynamic atlas 902 are the same atlas, but the sub-texture maps therein are different.

[0175] Step 408: Rendering is performed based on the sub-texture map in the dynamic atlas, and the rendered display element is displayed.

[0176] Rendering refers to restoring the sub-texture map for display; or, rendering refers to mapping the sub-texture map to the display element to generate a realistic image or animation.

[0177] In some embodiments, before rendering based on the sub-texture map in the dynamic atlas, it also includes: the computer device obtains the position information corresponding to the sub-texture map; the computer device encapsulates the position information and segmentation information to obtain the sub-texture map description information; the computer device inserts the sub-texture map description information into the index list corresponding to the dynamic atlas.

[0178] The position information is used to indicate the position of the sub-texture map in the dynamic atlas.

[0179] The sub-texture map description information is information used to describe a sub-texture map in a dynamic atlas.

[0180] Optionally, the segmentation information includes sub-texture map information and texture map information.

[0181] The sub-texture map information is used to represent the texture information of the sub-texture map; the texture map information is used to represent the texture information of the entire texture map.

[0182] The index list is used to represent a list of sub-texture map description information corresponding to each sub-texture map in the dynamic atlas.

[0183] Exemplarily, when rendering is required, the computer device obtains the sub-texture map description information in the index list; the computer device performs rendering based on the sub-texture map information in the sub-texture map description information, and displays the rendered display element.

[0184] Exemplarily, a computer device constructs vertices in a generated network according to sub-texture map information to obtain a mapping area corresponding to the sub-texture map; the computer device maps the pixel UV coordinates corresponding to the sub-texture map to the mapping area, and displays the rendered texture map on the display element; the above steps are performed on each sub-texture map to display the rendered display element.

[0185] In some embodiments, the computer device obtains a rendering queue; the computer device batches the font rendering tasks and sub-texture map rendering tasks having the same rendering parameters in the rendering queue.

[0186] The rendering queue refers to the order in which rendering tasks are executed by the GPU.

[0187] Batching refers to performing font rendering tasks and sub-texture rendering tasks at the same time.

[0188] In order to verify the performance advantage of the method of inserting texture maps into dynamic atlas after segmentation proposed in the embodiment of the present application, the method of inserting texture maps into dynamic atlas after segmentation proposed in the embodiment of the present application is compared with the traditional method of inserting dynamic atlas based on matrix filling algorithm. By comparing the method of inserting texture maps into dynamic atlas after segmentation proposed in the embodiment of the present application and the traditional method of inserting dynamic atlas based on matrix filling algorithm under the same environment, the execution time of each corresponding method is compared. Fig.10 The schematic diagram showing the comparison of execution time between different solutions is shown. Fig.10 Figure (a) shows the traditional method of inserting dynamic atlas based on matrix filling algorithm. It can be seen that when inserting 13 texture maps, the execution time of the traditional method is about 362ms. Fig.10 Figure (b) in the figure shows the method of inserting the texture map into the dynamic atlas after segmentation proposed in the embodiment of the present application. It can be seen that when 13 texture maps are inserted, the execution time of the method proposed in the embodiment of the present application is 2.8ms. From this comparison, it can be seen that the method proposed in the embodiment of the present application is faster and more efficient than the traditional method.

[0189] In some embodiments, by comparing the Drawcall data of the method proposed in the embodiment of the present application and the traditional method under different UI interfaces, without modifying the specific interface content, the comparative test results are shown in Table 1.

[0190] Table 1 Drawcall data comparison table

[0191] Traditional method 1 Traditional method 2 This application method Mall gift package interface 114 72 62 Hero interface 134 105 100 Alliance interface 74 61 23 Main Interface 183 163 133 Cumulative sign-in interface 105 70 55 Mail interface 109 78 63 Backpack interface 67 42 36

[0192] In some embodiments, without modifying any resources, the performance data of some UI interfaces is sampled to obtain the following: Fig.11 The schematic diagram of the performance data under different UI interfaces is shown. From the data in the figure, it can be seen that the performance consumption of the GPU of this solution is reduced by about 0.5-2% compared with the static atlas solution, while the CPU consumption is almost unchanged.

[0193] In summary, the method provided in this embodiment obtains a texture map; saves at least two sub-texture maps obtained by segmenting the texture map into a dynamic atlas; renders based on the sub-texture maps in the dynamic atlas, and displays the rendered display element. The present application segments a texture map of any size, saves at least two sub-texture maps obtained by segmentation into a dynamic atlas, and renders based on the sub-texture maps in the dynamic atlas. The segmented sub-texture maps make full use of the space of the dynamic atlas, thereby improving space utilization.

[0194] The method provided in this embodiment divides the texture map into sub-texture maps of equal height and inserts the sub-texture maps into the dynamic atlas. The sub-texture maps of equal height after division make full use of the space of the dynamic atlas, thereby improving the space utilization rate. In addition, since the occupied areas of the divided sub-texture maps in the dynamic atlas are all of equal height, the occupied areas after release can be quickly merged in the horizontal direction, and the sub-texture maps of the new texture map to be inserted are also of the same height, so the appropriate position can be quickly found.

[0195] The method provided in this embodiment encapsulates the position information and segmentation information corresponding to the sub-texture map to obtain the sub-texture map description information corresponding to the sub-texture map, and inserts the sub-texture map description information into the index list. The present application can achieve targeted rendering of sub-texture maps by indexing. The user can select in the index list as needed to determine the sub-texture map to be rendered, and then render the sub-texture map.

[0196] The method provided in this embodiment further improves the performance of the dynamic atlas solution by batching the font rendering task and the sub-texture map rendering task belonging to the same material.

[0197] Compared with other dynamic atlas solutions, the method provided in this embodiment significantly reduces the computational cost of inserting new texture maps into the dynamic atlas and the computational cost of reclaiming the used space, especially when there are tens of thousands of rectangles. It supports frequent addition and deletion of maps in the dynamic atlas, and does not need to reclaim space through atlas reconstruction and atlas expansion like other solutions, thereby further improving the performance of the dynamic atlas solution and realizing batch rendering of texture maps and text. It is far superior to static atlas solutions and other dynamic atlas solutions in terms of DrawCall batching and batch rendering status, has a wider range of application scenarios, and has been implemented in actual game project development.

[0198] Fig.12This is a flowchart of a rendering method based on a dynamic atlas provided by an exemplary embodiment of the present application. The method can be executed by a computer device, which can be a terminal or a server. Taking the rendering of the UI interface of a game as an example, the method includes:

[0199] Step 1201: Start.

[0200] Step 1202: Initialize the dynamic atlas.

[0201] Dynamic atlas is used to represent a collection of sub-texture maps that are dynamically saved during rendering. It is different from static atlas. Static atlas is an atlas that has been configured before rendering. The texture maps in the static atlas are fixed and cannot be modified. They are used directly during the rendering process. The sub-texture maps saved in the dynamic atlas will continue to change during the entire rendering process.

[0202] Exemplarily, the initialization of the dynamic atlas includes the generation of the atlas texture, generating a dynamic atlas texture of a specified size (W, H), the computer device divides the dynamic atlas into sub-areas, the height of the sub-area is a first height h, then the available area of ​​the dynamic atlas is divided into k (k = H / h) sub-areas, and at the same time, the material of the UI interface is bound to the dynamic atlas texture and the font texture.

[0203] Step 1203: Insert a new texture map.

[0204] Texture maps are used to represent images of any size required to render display elements.

[0205] Optionally, the display element includes at least one of a UI interface and a three-dimensional model, but is not limited thereto and is not specifically limited in the embodiments of the present application.

[0206] Optionally, the texture map is drawn manually, or the texture map is automatically generated by a device, but is not limited thereto. The embodiment of the present application does not specifically limit the source of the texture map.

[0207] Step 1204: Segment the texture map.

[0208] Segmentation refers to cutting the texture map according to segmentation rules.

[0209] Exemplarily, the computer device divides the texture map to obtain at least two sub-texture maps at a first height.

[0210] A sub-texture map is a part of a texture map; or, a sub-texture map is a map obtained by cutting a texture map; or, a sub-texture map is a map obtained by cropping a texture map; or, a sub-texture map is a map obtained by masking a part of an area in a texture map.

[0211] The first height refers to the custom height corresponding to the sub-texture map.

[0212] Optionally, the first height is at least one of a specified height input by a user and a system default height, but is not limited thereto and is not specifically limited in the embodiments of the present application.

[0213] Step 1205: Determine whether there is enough space for the dynamic atlas.

[0214] Exemplarily, determine whether the dynamic atlas has enough space to place the sub-texture map. If the dynamic atlas has enough space, execute step 1209; if the dynamic atlas does not have enough space, execute step 1206.

[0215] Step 1206: Merge the released areas.

[0216] Exemplarily, when there is not enough space in the dynamic atlas, the position occupied by the non-displayed sub-texture map in the sub-region is released to obtain a released region.

[0217] The release area is used to place subsequently inserted sub-texture maps.

[0218] When there is a released area at an adjacent position of the current released area, the current released area is merged with the released area to obtain a merged released area.

[0219] The size of the merged release area is larger than the size of the release area, and the merged release area is used to place the subsequently inserted sub-texture map.

[0220] Step 1207: Determine whether there is enough space in the dynamic atlas.

[0221] Exemplarily, after releasing the position occupied by the undisplayed sub-texture map in the sub-area, it is further determined whether the dynamic atlas has enough space to place the sub-texture map. If the dynamic atlas has enough space, step 1209 is executed; if the dynamic atlas does not have enough space, step 1208 is executed.

[0222] Step 1208: Fall back to the default rendering mode.

[0223] Exemplarily, after releasing the position occupied by the undisplayed sub-texture map in the sub-area, if there is still insufficient space in the dynamic atlas, the computer device uses the default rendering method provided by the game engine, and does not use the rendering method provided by the embodiment of the present application.

[0224] Step 1209: Calculate the insertion position.

[0225] Exemplarily, when there is enough space in the dynamic atlas, the computer device determines the position information of the sub-texture map in the dynamic atlas based on the length of the sub-texture map, and marks the corresponding area as a used area.

[0226] Step 1210: Texture map copying.

[0227] Exemplarily, after determining the position information of the sub-texture map in the dynamic atlas, the sub-texture map is inserted into the dynamic atlas by copying. Before copying, the texture pixels in the target area need to be erased. At the same time, in order to solve the edge pixel sampling problem, one more pixel is copied to the dynamic atlas.

[0228] Step 1211: Generate HSprite.

[0229] Exemplarily, after determining the position of the sub-texture map in the dynamic atlas, the position information and the segmentation information are packaged to obtain the sub-texture map description information HSprite, that is, the sub-texture map information, the texture map information and the position information are stored in the HSprite. At the same time, the computer device inserts the HSprite into the index list corresponding to the dynamic atlas.

[0230] Step 1212: Display through the HImage control.

[0231] For example, when rendering is required, the computer device passes the HSprite to the HImage control for rendering, where each sub-texture map corresponds to an HImage control. The HImage control will create multiple vertices when generating a mesh based on the sub-texture map information in the HSprite, and map the pixel uv coordinates of the atlas texture in the area where the sub-texture map is located to the vertex position of the mesh; after submitting a drawing request, the game engine will automatically batch the drawing requests of the fonts and texture maps belonging to the same material and submit them together to the GPU for rendering.

[0232] Step 1213: The Image control is hidden.

[0233] Exemplarily, when the sub-texture map in the dynamic atlas is not displayed, the Image control is hidden.

[0234] Step 1214: When there is no reference to HSprite, it will be released and its used area will be marked as a free area.

[0235] Exemplarily, when a sub-texture map in a dynamic atlas is not displayed, the HSprite reference count corresponding to the sub-texture map is reduced by 1. If the HSprite has no reference, it will be released, that is, the position occupied by the non-displayed sub-texture map will be released, and its used area will be marked as a free area.

[0236] Step 1215: Determine whether the game has ended.

[0237] Exemplarily, determine whether the game has ended, that is, determine whether the UI interface needs to be rendered. If the game has ended, execute step 1216; if the game has not ended, that is, there is a new UI interface that needs to be rendered, execute step 1203.

[0238] Step 1216: End.

[0239] An exemplary embodiment of the present application provides a rendering method based on a dynamic atlas. The method can be executed by a computer device, which can be a terminal or a server. The method includes:

[0240] The embodiment of the present application is implemented as a runtime dynamic atlas optimization solution based on texture segmentation. First, the computer device segments the input UI map into sub-texture maps of the same resolution according to the first height and saves the segmentation information of the texture map. The location information of each sub-texture map in the dynamic atlas is calculated through a custom atlas layout algorithm, and the segmentation information and location information are encapsulated into HSprite; then each sub-texture map is copied to the specified position of the dynamic atlas, and the HSprite is inserted into the Sprite index list of the dynamic atlas; when the sub-texture map needs to be displayed during game operation, the HSprite is taken out from the Sprite index list by the texture map name and passed to HImage, HImage age restores and displays the sub-texture map according to the segmentation information of HSprite; when the sub-texture map is not displayed, the corresponding HSprite is marked as deletable; when a new texture map is inserted into the dynamic atlas, if it is found that the dynamic atlas has insufficient space, the deletable HSprite will be quickly released to reclaim the layout space of the atlas, because the segmented texture maps are of equal height in the occupied area of ​​the dynamic atlas, and the reclaimed occupied area can be quickly merged horizontally, and the segmented sub-texture maps to be inserted into the new texture map are also of the same height, and the appropriate position can be quickly found, so the scheme does not need to rebuild the atlas. At the same time, this scheme modifies the UI material while referencing the font texture and atlas texture, realizing the batch rendering of texture maps and text.

[0241] The embodiment of the present application divides a texture map of any size into multiple sub-texture maps of the first height and inserts them into a dynamic atlas, uses a custom layout algorithm to calculate the layout position, and completes the complete display of the texture map based on the custom HSprite and HImage when the game is running. Compared with other dynamic atlas solutions, the embodiment of the present application significantly reduces the layout calculation consumption of inserting new texture maps into the dynamic atlas and the calculation consumption of recycling used space, and naturally supports frequent additions and deletions of sub-texture maps in the dynamic atlas. There is no need to reclaim space through atlas reconstruction and atlas expansion like other solutions, thereby further improving the performance of the dynamic atlas solution, and at the same time realizing batch rendering of texture maps and text, which is far superior to static atlas solutions and other dynamic atlas solutions in terms of DrawCall batching and batch rendering status.

[0242] The traditional static atlas solution refers to merging multiple texture maps into a large atlas. The merging is done before the game installation package is built. An independent atlas resource will be generated in advance. This atlas resource is loaded when the game is running to display the elements that need to be displayed.

[0243] The traditional dynamic UI atlas solution based on layout algorithms refers to dynamically merging multiple texture maps into a large atlas based on different layout algorithms when the game is running. Because it is a runtime merger, both the layout algorithm performance and space utilization need to be taken into account.

[0244] Optionally, the layout algorithm includes at least one of a rectangular filling algorithm, a fixed-size grid algorithm, a binary tree algorithm, and an approximate layout algorithm. Usually, a suitable algorithm is selected based on the user's application scenario, taking into account algorithm performance and space utilization.

[0245] Exemplarily, an embodiment of the present application divides a texture map of any size into multiple sub-texture maps of fixed heights, and inserts the sub-texture maps into a dynamic atlas by texture copying, so that images of any resolution can be placed into the dynamic atlas with a high utilization rate; since the inserted sub-texture maps are all of fixed height, the height direction of the atlas is fixed, and the atlas can be simply divided into multiple sub-areas of fixed height, and the insertion position of the new sub-texture map can be quickly calculated; then based on the custom HSprite and HImage, the divided sub-texture maps are used to complete the complete display of the texture map when the game is running; when the sub-texture map is recycled, the corresponding position is marked as an idle area, and when there is insufficient space for inserting a new sub-texture map, the idle areas will be merged, and the idle areas of each sub-area will be merged into rectangles of the same height through simple calculations. Compared with other dynamic atlas solutions, the layout calculation cost of inserting new sub-texture maps into the dynamic atlas and the calculation cost of reclaiming the used space are significantly reduced. It naturally supports frequent addition and deletion of maps in the dynamic atlas, and does not need to reclaim space through atlas reconstruction and atlas expansion like other solutions, thereby further improving the performance of the dynamic atlas solution. At the same time, it realizes batch rendering of texture maps and text, which is far superior to the static atlas solution and other dynamic atlas solutions in terms of DrawCall batching and batch rendering status.

[0246] The application background of the embodiment of the present application is:

[0247] The running memory and GPU performance of mobile terminals are limited, especially for mid- and low-end devices, which put forward high requirements on the running memory and rendering performance of applications. At present, most of the medium and large mobile terminal games have a huge number of resources, among which texture maps account for a large proportion. The running memory and rendering cost occupied by them are the inevitable links for optimizing game performance. The conventional practice in the field of game development is to generate atlases in advance, divide all texture maps into multiple atlases, and the elements in each atlas can be merged into a single Drawcall under certain conditions. By reducing Drawcalls, the rendering performance loss of the device operation is reduced. At the same time, the atlas can also reduce memory usage through specific compression texture algorithms. However, in order to reduce the number of DrawCalls, a large number of static atlases are generated offline in advance. It is difficult to ensure that a UI interface only uses one atlas. When using multiple atlases, it is difficult to effectively optimize the number of DrawCalls. At the same time, static atlases have a great disadvantage for memory. In many cases, only one texture map in the atlas needs to be displayed, but the entire atlas needs to be loaded into memory, resulting in a large waste of memory. The idea of ​​dynamic atlas is to load scattered texture maps on demand when the game is running, copy the texture of the texture map to the dynamic atlas, and use the dynamic atlas texture when rendering the texture map, ensuring that the UI interface only uses one atlas texture, thereby effectively lowering the threshold for optimizing the number of DrawCalls, while providing the feasibility of batching texture maps and text rendering. However, most of the current dynamic atlas solutions are one-way additions of textures, and the performance loss of rectangle calculations increases sharply when the number of rectangles is large, and the algorithm performance for spatial reuse after deleting idle textures is not good. Therefore, try to avoid removing idle textures. When the atlas space is insufficient, it is solved by expanding the atlas or rebuilding the atlas.

[0248] The solution idea of ​​the embodiment of the present application is: setting a fixed height for segmentation, dividing the fillable area of ​​the dynamic atlas into multiple sub-areas of equal height; segmenting a texture map of any size into multiple sub-texture maps of fixed height, and inserting the sub-texture map into the dynamic atlas by texture copying; based on custom HSprite and HImage, using the segmented sub-texture maps to complete the complete display of the texture map when the game is running; when the inserted sub-texture map is recycled, marking the corresponding position as a free area, and when there is insufficient space to insert a new sub-texture map, merging the free areas; modifying the UI material, referencing the dynamic atlas and font texture to achieve batch rendering of textures and text.

[0249] The workflow diagram of the solution corresponding to the embodiment of the present application is as follows:

[0250] Initialize dynamic atlas parameters. Generate a dynamic atlas texture of the specified size (W, H), set the split fixed height h, divide the available area of ​​the dynamic atlas into n (n = H / h) sub-areas, and bind the dynamic atlas texture and font texture to the UI material.

[0251] When rendering a new UI texture, first split the new texture into multiple sub-textures of height h vertically according to h. Check whether the available area of ​​the current dynamic atlas has enough space to insert the sub-texture.

[0252] Merge the free areas of the dynamic atlas. Traverse the sub-areas of the dynamic atlas and merge them quickly in the horizontal direction. Check whether the space in the available area of ​​the current dynamic atlas is sufficient to insert the sub-texture map.

[0253] If the space for the dynamic atlas is still insufficient, choose not to insert the dynamic atlas and fall back to the default rendering method of the game engine.

[0254] When there is enough space in the dynamic atlas, the specific insertion position of the sub-texture map is calculated and the corresponding area is marked as a used area.

[0255] Copy the sub-texture map to the dynamic atlas. Before copying, you need to erase the texture pixels in the target area. At the same time, in order to solve the edge pixel sampling problem, copy 1 more pixel to the atlas texture.

[0256] Generate HSprite. Store the original texture information, the split sub-texture map information and their position information in the dynamic atlas into HSprite. When the texture map is displayed, pass the HSprite to HImage for rendering. HImage will create multiple vertices when generating a mesh based on the sub-texture map information in the HSprite, map the pixel uv coordinates of the atlas texture in the area where the sub-texture map is located to the vertex position of the mesh, and then submit a drawing request. The game engine will automatically batch the drawing requests for fonts and texture maps belonging to the same material and submit them together to the GPU for rendering.

[0257] When the texture map is not displayed, the HImage will be hidden. When the HImage is hidden, the HSprite reference count will be reduced by 1. If the HSprite has no references, it will be released and its used area will be marked as a free area.

[0258] In summary, compared with other dynamic atlas solutions, this solution significantly reduces the computational cost of inserting new texture maps into the dynamic atlas and the computational cost of reclaiming the used space, especially in the case of tens of thousands of rectangles. It supports frequent addition and deletion of sub-texture maps in the dynamic atlas, and does not need to reclaim space through atlas reconstruction and atlas expansion like other solutions, thereby further improving the performance of the dynamic atlas solution. At the same time, it realizes batch rendering of texture maps and text. It is far superior to static atlas solutions and other dynamic atlas solutions in terms of DrawCall batching and batch rendering status, has a wider range of application scenarios, and has been implemented in actual game project development.

[0259] Fig.13 A schematic diagram of a rendering device based on a dynamic atlas provided by an exemplary embodiment of the present application is shown. The device can be implemented as all or part of a computer device through software, hardware, or a combination of both. The device includes:

[0260] An acquisition module 1301 is used to acquire a texture map, where the texture map is used to represent a picture of any size required for rendering a display element;

[0261] A segmentation module 1302, used for saving at least two sub-texture maps obtained by segmenting the texture map into the dynamic atlas, where the dynamic atlas is used for representing a set of sub-texture maps dynamically saved during rendering;

[0262] The rendering module 1303 is used to perform rendering based on the sub-texture map in the dynamic atlas, and display the rendered display element.

[0263] In some embodiments, the segmentation module 1302 is used to segment the texture map to obtain at least two sub-texture maps at a first height;

[0264] In some embodiments, the apparatus further comprises an inserting module 1304, and the inserting module 1304 is configured to insert at least two of the sub-texture maps at the first height into the dynamic atlas.

[0265] In some embodiments, the segmentation module 1302 is used to segment the texture map into n sub-texture maps at the first height when the ratio of the height of the texture map to the first height is a positive integer, where n is the ratio of the height of the texture map to the first height, and n is a positive integer.

[0266] In some embodiments, the segmentation module 1302 is used to segment the texture map into m sub-texture maps at the first height when the ratio of the height of the texture map to the first height is a non-positive integer, where m is the value obtained by rounding up the ratio of the height of the texture map to the first height, and m is a positive integer.

[0267] In some embodiments, the insertion module 1304 is used to divide the dynamic atlas into at least two sub-areas, where the height of the sub-areas is the first height; and insert the sub-texture map into the sub-areas of the dynamic atlas based on the length of the sub-texture map.

[0268] In some embodiments, the device further includes a release module 1305, and the release module 1305 is used to release the position occupied by the sub-texture map in the sub-area when the sub-texture map in the dynamic atlas is not displayed, so as to obtain a released area.

[0269] The release area is used to place the sub-texture map that is subsequently inserted.

[0270] In some embodiments, the apparatus further includes a merging module 1306, and the merging module 1306 is configured to merge the current released area with the released area to obtain a merged released area when there is a released area adjacent to the current released area.

[0271] The size of the merged release area is larger than the size of the release area, and the merged release area is used to place the sub-texture map that is subsequently inserted.

[0272] In some embodiments, an acquisition module 1301 is used to obtain position information corresponding to the sub-texture map, and the position information is used to indicate the position of the sub-texture map in the dynamic atlas; the position information and segmentation information are encapsulated to obtain sub-texture map description information, and the sub-texture map description information is information used to describe the sub-texture map in the dynamic atlas.

[0273] In some embodiments, the insertion module 1304 is used to insert the sub-texture map description information into the index list corresponding to the dynamic atlas.

[0274] Among them, the segmentation information includes sub-texture map information and texture map information, the sub-texture map information is used to represent the texture information of the sub-texture map, the texture map information is used to represent the texture information of the entire texture map, and the index list is used to represent the list of sub-texture map description information corresponding to each sub-texture map in the dynamic atlas.

[0275] In some embodiments, the acquisition module 1301 is used to obtain the sub-texture map description information in the index list.

[0276] In some embodiments, the rendering module 1303 is used to perform rendering based on the sub-texture map information in the sub-texture map description information, and display the rendered display element.

[0277] In some embodiments, the rendering module 1303 is used to construct vertices in the generated network according to the sub-texture map information to obtain a mapping area corresponding to the sub-texture map; map the pixel UV coordinates corresponding to the sub-texture map to the mapping area, and display the rendered sub-texture map on the display element; perform the above steps on each sub-texture map to display the rendered display element.

[0278] In some embodiments, the acquisition module 1301 is used to acquire a rendering queue, where the rendering queue refers to the arrangement order of rendering tasks executed by a graphics processor GPU.

[0279] In some embodiments, the apparatus further comprises a processing module 1307, the processing module 1307 being configured to batch process the font rendering tasks and the sub-texture map rendering tasks having the same rendering parameters in the rendering queue;

[0280] The batch processing refers to performing the font rendering task and the sub-texture map rendering task simultaneously.

[0281] In some embodiments, the segmentation module 1302 is used to save the texture map to the dynamic atlas when the height of the texture map is less than the first height.

[0282] Fig.14 The block diagram of the structure of a computer device 1400 provided by an exemplary embodiment of the present application is shown. The computer device 1400 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV). The computer device 1400 may also be called a user device, a portable terminal, or other names.

[0283] Typically, the computer device 1400 includes a processor 1401 and a memory 1402 .

[0284] The processor 1401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1401 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1401 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1401 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0285] The memory 1402 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 1402 may also include high-speed random access memory, and non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1402 is used to store at least one instruction, which is executed by the processor 1401 to implement the dynamic atlas-based rendering method provided in the embodiments of the present application.

[0286] In some embodiments, the computer device 1400 may further include: a peripheral device interface 1403 and at least one peripheral device. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1404 , a touch display screen 1405 , a camera assembly 1406 , an audio circuit 1407 and a power supply 1408 .

[0287] The peripheral device interface 1403 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1401 and the memory 1402. In some embodiments, the processor 1401, the memory 1402, and the peripheral device interface 1403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1401, the memory 1402, and the peripheral device interface 1403 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0288] The radio frequency circuit 1404 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1404 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1404 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1404 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 1404 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1404 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0289] The touch display screen 1405 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. The touch display screen 1405 also has the ability to collect touch signals on the surface or above the surface of the touch display screen 1405. The touch signal may be input to the processor 1401 as a control signal for processing. The touch display screen 1405 is used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the touch display screen 1405 may be one, and the front panel of the computer device 1400 is set; in other embodiments, the touch display screen 1405 may be at least two, which are respectively set on different surfaces of the computer device 1400 or are folded; in some embodiments, the touch display screen 1405 may be a flexible display screen, which is set on a curved surface or a folded surface of the computer device 1400. Even, the touch display screen 1405 can also be set as a non-rectangular irregular shape, that is, a special-shaped screen. The touch display screen 1405 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).

[0290] The camera assembly 1406 is used to capture images or videos. Optionally, the camera assembly 1406 includes a front camera and a rear camera. Typically, the front camera is used to realize video calls or selfies, and the rear camera is used to realize the shooting of photos or videos. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, and a wide-angle camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, and the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting functions. In some embodiments, the camera assembly 1406 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0291] The audio circuit 1407 is used to provide an audio interface between the user and the computer device 1400. The audio circuit 1407 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1401 for processing, or input them into the radio frequency circuit 1404 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the computer device 1400. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 1401 or the radio frequency circuit 1404 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as distance measurement. In some embodiments, the audio circuit 1407 may also include a headphone jack.

[0292] The power supply 1408 is used to power various components in the computer device 1400. The power supply 1408 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1408 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged through a wired line, and a wireless rechargeable battery is a battery that is charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0293] In some embodiments, the computer device 1400 further includes one or more sensors 1409 , including but not limited to: an acceleration sensor 1410 , a gyroscope sensor 1411 , a pressure sensor 1412 , an optical sensor 1413 , and a proximity sensor 1414 .

[0294] The acceleration sensor 1410 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the computer device 1400. For example, the acceleration sensor 1410 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 1401 can control the touch display screen 1405 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 1410. The acceleration sensor 1410 can also be used for collecting game or user motion data.

[0295] The gyro sensor 1411 can detect the body direction and rotation angle of the computer device 1400, and the gyro sensor 1411 can cooperate with the acceleration sensor 1410 to collect the user's 3D actions on the computer device 1400. The processor 1401 can implement the following functions based on the data collected by the gyro sensor 1411: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0296] The pressure sensor 1412 can be set on the side frame of the computer device 1400 and / or the lower layer of the touch display screen 1405. When the pressure sensor 1412 is set on the side frame of the computer device 1400, it can detect the user's grip signal of the computer device 1400, and perform left and right hand recognition or shortcut operations according to the grip signal. When the pressure sensor 1412 is set on the lower layer of the touch display screen 1405, it can control the operability controls on the UI interface according to the user's pressure operation on the touch display screen 1405. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0297] The optical sensor 1413 is used to collect the ambient light intensity. In one embodiment, the processor 1401 can control the display brightness of the touch display screen 1405 according to the ambient light intensity collected by the optical sensor 1413. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 1405 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 1405 is reduced. In another embodiment, the processor 1401 can also dynamically adjust the shooting parameters of the camera assembly 1406 according to the ambient light intensity collected by the optical sensor 1413.

[0298] The proximity sensor 1414, also called a distance sensor, is usually arranged on the front of the computer device 1400. The proximity sensor 1414 is used to collect the distance between the user and the front of the computer device 1400. In one embodiment, when the proximity sensor 1414 detects that the distance between the user and the front of the computer device 1400 is gradually decreasing, the processor 1401 controls the touch display screen 1405 to switch from the screen-on state to the screen-off state; when the proximity sensor 1414 detects that the distance between the user and the front of the computer device 1400 is gradually increasing, the processor 1401 controls the touch display screen 1405 to switch from the screen-off state to the screen-on state.

[0299] Those skilled in the art will understand that Fig.14 The structure shown in the figure does not constitute a limitation on the computer device 1400, and the computer device 1400 may include more or less components than shown in the figure, or combine some components, or adopt a different component arrangement.

[0300] Fig.15 The structural block diagram of a computer device 1500 shown in an exemplary embodiment of the present application is shown. The computer device can be implemented as a server in the above-mentioned solution of the present application. The computer device 1500 includes a central processing unit (CPU) 1501, a system memory 1504 including a random access memory (RAM) 1502 and a read-only memory (ROM) 1503, and a system bus 1505 connecting the system memory 1504 and the central processing unit 1501. The computer device 1500 also includes a large-capacity storage device 1506 for storing an operating system 1509, an application program 1510 and other program modules 1511.

[0301] The mass storage device 1506 is connected to the central processing unit 1501 through a mass storage controller (not shown) connected to the system bus 1505. The mass storage device 1506 and its associated computer readable medium provide non-volatile storage for the computer device 1500. That is, the mass storage device 1506 may include a computer readable medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.

[0302] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, Erasable Programmable Read Only Memory (EPROM), Electronically-Erasable Programmable Read-Only Memory (EEPROM) flash memory or other solid-state storage technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage medium is not limited to the above. The above-mentioned system memory 1504 and mass storage device 1506 can be collectively referred to as memory.

[0303] According to various embodiments of the present disclosure, the computer device 1500 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 1500 can be connected to the network 1508 through the network interface unit 1507 connected to the system bus 1505, or the network interface unit 1507 can be used to connect to other types of networks or remote computer systems (not shown).

[0304] The memory also includes at least one computer program, which is stored in the memory. The central processing unit 1501 implements all or part of the steps in the dynamic atlas-based rendering method shown in the above-mentioned embodiments by executing the at least one program.

[0305] An embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the dynamic atlas-based rendering method provided by the above-mentioned method embodiments.

[0306] An embodiment of the present application also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the dynamic atlas-based rendering method provided by the above-mentioned method embodiments.

[0307] An embodiment of the present application also provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; the computer program is read and executed from the computer-readable storage medium by a processor of a computer device, so that the computer device executes to implement the dynamic atlas-based rendering method provided in the above-mentioned method embodiments.

[0308] It will be understood that in the specific implementation of the present application, the data involved, historical data, and data related to user data processing such as portraits related to user identity or characteristics, when the above embodiments of the present application are applied to specific products or technologies, need to obtain user permission or consent, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0309] It should be noted that, unless otherwise clearly defined herein, all terms used in the claims are interpreted according to their ordinary meanings in the technical field. Unless otherwise clearly stated, all references to "an element, device, component, equipment, step, etc." will be openly interpreted as referring to at least one instance of an element, device, component, equipment, step, etc. Unless explicitly stated, the steps of any method disclosed herein do not have to be performed in the exact order disclosed.

[0310] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0311] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0312] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent switching, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A rendering method based on a dynamic atlas, characterized in that: The method comprises: Obtain a texture map, where the texture map is used to represent an image of any size required for rendering a display element; Saving at least two sub-texture maps obtained by segmenting the texture map into the dynamic atlas, wherein the dynamic atlas is used to represent a collection of the sub-texture maps dynamically saved during rendering; Rendering is performed based on the sub-texture map in the dynamic atlas, and the rendered display element is displayed.

2. The method according to claim 1, characterized in that The step of dividing the texture map into at least two sub-texture maps and saving them to the dynamic atlas includes: Splitting the texture map to obtain at least two sub-texture maps at a first height; Insert at least two of the sub-texture maps at the first height into the dynamic atlas.

3. The method according to claim 2, characterized in that The step of dividing the texture map to obtain at least two sub-texture maps at a first height includes: When the ratio of the height of the texture map to the first height is a positive integer, the texture map is divided into n sub-texture maps at the first height, where n is the ratio of the height of the texture map to the first height, and n is a positive integer; When the ratio of the height of the texture map to the first height is a non-positive integer, the texture map is divided into m sub-texture maps at the first height, where m is a value obtained by rounding up the ratio of the height of the texture map to the first height, and m is a positive integer.

4. The method according to claim 2, characterized in that: The inserting at least two of the sub-texture maps at the first height into the dynamic atlas comprises: Divide the dynamic atlas into at least two sub-areas, where the height of the sub-areas is the first height; The sub-texture map is inserted into the sub-region of the dynamic atlas based on a length of the sub-texture map.

5. The method according to claim 4, characterized in that The method further comprises: When the sub-texture map in the dynamic atlas is not displayed, releasing the position occupied by the sub-texture map in the sub-region to obtain a released region; The release area is used to place the sub-texture map that is subsequently inserted.

6. The method according to claim 5, characterized in that The method further comprises: In the case where there is a released area at an adjacent position of the current released area, merging the current released area with the released area to obtain a merged released area; The size of the merged release area is larger than the size of the release area, and the merged release area is used to place the sub-texture map that is subsequently inserted.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Obtaining position information corresponding to the sub-texture map, where the position information is used to indicate the position of the sub-texture map in the dynamic atlas; Encapsulating the position information and the segmentation information to obtain sub-texture map description information, wherein the sub-texture map description information is information used to describe the sub-texture map in the dynamic atlas; Inserting the sub-texture map description information into the index list corresponding to the dynamic atlas; Among them, the segmentation information includes sub-texture map information and texture map information, the sub-texture map information is used to represent the texture information of the sub-texture map, the texture map information is used to represent the texture information of the entire texture map, and the index list is used to represent the list of sub-texture map description information corresponding to each sub-texture map in the dynamic atlas.

8. The method according to claim 7, characterized in that The rendering based on the sub-texture map in the dynamic atlas and displaying the rendered display element comprises: Obtaining the sub-texture map description information in the index list; Rendering is performed based on the sub-texture map information in the sub-texture map description information, and the rendered display element is displayed.

9. The method according to claim 8, characterized in that The rendering based on the sub-texture map information in the sub-texture map description information and displaying the rendered display element comprises: Constructing vertices in the generated network according to the sub-texture map information to obtain a mapping area corresponding to the sub-texture map; Mapping the pixel UV coordinates corresponding to the sub-texture map to the mapping area, and displaying the rendered sub-texture map on the display element; The above steps are performed on each of the sub-texture maps to display the rendered display element.

10. The method according to claim 8, characterized in that The method further comprises: Obtaining a rendering queue, wherein the rendering queue refers to the arrangement order of rendering tasks executed by a graphics processor GPU; Batch processing the font rendering tasks and the sub-texture map rendering tasks with the same rendering parameters in the rendering queue; The batch processing refers to performing the font rendering task and the sub-texture map rendering task simultaneously.

11. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: When the height of the texture map is less than the first height, the texture map is saved in the dynamic atlas.

12. A rendering device based on a dynamic atlas, characterized in that: The device comprises: An acquisition module, used to acquire a texture map, wherein the texture map is used to represent a picture of any size required for rendering a display element; A segmentation module, used for saving at least two sub-texture maps obtained by segmenting the texture map into the dynamic atlas, wherein the dynamic atlas is used for representing a set of sub-texture maps dynamically saved during rendering; A rendering module is used to render based on the sub-texture map in the dynamic atlas and display the rendered display element.

13. A computer device, characterized in that: The computer device comprises: a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the dynamic atlas-based rendering method according to any one of claims 1 to 11.

14. A computer storage medium, characterized in that: At least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by the processor to implement the dynamic atlas-based rendering method according to any one of claims 1 to 11.

15. A computer program product, characterized in that The computer program product includes a computer program, which is stored in a computer-readable storage medium; the computer program is read and executed from the computer-readable storage medium by a processor of a computer device, so that the computer device executes the dynamic atlas-based rendering method as described in any one of claims 1 to 11.