Atlas optimization method, device and computer storage medium

By scanning the prefabricated body in game development, calculating the similarity and correlation of pictures, and generating a distance matrix to divide the picture album, the problem of unreasonable division of the picture album in the existing technology is solved, and the effect of performance optimization and cost reduction is achieved.

CN115591246BActive Publication Date: 2025-05-23XIAMEN WOOBEST INTERACTIVE NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211396119.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-09
Publication Date
2025-05-23
Estimated Expiration
2042-11-09

AI Technical Summary

Technical Problem

The existing technology has unreasonable strategy for dividing the picture album in game development, resulting in poor performance optimization results and increased labor costs and memory usage.

Method used

By scanning all prefabricated bodies, obtaining the reference set of each picture, calculating the similarity and correlation matrix between each two pictures, generating a distance matrix, and dividing the pictures into the appropriate picture set according to the distance matrix.

Benefits of technology

A reasonable picture atlas division is achieved, reducing Draw Call and memory footprint, reducing labor costs, and improving game performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115591246B_ABST
    Figure CN115591246B_ABST
Patent Text Reader

Abstract

The present disclosure provides an atlas optimization method, device and computer storage medium, which relate to the field of computer technology. Scan all prefabricated bodies, obtain the reference set of each picture; obtain the similarity matrix between every two pictures according to the reference set; determine the display time period of each prefabricated body in the reference set of each picture during the game operation; obtain the correlation matrix between every two pictures according to the display time period of each prefabricated body in the reference set of each picture; obtain the distance matrix between every two pictures according to the similarity matrix and the correlation matrix; obtain the first distance value between the first picture in the list of pictures to be divided and the second picture in each atlas in the divided atlas list according to the distance matrix between every two pictures; divide the first picture whose first distance value meets the preset conditions into the target atlas of the corresponding divided atlas list. Realize reasonable and efficient atlas division, reduce Draw Call and reduce memory usage.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In the process of game development, in order to improve rendering efficiency, almost all games will use atlases. In the Unity engine, only the packaging and loading of atlases are supported, but there is no relevant strategy or support for how to divide the pictures in the project. Reasonable atlas division can bring great optimization to game performance, otherwise, it may cause more performance overhead.

[0003] Currently, in the process of game development, there are two main strategies for dividing atlases: one is completely manual division; the other is division through an automated script, where all images referenced by a prefab are put into a separate atlas. If an image is referenced by multiple prefabs, the image is put into a public atlas.

[0004] However, both methods have some disadvantages. If the manual division method is used, it will increase labor costs, consume a lot of time, and it is not convenient to coordinate all the pictures in the project from a global perspective. If the above automated script method is used, the pictures referenced by each prefab are put into an atlas. When there are more prefabs, it is easy to cause the atlas to be divided too finely, which cannot reduce the DrawCall (drawing times) and occupies a large amount of memory.

[0005] Therefore, an efficient and reasonable atlas optimization method is needed to reduce DrawCall and memory usage.

[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0007] The purpose of the present disclosure is to provide an atlas optimization method, device and computer storage medium, which can at least to some extent overcome the problems of unreasonable atlas partitioning strategy and low efficiency in related technologies.

[0008] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0009] According to one aspect of the present disclosure, a method for optimizing an atlas is provided, comprising:

[0010] Scan all prefabricated bodies to obtain a reference set of each image, wherein the reference set is a list of referenced prefabricated bodies corresponding to each image;

[0011] Obtaining a similarity matrix between every two images according to the reference set;

[0012] Determine the display period of each prefab in the reference collection of each image during game operation;

[0013] Obtaining a correlation matrix between every two pictures according to the display period of each preform in the reference collection of each picture;

[0014] Obtaining a distance matrix between every two pictures according to the similarity matrix and the correlation matrix;

[0015] According to the distance matrix between every two pictures, obtain a first distance value between a first picture in the to-be-divided picture list and a second picture in each atlas in the divided atlas list;

[0016] The first picture whose first distance value meets the preset condition is divided into the target atlas in the corresponding divided atlas list.

[0017] In one embodiment of the present disclosure, the method further includes:

[0018] If the distance values ​​in the first distance matrix corresponding to the first picture do not meet the preset conditions, creating a new atlas;

[0019] The first picture is divided into the new picture set.

