Picture processing method and device, storage medium and electronic device
By automatically dividing textures into cross-module public and exclusive textures and dividing the atlas based on similarity, the problem of high human resource consumption caused by manual division in the existing technology is solved, and the efficiency of atlas division and memory optimization effect are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-07-28
- Publication Date
- 2026-05-12
AI Technical Summary
Existing image processing methods require multiple manual image atlas divisions, resulting in high human resource consumption and low efficiency in image atlas division.
By using an automatic partitioning method, textures are divided into multiple atlases based on the similarity of the referenced modules and prefab information. These atlases include common textures across modules and exclusive textures, and partitioning is performed separately to reduce manual intervention.
This eliminates the need for multiple manual map atlas partitioning operations, reducing manpower consumption, improving the efficiency and rationality of map atlas partitioning, and optimizing memory and rendering performance.
Smart Images

Figure CN117520585B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a method and apparatus for processing images, a storage medium, and an electronic device. Background Technology
[0002] For applications that allow human-computer interaction, the UI (User Interface) is used to interact with the user and exchange information. The images required for UI rendering are called UI textures. If an application's project contains a large number of UI textures (each UI texture is an independent image), the application will consume a significant amount of runtime memory and draw calls, resulting in a substantial performance drain on the application's runtime memory and GPU (Graphics Processing Unit).
[0003] To reduce memory usage and GPU performance consumption, UI textures used in the application can be pre-divided into different atlases, generating multiple UI atlases. The drawing of elements within each atlas can be merged into a single drawcall under specific conditions. Reducing drawcalls decreases rendering performance overhead on the device, and the atlases can also reduce memory usage through specific texture compression algorithms.
[0004] Currently, when partitioning graph atlases, it is usually done manually by the project's developers based on resource analysis results and technical experience. After partitioning, the graph atlas needs to be monitored in real-time during application runtime to identify problematic areas, often requiring multiple partitioning attempts to achieve satisfactory results.
[0005] It is evident that the image processing methods in related technologies suffer from the problem of high human resource consumption due to the need for multiple manual image atlas divisions. Summary of the Invention
[0006] This application provides a method and apparatus for image processing, a storage medium and an electronic device, to address the problem that image processing methods in at least the related art suffer from high human resource consumption due to the need for multiple manual image atlas divisions.
[0007] According to one aspect of the embodiments of this application, an image processing method is provided, comprising: determining a set of first textures and multiple sets of second textures, wherein each first texture in the set of first textures is a texture referenced by more than a preset number of business modules of the target application in multiple textures, and each set of second textures in the multiple sets of second textures includes other textures in the multiple textures besides the set of first textures that correspond to a business module; dividing the set of first textures into multiple first image sets according to the similarity between the reference module information of each first texture, wherein the reference module information of each first texture is used to represent the business module that references each first texture; dividing each set of second textures into multiple second image sets according to the similarity between the prefab reference information of each second texture in each set of second textures, wherein the prefab reference information of each second texture is used to represent the prefab that references each second texture among multiple prefabs of the business module corresponding to each set of second textures.
[0008] According to another aspect of the embodiments of this application, an image processing apparatus is also provided, comprising: a first determining unit, configured to determine a set of first textures and multiple sets of second textures, wherein each first texture in the set of first textures is a texture referenced by more than a preset number of business modules of the target application in multiple textures, and each set of second textures in the multiple sets of second textures includes other textures in the multiple textures besides the set of first textures corresponding to a business module; a first dividing unit, configured to divide the set of first textures into multiple first image sets according to the similarity between the reference module information of each first texture, wherein the reference module information of each first texture is used to indicate the business module referencing each first texture; and a second dividing unit, configured to divide each set of second textures into multiple second image sets according to the similarity between the prefab reference information of each second texture in each set of second textures, wherein the prefab reference information of each second texture is used to indicate the prefab referenced by each second texture among multiple prefabs of the business module corresponding to each set of second textures.
[0009] As an optional solution, the first partitioning unit includes: a first partitioning module, configured to partition the group of first images into the plurality of first image sets based on the similarity between the module reference tuples of each first image, wherein each element in the module reference tuple of each first image corresponds to a business module of the target application, and each element in the module reference tuple of each first image is used to indicate whether the corresponding business module references each first image.
[0010] As an optional solution, the first partitioning module includes: a first partitioning submodule, used to partition the group of first textures into the plurality of first texture sets according to the Hamming distance between the module reference tuples of each first texture.
[0011] As an optional solution, the first partitioning unit includes: a second partitioning module, configured to partition the group of first textures into a plurality of first atlases according to the similarity between the reference module information of each first texture and a first resolution size range, wherein the atlas resolution size of each of the plurality of first atlases is within the first resolution size range.
[0012] As an optional scheme, the first resolution size range is the size range from a first resolution size threshold to a second resolution size threshold; the second partitioning module includes: a first iteration submodule, used to iteratively execute the following partitioning steps until a first iteration termination condition is met, wherein the first iteration termination condition includes at least one of the following: the number of iterations reaches the first number, and the number of remaining first textures in the group of first textures is zero; after executing one iteration, the first similarity threshold is increased by the first step length: each first texture in the group of first textures is sequentially used as the current texture and the following processing steps are executed: when there is an existing first temporary texture set in the first temporary texture set list, the similarity between the current texture and each first temporary texture set is determined according to the similarity between the current texture and the first textures in each first temporary texture set, and a first matching texture set is obtained, wherein the first matching texture set is the first temporary texture set with the highest similarity to the current texture; when the similarity between the current texture and the first matching texture set is greater than or equal to If the image resolution size of the first matching image set after adding the current image is less than or equal to the second resolution size threshold, the current image is added to the first matching image set to obtain an updated first matching image set. If the image resolution size of the updated first matching image set is greater than or equal to the first resolution size threshold and the image fill rate of the updated first matching image set is greater than or equal to the first fill rate threshold, the updated first matching image set is determined as a first image set, the first image in the updated first matching image set is removed from the group of first images, and the first matching image set is removed from the first temporary image set list. If there is no existing first temporary image set in the first temporary image set list, or if the current image is not added to any first temporary image set, a new temporary image set is created to obtain a first new image set, the current image is added to the first new image set, and the first new image set is added to the first temporary image set list.
[0013] As an optional approach, the iterative submodule includes: a first determining subunit, used to determine the average similarity between the current texture and each first texture in each first temporary texture set as the similarity between the current texture and each first temporary texture set.
[0014] As an optional solution, the apparatus further includes: a second determining unit, configured to, after performing the following processing steps by sequentially using each of the first textures in the set of first textures as the current texture, when there are multiple first temporary texture sets in the first temporary texture set list, determine the first temporary texture set whose texture set resolution size is less than or equal to a third resolution size threshold as a first candidate texture set; a first iteration unit, configured to, when there are multiple first candidate texture sets, iteratively execute the following steps until a second iteration termination condition is met, wherein the second iteration termination condition includes at least one of the following: the iteration count reaches the second number, and the number of remaining first candidate texture sets after iteration is less than or equal to a first number threshold; sorting the multiple first candidate texture sets in descending order of texture set resolution size to obtain a first candidate texture set list; sequentially traversing the first candidate texture sets in the first candidate texture set list, and performing processing on the current texture set traversed. Perform the following graph set merging operation: Determine a first target graph set in the first candidate graph set list, wherein the first target graph set is the graph set in the first candidate graph set list other than the current graph set, whose graph set resolution size after merging with the current graph set is less than or equal to the second resolution size threshold, and whose graph set fill rate is the largest; merge the current graph set with the first target graph set to obtain a first merged graph set, and remove the current graph set and the first target graph set from the first candidate graph set list; if the graph set resolution size of the first merged graph set is greater than or equal to the first resolution size threshold, and the graph set fill rate is greater than or equal to the first fill rate threshold, determine the first merged graph set as a first graph set; if the graph set resolution size of the first merged graph set is less than the first resolution size threshold, add the first merged graph set as a first candidate graph set to the first candidate graph set list.
[0015] As an optional solution, the second partitioning unit includes: a third partitioning module, used to partition each group of second textures into the plurality of second texture sets according to the similarity between the prefab reference tuples of each second texture, wherein each element in the prefab reference tuple of each second texture corresponds to a prefab of the business module corresponding to each group of second textures, and each element in the prefab reference tuple of each second texture is used to indicate whether the corresponding prefab references each second texture.
[0016] As an optional solution, the third partitioning module includes: a second partitioning submodule, used to partition each group of second textures into the plurality of second texture sets according to the Hamming distance between the prefab reference tuples of each second texture.
[0017] As an optional solution, the second partitioning unit includes: a fourth partitioning module, used to partition each group of second textures into a plurality of second texture sets according to the similarity between the prefab reference information of each second texture and according to a second resolution size range, wherein the texture set resolution size of each of the plurality of second texture sets is within the second resolution size range.
[0018] As an optional scheme, the second resolution size range is the size range from the fourth resolution size threshold to the fifth resolution size threshold; the fourth partitioning module includes: a second iteration submodule, used to iteratively execute the following partitioning steps until the third iteration termination condition is met, wherein the third iteration termination condition includes at least one of the following: the number of iterations reaches the third number, and the number of remaining second textures in each group of second textures is zero; after executing one iteration, the second similarity threshold is increased by a second step size: each second texture in each group of second textures is sequentially used as the current texture and the following processing steps are executed: when there is an existing second temporary texture set in the second temporary texture set list, the similarity between the current texture set and each second temporary texture set is determined according to the similarity between the current texture set and the second textures in each second temporary texture set, and a second matching texture set is obtained, wherein the second matching texture set is the second temporary texture set with the highest similarity to the current texture set; when the similarity between the current texture set and the second matching texture set is greater than or equal to the second temporary texture set, the second matching texture set is determined. If the similarity is equal to the second similarity threshold, and the resolution size of the second matching image set after adding the current image is less than or equal to the fifth resolution size threshold, the current image is added to the second matching image set to obtain an updated second matching image set. If the resolution size of the updated second matching image set is greater than or equal to the fourth resolution size threshold, and the fill rate of the updated second matching image set is greater than or equal to the second fill rate threshold, the updated second matching image set is determined as a second image set, the second image in the second matching image set is removed from each group of second images, and the second matching image set is removed from the second temporary image set list. If there is no existing second temporary image set in the second temporary image set list, or if the current image is not added to any second temporary image set, a new temporary image set is created to obtain a new second image set, the current image is added to the new second image set, and the new second image set is added to the second temporary image set list.
[0019] As an optional approach, the second iteration submodule includes: a second determining subunit, used to determine the average similarity between the current texture and each of the second textures in each of the second temporary texture sets as the similarity between the current texture and each of the second temporary texture sets.
[0020] As an optional solution, the apparatus further includes: a third determining unit, configured to, after performing the following processing steps by sequentially using each of the second textures in each group of second textures as the current texture, when there are multiple second temporary texture sets in the second temporary texture set list, determine the second temporary texture sets in the multiple second temporary texture sets whose texture set resolution size is less than or equal to a sixth resolution size threshold as second candidate texture sets; a second iteration unit, configured to, when there are multiple second candidate texture sets, iteratively execute the following steps until a fourth iteration termination condition is met, wherein the fourth iteration termination condition includes at least one of the following: the iteration count reaches the fourth number, and the number of remaining second candidate texture sets after the iteration is less than or equal to a second number threshold; sorting the multiple second candidate texture sets in descending order of texture set resolution size to obtain a second candidate texture set list; sequentially traversing the second candidate texture sets in the second candidate texture set list, and performing the following processing steps on the traversed current texture set: The following is a set-merging operation: First, determine the second target set in the second candidate set list. The second target set is the set in the second candidate set list other than the current set that, after being merged with the current set, has a set resolution smaller than or equal to the fifth resolution size threshold and the largest set fill rate. Then, merge the current set with the second target set to obtain a second merged set, and remove both the current set and the second target set from the second candidate set list. If the set resolution of the second merged set is greater than or equal to the fourth resolution size threshold and the set fill rate is greater than or equal to the second fill rate threshold, the second merged set is determined as a second set. If the set resolution of the second merged set is less than the fourth resolution size threshold, the second merged set is added as a second candidate set to the second candidate set set list.
[0021] As an optional solution, the first determining unit includes: a first determining module, configured to determine a set of initial textures corresponding to each of the plurality of business modules of the target application, wherein the set of initial textures corresponding to each business module includes textures referenced by each business module in the plurality of textures; an extraction module, configured to extract textures in the plurality of textures that are referenced by more than the preset number of business modules, to obtain the set of first textures; and a removal module, configured to remove the first textures in the set of initial textures corresponding to each business module, to obtain the plurality of sets of second textures.
[0022] As an optional solution, the apparatus further includes: a removal unit, configured to, after determining a set of initial textures corresponding to each of the plurality of business modules of the target application, remove the unreferenced textures from the set of initial textures corresponding to the first business module if, based on the texture reference records of the plurality of textures, it is determined that there are textures in the set of initial textures corresponding to the first business module that are not referenced by the first business module, thereby obtaining an updated set of initial textures corresponding to the first business module; and an addition unit, configured to, if, based on the texture reference records of the plurality of textures, it is determined that there are textures in the plurality of textures that are referenced by the second business module but are not included in the set of initial textures corresponding to the second business module, add the referenced textures to the set of initial textures corresponding to the second business module, thereby obtaining an updated set of initial textures corresponding to the second business module.
[0023] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described image processing method when running.
[0024] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the processing method as shown in the above figures.
[0025] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described image processing method through the computer program.
[0026] In this embodiment, based on the number of business modules referencing the texture, the texture is divided into a set of common textures across modules (i.e., first textures) and a set of exclusive textures for each business module (i.e., second textures). For a set of common textures, based on the similarity between business modules referencing the common texture, the set of common textures is divided into multiple atlases (i.e., multiple first atlases). For each set of exclusive textures, based on the similarity between prefabs (i.e., prefabs) referencing the exclusive texture, each set of exclusive textures can be divided into multiple atlases (i.e., multiple second atlases). Through the above automatic atlas division method, the number of atlases referenced by a single prefab can be effectively reduced, and the memory distribution range of the atlases referenced by a single prefab can be narrowed, thereby improving the rationality of atlas division. Furthermore, since automatic atlas division is performed, the purpose of eliminating the need for multiple manual atlas divisions can be achieved, thus reducing human resource consumption and improving atlas division efficiency. This solves the problem of high human resource consumption caused by multiple manual atlas divisions in related technologies for image processing methods. Attached Figure Description
[0027] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0028] Figure 1 This is a schematic diagram of an application environment for an optional image processing method according to an embodiment of this application;
[0029] Figure 2 This is a schematic flowchart of an optional image processing method according to an embodiment of this application;
[0030] Figure 3 This is a schematic diagram of an optional UI texture according to an embodiment of this application;
[0031] Figure 4 This is a schematic diagram of an optional UI atlas according to an embodiment of this application;
[0032] Figure 5 This is a schematic diagram of an optional atlas division according to an embodiment of this application;
[0033] Figure 6 This is a schematic diagram of an optional module reference tuple according to an embodiment of this application;
[0034] Figure 7 This is a schematic diagram of an optional Hamming distance according to an embodiment of this application;
[0035] Figure 8 This is a schematic diagram of another optional atlas division according to an embodiment of this application;
[0036] Figure 9 This is a schematic diagram of another optional atlas division according to an embodiment of this application;
[0037] Figure 10 This is a schematic diagram of an optional prefabricated reference tuple according to an embodiment of this application;
[0038] Figure 11 This is a schematic diagram of another optional Hamming distance according to an embodiment of this application;
[0039] Figure 12 This is a schematic flowchart of another optional image processing method according to an embodiment of this application;
[0040] Figure 13 This is a structural block diagram of an optional image processing apparatus according to an embodiment of this application;
[0041] Figure 14 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application;
[0042] Figure 15 This is a structural block diagram of a computer system for an optional electronic device according to an embodiment of this application. Detailed Implementation
[0043] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0044] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0045] According to one aspect of the embodiments of this application, an image processing method is provided. Optionally, as an optional implementation, the above-described image processing method may be applied to, but is not limited to, [examples of image processing methods]. Figure 1 The environment shown may include, but is not limited to, terminal device 102, network 110, and server 112. The terminal device 102 may include, but is not limited to, a display 108, a processor 106, and a memory 104.
[0046] The specific process can be summarized in the following steps:
[0047] Step S102: Store multiple image sets of the target game in the database 114 of server 112.
[0048] For the multiple UI textures used in the target game, they can be divided into multiple texture sets. The multiple texture sets can be saved to database 114. Here, the server can be the backend server of the target game.
[0049] In step S104, the processing engine 116 of server 112 can determine to send multiple atlases to terminal device 102, and can send multiple atlases to terminal device 102. Terminal device 102 can receive and save multiple atlases, for example, when downloading or updating the target application on terminal device 102, or at other times. The processing engine 116 of server 112 can determine to send multiple atlases to terminal device 102.
[0050] In step S106, the terminal device 102 draws UI textures from one or more atlases onto its display 108, thereby displaying the game screen on the device screen.
[0051] Optionally, the terminal device 102 may include, but is not limited to, at least one of the following: mobile phones (such as Android phones, iOS phones, etc.), laptops, tablets, handheld computers, mobile internet devices (MIDs), tablets, desktop computers, smart home appliances, in-vehicle devices, etc. The network 110 may include, but is not limited to, wired networks and wireless networks. The wired network includes local area networks (LANs), metropolitan area networks (MANs), and wide area networks (WANs). The wireless network includes Bluetooth, Wireless Fidelity (WIFI), and other networks that enable wireless communication. The server 112 may be a single server, a server cluster consisting of multiple servers, or a cloud server. The above is merely an example, and no limitations are imposed in this embodiment.
[0052] Optionally, the above image processing method can be executed by either the terminal device 102 or the server 112 alone, or by other processing devices besides the terminal device 102 and the server 112, as long as the processed image set can be applied to the terminal device 102 and the server 112. As an optional implementation, taking the image processing method of this embodiment executed by a processing device as an example... Figure 2 This is a schematic flowchart of an optional image processing method according to an embodiment of this application, such as... Figure 2 As shown, the image processing method can include the following steps:
[0053] S202, determine a set of first textures and multiple sets of second textures, wherein each first texture in the set of first textures is a texture referenced by more than a preset number of business modules of the target application in multiple textures, and each set of second textures in multiple sets of second textures contains other textures in multiple textures other than the set of first textures corresponding to a business module.
[0054] The image processing method in this embodiment can be applied to application scenarios using UI atlases, including but not limited to game scenarios, animation production scenarios, or other similar application scenarios. Here, UI (i.e., user interface) refers to the overall design of the software's human-computer interaction, operation logic, and interface aesthetics. In games, it generally refers to the game interface, providing players with a medium for interactive operation. In game applications, animation production applications, or other similar applications, UI textures can be used to present the UI. That is, UI textures are artistic images required for UI (e.g., game UI) presentation. Loading images into the device's running memory requires a certain amount of memory (i.e., texture memory). A UI atlas is a collection of UI textures, usually merging a certain number of UI textures into one image and providing configurations that can index individual textures. It can also provide descriptions of individual textures in the UI atlas through sprites. In addition, prefabs (such as UI prefabs in games) can be used in the engine editor of an application (e.g., a game engine editor) to quickly pregenerate visual UIs. That is, a prefab is an intermediate product used in the engine editor to quickly pregenerate visual UIs, and it can contain information such as the layout of UI elements and the sprites of referenced atlases.
[0055] Taking game applications as an example, game applications can include, but are not limited to, all games that use firearms for ranged attacks, including but not limited to first-person shooter games and third-person shooter games. Specifically, target shooting applications can be multiplayer online battle arena (MOBA) games or single-player games (SPG). It should be noted that the type of game application can include, but is not limited to, at least one of the following: two-dimensional (2D) game applications, three-dimensional (3D) game applications, virtual reality (VR) game applications, augmented reality (AR) game applications, and mixed reality (MR) game applications. The above is merely an example, and no limitation is made in this embodiment.
[0056] Most medium to large-scale games (e.g., mobile games) have a huge amount of resources, and game development projects typically involve a large number of UI textures (such as...). Figure 3 As shown, UI textures account for a significant portion of resources in medium to large-scale games. Terminal devices (especially mobile devices) have limited RAM and GPU performance, placing high demands on application RAM and rendering performance. During game runtime, UI textures consume a large amount of RAM and draw calls. The RAM consumption and rendering overhead have a significant impact on game performance optimization. Draw calls are operations where the CPU (Central Processing Unit) calls graphics programming interfaces (such as DirectX or OpenGL) to instruct the GPU to perform rendering. The more draw calls there are, the greater the performance cost for the device.
[0057] To reduce the runtime memory and draw calls consumed by UI textures, UI texture sets (such as...) can be pre-generated. Figure 4As shown, all UI textures are divided into multiple atlases. The drawing of elements within each atlas can be merged into a single drawcall under specific conditions. Reducing drawcalls decreases rendering performance overhead on the device. Atlases can also reduce memory usage through specific texture compression algorithms. Here, drawing refers to the rendering of textures from the CPU to the GPU and then onto the device screen. In related technologies, the commonly used atlas partitioning scheme (i.e., dividing all UI textures into different atlases) is manually performed by project developers based on resource analysis and technical experience. However, manual partitioning relies on human experience and is prone to resulting in large memory prefabs, requiring significant manpower for iterative version updates.
[0058] In addition, an automatic partitioning scheme based on minimizing Prefab memory (i.e., the optimal Prefab memory solution) can be used. This scheme performs simple classification and partitioning based on modules and Prefabs to minimize the memory usage of individual Prefab reference atlases. This automatic partitioning scheme may include the following steps: roughly grouping Prefabs according to business modules; classifying UI textures referenced by multiple Prefabs as common textures, which are then preferentially placed into an independent atlas based on their Prefab reference information; UI textures referenced by only one Prefab are placed into their dedicated Prefab atlas; if the effective fill rate of the current dedicated atlas is low after partitioning, it will attempt to fill it with textures from other atlases in the same group to improve the effective fill rate of a single atlas.
[0059] The above atlas partitioning scheme optimizes the memory management of a single prefab by relaxing the limit on the number of atlases, thus alleviating the problem of large memory prefabs. However, it brings other problems, such as low effective fill rate (low utilization) of the atlas, significant memory growth due to resource redundancy, and a surge in the number of atlases referenced by prefabs.
[0060] To at least partially solve the aforementioned technical problems, in this embodiment, based on the number of business modules referencing the texture, the texture is divided into a set of common textures across modules and a set of exclusive textures for each business module. For a set of common textures, based on the similarity between business modules referencing the common texture, the set of common textures is divided into multiple texture sets. For each set of exclusive textures, based on the similarity between prefabs referencing the exclusive texture, each set of exclusive textures can be divided into multiple texture sets. Through the above texture set division method, while ensuring the rationality of texture set division, there is no need to manually divide texture sets multiple times, thereby reducing the human resource consumption of texture set division and improving the efficiency of texture set division.
[0061] For multiple textures to be divided in a target application (which may be a target game application), the processing device can divide them into a first set of textures and multiple sets of second textures based on the business modules that reference each texture. Here, a first set of textures may contain multiple first textures, each of which is a texture referenced by more than a preset number of business modules of the target application, or a common texture. The multiple sets of second textures correspond one-to-one with multiple business modules, and each set of second textures contains other textures in multiple textures other than the first set of textures corresponding to a business module, or exclusive textures of the business module.
[0062] For example, a threshold L_limit can be set for determining the common module of a texture (corresponding to the common texture, the module to which the common texture is assigned). All textures are traversed, and the number c of business modules referencing the traversed texture is calculated. When c ≥ L_limit, the traversed texture is assigned to the common module; when c < L_limit, the traversed texture is determined to be the exclusive texture of the business module.
[0063] Here, a business module refers to a functional module of the target application. The division of business modules can be done manually or automatically based on the project directory of the target application. This embodiment does not limit the method of dividing business modules. For example, a business module can be a game business module. A game business module generally refers to the gameplay features in a game. Usually, a game has many gameplay features, and each gameplay feature will have its own unique set of UI.
[0064] It should be noted that the second texture does not necessarily exist only in each group of second textures corresponding to a single business module. It just means that fewer business modules reference the texture. In other words, the exclusive texture of a business module does not mean that only that business module references the texture.
[0065] S204, based on the similarity between the referenced module information of each first image, a set of first images is divided into multiple first image sets, wherein the referenced module information of each first image is used to represent the business module that references each first image.
[0066] Different partitioning methods can be used for different texture groups. Optionally, for a set of first textures, the set can be divided into multiple first texture sets based on the similarity between business modules referencing different first textures. For each first texture, the referencing module information can be determined. Here, the referencing module information of each first texture represents the business module referencing each first texture, and it can be represented by an array or other data structures. For a first texture, the referencing module information can contain only the description information of the business module referencing the first texture (which can be a business module identifier or a flag), or it can contain the description information of all business modules, as long as it clearly indicates which business modules reference the first texture.
[0067] Based on the reference module information of each first texture, the similarity between the reference module information of each first texture can be calculated. That is, the similarity between the reference module information of any two first textures can be used as the similarity between the first textures. Based on the similarity between the reference module information of each first texture, a set of first textures can be divided into atlases. Two first textures with higher similarity are more likely to be assigned to the same atlas, while two first textures with lower similarity are more likely to be assigned to different atlases.
[0068] S206, based on the similarity between the prefab reference information of each second texture in each group of second textures, divide each group of second textures into multiple second texture sets, wherein the prefab reference information of each second texture is used to represent the reference of the prefab of each second texture in the multiple prefabs of the business module corresponding to each group of second textures.
[0069] For each group of second textures, the same partitioning method can be used for atlas division. A business module corresponding to a group of second textures can have multiple prefabs, and each prefab can reference multiple textures. For the current group of second textures (which can be any group of second textures), the current group of second textures can be divided into multiple atlases based on the similarity between prefabs referencing different second textures within the multiple prefabs of the business module corresponding to the current group of second textures. The multiple atlases formed by different groups of second textures are different.
[0070] Here, since each business module has its own unique set of UI elements, and each UI element has its own prefab in the project archive, each business module can have its own set of prefabs. The multiple prefabs mentioned above are the prefabs owned by the business module.
[0071] For each second texture in the current group of second textures, the prefab reference information for each second texture can be determined. Here, the prefab reference information for each second texture is used to indicate the prefabs that reference each second texture among multiple prefabs of the business module corresponding to the current group of second textures. It can be represented in the form of an array or in other data structures. For a second texture, the referenced prefab information of the second texture can only contain the description information of the prefabs that reference the second texture (which can be a prefab identifier or a flag bit), or it can contain the description information of all prefabs, as long as it can clearly indicate which prefabs reference the second texture.
[0072] Based on the referenced prefab information of each second texture, the similarity between the referenced prefab information of each second texture can be calculated. That is, the similarity between the referenced prefab information of any two second textures can be used as the similarity between the second textures. Based on the similarity between the referenced prefab information of each second texture, the current group of second textures can be divided into texture sets. Two second textures with higher similarity are more likely to be assigned to the same texture set, while two second textures with lower similarity are more likely to be assigned to different texture sets.
[0073] The multiple atlases, which divide multiple textures, include multiple first atlases and multiple second atlases for each group of second textures. These atlases can be applied to the target application for user interface display on the terminal device. The usage process of the divided atlases can be found in relevant technologies, and will not be elaborated upon in this embodiment.
[0074] For example, such as Figure 5 As shown, the UI textures to be divided can first be divided into common textures in the common module and exclusive textures in the exclusive modules corresponding to different business modules (e.g., business module 1, business module 2, business module n, etc.). Then, the common textures in the common module and the exclusive textures in the exclusive modules corresponding to different business modules are divided into multiple texture sets respectively.
[0075] The embodiments provided in this application determine a set of first textures and multiple sets of second textures. Each first texture in the set of first textures is a texture referenced by more than a preset number of business modules of the target application among multiple textures. Each set of second textures includes other textures besides the set of first textures that correspond to a business module. Based on the similarity between the referenced module information of each first texture, the set of first textures is divided into multiple first texture sets, where the referenced module information of each first texture represents the business module referencing each first texture. Based on the similarity between the prefab reference information of each second texture in each set of second textures, each set of second textures is divided into multiple second texture sets, where the prefab reference information of each second texture represents the prefab referenced by each second texture among multiple prefabs of the business module corresponding to each set of second textures. This solves the problem of high human resource consumption caused by the need for multiple manual texture set divisions in related technologies, reducing human resource consumption and improving the efficiency of texture set division.
[0076] As an optional approach, a set of first textures is divided into multiple first texture sets based on the similarity between the referenced module information of each first texture, including:
[0077] S11. Based on the similarity between the module reference tuples of each first image, a set of first images is divided into multiple first image sets. Each element in the module reference tuple of each first image corresponds to a business module of the target application. Each element in the module reference tuple of each first image is used to indicate whether the corresponding business module references each first image.
[0078] In this embodiment, to improve the convenience of similarity calculation, the reference module information of the first texture can be represented by the module reference tuple of the first texture. Here, the information of which modules or prefabs reference the texture is quantified by a set of values, which can be called the reference tuple. The module reference tuple refers to the reference tuple based on the number of reference modules of the UI texture. Each element in the module reference tuple corresponds to a business module of the target application, and each element (or the element value of each element) is used to indicate whether the corresponding business module references the current texture.
[0079] For example, a module reference tuple for a UI texture can be calculated. Based on the current number of modules n, an array of n bits (one bit in binary) is allocated to each UI texture, where each bit represents a business module, such as... Figure 6 As shown, when the image references this business module, the corresponding bit is set to 1; otherwise, it is set to 0.
[0080] Based on the module reference tuple of each first texture, the similarity between the module reference tuples of any two first textures in a set can be calculated, and the calculated similarity can be used as the similarity between the first textures. Furthermore, based on the similarity between the module reference tuples of each first texture, a set of first textures can be divided into multiple first texture sets in a similar manner as described above, which has already been explained and will not be repeated here.
[0081] The embodiments provided in this application represent referenced module information in the form of module reference tuples, which facilitates the calculation of similarity between referenced module information of different textures and improves the convenience of similarity calculation.
[0082] As an optional approach, a set of first textures is divided into multiple first texture sets based on the similarity between the module reference tuples of each first texture, including:
[0083] S21, based on the Hamming distance between the module reference tuples of each first texture, divide a set of first textures into multiple first texture sets.
[0084] When calculating the similarity between different reference tuples, any method for calculating the similarity between different arrays can be used. To improve the convenience of similarity calculation, the similarity between different reference tuples can be calculated based on the Hamming distance between them; that is, the similarity between different reference tuples can be represented by the Hamming distance between them. Based on the Hamming distance between the module reference tuples of each first texture, a set of first textures can be divided into multiple first texture sets.
[0085] Here, Hamming distance represents the number of distinct characters at corresponding positions in two strings of the same length. It can be represented by d(x,y) as the Hamming distance between two characters x and y. To calculate the Hamming distance, the two strings can be XORed, and the number of 1s in the result is the Hamming distance. For example, ... Figure 7 As shown, for public posts Figure 1 Module reference tuples and public posts Figure 2 The Hamming distance between module reference tuples is obtained by performing an XOR operation on the elements at corresponding positions of the module reference tuples and counting the number of 1s.
[0086] The embodiments provided in this application demonstrate that the atlas of common textures can be partitioned based on the Hamming distance between module reference tuples of different common textures, thereby improving the convenience of atlas partitioning.
[0087] As an optional approach, a set of first textures is divided into multiple first texture sets based on the similarity between the referenced module information of each first texture, including:
[0088] S31, based on the similarity between the reference module information of each first texture, a group of first textures is divided into multiple first texture sets according to the first resolution size range, wherein the texture set resolution size of each of the multiple first texture sets is within the first resolution size range.
[0089] To avoid excessive memory consumption during atlas rendering and to ensure a high atlas fill rate, the size of each atlas can be limited. For example, the maximum atlas resolution size and the minimum atlas resolution size, or one of the two, can be limited to restrict the atlas resolution size of each first atlas obtained from the division to the range of the first resolution size, such as [1024, 2048].
[0090] For a set of first textures, the set of first textures can be divided into multiple first texture sets according to the first resolution size range based on the similarity between the reference module information of each first texture. The method of calculating the similarity between the reference module information of each first texture can be the same as or similar to that in the previous embodiment, and will not be described in detail in this embodiment.
[0091] For example, the Hamming distance between module reference tuples between UI textures can be calculated, and an appropriate distance threshold can be set for iterative calculation to obtain the atlas partitioning result of cross-module textures. The obtained atlas partitioning result can be a preliminary atlas partitioning result, and subsequent atlas partitioning can be merged or otherwise processed.
[0092] By limiting the resolution size range of each atlas obtained after division through the embodiments provided in this application, atlases with excessively small or large resolution sizes can be identified, thereby improving the rationality of atlas division.
[0093] As an optional approach, the first resolution size range is a size range from a first resolution size threshold to a second resolution size threshold. It may include at least one of the first resolution size threshold and the second resolution size threshold, or it may not include either of them. Here, the first resolution size threshold is less than the second resolution size threshold. For example, the first resolution size threshold may be 1024, and the second resolution size threshold may be 2048. Alternatively, the first resolution size threshold and the second resolution size threshold may be other values. In this embodiment, the first resolution size threshold and the second resolution size threshold are not limited.
[0094] In this embodiment, multiple rounds of iterative calculations can be performed to divide a set of first textures into multiple first texture sets. Before performing the iterations, the following information can be set:
[0095] The first resolution size range includes a first resolution size threshold and a second resolution size threshold;
[0096] The number of iterations is the same as the number of iterations in the first iteration.
[0097] The fill rate threshold is the first fill rate threshold. Here, the fill rate threshold is the fill rate condition that must be met to convert the preparatory drawing set into the formal drawing set. The preparatory drawing set refers to the temporary drawing set generated in the automated process, which can be modified at any time. The formal drawing set is the output version of the temporary drawing set in the automated process, which cannot be modified. Multiple first drawing sets constitute the formal drawing set.
[0098] The similarity threshold between a texture and an image set is the first similarity threshold. Based on this similarity threshold, it can be determined whether a texture should be classified into an image set.
[0099] The iteration step size, which is the first step size, is the step size by which the similarity threshold between the texture and the atlas increases after each iteration.
[0100] For example, an initial segmentation threshold X0 can be set (which functions the same as the first similarity threshold mentioned above), and the iteration step size x can be set. t (Same function as the first step above), iteration number I (I > 0), upper limit W0 = 2048 (same function as the first resolution size threshold above), effective fill rate threshold U0 of the atlas (e.g., U0 ≥ 85%) (same function as the first fill rate threshold above), lower limit W of resolution size when the preliminary atlas meets the fill rate threshold and is converted to the formal atlas. s =1024 (functions the same as the second resolution size threshold mentioned above).
[0101] Correspondingly, based on the similarity between the referenced module information of each first texture, and according to the first resolution size range, a set of first textures is divided into multiple first atlases, including:
[0102] S41, iteratively execute the following partitioning steps until the first iteration termination condition is met, wherein the first iteration termination condition includes at least one of the following: the number of iterations reaches the first iteration number, the number of remaining first textures in a group of first textures is zero, and after completing one iteration, the first similarity threshold is increased by the first step length:
[0103] Each of the first textures in a set is used as the current texture, and the following processing steps are performed:
[0104] S411, when there is an existing first temporary map set in the first temporary map set list, determine the similarity between the current map set and each first temporary map set based on the similarity between the current map set and the first map set in each first temporary map set, and obtain the first matching map set, wherein the first matching map set is the first temporary map set with the highest similarity to the current map set.
[0105] At the start of an iteration, each of the first textures in the current set can be sequentially used as the current texture. The first temporary atlas to which the current texture is added is then determined. To partition the set of first textures, a list of first temporary atlases can be set up. The number of first temporary atlases in the list can be arbitrary, or there can be no first temporary atlases. For the current texture, if an existing first temporary atlas exists in the list, the similarity between the current texture and each first temporary atlas in the list can be determined. The first temporary atlas corresponding to the highest similarity among the current texture and each first temporary atlas is then used to determine the first temporary atlas that matches the current texture; that is, the first matching atlas.
[0106] Optionally, the similarity between the current texture and each first temporary image set can be determined based on the similarity between the current texture and the first texture in each first temporary image set. The similarity between the current texture and the first texture in each first temporary image set can be the similarity between the module reference tuples of the textures. The calculation method is similar to that in the previous embodiments and will not be described in detail here.
[0107] For example, after performing the iterative partitioning of the atlas, I can be set. i (0 < i ≤ I) represents the current iteration, X i Define the threshold for the current iteration, where i is the current iteration number. Initialize i = 1, X i =X0. A single iteration begins, traversing all textures. If the traversal is not yet complete, the current texture can be traversed. When traversing to the current texture, if the number of pre-set textures in the pre-set texture list is not 0, traverse the pre-set texture list T, calculate the similarity between the current texture and each pre-set texture, and determine the pre-set texture with the highest similarity as the matching pre-set texture.
[0108] S412, if the similarity between the current texture and the first matching image set is greater than or equal to the first similarity threshold, and the image set resolution size of the first matching image set after adding the current texture is less than or equal to the second resolution size threshold, add the current texture to the first matching image set to obtain the updated first matching image set.
[0109] If the similarity between the current texture and the first matching image set is greater than or equal to a first similarity threshold, then the image set resolution size of the first matching image set after adding the current texture can be further determined. The method of adding a texture to an image set can be found in relevant technologies, and will not be elaborated upon in this embodiment. If the image set resolution size of the first matching image set after adding the current texture is less than or equal to a second resolution size threshold, that is, it does not exceed the resolution size upper limit, then the current texture can be added to the first matching image set to obtain an updated first matching image set.
[0110] For example, if the similarity threshold is met, calculate the resolution (width, height) of the matching pre-set image after adding the current texture, and let w = max(width, height). If w ≤ W0, add the current texture to the matching pre-set image.
[0111] S413, if the atlas resolution size of the updated first matching atlas is greater than or equal to the first resolution size threshold and the atlas fill rate of the updated first matching atlas is greater than or equal to the first fill rate threshold, the updated first matching atlas is determined as a first atlas, the first texture in the updated first matching atlas is removed from a group of first textures, and the first matching atlas is removed from the first temporary atlas list.
[0112] If the updated first matching atlas has an atlas resolution size greater than or equal to a first resolution size threshold (i.e., reaching the lower resolution size limit), the atlas fill rate of the updated first matching atlas can be determined, i.e., the effective fill rate. The effective fill rate can refer to the proportion of the effective area of the atlas filled by sprites in the entire atlas texture. If the updated first matching atlas fill rate is greater than or equal to the first fill rate threshold, the updated first matching atlas can be determined as a formal atlas, i.e., a first atlas. Furthermore, the first texture in the updated first matching atlas is removed from the set of first textures, and the first matching atlas is removed from the first temporary atlas list.
[0113] For example, after adding the current texture to the matching pre-map set, the effective fill rate U of the pre-map set is calculated. i If U i >U0, and w≥W s The prepared texture set is then identified as the official texture set and removed from the prepared texture set list, allowing processing of the next texture. For example... Figure 8 As shown, after adding a UI texture to the preparatory texture set 2, and after the preparatory texture set 2 meets the conditions for becoming the official texture set, the preparatory texture set 2 is converted into the official texture set 2, and the preparatory texture set 2 is removed from the preparatory texture set list.
[0114] S414: When there is no existing first temporary atlas in the first temporary atlas list, or the current texture has not been added to any first temporary atlas, create a new temporary atlas, obtain the first new atlas, add the current texture to the first new atlas, and add the first new atlas to the first temporary atlas list.
[0115] If there is no existing first temporary atlas in the first temporary atlas list, or if the current texture has not been added to any first temporary atlas in the first temporary atlas list, a new temporary atlas can be created, resulting in a new first atlas. The current texture is then added to the new first atlas, and the new first atlas is added to the first temporary atlas list. At this time, the number of first temporary atlases in the first temporary atlas list increases by one.
[0116] For example, if the number of pre-set textures in the pre-set list is 0 or the current texture has not been added to any pre-set texture, a new pre-set texture is created to store the current texture, and the process continues with the next texture. For example, if... Figure 9 As shown, if there is no matching pre-set, you can create a new pre-set q+1 and add the current texture to the new pre-set q+1.
[0117] The atlas partitioning results obtained by iterative calculation using the embodiments provided in this application, through setting an appropriate distance threshold, can improve the convenience and rationality of atlas partitioning.
[0118] As an optional approach, the similarity between the current texture and each first temporary image set is determined based on the similarity between the current texture and the first texture in each first temporary image set, including:
[0119] S51, the average similarity between the current texture and each first texture in each first temporary texture set is determined as the similarity between the current texture and each first temporary texture set.
[0120] In this embodiment, the similarity between the current texture and the temporary atlas can be determined based on the average similarity between the current texture and each texture in the temporary atlas. The method for calculating the similarity between two textures can be similar to that in the previous embodiments, and will not be repeated here. For each first temporary atlas, the average similarity between the current texture and each first texture in each first temporary atlas can be determined as the similarity between the current texture and each first temporary atlas.
[0121] For example, the average Hamming distance between reference tuples of a texture and an atlas is the average Hamming distance between the texture and all reference tuples of textures in the atlas, which can be used to represent the similarity between a texture and an atlas. Traversing the list of candidate atlases T (0 < j < c, where c is the number of atlases), the similarity between the current texture and each candidate atlas t is calculated. j The average Hamming distance r of the module reference tuples j r E =min{r0, ...,r} c The preliminary map set with the minimum distance is selected as the matching preliminary map set.
[0122] For example, for the automatic partitioning of common textures of common modules into atlases, the following atlas partitioning steps can be performed at the beginning of a single iteration:
[0123] Step 1: Start a single iteration and begin traversing all textures. If the traversal is not yet complete, jump to Step 2. If the current iteration has completed traversing all textures, jump to Step 6.
[0124] Step 2: When traversing to the current texture, if the number of prepared textures in the prepared texture list is not 0, then jump to step 4; otherwise, execute step 3.
[0125] Step 3: Create a new pre-processed texture set to store the current texture, and continue processing the next texture. Skip to Step 2.
[0126] Step 4: Traverse the list of preparatory texture sets T (0 < j < c, where c is the number of texture sets), and calculate the relationship between the current texture and each preparatory texture set t. j The average Hamming distance r of the module reference tuples j r E =min{r0, ...,r c}, find the preliminary map set with the minimum distance as the preliminary map set for matching, if r E ≤X i Calculate the resolution (width, height) of the matching pre-set map after adding the current texture. Let w = max(width, height). If w ≤ W0, jump to step 5; otherwise, jump to step 3.
[0127] Step 5: Add the current texture to the matching pre-set texture and calculate the effective fill rate U of the texture set. i If U i >U0, and w≥W s The prepared texture set is identified as the official texture set and removed from the prepared texture set list. The next texture is then processed, and the process jumps to step 2.
[0128] Step 6, iteration number i = i + 1, partition threshold X i =X0+x t If i ≤ I, then jump to step 1; otherwise, the current partitioning process ends.
[0129] The embodiments provided in this application determine the similarity between a texture and an image set based on the similarity between the texture and each texture in the image set, which can improve the convenience of similarity determination.
[0130] As an optional approach, after sequentially using each of the first textures in a set of first textures as the current texture and performing the following processing steps, the above method further includes:
[0131] S61, when there are multiple first temporary map sets in the first temporary map set list, the first temporary map set whose map set resolution size is less than or equal to the third resolution size threshold is determined as the first candidate map set.
[0132] The automatically generated temporary atlas list may contain many small atlases or large atlases with low effective fill rate (i.e., low utilization). Two atlases can be merged by calculating the similarity of the atlases: atlases with low effective fill rate are merged with small atlases, or small atlases with small average Hamming distance are merged with each other, thereby improving the effective fill rate of the atlases.
[0133] In this embodiment, after each iteration, the number of first temporary atlases in the first temporary atlas list at the end of the iteration can be determined. If multiple first temporary atlases exist in the first temporary atlas list, at least a portion of the first temporary atlases can be merged based on the similarity between the atlases. Optionally, a threshold for the resolution size at which the atlases are merged can be set, i.e., a third resolution size threshold, which can be the maximum resolution size at which the atlases are merged (e.g., the maximum resolution size W). g =512), a first temporary map set whose map set resolution size is less than or equal to the third resolution size threshold can be selected from multiple first temporary map sets as a temporary map set to be merged, thereby obtaining one or more first candidate map sets.
[0134] Furthermore, based on the set merging indication information of each of the multiple first temporary sets, the first temporary sets allowed to be merged can be determined, resulting in one or more first candidate sets. Alternatively, the first temporary sets allowed to be merged and whose set resolution size is less than or equal to a third resolution size threshold can be identified as temporary sets to be merged, thus obtaining one or more first candidate sets. For example, the set parameters of the temporary sets can be set to allow the set to change its size A0 (A0=0 indicates not allowed, A0=1 indicates allowed).
[0135] S62, when there are multiple first candidate map sets, the following steps are performed iteratively until the second iteration termination condition is met, wherein the second iteration termination condition includes at least one of the following: the number of iterations reaches the second number, and the number of remaining first candidate map sets after the iteration is less than or equal to the first quantity threshold.
[0136] If there are multiple first candidate graph sets, multiple rounds of iterative calculations can be performed to merge the first candidate graph sets that meet the graph set merger conditions. Before performing the iterations, the following information can be set (information that has already been set can also be used directly):
[0137] The first resolution size range includes a first resolution size threshold and a second resolution size threshold;
[0138] The number of iterations is the number of the second iteration.
[0139] The fill rate threshold is the first fill rate threshold.
[0140] For example, we can set the number of iterations I (I > 0), the upper limit of the atlas resolution size W0 ≤ 2048, the effective fill rate threshold U0 of the atlas, and the lower limit of the resolution size W when the preliminary atlas meets the fill rate threshold to be converted into the formal atlas. s =1024, the maximum resolution size W of the merged atlas. g =512, the drawing set is allowed to change size A0 (A0=0 means not allowed, A0=1 means allowed).
[0141] When merging the pre-set maps in the pre-set map list, iterative initialization can be performed first. Set I i (0<i≤I) represents the current iteration, where i is the current iteration number. Initialize i=1, and set all the atlases (atlases in the preparatory atlas list) of the current business module to the preparatory atlases.
[0142] During an iteration, the first candidate graph sets that meet the graph set merger conditions can be merged by performing the following steps:
[0143] S621, sort the multiple first candidate map sets in descending order of map set resolution size to obtain a list of first candidate map sets.
[0144] For the current multiple first candidate map sets, they can be sorted in descending order of map set resolution size. If the map set resolution size is the same, the first candidate map sets with the same map set resolution size can be sorted in descending order of map set fill rate to obtain a list of first candidate map sets.
[0145] For example, at the start of a new iteration, it iterates through its own list of prepared atlases and selects those that meet the merging criteria (atlas resolution size w <= W). g The list of atlases to be merged is sorted according to their resolution size and effective fill rate. Atlases with larger resolution sizes and higher effective fill rates are placed at the top of the list and given priority to be converted into official atlases.
[0146] S622, iterate through the first candidate atlas in the first candidate atlas list, and perform the following atlas set union operation on the current atlas:
[0147] S6221, determine the first target map set in the first candidate map set list, wherein the first target map set is the map set with the largest map set resolution size after being merged with the current map set in the first candidate map set list other than the current map set, and the map set with the largest map set fill rate.
[0148] For the first candidate map set in the first candidate map set list, each first candidate map set in the first candidate map set list can be traversed sequentially. For the current map set that is traversed, it can be determined whether the current map set and other map sets in the first candidate map set list other than the current map set meet the resolution size condition for map set merging. That is, the resolution size of the map set after merging with the current map set is less than or equal to the second resolution size threshold. If there are multiple map sets that meet the resolution size condition, the map set fill rate after merging the current map set with each map set that meets the resolution size condition can be further determined, and the map set with the largest map set fill rate is determined as the first target map set to be merged with the current map set.
[0149] For example, iterate through the list of preparatory atlases to be merged, and merge the current atlas with other atlases one by one to obtain the resolution size w and effective fill rate U of the new atlas. If w ≤ W0, add it to the target merging list of the current atlas. After the traversal is completed, find the atlas with the largest effective fill rate U in the target merging list and merge it with the current atlas.
[0150] S6222, merge the current map set with the first target map set to obtain the first merged map set, and remove the current map set and the first target map set from the first candidate map set list.
[0151] After obtaining the first target map set, the current map set and the first target map set can be merged to obtain the first merged map set. Since the current map set and the first target map set have been merged into the first merged map set, the current map set and the first target map set can be removed from the first candidate map set list.
[0152] S6223, if the map set resolution size of the first merged map set is greater than or equal to the first resolution size threshold and the map set fill rate is greater than or equal to the first fill rate threshold, the first merged map set is determined as a first map set.
[0153] For the first merged atlas obtained, it can be further determined whether it meets the conditions for conversion into a formal atlas, that is, the atlas resolution size is greater than or equal to the first resolution size threshold and the atlas fill rate is greater than or equal to the first fill rate threshold. If these conditions are met, the first merged atlas is determined as a first atlas.
[0154] S6224, if the atlas resolution size of the first merged atlas is less than the first resolution size threshold, the first merged atlas is added as a first candidate atlas to the first candidate atlas list.
[0155] If the resolution size of the first merged atlas is smaller than the first resolution size threshold, then the first merged atlas can be added as a first candidate atlas to the first candidate atlas list. After performing the atlas merge operation on the current atlas, if there is another atlas in the first candidate atlas list, then the next atlas can be used as the current atlas, and the atlas merge operation can continue until all atlases in the first candidate atlas list have been traversed. If there are still atlases in the first candidate atlas list, the atlases in the first candidate atlas list can be traversed again until, after one round of traversal, the atlases in the first candidate atlas list are empty or have not undergone any transformation.
[0156] For example, if the merged current atlas has U > U0 and w ≥ W s The preparatory map set is determined to be an official map set and removed from the preparatory map set list. The next map set is then processed. When all map sets have been traversed, and the number of preparatory map sets to be merged is not empty, the process jumps to traversing the preparatory map set list to be merged again.
[0157] The embodiments provided in this application demonstrate that by merging small-sized atlases, the effective fill rate of the atlas can be improved, and the quality of atlas partitioning can be enhanced.
[0158] As an optional approach, each group of second textures is divided into multiple second texture sets based on the similarity between the prefab reference information of each second texture in each set, including:
[0159] S71, based on the similarity between the prefab reference tuples of each second texture, divide each group of second textures into multiple second texture sets, wherein each element in the prefab reference tuple of each second texture corresponds to a prefab of the business module corresponding to each group of second textures, and each element in the prefab reference tuple of each second texture is used to indicate whether the corresponding prefab references each second texture.
[0160] In this embodiment, to improve the convenience of similarity calculation, the prefab reference tuple of the second texture can be represented by the prefab reference tuple of the second texture (i.e., the Prefab reference tuple). Here, the Prefab reference tuple refers to a reference tuple based on the number of reference Prefabs of the UI texture. Each element in the Prefab reference tuple corresponds to a prefab of the business module to which the current texture belongs, and each element (or the element value of each element) is used to indicate whether the corresponding prefab references the current texture.
[0161] For example, a tuple of prefab references for a UI texture can be calculated. Based on the number m prefabs in the current module, an array of m bits is allocated to each UI texture, where each bit represents a prefab, such as... Figure 10 As shown, the corresponding bit is set to 1 when the texture references the Prefab, otherwise it is set to 0.
[0162] Based on the prefab reference tuples of each second texture, the similarity between any two prefab reference tuples of the current group of second textures can be calculated, and the calculated similarity can be used as the similarity between the second textures. Furthermore, based on the similarity between the prefab reference tuples of each second texture, the current group of second textures can be divided into multiple second texture sets in a similar manner as described above, which has already been explained and will not be repeated here.
[0163] The embodiments provided in this application represent referenced prefab information in the form of prefab reference tuples, which facilitates the calculation of similarity between referenced prefab information of different textures and improves the convenience of similarity calculation.
[0164] As an alternative approach, each group of second textures is divided into multiple second texture sets based on the similarity between the prefab reference tuples of each second texture, including:
[0165] S81, based on the Hamming distance between the prefab reference tuples of each second texture, divide each group of second textures into multiple second texture sets.
[0166] To improve the convenience of similarity calculation, the similarity between different prefab reference tuples can be calculated based on the Hamming distance between them. That is, the similarity between different prefab reference tuples can be represented by the Hamming distance between them. Based on the Hamming distance between the prefab reference tuples of each second texture, each group of second textures can be divided into multiple second texture sets. The method for calculating the Hamming distance between the prefab reference tuples of each second texture can be referred to the aforementioned embodiments, and will not be repeated here.
[0167] For example, such as Figure 11 As shown, for exclusive posts Figure 1 Prefab reference tuples and exclusive posts Figure 2 The Hamming distance between Prefab reference tuples is obtained by performing an XOR operation on the elements at corresponding positions in the Prefab reference tuples and counting the number of 1s.
[0168] The embodiments provided in this application demonstrate that the atlas of exclusive textures can be divided based on the Hamming distance between the reference tuples of prefabs of different exclusive textures, thereby improving the convenience of atlas division.
[0169] As an optional approach, each group of second textures is divided into multiple second texture sets based on the similarity between the prefab reference information of each second texture in each set, including:
[0170] S91, based on the similarity between the prefab reference information of each second texture, divide each group of second textures into multiple second texture sets according to the second resolution size range, wherein the texture set resolution size of each second texture set in the multiple second texture sets is within the second resolution size range.
[0171] To avoid excessive memory consumption during atlas rendering and to ensure a high atlas fill rate, the size of each atlas can be limited. For example, the maximum atlas resolution size and the minimum atlas resolution size, or one of the two, can be limited to restrict the atlas resolution size of each of the divided second atlases to the range of the second resolution size, such as [1024, 2048].
[0172] For the current group of second textures, the current group of second textures can be divided into multiple second texture sets according to the second resolution size range based on the similarity between the referenced prefab information of each second texture. The method of calculating the similarity between the referenced prefab information of each second texture can be the same as or similar to that in the previous embodiment, and will not be described in detail in this embodiment.
[0173] For example, for textures within the same module, we can calculate the prefab reference tuples of the textures, then calculate the Hamming distance between the prefab reference tuples of the UI textures, and set an appropriate distance threshold for iterative calculation to obtain the atlas partitioning result of the module. The obtained atlas partitioning result can be a preliminary atlas partitioning result, and subsequent atlas partitioning can be merged or otherwise processed.
[0174] By limiting the resolution size range of each atlas obtained after division through the embodiments provided in this application, atlases with excessively small or large resolution sizes can be identified, thereby improving the rationality of atlas division.
[0175] As an optional approach, the second resolution size range is the size range from the fourth resolution size threshold to the fifth resolution size threshold. It may include at least one of the fourth resolution size threshold and the fifth resolution size threshold, or it may not include either of them. Here, the fourth resolution size threshold is less than the fifth resolution size threshold. For example, the fourth resolution size threshold may be 1024, while the fifth resolution size threshold may be 2048. Alternatively, the first resolution size threshold and the second resolution size threshold may also be other values. In this embodiment, the first resolution size threshold and the second resolution size threshold are not limited.
[0176] In this embodiment, multiple rounds of iterative calculations can be performed to divide each group of second textures into multiple second atlases. Correspondingly, based on the similarity between the prefab reference information of each second texture, and according to the second resolution size range, each group of second textures is divided into multiple second atlases, including:
[0177] S101, iteratively execute the following partitioning steps until the third iteration termination condition is met, wherein the third iteration termination condition includes at least one of the following: the number of iterations reaches the third number, and the number of remaining second textures in each group of second textures is zero; after completing one iteration, the second similarity threshold is increased by a second step size:
[0178] For each group of second textures, use each second texture as the current texture and perform the following processing steps:
[0179] When there is an existing second temporary map set in the list of second temporary map sets, the similarity between the current map set and each second temporary map set is determined based on the similarity between the current map set and the second map set in each second temporary map set, and the second matching map set is obtained. The second matching map set is the second temporary map set with the highest similarity to the current map set.
[0180] If the similarity between the current texture and the second matching texture set is greater than or equal to the second similarity threshold, and the resolution size of the second matching texture set after adding the current texture is less than or equal to the fifth resolution size threshold, then the current texture is added to the second matching texture set to obtain an updated second matching texture set.
[0181] If the resolution size of the updated second matching atlas is greater than or equal to the fourth resolution size threshold and the atlas fill rate of the updated second matching atlas is greater than or equal to the second fill rate threshold, the updated second matching atlas is determined as a second atlas, the second texture in the second matching atlas is removed from each group of second textures, and the second matching atlas is removed from the second temporary atlas list.
[0182] If there is no existing second temporary atlas in the second temporary atlas list, or if the current texture has not been added to any second temporary atlas, create a new temporary atlas, obtain the new second atlas, add the current texture to the new second atlas, and add the new second atlas to the second temporary atlas list.
[0183] In this embodiment, a similar method can be used to divide a group of first textures into multiple first atlases according to a first resolution size range based on the similarity between the module reference information of each first texture in the previous embodiment. Based on the similarity between the prefab reference information of each second texture, each group of second textures can be divided into multiple second atlases according to a second resolution size range. The third iteration number can be the same as or different from the first iteration number. The second similarity threshold can be the same as or different from the first similarity threshold. The second fill rate threshold can be the same as or different from the first fill rate threshold. These have been described before and will not be repeated here.
[0184] The atlas partitioning results obtained by iterative calculation using the embodiments provided in this application, through setting an appropriate distance threshold, can improve the convenience and rationality of atlas partitioning.
[0185] As an optional approach, the similarity between the current texture and each second temporary texture set is determined based on the similarity between the current texture and the second texture in each second temporary texture set, including:
[0186] S111, the average similarity between the current texture and each of the second textures in each second temporary texture set is determined as the similarity between the current texture and each second temporary texture set.
[0187] In this embodiment, the similarity between the current texture and the temporary atlas can be determined based on the average similarity between the current texture and each texture in the temporary atlas. The method for calculating the similarity between two textures can be similar to that in the previous embodiments, and will not be repeated here. For each second temporary atlas, the average similarity between the current texture and each second texture in each second temporary atlas can be determined as the similarity between the current texture and each second temporary atlas.
[0188] For example, for the automatic partitioning of the atlas of exclusive textures for each business module's exclusive modules, an initial partitioning threshold X0 can be set, and the iteration step size x can be set. t The iteration number I (I > 0), the upper limit of the atlas resolution size W0 = 2048, the effective fill rate threshold U0 of the atlas (U0 ≥ 85%), and the lower limit of the resolution size W when the preliminary atlas meets the fill rate threshold to be converted into the formal atlas. s =1024.
[0189] When performing the iterative partitioning process, I can be set. i (0 < i ≤ I) represents the current iteration, X i Define the threshold for the current iteration, where i is the current iteration number. Initialize i = 1, X i =X0. At the start of a single iteration, the following atlas partitioning steps can be performed:
[0190] Step 1: Start a single iteration and begin traversing all textures. If the traversal is not yet complete, jump to Step 2. If the current iteration has completed traversing all textures, jump to Step 6.
[0191] Step 2: When traversing to the current texture, if the number of prepared textures in the prepared texture list is not 0, then jump to step 4; otherwise, execute step 3.
[0192] Step 3: Create a new pre-processed texture set to store the current texture, and continue processing the next texture. Skip to Step 2.
[0193] Step 4: Iterate through the list of preparatory texture sets T (0 < j < c, where c is the number of texture sets), and calculate the relationship between the current texture and each preparatory texture set t. j The average Hamming distance r of the module reference tuples j r E =min{r0, ...,r} c}, find the preliminary map set with the minimum distance as the preliminary map set for matching, if r E ≤X i Calculate the resolution (width, height) of the matching pre-set map after adding the current texture. Let w = max(width, height). If w ≤ W0, jump to step 5; otherwise, jump to step 3.
[0194] Step 5: Add the current texture to the matching pre-set texture and calculate the effective fill rate U of the texture set. i If U i >U0, and w≥W s The prepared texture set is identified as the official texture set and removed from the prepared texture set list. The next texture is then processed, and the process jumps to step 2.
[0195] Step 6, iteration number i = i + 1, partition threshold X i =X0+x t If i ≤ I, then jump to step 1; otherwise, the current partitioning process ends.
[0196] The embodiments provided in this application determine the similarity between a texture and an image set based on the similarity between the texture and each texture in the image set, which can improve the convenience of similarity determination.
[0197] As an optional approach, after sequentially using each second texture in each group as the current texture and performing the following processing steps, the above method further includes:
[0198] S121, when there are multiple second temporary map sets in the second temporary map set list, the second temporary map set whose map set resolution size is less than or equal to the sixth resolution size threshold is determined as the second candidate map set;
[0199] S122, when there are multiple second candidate map sets, iteratively execute the following steps until the fourth iteration termination condition is met, wherein the fourth iteration termination condition includes at least one of the following: the number of iterations reaches the fourth number, and the number of remaining second candidate map sets after the iteration is less than or equal to the second quantity threshold:
[0200] The multiple candidate map sets are sorted in descending order of map set resolution size to obtain a list of candidate map sets;
[0201] Iterate through the second candidate atlas list, performing the following atlas set union operation on each candidate atlas:
[0202] Determine the second target map set in the second candidate map set list. The second target map set is the map set with the largest map set resolution size after merging with the current map set from the other map sets in the second candidate map set list, which is less than or equal to the fifth resolution size threshold and has the largest map set fill rate.
[0203] Merge the current map set with the second target map set to obtain the second merged map set, and remove the current map set and the second target map set from the second candidate map set list;
[0204] If the atlas resolution size of the second merged atlas is greater than or equal to the fourth resolution size threshold and the atlas fill rate is greater than or equal to the second fill rate threshold, the second merged atlas is determined as a second atlas.
[0205] If the resolution size of the second merged atlas is less than the fourth resolution size threshold, the second merged atlas is added as a second candidate atlas to the list of second candidate atlases.
[0206] After each iteration, the number of second temporary graph sets contained in the second temporary graph set list at the end of the iteration can be determined. If there are multiple second temporary graph sets in the second temporary graph set list, a graph set merger operation can be performed on the multiple second temporary graph sets in a manner similar to that in the previous embodiment. The fourth iteration number can be the same as or different from the second iteration number, as has been explained before, and will not be repeated here.
[0207] The embodiments provided in this application demonstrate that by merging small-sized atlases, the effective fill rate of the atlas can be improved, and the quality of atlas partitioning can be enhanced.
[0208] As an alternative approach, a first set of textures and multiple sets of second textures are determined, including:
[0209] S131, determine a set of initial textures corresponding to each of the multiple business modules of the target application, wherein the set of initial textures corresponding to each business module includes textures referenced by each business module in multiple textures;
[0210] S132, extract the textures of multiple textures that exceed the preset number of business modules to obtain a first set of textures;
[0211] S133, remove the first image from the initial set of images corresponding to each business module to obtain multiple sets of second images.
[0212] A set of first textures and multiple sets of second textures can be obtained by developers manually dividing multiple textures. To improve the rationality of texture atlas division, developers or processing devices can first automatically divide the textures by directory to obtain a set of initial textures corresponding to each of the multiple business modules in the target application. The set of initial textures corresponding to each business module includes multiple textures referenced by this business module.
[0213] After obtaining a set of initial textures corresponding to each business module, textures referenced by more than a preset number of business modules (i.e., common textures) can be extracted from multiple textures based on the number of times each texture is referenced by a business module. The extracted textures are taken as a separate texture group, i.e., a set of first textures. The textures in the initial set of textures corresponding to each business module, excluding the first texture (common textures, which belong to the set of first textures), are taken as a texture group, i.e., a set of second textures, thus obtaining a set of second textures corresponding to each business module.
[0214] For example, combining the advantages of manual partitioning and automatic partitioning schemes based on minimizing Prefab memory, since the game's UI and Prefab resources are a known finite set of data, and the division of the game's business modules is also known, UI textures and Prefabs can be manually or automatically pre-partitioned based on business modules in the form of directories, and the partitioning results can be saved in the form of configuration files for reuse in subsequent automated processes.
[0215] When manually pre-dividing modules and archiving the results, a module set M = {m_0, m_1, ..., m_(n-1)} can be obtained based on the current game's functional system, where n is the number of modules. The Prefab set P_i and UI texture set S_i to which m_i (0≤i<n) belong can be specified. The partitioning results can be archived and edited using tools.
[0216] In addition, UI textures can be further divided based on module references. That is, UI textures referenced by business modules exceeding a set threshold are assigned to a common module, resulting in a set of common textures in the common module. The remaining UI textures in the UI texture set of each business module are used as exclusive textures for that business module.
[0217] The embodiments provided in this application improve the rationality and convenience of texture division by pre-dividing multiple textures and then performing secondary division based on module references according to the pre-division results.
[0218] As an optional approach, after determining an initial set of textures corresponding to each of the multiple business modules of the target application, the above method further includes:
[0219] S141, if it is determined from the texture reference records of multiple textures that there are textures in a set of initial textures corresponding to the first business module that have not been referenced by the first business module, the unreferenced textures are removed from the set of initial textures corresponding to the first business module to obtain an updated set of initial textures corresponding to the first business module.
[0220] S142, if it is determined from the texture reference records of multiple textures that there are textures referenced by the second business module that are not included in the set of initial textures corresponding to the second business module, the referenced textures are added to the set of initial textures corresponding to the second business module to obtain an updated set of initial textures corresponding to the second business module.
[0221] In this embodiment, the actual referenced business module and the manually divided business module can be compared. If they are inconsistent, the business module to which the texture belongs can be adjusted. Otherwise, it can remain in the manually divided business module. That is, if a UI texture should belong to one business module according to the actual referenced record, but it was manually divided into the texture set of another business module, then the business module to which the UI texture belongs can be adjusted.
[0222] For each set of initial textures corresponding to a business module, the presence of textures not referenced by each business module in the initial set of textures can be determined based on the texture reference records of multiple textures. If there are textures not referenced by the first business module in the initial set of textures corresponding to the first business module, then the unreferenced textures are removed from the initial set of textures corresponding to the first business module, resulting in an updated initial set of textures corresponding to the first business module. Here, considering that the texture reference record only records texture references that have occurred, there may be cases where a business module needs to reference a texture but has not referenced it before. Therefore, unreferenced textures may not need to be processed.
[0223] For each set of initial textures corresponding to a business module, the texture reference records of multiple textures can be used to determine if there are cases where a business module references a particular texture but the texture is not included in the initial texture set corresponding to that business module. If there are textures referenced by a second business module that are not included in the initial texture set corresponding to that second business module, the referenced texture can be added to the initial texture set corresponding to the second business module, resulting in an updated initial texture set corresponding to the second business module.
[0224] The embodiments provided in this application allow for the adjustment of a set of textures corresponding to each pre-divided business module based on the application records of textures, thereby improving the rationality of texture division.
[0225] The image processing method in this application embodiment is explained below with reference to optional examples. In this optional example, the target application is a target game application, the business module is a game business module, the first resolution size range and the second resolution size range are the same, both [1024, 2048], the third resolution size threshold is 512, the first fill rate threshold and the second fill rate threshold are the same, both greater than or equal to 85%, the atlas fill rate is the effective fill rate of the atlas, the first texture is a common texture, the second texture is an exclusive texture of a certain business module, the similarity between common textures is represented by the Hamming distance between the module reference tuples of the common texture, the similarity between exclusive textures of the same business module is represented by the Hamming distance between the Prefab reference tuples of the exclusive texture, and each similarity threshold can be a distance threshold, that is, a limit value of Hamming distance. If the Hamming distance between two textures is lower than the distance threshold, it can be determined that the two textures are atlas similar. Here, atlas similarity refers to the probability that two UI textures are classified into the same atlas.
[0226] This optional example provides a game UI atlas partitioning scheme based on Hamming distance. First, it calculates the module reference tuple and prefab reference tuple of the UI textures. Then, it iteratively calculates the Hamming distance between these tuples and sets an appropriate distance threshold to obtain a preliminary atlas partitioning result. Finally, it merges the smaller atlases according to certain atlas merging rules. The UI atlas partitioned using this method outperforms manual organization and simple automatic partitioning schemes in terms of effective atlas fill rate, memory distribution range of single prefab reference atlases, and number of single prefab reference atlases. As shown in Table 1, the total number of atlases is close to that of manual partitioning. While optimizing the partitioning results, it reduces manual intervention and resource redundancy.
[0227] Table 1
[0228]
[0229] Among them, Scheme 1 is manual partitioning, Scheme 2 is a simple automatic partitioning strategy, and Scheme 3 is an automatic partitioning strategy based on Hamming distance. As shown in Table 1, the automatic partitioning strategy based on Hamming distance can achieve better partitioning results and effectively improve the game's performance on terminal devices.
[0230] Combination such as Figure 12 The image processing method in this optional example may include the following steps:
[0231] Step S1202: Manually pre-divide the modules and archive the results.
[0232] The prefabs and UI textures for each business module can be roughly specified manually; that is, the prefabs and UI textures for each game business module can be roughly configured and allocated. Here, the game business modules can be counted and each module can be assigned a fixed bit.
[0233] Step S1204: Based on the secondary division of module references, UI textures are divided into public modules and exclusive modules. Here, the dependency information of all resources can be calculated to obtain the referenced module information and referenced Prefab information of each UI texture. If the number of referenced modules of a UI texture is greater than the set threshold, the UI texture is adjusted to the public module; otherwise, it remains in the current module.
[0234] Step S1206: Automatic partitioning of common module textures. The module reference information and prefab reference information of each UI texture are converted into different reference tuples, and an appropriate distance threshold is set for iterative calculation to obtain the preliminary atlas partitioning result. The atlas partitioning of common modules is performed based on the Hamming distance between module reference tuples.
[0235] Step S1208: The exclusive module texture is automatically divided. The atlas division of a single business module is performed based on the Hamming distance between Prefab reference tuples.
[0236] Step S1210, graph set merging: Here, the graph set groups of each game business module can be merged according to specific rules to improve the effective fill rate of the graph set.
[0237] In addition, after dividing the image sets, you can move the textures to the corresponding image set directory, and the process ends.
[0238] This optional example uses module reference information and prefab information to represent them mathematically using module reference tuples and prefab reference tuples; iterative calculations are performed using the Hamming distance between tuples to obtain preliminary atlas partitioning results; and small atlases are merged using certain atlas merging rules, which optimizes atlas performance while reducing manual intervention.
[0239] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0240] According to another aspect of the embodiments of this application, an image processing apparatus for implementing the above-described image processing method is also provided. Figure 13 This is a schematic diagram of the structure of an optional image processing apparatus according to an embodiment of this application, such as... Figure 13 As shown, the device may include:
[0241] The first determining unit 1302 is used to determine a set of first textures and multiple sets of second textures, wherein each first texture in the set of first textures is a texture referenced by more than a preset number of business modules of the target application in multiple textures, and each set of second textures in multiple sets of second textures includes other textures in multiple textures other than the set of first textures corresponding to a business module.
[0242] The first partitioning unit 1304 is used to partition a set of first images into multiple first image sets based on the similarity between the reference module information of each first image, wherein the reference module information of each first image is used to represent the business module that references each first image;
[0243] The second division unit 1306 is used to divide each group of second textures into multiple second texture sets based on the similarity between the prefab reference information of each second texture in each group of second textures. The prefab reference information of each second texture is used to indicate that the prefab reference of each second texture is used in the multiple prefabs of the business module corresponding to each group of second textures.
[0244] It should be noted that the first determining unit 1302 in this embodiment can be used to execute the above step S202, the first dividing unit 1304 in this embodiment can be used to execute the above step S204, and the second dividing unit 1306 in this embodiment can be used to execute the above step S206.
[0245] The embodiments provided in this application determine a set of first textures and multiple sets of second textures. Each first texture in the set of first textures is a texture referenced by more than a preset number of business modules of the target application among multiple textures. Each set of second textures includes other textures besides the set of first textures that correspond to a business module. Based on the similarity between the referenced module information of each first texture, the set of first textures is divided into multiple first texture sets, where the referenced module information of each first texture represents the business module referencing each first texture. Based on the similarity between the prefab reference information of each second texture in each set of second textures, each set of second textures is divided into multiple second texture sets, where the prefab reference information of each second texture represents the prefab referenced by each second texture among multiple prefabs of the business module corresponding to each set of second textures. This solves the problem of high human resource consumption caused by the need for multiple manual texture set divisions in related technologies, reducing human resource consumption and improving the efficiency of texture set division.
[0246] As an optional scheme, the first partitioning unit 1304 includes:
[0247] The first partitioning module is used to partition a set of first images into multiple first image sets based on the similarity between the module reference tuples of each first image. Each element in the module reference tuple of each first image corresponds to a business module of the target application, and each element in the module reference tuple of each first image is used to indicate whether the corresponding business module references each first image.
[0248] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0249] As an optional approach, the first partitioning module includes:
[0250] The first partitioning submodule is used to divide a set of first textures into multiple first texture sets based on the Hamming distance between the module reference tuples of each first texture.
[0251] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0252] As an optional scheme, the first partitioning unit includes:
[0253] The second partitioning module is used to partition a group of first images into multiple first image sets according to the similarity between the reference module information of each first image and the first resolution size range, wherein the image set resolution size of each first image set in the multiple first image sets is within the first resolution size range.
[0254] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0255] As an optional approach, the first resolution size range is the size range from a first resolution size threshold to a second resolution size threshold; the second partitioning module includes:
[0256] The first iteration submodule is used to iteratively execute the following partitioning steps until the first iteration termination condition is met, wherein the first iteration termination condition includes at least one of the following: the number of iterations reaches the first iteration number, the number of remaining first textures in a group of first textures is zero; after executing one iteration, the first similarity threshold is increased by the first step length:
[0257] Each of the first textures in a set is used as the current texture, and the following processing steps are performed:
[0258] When there is an existing first temporary atlas in the first temporary atlas list, the similarity between the current texture and each first temporary atlas is determined based on the similarity between the current texture and the first texture in each first temporary atlas, and the first matching atlas is obtained. The first matching atlas is the first temporary atlas with the highest similarity to the current texture.
[0259] If the similarity between the current texture and the first matching image set is greater than or equal to the first similarity threshold, and the resolution size of the first matching image set after adding the current texture is less than or equal to the second resolution size threshold, the current texture is added to the first matching image set to obtain the updated first matching image set.
[0260] If the atlas resolution size of the updated first matching atlas is greater than or equal to the first resolution size threshold, and the atlas fill rate of the updated first matching atlas is greater than or equal to the first fill rate threshold, the updated first matching atlas is determined as a first atlas, the first texture in the updated first matching atlas is removed from a group of first textures, and the first matching atlas is removed from the first temporary atlas list;
[0261] If there is no existing first temporary atlas in the first temporary atlas list, or if the current texture has not been added to any first temporary atlas, a new temporary atlas is created, resulting in the first newly created atlas. The current texture is then added to the first newly created atlas, and the first newly created atlas is added to the first temporary atlas list.
[0262] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0263] As an optional approach, the iterative submodule includes:
[0264] The first determining subunit is used to determine the average similarity between the current texture and each first texture in each first temporary texture set as the similarity between the current texture and each first temporary texture set.
[0265] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0266] As an optional solution, the above-mentioned device further includes:
[0267] The second determining unit is used to determine the first temporary image set with a resolution size less than or equal to a third resolution size threshold as the first candidate image set when there are multiple first temporary image sets in the first temporary image set list after performing the following processing steps by taking each of the first images in a set as the current image set in turn.
[0268] The first iteration unit is configured to iteratively execute the following steps when there are multiple first candidate map sets, until a second iteration termination condition is met, wherein the second iteration termination condition includes at least one of the following: the number of iterations reaches the second number, and the number of remaining first candidate map sets after the iteration is less than or equal to a first quantity threshold:
[0269] The multiple first candidate map sets are sorted in descending order of map set resolution size to obtain a list of first candidate map sets;
[0270] Iterate through the first candidate atlas in the first candidate atlas list, and perform the following atlas set union operation on the current atlas:
[0271] Determine the first target map set in the first candidate map set list, wherein the first target map set is the map set with the largest map set resolution size after being merged with the current map set from the other map sets in the first candidate map set list, and whose map set resolution size is less than or equal to the second resolution size threshold and whose map set fill rate is the largest;
[0272] Merge the current map set with the first target map set to obtain the first merged map set, and remove the current map set and the first target map set from the first candidate map set list;
[0273] If the map set resolution size of the first merged map set is greater than or equal to the first resolution size threshold and the map set fill rate is greater than or equal to the first fill rate threshold, the first merged map set is determined as a first map set;
[0274] If the resolution size of the first merged map set is less than the first resolution size threshold, the first merged map set is added as a first candidate map set to the first candidate map set list.
[0275] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0276] As an optional solution, the second partitioning unit 1306 includes:
[0277] The third partitioning module is used to partition each group of second textures into multiple second texture sets based on the similarity between the prefab reference tuples of each second texture. Each element in the prefab reference tuple of each second texture corresponds to a prefab of the business module corresponding to each group of second textures. Each element in the prefab reference tuple of each second texture is used to indicate whether the corresponding prefab references each second texture.
[0278] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0279] As an optional solution, the third partitioning module includes:
[0280] The second partitioning submodule is used to divide each group of second textures into multiple second atlases based on the Hamming distance between the prefab reference tuples of each second texture.
[0281] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0282] As an optional approach, the second partitioning unit includes:
[0283] The fourth partitioning module is used to divide each group of second textures into multiple second texture sets according to the similarity between the prefab reference information of each second texture and the second resolution size range, wherein the texture set resolution size of each second texture set in the multiple second texture sets is within the second resolution size range.
[0284] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0285] As an optional approach, the second resolution size range is the size range from the fourth resolution size threshold to the fifth resolution size threshold; the fourth partitioning module includes:
[0286] The second iteration submodule is used to iteratively execute the following partitioning steps until the third iteration termination condition is met, wherein the third iteration termination condition includes at least one of the following: the number of iterations reaches the third number, and the number of remaining second textures in each group of second textures is zero; after executing one iteration, the second similarity threshold is increased by a second step size:
[0287] For each group of second textures, use each second texture as the current texture and perform the following processing steps:
[0288] When there is an existing second temporary map set in the list of second temporary map sets, the similarity between the current map set and each second temporary map set is determined based on the similarity between the current map set and the second map set in each second temporary map set, and the second matching map set is obtained. The second matching map set is the second temporary map set with the highest similarity to the current map set.
[0289] If the similarity between the current texture and the second matching texture set is greater than or equal to the second similarity threshold, and the resolution size of the second matching texture set after adding the current texture is less than or equal to the fifth resolution size threshold, then the current texture is added to the second matching texture set to obtain an updated second matching texture set.
[0290] If the resolution size of the updated second matching atlas is greater than or equal to the fourth resolution size threshold and the atlas fill rate of the updated second matching atlas is greater than or equal to the second fill rate threshold, the updated second matching atlas is determined as a second atlas, the second texture in the second matching atlas is removed from each group of second textures, and the second matching atlas is removed from the second temporary atlas list.
[0291] If there is no existing second temporary atlas in the second temporary atlas list, or if the current texture has not been added to any second temporary atlas, create a new temporary atlas, obtain the new second atlas, add the current texture to the new second atlas, and add the new second atlas to the second temporary atlas list.
[0292] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0293] As an optional approach, the second iteration submodule includes:
[0294] The second determining subunit is used to determine the average similarity between the current texture and each of the second textures in each second temporary texture set as the similarity between the current texture and each second temporary texture set.
[0295] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0296] As an optional solution, the above-mentioned device further includes:
[0297] The third determining unit is used to determine the second candidate map set as the second temporary map set when there are multiple second temporary map sets in the second temporary map set list after performing the following processing steps by taking each second map set in each group of second maps as the current map set in turn.
[0298] The second iteration unit is used to iteratively execute the following steps when there are multiple second candidate map sets, until the fourth iteration termination condition is met, wherein the fourth iteration termination condition includes at least one of the following: the number of iterations reaches the fourth number, and the number of remaining second candidate map sets after the iteration is less than or equal to the second quantity threshold:
[0299] The multiple candidate map sets are sorted in descending order of map set resolution size to obtain a list of candidate map sets;
[0300] Iterate through the second candidate atlas list, performing the following atlas set union operation on each candidate atlas:
[0301] Determine the second target map set in the second candidate map set list. The second target map set is the map set with the largest map set resolution size after merging with the current map set from the other map sets in the second candidate map set list, which is less than or equal to the fifth resolution size threshold and has the largest map set fill rate.
[0302] Merge the current map set with the second target map set to obtain the second merged map set, and remove the current map set and the second target map set from the second candidate map set list;
[0303] If the atlas resolution size of the second merged atlas is greater than or equal to the fourth resolution size threshold and the atlas fill rate is greater than or equal to the second fill rate threshold, the second merged atlas is determined as a second atlas.
[0304] If the resolution size of the second merged atlas is less than the fourth resolution size threshold, the second merged atlas is added as a second candidate atlas to the list of second candidate atlases.
[0305] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0306] As an optional approach, the first determining unit includes:
[0307] The first determining module is used to determine a set of initial textures corresponding to each of the multiple business modules of the target application, wherein the set of initial textures corresponding to each business module includes textures referenced by each business module in multiple textures.
[0308] The extraction module is used to extract the textures of multiple textures that exceed a preset number of business modules, and obtain a first set of textures.
[0309] The removal module is used to remove the first image from a set of initial images corresponding to each business module, resulting in multiple sets of second images.
[0310] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0311] As an optional solution, the above-mentioned device further includes:
[0312] The removal unit is used to remove unreferenced textures from the set of initial textures corresponding to the first business module after determining a set of initial textures corresponding to each of the multiple business modules of the target application, and if it is determined from the texture reference records of the multiple textures that there are textures that the first business module has not referenced in the set of initial textures corresponding to the first business module, thereby obtaining an updated set of initial textures corresponding to the first business module.
[0313] The addition unit is used to add the referenced texture to the set of initial textures corresponding to the second business module when it is determined from the texture reference records of multiple textures that there are textures referenced by the second business module but not included in the set of initial textures corresponding to the second business module, so as to obtain an updated set of initial textures corresponding to the second business module.
[0314] Optional examples of this implementation scheme can be found in the examples shown in the processing method of the above images, which will not be repeated here.
[0315] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described image processing method is also provided. This electronic device may be... Figure 1 The terminal device or server shown. This embodiment uses this electronic device as an example for illustration. Figure 14 As shown, the electronic device includes a memory 1402 and a processor 1404. The memory 1402 stores a computer program, and the processor 1404 is configured to execute the steps of any of the above method embodiments via the computer program.
[0316] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0317] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0318] S1, determine a set of first textures and multiple sets of second textures, wherein each first texture in the set of first textures is a texture referenced by more than a preset number of business modules of the target application in multiple textures, and each set of second textures in multiple textures contains other textures in multiple textures other than the set of first textures corresponding to a business module.
[0319] S2, based on the similarity between the referenced module information of each first image, a group of first images is divided into multiple first image sets, wherein the referenced module information of each first image is used to represent the business module that references each first image;
[0320] S3, based on the similarity between the prefab reference information of each second texture in each group of second textures, divide each group of second textures into multiple second texture sets, wherein the prefab reference information of each second texture is used to represent the reference of the prefab of each second texture in the multiple prefabs of the business module corresponding to each group of second textures.
[0321] Alternatively, as those skilled in the art will understand, Figure 14 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, and other terminal devices such as MIDs and PADs. Figure 14 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 14 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 14 The different configurations shown.
[0322] The memory 1402 can be used to store software programs and modules, such as the program instructions / modules corresponding to the image processing method and apparatus in this embodiment. The processor 1404 executes various functional applications and data processing by running the software programs and modules stored in the memory 1402, thereby implementing the aforementioned image processing method. The memory 1402 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1402 may further include memory remotely located relative to the processor 1404, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 1402 may be used, but is not limited to, for serializing files and compiling files, etc. As an example, such as... Figure 14 As shown, the memory 1402 may include, but is not limited to, the first determining unit 1302, the first dividing unit 1304, and the second dividing unit 1306 in the image processing device. Furthermore, it may include, but is not limited to, other module units in the image processing device, which will not be elaborated upon in this example.
[0323] Optionally, the transmission device 1406 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1406 includes a Network Interface Controller (NIC), which can be connected to other network devices and routers via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 1406 is a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0324] In addition, the aforementioned electronic device also includes: a display 1408 for displaying the texture to be divided, the divided atlas, or a user interface using the atlas; and a connection bus 1410 for connecting the various module components in the aforementioned electronic device.
[0325] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer (P2P) network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this peer-to-peer network.
[0326] According to one aspect of this application, a computer program product is provided, comprising a computer program / instructions containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 1509, and / or installed from removable medium 1511. When the computer program is executed by central processing unit 1501, it performs various functions provided in the embodiments of this application. The above embodiment numbers are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0327] Figure 15 A schematic block diagram of a computer system architecture for implementing embodiments of the present application is shown. Figure 15 As shown, the computer system 1500 includes a central processing unit (CPU) 1501, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1502 or programs loaded from storage section 1508 into random access memory (RAM). The RAM 1503 also stores various programs and data required for system operation. The CPU 1501, ROM 1502, and RAM 1503 are interconnected via a bus 1504. An input / output interface 1505 (I / O interface) is also connected to the bus 1504.
[0328] The following components are connected to the input / output interface 1505: an input section 1506 including a keyboard, mouse, etc.; an output section 1507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a local area network card, modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to the input / output interface 1505 as needed. A removable medium 1511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1510 as needed so that computer programs read from it can be installed into the storage section 1508 as needed.
[0329] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1509, and / or installed from removable medium 1511. When the computer program is executed by central processing unit 1501, it performs various functions defined in the system of this application.
[0330] It should be noted that, Figure 15 The computer system 1500 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0331] According to one aspect of this application, a computer-readable storage medium is provided, from which a processor of a computer device reads computer instructions, and the processor executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the above embodiments.
[0332] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0333] S1, determine a set of first textures and multiple sets of second textures, wherein each first texture in the set of first textures is a texture referenced by more than a preset number of business modules of the target application in multiple textures, and each set of second textures in multiple textures contains other textures in multiple textures other than the set of first textures corresponding to a business module.
[0334] S2, based on the similarity between the referenced module information of each first image, a group of first images is divided into multiple first image sets, wherein the referenced module information of each first image is used to represent the business module that references each first image;
[0335] S3, based on the similarity between the prefab reference information of each second texture in each group of second textures, divide each group of second textures into multiple second texture sets, wherein the prefab reference information of each second texture is used to represent the reference of the prefab of each second texture in the multiple prefabs of the business module corresponding to each group of second textures.
[0336] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0337] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0338] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0339] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.
[0340] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0341] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or at least two units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0342] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for processing images, characterized in that, include: A set of first textures and multiple sets of second textures are determined, wherein each first texture in the set of first textures is a texture referenced by more than a preset number of business modules of the target application in multiple textures, and each set of second textures in the multiple sets of second textures contains other textures in the multiple textures besides the set of first textures that correspond to a business module. Based on the similarity between the reference module information of each first image, the group of first images is divided into multiple first image sets, wherein the reference module information of each first image is used to represent the business module that references each first image; Based on the similarity between the prefab reference information of each second texture in each group of second textures, each group of second textures is divided into multiple second texture sets, wherein the prefab reference information of each second texture is used to indicate that among the multiple prefabs of the business module corresponding to each group of second textures, the prefab reference of each second texture is used.
2. The method according to claim 1, characterized in that, The step of dividing the group of first images into multiple first image sets based on the similarity between the reference module information of each first image includes: Based on the similarity between the module reference tuples of each first image, the group of first images is divided into multiple first image sets, wherein each element in the module reference tuple of each first image corresponds to a business module of the target application, and each element in the module reference tuple of each first image is used to indicate whether the corresponding business module references each first image.
3. The method according to claim 2, characterized in that, The step of dividing a group of first images into multiple first image sets based on the similarity between the module reference tuples of each first image includes: The first set of textures is divided into multiple first atlases based on the Hamming distance between the module reference tuples of each first texture.
4. The method according to claim 1, characterized in that, The step of dividing the group of first images into multiple first image sets based on the similarity between the reference module information of each first image includes: Based on the similarity between the reference module information of each first texture, the group of first textures is divided into multiple first atlases according to the first resolution size range, wherein the atlas resolution size of each first atlas in the multiple first atlases is within the first resolution size range.
5. The method according to claim 4, characterized in that, The first resolution size range is a size range from a first resolution size threshold to a second resolution size threshold; the step of dividing the group of first textures into the plurality of first texture sets according to the first resolution size range based on the similarity between the reference module information of each first texture includes: The following partitioning steps are performed iteratively until a first iteration termination condition is met, wherein the first iteration termination condition includes at least one of the following: the number of iterations reaches the first iteration number, and the number of remaining first textures in the group of first textures is zero; after performing one iteration, the first similarity threshold is increased by the first iteration length: The following processing steps are performed on each of the first textures in the group as the current texture: When there is an existing first temporary image set in the first temporary image set list, the similarity between the current image and each first temporary image set is determined based on the similarity between the current image and the first image in each first temporary image set, and a first matching image set is obtained, wherein the first matching image set is the first temporary image set with the highest similarity to the current image; If the similarity between the current texture and the first matching image set is greater than or equal to the first similarity threshold, and the resolution size of the first matching image set after adding the current texture is less than or equal to the second resolution size threshold, the current texture is added to the first matching image set to obtain an updated first matching image set. If the updated first matching atlas has an atlas resolution size greater than or equal to the first resolution size threshold and the updated first matching atlas has an atlas fill rate greater than or equal to the first fill rate threshold, the updated first matching atlas is determined as a first atlas, the first texture in the updated first matching atlas is removed from the group of first textures, and the first matching atlas is removed from the first temporary atlas list. If there is no existing first temporary atlas in the first temporary atlas list, or if the current texture has not been added to any first temporary atlas, a new temporary atlas is created to obtain a new first atlas. The current texture is then added to the new first atlas, and the new first atlas is added to the first temporary atlas list.
6. The method according to claim 5, characterized in that, The step of determining the similarity between the current texture and each first temporary image set based on the similarity between the current texture and the first texture in each first temporary image set includes: The average similarity between the current texture and each of the first textures in each of the first temporary texture sets is determined as the similarity between the current texture and each of the first temporary texture sets.
7. The method according to claim 5, characterized in that, After performing the following processing steps by sequentially using each of the first textures in the group of first textures as the current texture, the method further includes: When there are multiple first temporary map sets in the first temporary map set list, the first temporary map set whose map set resolution size is less than or equal to the third resolution size threshold is determined as the first candidate map set. When there are multiple candidate map sets, the following steps are performed iteratively until a second iteration termination condition is met, wherein the second iteration termination condition includes at least one of the following: the number of iterations reaches a second number, and the number of remaining candidate map sets after the iteration is less than or equal to a first number threshold: The first candidate map sets are sorted in descending order of map set resolution size to obtain a list of first candidate map sets; Iterate through the first candidate graph set in the first candidate graph set list, and perform the following graph set union operation on the current graph set: Determine a first target map set in the first candidate map set list, wherein the first target map set is the map set with the largest map set resolution size after being merged with the current map set in the first candidate map set list other than the current map set, and whose map set fill rate is the largest. Merge the current atlas with the first target atlas to obtain a first merged atlas, and remove the current atlas and the first target atlas from the first candidate atlas list; If the map set resolution size of the first merged map set is greater than or equal to the first resolution size threshold and the map set fill rate is greater than or equal to the first fill rate threshold, the first merged map set is determined as a first map set; If the resolution size of the first merged map set is smaller than the first resolution size threshold, the first merged map set is added as a first candidate map set to the first candidate map set list.
8. The method according to claim 1, characterized in that, The step of dividing each group of second textures into multiple second texture sets based on the similarity between the prefab reference information of each second texture in each group includes: Based on the similarity between the prefab reference tuples of each second texture, each group of second textures is divided into multiple second texture sets, wherein each element in the prefab reference tuple of each second texture corresponds to a prefab of the business module corresponding to each group of second textures, and each element in the prefab reference tuple of each second texture is used to indicate whether the corresponding prefab references each second texture.
9. The method according to claim 8, characterized in that, The step of dividing each group of second textures into multiple second texture sets based on the similarity between the prefab reference tuples of each second texture includes: Each group of second textures is divided into multiple second texture sets based on the Hamming distance between the prefab reference tuples of each second texture.
10. The method according to claim 1, characterized in that, The step of dividing each group of second textures into multiple second texture sets based on the similarity between the prefab reference information of each second texture in each group includes: Based on the similarity between the prefab reference information of each second texture, each group of second textures is divided into a plurality of second texture sets according to the second resolution size range, wherein the texture set resolution size of each of the plurality of second texture sets is within the second resolution size range.
11. The method according to claim 10, characterized in that, The second resolution size range is the size range from the fourth resolution size threshold to the fifth resolution size threshold; the step of dividing each group of second textures into the plurality of second texture sets according to the second resolution size range based on the similarity between the prefab reference information of each second texture includes: The following partitioning steps are performed iteratively until the third iteration termination condition is met, wherein the third iteration termination condition includes at least one of the following: the number of iterations reaches the third number, and the number of remaining second textures in each group of second textures is zero; after performing one iteration, the second similarity threshold is increased by a second step size: Each of the second textures in each group is used as the current texture and the following processing steps are performed: When a second temporary atlas exists in the list of second temporary atlases, the similarity between the current texture and each second temporary atlas is determined based on the similarity between the current texture and the second texture in each second temporary atlas, thus obtaining a second matching atlas. The second matching atlas is the second temporary atlas with the highest similarity to the current texture. If the similarity between the current texture and the second matching image set is greater than or equal to the second similarity threshold, and the image set resolution size of the second matching image set after adding the current texture is less than or equal to the fifth resolution size threshold, then the current texture is added to the second matching image set to obtain an updated second matching image set. If the resolution size of the updated second matching atlas is greater than or equal to the fourth resolution size threshold and the atlas fill rate of the updated second matching atlas is greater than or equal to the second fill rate threshold, the updated second matching atlas is determined as a second atlas, the second texture in the second matching atlas is removed from each group of second textures, and the second matching atlas is removed from the second temporary atlas list. If there is no existing second temporary atlas in the second temporary atlas list, or if the current texture has not been added to any second temporary atlas, a new temporary atlas is created to obtain a new second atlas. The current texture is then added to the new second atlas, and the new second atlas is added to the second temporary atlas list.
12. The method according to claim 11, characterized in that, The step of determining the similarity between the current texture and each second temporary image set based on the similarity between the current texture and the second texture in each second temporary image set includes: The average similarity between the current texture and each of the second textures in each of the second temporary texture sets is determined as the similarity between the current texture and each of the second temporary texture sets.
13. The method according to claim 11, characterized in that, After performing the following processing steps by sequentially using each of the second textures in each group of second textures as the current texture, the method further includes: When there are multiple second temporary map sets in the second temporary map set list, the second temporary map set whose map set resolution size is less than or equal to the sixth resolution size threshold is determined as the second candidate map set; When there are multiple candidate map sets, the following steps are performed iteratively until a fourth iteration termination condition is met, wherein the fourth iteration termination condition includes at least one of the following: the number of iterations reaches a fourth number, and the number of remaining candidate map sets after the iteration is less than or equal to a second quantity threshold: The second candidate map sets are sorted in descending order of resolution size to obtain a list of second candidate map sets; Iterate through the second candidate graph sets in the second candidate graph set list, and perform the following graph set union operation on the current graph set being iterated over: Determine the second target map set in the second candidate map set list, wherein the second target map set is the map set with the largest map set resolution size after being merged with the current map set in the other map sets in the second candidate map set list, excluding the current map set; Merge the current map set with the second target map set to obtain a second merged map set, and remove the current map set and the second target map set from the second candidate map set list; If the atlas resolution size of the second merged atlas is greater than or equal to the fourth resolution size threshold and the atlas fill rate is greater than or equal to the second fill rate threshold, the second merged atlas is determined as a second atlas. If the resolution size of the second merged atlas is less than the fourth resolution size threshold, the second merged atlas is added as a second candidate atlas to the second candidate atlas list.
14. The method according to any one of claims 1 to 13, characterized in that, The determination of a first set of textures and multiple sets of second textures includes: Determine a set of initial textures corresponding to each of the multiple business modules of the target application, wherein the set of initial textures corresponding to each business module includes textures referenced by each business module among the multiple textures; Extract the images from the plurality of images that are referenced by more than the preset number of business modules to obtain the first set of images; The first image in the initial set of images corresponding to each business module is removed to obtain the multiple sets of second images.
15. The method according to claim 14, characterized in that, After determining an initial set of textures corresponding to each of the multiple business modules of the target application, the method further includes: If, based on the texture reference records of the multiple textures, it is determined that there is a texture in a set of initial textures corresponding to the first business module that has not been referenced by the first business module, the unreferenced texture is removed from the set of initial textures corresponding to the first business module to obtain an updated set of initial textures corresponding to the first business module. If, based on the texture reference records of the plurality of textures, it is determined that there is a texture referenced by the second business module that is not included in the initial set of textures corresponding to the second business module, the referenced texture is added to the initial set of textures corresponding to the second business module to obtain an updated initial set of textures corresponding to the second business module.
16. An image processing apparatus, characterized in that, include: A first determining unit is configured to determine a set of first textures and multiple sets of second textures, wherein each first texture in the set of first textures is a texture referenced by more than a preset number of business modules of the target application in multiple textures, and each set of second textures in the multiple sets of second textures includes other textures in the multiple textures besides the set of first textures that correspond to a business module. The first partitioning unit is used to partition the group of first images into multiple first image sets based on the similarity between the reference module information of each first image, wherein the reference module information of each first image is used to represent the business module that references each first image; The second division unit is used to divide each group of second textures into multiple second texture sets based on the similarity between the prefab reference information of each second texture in each group of second textures. The prefab reference information of each second texture is used to indicate that the prefab reference of each second texture is used in multiple prefabs of the business module corresponding to each group of second textures.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 15.
18. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1 to 15.
19. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 15 through the computer program.