[0020] In one embodiment of the present disclosure, the method further includes:

[0021] When the prefabricated body changes, a necessary update atlas is determined, wherein the necessary update atlas is an atlas corresponding to the picture for performing the first preset operation;

[0022] The necessary update atlas is updated in real time.

[0023] In one embodiment of the present disclosure, the method further includes:

[0024] When the prefabricated body changes, a non-essential update atlas is determined, wherein the non-essential update atlas is an atlas corresponding to the picture for performing the second preset operation;

[0025] When the estimated update amount is less than or equal to the update threshold, the non-essential update atlas is updated.

[0026] In one embodiment of the present disclosure, the method further includes:

[0027] Acquire an updateable atlas combination, wherein the updateable atlas combination includes a new atlas and an old atlas, and the new atlas is completely consistent with the pictures in the old atlas;

[0028] Comparing the new atlas in the updateable atlas combination with the old atlas to obtain atlas similarity;

[0029] Naming the corresponding new atlas with the name of the old atlas whose atlas similarity exceeds a preset value, to obtain a named updateable atlas combination;

[0030] The named updateable atlas combination is differentially updated using Unity's preset resource package.

[0031] In one embodiment of the present disclosure, obtaining a similarity matrix between every two pictures according to the reference set includes:

[0032] Determine the similarity between the reference sets corresponding to every two pictures, wherein the similarity is calculated as follows:

[0033] M = (A∩B) / (A∪B), and 0≤M≤1;

[0034] Wherein, M is the similarity, A and B are any two pictures;

[0035] The similarities are stored in a two-dimensional array to form the similarity matrix.

[0036] In one embodiment of the present disclosure, obtaining a correlation matrix between every two pictures according to the display period of each preform in the reference collection of each picture includes:

[0037] Determine the total display period of each picture and the simultaneous display period between every two pictures according to the display period of each preform in the reference collection of each picture;

[0038] Determine the correlation between each two pictures according to the ratio of the simultaneous display period between each two pictures to the corresponding total display period, wherein the correlation is greater than or equal to 0 and less than or equal to 1;

[0039] A correlation matrix is ​​generated according to the correlation between each two pictures.

[0040] In one embodiment of the present disclosure, the step of dividing the first picture whose first distance value meets a preset condition into a target atlas in the corresponding divided atlas list includes:

[0041] Obtain an average distance value between the first image and the atlases in the divided atlas list, wherein the average distance value is the distance between all images in the atlas and the first image divided by the number of images in the atlas;

[0042] Select a target atlas with the smallest average distance from the first image and a fluctuation distance value within a preset threshold range, wherein the fluctuation distance value is the variance of the distance between the first image and the images in the atlas;

[0043] The first picture is divided into the target atlas.

[0044] According to another aspect of the present disclosure, there is provided an atlas optimization device, comprising:

[0045] A reference scanning module, used to scan all prefabricated bodies and obtain a reference set of each picture, wherein the reference set is a list of referenced prefabricated bodies corresponding to each picture;

[0046] A similarity acquisition module, used to obtain a similarity matrix between every two pictures according to the reference set;

[0047] A display acquisition module, used to determine the display period of each prefab in the reference collection of each picture during game operation;

[0048] A correlation acquisition module, used for obtaining a correlation matrix between every two pictures according to the display period of each preform in the reference collection of each picture;

[0049] A distance matrix acquisition module, used for obtaining a distance matrix between every two pictures according to the similarity matrix and the correlation matrix;

[0050] A first distance acquisition module, used for acquiring a first distance value between a first picture in the to-be-divided picture list and a second picture in each atlas in the divided atlas list according to the distance matrix between every two pictures;

[0051] An atlas partitioning module is used to partition the first image whose first distance value meets a preset condition into a target atlas in the corresponding partitioned atlas list.

[0052] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the atlas optimization method described in any one of the above is implemented.

[0053] An atlas optimization method provided by an embodiment of the present disclosure obtains a reference set of each picture by scanning all prefabricated bodies, wherein the reference set is a list of referenced prefabricated bodies corresponding to each picture; then obtains a similarity matrix between every two pictures according to the reference set; determines the display time period of each prefabricated body in the reference set of each picture during game operation; then obtains a correlation matrix between every two pictures according to the display time period of each prefabricated body in the reference set of each picture; obtains a distance matrix between every two pictures according to the similarity matrix and the correlation matrix; obtains a first distance value between the first picture in the list of pictures to be divided and the second picture in each atlas in the list of divided atlases according to the distance matrix between every two pictures; and divides the first picture whose first distance value meets the preset conditions into the target atlas of the corresponding divided atlas list. By dividing pictures with similar usage scenarios and display time intervals into the same target atlas, reasonable atlas division is achieved, and the effect of reducing Draw Call and memory usage is achieved, and manpower costs are reduced.

[0054] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0056] Figure 1 A schematic diagram of a method for optimizing an atlas in one embodiment of the present disclosure is shown;

[0057] Figure 2 A schematic diagram of a method for optimizing an atlas in another embodiment of the present disclosure is shown;

[0058] Figure 3 A schematic diagram of a method for optimizing an atlas in another embodiment of the present disclosure is shown; and

[0059] Figure 4 A schematic diagram of an atlas optimization device in one embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0060] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0061] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0062] The solution provided by this application is an automatic optimization strategy for game atlases based on the Unity engine. For ease of understanding, several terms involved in this application are first explained below.

[0063] Prefab: A collection of an object and its components in the game interface, the purpose of which is to make the object and resources easy to reuse.

[0064] An atlas refers to a collection of images that are merged into a large image according to a rule. An atlas is a large image and also includes a collection of information such as the coordinates of the images.

[0065] DrawCall refers to the operation in which the CPU calls the graphics programming interface to instruct the GPU to render. If there are too many DrawCalls, the CPU will spend a lot of time submitting DrawCalls, causing CPU overload.

[0066] like Figure 1 A schematic diagram of a method flow chart of an atlas optimization is shown. In one embodiment of the present disclosure, a method for optimizing an atlas is provided, comprising:

[0067] S101, scanning all prefabricated bodies to obtain a reference set of each picture, wherein the reference set is a list of referenced prefabricated bodies corresponding to each picture;

[0068] Put all UI images in the game that are directly referenced by prefabs into a resource pool for division. Specifically, scan all UI (User Interface) prefabs and count the reference set of each image. The reference set refers to the list of all prefabs that reference a certain image, which is called the reference set of the image. Each image corresponds to a prefab list.

[0069] S102, obtaining a similarity matrix between every two pictures according to the reference set;

[0070] Specifically, the similarity between two images is calculated through the reference set and stored in a two-dimensional array, which is called a similarity matrix. The similarity mentioned above is used to describe the similarity of the reference sets of two images. Assuming that the reference sets of two images are A and B, the similarity calculation formula is: (A∩B) / (A∪B), and the range of similarity is: 0≤similarity≤1.

[0071] S103, determining a display period of each prefab in the reference collection of each picture during game operation;

[0072] Specifically, data statistics are performed when the game is running, and the opening and closing time of each UI prefab is counted. Then, the display time period of each prefab in the reference set of each picture is obtained through the statistical data at runtime, that is, the display time period of each prefab mentioned above, so that the correlation between pictures can be calculated later through the display time period.

[0073] S104, obtaining a correlation matrix between every two pictures according to the display period of each preform in the reference collection of each picture;

[0074] Specifically, the correlation is used to describe the time period when two images are loaded simultaneously in the game, that is, the proportion of the time period when two images are displayed simultaneously to the total time period when they are loaded. The value range of the correlation is: 0≤correlation≤1. The calculated correlation is stored in a two-dimensional array to obtain a correlation matrix.

[0075] S105, obtaining a distance matrix between every two pictures according to the similarity matrix and the correlation matrix;

[0076] After obtaining the correlation matrix between every two pictures and the similarity matrix between every two pictures in the above steps, the distance matrix is ​​calculated using the distance formula through the similarity matrix and the correlation matrix to obtain the distance between the two pictures. The distance is a quantity used to describe the difference in the final usage scenarios of the two pictures. The smaller the distance between the two pictures, the greater the probability that the two pictures are divided into the same atlas. The distance calculation formula is: 1-(similarity × similarity weight + correlation × correlation weight). The value range of the distance is: 0≤distance≤1, and the similarity weight + correlation weight = 1. The above steps are used to analyze which pictures are referenced by similar prefabs or loaded at the same time during the game, so as to divide these pictures into the same atlas.

[0077] S106, obtaining a first distance value between a first picture in the to-be-divided picture list and a second picture in each atlas in the divided atlas list according to the distance matrix between every two pictures;

[0078] After obtaining the distance matrix between each two pictures, the list of pictures to be divided and the list of divided atlases can be divided and managed according to the distance value. The list of pictures to be divided includes many pictures that have not been divided into atlases, and the list of divided atlases includes many atlases, each of which includes pictures divided into the atlas.

[0079] In the specific division process, the list of images to be divided is traversed. Each time a picture is traversed, the list of divided atlases is traversed to obtain the distance between each picture in the atlas in the divided atlas list and the current picture, which is the first distance value.

[0080] S107: Classify the first picture whose first distance value meets a preset condition into a target atlas in the corresponding divided atlas list.

[0081] Find the first picture that meets the preset condition in the above first distance value, where the preset condition refers to the atlas with the smallest average distance from the current picture and a distance fluctuation value within a specified threshold, add the picture to the atlas and remove the current picture from the list of pictures to be divided.

[0082] The average distance between an atlas and an image is the sum of the distances between the image and all the images in the atlas divided by the number of images in the atlas. The smaller the average distance, the more similar the image is to the application of the atlas. The distance fluctuation value is the variance of the distance between the image and all the images in the atlas. Assuming that the distance between the image and image A in the atlas is very small, and the distance between the image and image B in the atlas is relatively large, the average distance calculated may be relatively small, but the distance fluctuation value will be relatively large, and the image cannot be added to the atlas at this time. By calculating the distance value, the image is added to the corresponding most similar atlas, which is the target atlas mentioned above. A more efficient and reasonable atlas partitioning strategy is implemented. When there are no images in the list to be partitioned, the partitioned atlas list is the final atlas partitioning result.

[0083] The present embodiment provides a method for optimizing an atlas, which obtains a reference set of each picture by scanning all prefabricated bodies, wherein the reference set is a list of referenced prefabricated bodies corresponding to each picture; then obtains a similarity matrix between each two pictures according to the reference set; determines the display time period of each prefabricated body in the reference set of each picture during the game operation; then obtains a correlation matrix between each two pictures according to the display time period of each prefabricated body in the reference set of each picture; obtains a distance matrix between each two pictures according to the similarity matrix and the correlation matrix; obtains a first distance value between the first picture in the list of pictures to be divided and the second picture in each atlas in the list of divided atlases according to the distance matrix between each two pictures; and divides the first picture whose first distance value meets the preset conditions into the target atlas of the corresponding divided atlas list. By dividing the pictures with similar usage scenarios and display time intervals into the same target atlas, reasonable atlas division is achieved, and by reasonably dividing the atlases, the number of atlases loaded during the game operation is reduced. The effect of reducing Draw Call and memory usage is reduced, and the cost of manpower is reduced.

[0084] In one embodiment of the present disclosure, the method further includes:

[0085] If the distance values ​​in the first distance matrix corresponding to the first picture do not meet the preset conditions, creating a new atlas;

[0086] The first picture is divided into the new picture set.

[0087] Specifically, if an image does not find an atlas that meets the joining condition after traversing all the divided atlases, a new atlas is created, the image is added to the atlas and removed from the list to be divided.

[0088] In one embodiment of the present disclosure, the method further includes:

[0089] When the prefabricated body changes, a necessary update atlas is determined, wherein the necessary update atlas is an atlas corresponding to the picture for performing the first preset operation;

[0090] The necessary update atlas is updated in real time.

[0091] When scanning the prefab and finding that the prefab has changed, the atlas needs to be updated because the adjustment of the UI prefab during the game iteration process often leads to changes in the atlas division. The adjustment of a UI prefab often affects multiple UI atlases.

[0092] First, mark the necessary update atlas. All atlases involved in the added, deleted, and modified images in the project are necessary update atlases. Regardless of whether the update amount exceeds the atlas update amount threshold, they must be updated. Necessary update atlases refer to atlases involved in the addition, deletion, and modification of images in the project. The above-mentioned first preset operation includes the above-mentioned operations such as addition, deletion, and modification. The first preset operation can be set according to actual application needs and is not limited here.

[0093] In one embodiment of the present disclosure, the method further includes:

[0094] When the prefabricated body changes, a non-essential update atlas is determined, wherein the non-essential update atlas is an atlas corresponding to the picture for performing the second preset operation;

[0095] When the estimated update amount is less than or equal to the update threshold, the non-essential update atlas is updated.

[0096] The unnecessary update of the atlas is caused by factors such as the prefab reference relationship and the length of time used. Even if it is not updated, it will not affect the game experience. The second preset operation refers to the operation factors such as the prefab reference relationship and the length of time used. It can be set according to actual application needs and is not limited here.

[0097] If the necessary update amount exceeds the update threshold, no unnecessary update is performed, otherwise, the unnecessary update is continued. The necessary update amount is the update amount of the necessary update atlas.

[0098] Among them, the estimated update amount of the atlas refers to the estimated total area of ​​the atlas that needs to be updated, and the update threshold refers to the incremental limit of the estimated update amount. If the update amount of necessary updates plus non-essential updates exceeds this value, only the necessary updates and the non-essential updates that do not exceed this value will be updated. Among them, the update threshold can select a suitable value according to actual application requirements.

[0099] In one embodiment of the present disclosure, the method further includes:

[0100] Acquire an updateable atlas combination, wherein the updateable atlas combination includes a new atlas and an old atlas, and the new atlas is completely consistent with the corresponding pictures in the old atlas;

[0101] Comparing the new atlas in the updateable atlas combination with the old atlas for similarity;

[0102] The names of the old atlases whose atlas similarity exceeds the preset value are named as the corresponding new atlases to obtain the named updateable atlas combination;

[0103] The named updateable atlas combination is differentially updated using Unity's preset resource package.

[0104] Specifically, the updateable atlas combination includes new atlases and old atlases, and the number of new and old atlases is at least one. The following example is used to illustrate: for example, there are currently several atlases {A, B, C, D, E, F}, which contain all the pictures in the project. Due to changes in factors such as prefabricated bodies and opening time, after re-executing the overall division, the atlas becomes {A, G, H, I, J, K}. Except for atlas A, the division of other atlases has changed, which is equivalent to disrupting the pictures in them and re-dividing them to obtain new atlases. In order to control the update magnitude, it is generally not directly updating all atlases {G, H, I, J, K}, but using a partial update method.

[0105] The details are as follows: Assuming that the images in the atlas {B, C} are redivided into the atlas {G, H, I}, and all the images in the atlas {G, H, I} are exactly the same as the images in {B, C}, then it is considered that the atlas {B, C} can be updated to {G, H, I}, and the combination of {B, C} becoming {G, H, I} is a set of updateable atlas combinations.

[0106] Optionally, in the changed atlas, as many such updateable atlas combinations as possible are searched and added to the update list. When the estimated update amount and necessary update amount in the update list reach the update amount threshold, the addition is stopped. The estimated update amount is the update amount that can be performed based on the update amount and necessary update amount of the atlas.

[0107] Then, traverse each updateable combination, compare the atlas similarity of the new and old atlases in each combination one by one, and for the new and old atlases with high similarity, set a preset value to select the new and old atlas combinations with atlas similarity exceeding the preset value, and name the new atlas with the name of the old atlas, thereby triggering the difference update of the Unity Asset Bundle package, that is, the preset resource package mentioned above, to achieve a smaller update amount. Implementing partial updates optimizes the update of atlases and makes them more efficient.

[0108] In one embodiment of the present disclosure, obtaining a similarity matrix between every two pictures according to the reference set includes:

[0109] Determine the similarity between the reference sets corresponding to every two pictures, wherein the similarity is calculated as follows:

[0110] M = (A∩B) / (A∪B), and 0≤M≤1;

[0111] Wherein, M is the similarity, A and B are any two pictures;

[0112] The similarities are stored in a two-dimensional array to form the similarity matrix.

[0113] The similarity between each image is calculated through the reference set and stored in a two-dimensional array, which is called a similarity matrix. The above similarity is used to describe the similarity of the reference sets of two images. Assuming that the reference sets of two images are A and B, the similarity calculation formula is: M = (A∩B) / (A∪B), and the range of similarity is: 0≤M≤1. Through the above steps, the images displayed in the same period during the game will tend to be concentrated in the same atlas. This can reduce the number of atlases loaded at runtime.

[0114] like Figure 2 Another schematic flow chart of an atlas optimization method is shown. In one embodiment of the present disclosure, obtaining a correlation matrix between every two pictures according to the display period of each preform in the reference collection of each picture includes:

[0115] S201, determining the total display period of each picture and the simultaneous display period between every two pictures according to the display period of each preform in the reference collection of each picture;

[0116] S202, determining the correlation between each two pictures according to the ratio of the simultaneous display period between each two pictures to the corresponding total display period, wherein the correlation is greater than or equal to 0 and less than or equal to 1;

[0117] S203: Generate a correlation matrix according to the correlation between every two pictures.

[0118] Specifically, the proportion of the time period in which the two images are loaded simultaneously in the game to the total time period in which they are loaded is calculated, so as to determine the relevance of the two images. After storage, the relevance matrix is ​​obtained.

[0119] like Figure 3Another atlas optimization method flow chart is shown. In the embodiment of the present disclosure, the first image whose first distance value meets the preset condition is divided into a target atlas in the corresponding divided atlas list, including:

[0120] S301, obtaining an average distance value between the first image and the atlas in the divided atlas list, wherein the average distance value is the distance between all images in the atlas and the first image divided by the number of images in the atlas;

[0121] S302, selecting a target atlas having a minimum average distance from the first image and a fluctuation distance value within a preset threshold range, wherein the fluctuation distance value is a variance of the distance between the first image and the images in the atlas;

[0122] S303: classify the first picture into the target atlas.

[0123] Specifically, for example, the list of pictures to be divided includes picture a, picture b, and picture c, and the list of divided atlases includes atlas 1, atlas 2, and atlas 3. Atlas 1 includes picture e, picture f, picture g, and picture h. Traverse the images in the list of images to be divided. After determining image a, traverse the divided atlas list, and calculate the average distance values ​​between the images in atlas 1, atlas 2, and atlas 3 and image a in turn. Taking atlas 1 as an example, obtain the distance i between image e and image a, the distance j between image f and image a, the distance k between image g and image a, and the distance l between image h and image a. The average distance is (distance i + distance j + distance k + distance l) / 4. Find the atlas with the smallest average distance value from the current image a. If it is assumed to be atlas 1, determine the fluctuation distance value between atlas 1 and image a. The distance fluctuation value is the variance of the distance between the image and all images in the atlas. If the distance variance between image a and images e, f, g, and h is within the preset acceptable range, it is considered that image a can be divided into atlas 1, and image 1 is the target atlas of image a.

[0124] like Figure 4 A schematic diagram of an atlas optimization device is shown. In another embodiment of the present disclosure, an atlas optimization device 400 is provided, including:

[0125] A reference scanning module 401 is used to scan all preforms and obtain a reference set of each picture, wherein the reference set is a list of referenced preforms corresponding to each picture;

[0126] A similarity acquisition module 402, used to obtain a similarity matrix between every two pictures according to the reference set;

[0127] A display acquisition module 403, used to determine the display period of each prefab in the reference collection of each picture during game operation;

[0128] A correlation acquisition module 404, configured to obtain a correlation matrix between every two pictures according to the display period of each preform in the reference collection of each picture;

[0129] A distance matrix acquisition module 405 is used to obtain a distance matrix between every two pictures according to the similarity matrix and the correlation matrix;

[0130] A first distance acquisition module 406 is used to acquire a first distance value between a first picture in the to-be-divided picture list and a second picture in each atlas in the divided atlas list according to the distance matrix between every two pictures;

[0131] The atlas partitioning module 407 is configured to partition the first image whose first distance value meets a preset condition into a target atlas in the corresponding partitioned atlas list.

[0132] The atlas optimization device provided in this embodiment realizes reasonable atlas division through the above modules, and reduces the number of atlases loaded when the game is running by reasonably dividing the atlas, thereby reducing the effect of Draw Call and memory usage, and reducing manpower costs.

[0133] In another embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned atlas optimization methods is implemented.

[0134] This embodiment provides a computer-readable storage medium, and a computer program is executed by a processor to implement the above-mentioned atlas optimization method.

[0135] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0136] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0137] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0138] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.

[0139] A program product for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0140] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0141] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0142] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0143] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0144] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0145] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0146] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0147] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. A method for optimizing an atlas, It is characterized in that include: Scan all prefabricated bodies to obtain a reference set of each image, wherein the reference set is a list of referenced prefabricated bodies corresponding to each image; Obtaining a similarity matrix between every two images according to the reference set; Determine the display period of each prefab in the reference collection of each image during game operation; Obtaining a correlation matrix between every two pictures according to the display period of each preform in the reference collection of each picture; Obtaining a distance matrix between every two pictures according to the similarity matrix and the correlation matrix; According to the distance matrix between every two pictures, obtain a first distance value between a first picture in the to-be-divided picture list and a second picture in each atlas in the divided atlas list; The first picture whose first distance value meets the preset condition is divided into the target atlas in the corresponding divided atlas list.

2. The atlas optimization method according to claim 1, It is characterized in that The method further comprises: If the distance values ​​in the first distance matrix corresponding to the first picture do not meet the preset conditions, creating a new atlas; The first picture is divided into the new picture set.

3. The atlas optimization method according to claim 1, It is characterized in that The method further comprises: When the prefabricated body changes, a necessary update atlas is determined, wherein the necessary update atlas is an atlas corresponding to the picture for performing the first preset operation; The necessary update atlas is updated in real time.

4. According to the atlas optimization method described in claim 1, It is characterized in that The method further comprises: When the prefabricated body changes, a non-essential update atlas is determined, wherein the non-essential update atlas is an atlas corresponding to the picture for performing the second preset operation; When the estimated update amount is less than or equal to the update threshold, the non-essential update atlas is updated.

5. The atlas optimization method according to claim 4, It is characterized in that The method further comprises: Acquire an updateable atlas combination, wherein the updateable atlas combination includes a new atlas and an old atlas, and the new atlas is completely consistent with the pictures in the old atlas; Comparing the new atlas in the updateable atlas combination with the old atlas to obtain atlas similarity; Naming the corresponding new atlas with the name of the old atlas whose atlas similarity exceeds a preset value, to obtain a named updateable atlas combination; The named updateable atlas combination is differentially updated using Unity's preset resource package.

6. The atlas optimization method according to claim 1, It is characterized in that The obtaining the correlation matrix between every two pictures according to the display period of each preform in the reference collection of each picture includes: Determine the total display period of each picture and the simultaneous display period between every two pictures according to the display period of each preform in the reference collection of each picture; Determine the correlation between each two pictures according to the ratio of the simultaneous display period between each two pictures to the corresponding total display period, wherein the correlation is greater than or equal to 0 and less than or equal to 1; A correlation matrix is ​​generated according to the correlation between each two pictures.

7. The atlas optimization method according to claim 1, It is characterized in that The step of dividing the first picture whose first distance value meets the preset condition into a target atlas in the corresponding divided atlas list includes: Obtain an average distance value between the first image and the atlases in the divided atlas list, wherein the average distance value is the distance between all images in the atlas and the first image divided by the number of images in the atlas; Select a target atlas with the smallest average distance from the first image and a fluctuation distance value within a preset threshold range, wherein the fluctuation distance value is the variance of the distance between the first image and the images in the atlas; The first picture is divided into the target atlas.

8. An atlas optimization device, It is characterized in that include: A reference scanning module, used to scan all prefabricated bodies and obtain a reference set of each picture, wherein the reference set is a list of referenced prefabricated bodies corresponding to each picture; A similarity acquisition module, used to obtain a similarity matrix between every two pictures according to the reference set; A display acquisition module, used to determine the display period of each prefab in the reference collection of each picture during game operation; A correlation acquisition module, used for obtaining a correlation matrix between every two pictures according to the display period of each preform in the reference collection of each picture; A distance matrix acquisition module, used for obtaining a distance matrix between every two pictures according to the similarity matrix and the correlation matrix; A first distance acquisition module, used for acquiring a first distance value between a first picture in the to-be-divided picture list and a second picture in each atlas in the divided atlas list according to the distance matrix between every two pictures; An atlas partitioning module is used to partition the first image whose first distance value meets a preset condition into a target atlas in the corresponding partitioned atlas list.

9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the atlas optimization method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Picture similarity detection method and device, medium and electronic device

    CN109447154A

  • Video frame image testing method, device and equipment and computer storage medium

    CN112153374A