Special effects resource processing methods, devices, storage media and computing equipment
By automatically calculating the similarity and resource cost scores of special effects resources for classification, the problem of heavy workload for special effects resource classification production personnel is solved, and low-cost and efficient special effects resource processing is achieved.
Patent Information
- Application Number
- CN202210231937.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-03-09
AI Technical Summary
In existing technologies, the graded production of special effects resources increases the workload of special effects production personnel, and the processing cost of existing special effects resources of online projects is high, which affects the game experience.
By automatically calculating the similarity score and resource cost score between special effects resources and original resources, and classifying them according to preset thresholds, a configuration file is generated to instruct terminal devices to display special effects resources of the corresponding level.
Automatic grading of special effects resources can be achieved without human intervention, reducing processing costs and time and improving the gaming experience.
Smart Images

Figure CN114546664B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this application relate to the field of display resource processing, and more specifically to a method, apparatus, storage medium, and computing device for processing special effects resources. Background Technology
[0002] Currently, to enrich game content and enhance visual effects, numerous game effects are typically added to game scenes. However, due to their inherent nature, these effects consume significant CPU and GPU resources during rendering. Therefore, excessive effects can cause lag and negatively impact the gaming experience. Consequently, to ensure optimal performance on high-end devices and smooth gameplay on low-end devices, effects need to be tiered and tailored to different device performance levels.
[0003] The current common approach to tiered effects is to add a tiered configuration for the various sub-effects of a complete special effect. Special effects artists then configure which sub-effects should be displayed at each tier based on the desired performance. This existing approach undoubtedly increases the workload of special effects artists and requires them to have a good understanding of the equipment resources needed to display the effects, and to accurately assess and quantify the resource costs of the effects being produced. Furthermore, for projects already in production, the sheer volume of existing special effects resources makes manual processing too costly. Summary of the Invention
[0004] Embodiments of this application provide a method, apparatus, storage medium, and computing device for processing special effects resources, which can automatically classify special effects resources without requiring users to understand the concept of resource costs for special effects, thus saving human resources.
[0005] In a first aspect of this application, a method is provided, comprising: acquiring a first special effects resource and a second special effects resource, wherein both the first special effects resource and the second special effects resource include at least one sub-effect, and the second special effects resource is a subset of the first special effects resource;
[0006] Calculate the similarity score between the second special effects resource and the first special effects resource, as well as the resource cost score of the second special effects resource;
[0007] If the sum of the similarity score and the resource cost score of the second special effects resource meets the preset threshold, then the second special effects resource is determined to be of the corresponding level.
[0008] In one embodiment, the second special effects resource is the same as the first special effects resource;
[0009] If the sum of the similarity score and the resource cost score of the second special effect resource does not meet the preset threshold, then one sub-effect of the second special effect resource is turned off to obtain an updated second special effect resource. The similarity score and resource cost score between the updated second special effect resource and the first special effect resource are recalculated until the sum of the similarity score and resource cost score between the updated second special effect resource and the first special effect resource meets the preset threshold, and the updated second special effect resource is determined to be of the corresponding level.
[0010] In one embodiment, the sub-effects of the second effect resource are turned off in order of the difference between the sum of the similarity score and the resource cost score of the second effect resource before and after each sub-effect is turned on and off.
[0011] In one embodiment, the method for calculating the similarity score between the second special effects resource and the first special effects resource includes at least one of the following:
[0012] Structural similarity, Hausdorff distance, and root mean square error;
[0013] The calculation of the similarity score between the second special effects resource and the first special effects resource based on structural similarity includes:
[0014] Obtain one frame image of the first special effects resource and the second special effects resource respectively;
[0015] Calculate the structural similarity score between two frame images, and use the structural similarity score as the similarity score between the second special effects resource and the first special effects resource.
[0016] In one embodiment, when calculating the structural similarity between two frame images, a one-dimensional Gaussian convolution kernel is used to process the two frame images respectively, so as to calculate the average gray level, brightness contrast value and contrast contrast value of the two frame images.
[0017] In one embodiment, when calculating the structural similarity between two frame images, a symmetric filter is used to process the two frame images respectively, so as to calculate the average gray level, brightness contrast value and contrast contrast value of the two frame images.
[0018] In one embodiment, calculating the resource cost score of the second special effects resource includes:
[0019] The resource overhead score is calculated based on at least one of the following: average number of rendering processes, average number of particles, screen ratio, and duration of the second special effects resource.
[0020] In one embodiment, if the sum of the similarity score and the resource cost score of the second special effects resource meets a preset threshold, then the second special effects resource is determined to be of the corresponding level, including:
[0021] According to preset rules, the grade score of the second special effects resource is calculated based on the similarity score and resource cost score;
[0022] If the grade score meets the preset threshold, then the second special effects resource is determined to be of the corresponding grade.
[0023] In one embodiment, the preset rules include multiple preset score calculation methods for different special effects levels, and each special effects level score calculation method presets different similarity score weights and resource cost score weights;
[0024] According to preset rules, based on the similarity score and resource cost score, the grade score of the second special effects resource is calculated, including:
[0025] For different special effects levels, the level scores of the second special effects resource for different special effects levels are calculated based on the corresponding similarity score weights and resource cost score weights, as well as the similarity score and resource cost score.
[0026] If the grade score meets the preset threshold, then the second special effects resource is determined to be of the corresponding grade, including:
[0027] If one of the calculated scores for different levels meets the corresponding preset threshold, then the second special effects resource is determined to be of the corresponding level.
[0028] In one embodiment, the preset rules include a score calculation method for three different special effects levels: high, medium, and low.
[0029] Among them, the similarity between the medium-level special effects resources and the original special effects resources is greater than the preset similarity.
[0030] The resource cost score for low-level special effects is less than the preset resource cost.
[0031] In one embodiment, the similarity score weight is 0 in the scoring method for advanced special effects level;
[0032] In the scoring method for intermediate-level special effects, the similarity score has a greater weight than the resource cost score.
[0033] In the scoring method for low-level special effects, the similarity score has a lower weight than the resource cost score.
[0034] In one embodiment, the resource overhead score is calculated based on at least one of the following: average number of rendering passes, average number of particles, screen ratio, and duration of the second special effects resource, including:
[0035] The resource cost score is calculated based on several factors, including the average number of rendering processes, the average number of particles, the screen ratio, and the duration of the second special effects resource.
[0036] For each resource cost score, the score calculation method for each effect level has multiple preset different resource cost score weights;
[0037] In the scoring method for intermediate-level special effects, the similarity score has a greater weight than the individual resource cost scores.
[0038] In the scoring method for low-level special effects, the similarity score has a smaller weight than the partial resource cost score.
[0039] In one embodiment, after determining that the second special effects resource is of the corresponding level, the method further includes:
[0040] Based on the composition structure of the second special effects resource, generate the corresponding configuration file;
[0041] The configuration file is used to instruct the client to display the corresponding special effects resources according to the configuration file.
[0042] In a second aspect of this application, a special effects resource processing apparatus is provided, comprising:
[0043] The acquisition module is configured to acquire a first special effects resource and a second special effects resource, wherein both the first and second special effects resources include at least one sub-effect, and the second special effects resource is a subset of the first special effects resource;
[0044] The calculation module is configured to calculate the similarity score between the second special effects resource and the first special effects resource, as well as the resource cost score of the second special effects resource;
[0045] The determination module is configured to determine the second special effects resource as the corresponding level if the sum of the similarity score and the resource cost score of the second special effects resource meets a preset threshold.
[0046] In a third aspect of this application, a computer-readable storage medium is provided, which includes instructions that, when executed on a computer, cause the computer to perform the method as described in the first aspect, or to perform the method as described in the second aspect.
[0047] In a fourth aspect of this application, a computing device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method of the first aspect or the method of the second aspect.
[0048] According to the special effects resource processing method, apparatus, storage medium, and computing device of this application, the level of the special effects resource to be processed is automatically determined by calculating the similarity score between the special effects resource to be processed and the original special effects resource, as well as the resource cost score of the special effects resource to be processed itself, and comparing them with a preset threshold. This eliminates the need for manual intervention, facilitating automatic grading by special effects creators during special effects production. It significantly reduces the processing cost and time for special effects resource grading, providing a better user experience. Furthermore, the special effects resource processing method provided in this application can also automatically process and grade existing special effects resources without manual intervention, further reducing the grading cost and time for existing special effects resources. Attached Figure Description
[0049] The above and other objects, features, and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of the present application are illustrated in the drawings by way of example and not limitation, wherein:
[0050] Figure 1 This is a schematic diagram illustrating application scenarios of the special effects resource processing method in some embodiments of this application;
[0051] Figure 2 This is a flowchart illustrating a special effects resource processing method according to an embodiment of this application;
[0052] Figure 3 This is a schematic diagram illustrating the composition of the first and second special effects resources according to an embodiment of this application.
[0053] Figure 4 This is a schematic diagram of the interface of a special effects editor according to an embodiment of this application;
[0054] Figure 5 This is a tree structure diagram of special effects resources including multiple sub-effects, which is another embodiment of this application;
[0055] Figure 6 This is a schematic diagram of the structure of a special effects resource processing device according to an embodiment of this application;
[0056] Figure 7 This is a schematic diagram of the structure of a computer-readable storage medium according to an embodiment of this application;
[0057] Figure 8This is a schematic diagram of the structure of a computing device according to an embodiment of this application.
[0058] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation
[0059] The principles and spirit of this application will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement this application, and are not intended to limit the scope of this application in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.
[0060] Those skilled in the art will recognize that the embodiments of this application can be implemented as a system, apparatus, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0061] Furthermore, the number of any elements in the accompanying drawings is for illustrative purposes only and not for limitation, and any naming is for distinction only and has no limiting meaning.
[0062] According to embodiments of this application, a method, apparatus, storage medium, and computing device for processing special effects resources are proposed, which can automatically perform hierarchical processing of special effects resources without manual operation, saving processing time and processing costs, and bringing a good user experience.
[0063] The technical solution of this application will be described in detail below with reference to several embodiments.
[0064] Application Scenarios Overview
[0065] Please refer to Figure 1 This diagram illustrates the structural structure of an application environment involved in the special effects resource processing method provided in this application embodiment. The application environment may include a terminal 01 and a server 02. The terminal 01 may be a computer, tablet computer, smartphone, etc. The server 02 may be a single server, a server cluster consisting of several servers, or a cloud computing service center. Furthermore, the terminal 01 and the server 02 can establish a connection via a wired or wireless network.
[0066] Terminal 01 can send special effects resources to server 02. Server 02 can process the special effects resources using the special effects resource processing method provided in this application embodiment to obtain the level of the special effects resource, and then return the level of the special effects resource to terminal 01. Alternatively, server 02 can process the special effects resource using the special effects resource processing method provided in this application embodiment, automatically turn off each sub-effect of the special effects resource, calculate the score of the special effects resource after turning off a certain sub-effect, match it with a preset threshold, and finally determine several child special effects resources of different levels from the special effects resource, and return several child special effects resources of different levels to terminal 01.
[0067] It should be noted that this implementation environment may also include only terminal 01, excluding server 02. Terminal 01 can directly use the special effects resource processing method of this application embodiment to perform hierarchical processing on the special effects resources stored therein. In this implementation, terminal 01 may also be a server, a server cluster consisting of several servers, or a cloud computing service center.
[0068] The special effects resource processing method provided in this application embodiment can also be applied to the processing of other display resources, such as the hierarchical processing of web page display components. Web page display components also need to occupy the hardware or software resources of the terminal device for rendering. Therefore, the special effects resource processing method provided in this application embodiment can be used to perform the same hierarchical processing on web page components, so as to facilitate the display of the best effect on high-end devices and the smooth rendering of web pages on low-end devices.
[0069] Exemplary methods
[0070] The following is combined Figure 1 Application scenarios, refer to Figure 2 This application describes a method for processing special effects resources according to exemplary embodiments. This method is applicable to a computing device, which may be terminal 01 or server 02 as listed in the application scenarios above. This application does not limit the product form or structure of the computing device executing this special effects resource processing method. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way in this respect. Rather, the embodiments of this application can be applied to any applicable scenario.
[0071] In one embodiment of this application, a special effects resource processing method is provided, comprising:
[0072] Step S110: Obtain the first special effects resource and the second special effects resource;
[0073] In this embodiment, a first special effects resource and a second special effects resource are first obtained, wherein the second special effects resource is the special effects resource to be processed. In some embodiments of this application, the second special effects resource needs to be rated. (Refer to...) Figure 3 Both the first and second special effects resources include at least one sub-effect. The first special effects resource is generally an original special effects resource or a complete special effects resource. For example, if a special effect A includes sub-effects a1 to a5, then special effect A can be considered as a set of sub-effects a1 to a5. If special effect A is the first special effects resource, then the second special effects resource is a subset of the first special effects resource, that is, a subset of special effect A, which includes one or more of the sub-effects a1 to a5. Figure 3 As shown, the second special effects resource includes sub-effects a1~a4.
[0074] In one embodiment of this application, the second special effects resource can be a currently real-time special effects resource awaiting grading. That is, the special effects creator has produced a complete special effects set, and then needs to determine several different levels of child special effects from this complete set. Therefore, the complete special effects set can be edited to determine the different levels of child special effects, such as... Figure 4 As shown, for example, you can uncheck one or more sub-effects or slide the particle percentage control bar.
[0075] After obtaining the first special effects resource and the second special effects resource, the next step is to execute step S120 to calculate the similarity score between the second special effects resource and the first special effects resource, as well as the resource cost score of the second special effects resource.
[0076] In this embodiment, the second special effects resource to be graded or processed is compared with the original special effects resource (first special effects resource) to determine the display effect of the second special effects resource, and the resource cost of the second special effects resource is calculated to determine the cost-effectiveness of the second special effects resource, i.e., the comprehensive score used for grading.
[0077] In one embodiment of this application, the method for calculating the similarity score between the second special effects resource and the first special effects resource includes at least one of the following:
[0078] Structural similarity, Hausdorff distance, and root mean square error.
[0079] The following embodiment of this application details how to determine the similarity score between the second special effects resource and the first special effects resource based on structural similarity. The calculation of the similarity score between the second special effects resource and the first special effects resource using structural similarity includes:
[0080] Obtain one frame image of the first special effects resource and the second special effects resource respectively;
[0081] In this embodiment, considering that special effects resources generally have a duration attribute, that is, the display of special effects resources is equivalent to playing a video, special effects resources are three-dimensional. If we want to compare the similarity between the first special effects resource and the second special effects resource, it is equivalent to calculating the similarity between two videos, which has a high computational complexity.
[0082] Considering that each frame of a special effects resource is equally important when it is displayed, that is, the special effects displayed in each frame are the same or similar, in this embodiment, one frame of each of the first and second special effects resources can be obtained respectively, and the video similarity calculation can be replaced by the image similarity calculation. Therefore, the similarity calculation between special effects resources is more convenient and simple.
[0083] After obtaining one frame each of the first and second special effects resources, the next step is to calculate the structural similarity (SSIM) score between the two frames, and use the structural similarity score as the similarity score between the second and first special effects resources.
[0084] Structural similarity ranges from -1 to 1. When two images are identical, the SSIM value equals 1. In this embodiment, we assume the letter E represents the similarity score, E = 1 – SSIM value.
[0085] In the prior art, when performing SSIM calculation on two images, two-dimensional Gaussian convolution is often used to process the two images separately. Considering that two-dimensional Gaussian convolution is equivalent to two one-dimensional Gaussian convolutions, in order to reduce computational complexity, in one embodiment of this application, when calculating the SSIM of two images, the original two-dimensional Gaussian convolution is transformed into performing one one-dimensional Gaussian convolution in different dimensions, that is, the computational complexity is changed from O(n²r²) to O(n²r), where r is the size parameter of the Gaussian kernel.
[0086] In another embodiment of this application, to calculate the structural similarity score between two frame images more quickly and efficiently, a symmetric filter is used to process the two frame images respectively, so as to calculate the average grayscale, brightness contrast value, and contrast contrast value of the two frame images. Specifically, considering that the Gaussian convolution kernel has symmetry, that is, when calculating the SSIM value, the Gaussian convolution calculation used is an even function, thus, using a symmetric filter to process the image for calculation can save half of the computational load.
[0087] In this embodiment, the use of a symmetric filter implements a one-dimensional convolution function, providing a fast calculation method for Gaussian convolution.
[0088] After introducing how to calculate the similarity score between the second special effects resource and the first special effects resource, the following describes how to calculate the resource cost score of the second special effects resource. In one embodiment of this application, calculating the resource cost score of the second special effects resource includes:
[0089] The resource overhead score is calculated based on at least one of the following: average number of rendering processes, average number of particles, screen ratio, and duration of the second special effects resource;
[0090] Specifically, when calculating the resource overhead score based on the average of the drawing process of the second special effects resource, the calculation can be achieved by first obtaining the number of DPs for each frame of the special effects resource, and then averaging the DPs across the total number of frames to measure the CPU load. Assuming the resource overhead score calculated based on DP is A, then A = average DP / reference value. In this embodiment, the reference value can be determined based on the maximum number of DPs that can be provided to the special effects resource given the product's complexity. Those skilled in the art can determine this value according to actual needs; for example, the reference value agreed upon in games is 50.
[0091] It should be noted that the drawing process (DP, Draw Primitive) refers to a primitive drawing API call process, or a DC (draw call), which represents an execution process of drawing a three-dimensional spatial geometry and its material to a two-dimensional frame image buffer.
[0092] When calculating the resource overhead score based on the average number of particles in the second special effects resource, specifically in this embodiment, the number of particles in each frame of the special effects resource during playback can be obtained, and then the average number of all frames can be calculated to measure the CPU load. Updating particles in each frame consumes significant CPU computing resources. Assuming the resource overhead score based on particle calculation is B, then B = average number of particles / reference value. In this embodiment, the reference value can be obtained based on historical product data, and those skilled in the art can determine it according to actual needs; for example, the reference value agreed upon in games is 55.
[0093] When calculating the resource overhead score based on the screen ratio of the second special effects resource, specifically, in this embodiment, the screen ratio refers to the proportion of pixels occupied by the special effects resource when displayed on the screen. In this embodiment, the frame image data used in calculating similarity can be directly used. In this embodiment, it is assumed that the resource overhead score calculated based on the screen ratio is C.
[0094] When calculating the resource cost score based on the duration of the second special effects resource, specifically, in this embodiment, the duration refers to the effective display duration of the special effects resource, lifespan. Assuming the resource cost score calculated based on time is D, then D = min(lifespan / reference value, 1), where 1 indicates that the number of loop playbacks is 1. In this embodiment, the reference value can also be a product experience value, which can be determined by those skilled in the art according to actual needs. For example, the reference value agreed upon by the game is 400 seconds.
[0095] It is understood that although this embodiment describes how to calculate the resource cost score of special effects resources from four dimensions: average number of rendering processes, average number of particles, screen ratio, and duration, in other embodiments of this application, the resource cost score of special effects resources can also be calculated from other dimensions, such as color histograms. It is also understood that in some embodiments, the resource cost scores calculated from each dimension can be integrated into a whole as the resource cost score of the special effects resource.
[0096] After explaining how to calculate the similarity score between the second special effects resource and the first special effects resource, and how to calculate its own resource cost score, the next step is to execute step S130. If the sum of the similarity score and the resource cost score of the second special effects resource meets the preset threshold, then the second special effects resource is determined to be of the corresponding level.
[0097] In one embodiment of this application, the grade score of the second special effects resource can be calculated based on the similarity score and resource cost score according to preset rules;
[0098] Specifically, the preset rule may be to simply add the similarity score and the resource cost score together as the grade score of the second special effects resource;
[0099] If the grade score meets the preset threshold, then the second special effects resource is determined to be of the corresponding grade;
[0100] In this embodiment, a preset threshold can be set for each preset level. For example, the threshold for high level is S1, the threshold for medium level is S2, and the threshold for low level is S3. The second special effect resource is determined to be of the corresponding level based on which threshold range the level score falls into. That is, regardless of the level, the level score is calculated in the same way.
[0101] It is understood that, in one embodiment of this application, different weights may be preset for the similarity score and the resource cost score, so that the display effect or resource cost is the focus when performing the classification.
[0102] In another embodiment of this application, the preset rules include multiple preset score calculation methods for different special effects levels, and each special effects level score calculation method presets different similarity score weights and resource cost score weights;
[0103] In this embodiment, a different score calculation method can be preset for each different level. This considers that different levels emphasize different indicators; for example, mid-level special effects resources tend to be closer to the original special effects resources in terms of display effect, while low-level special effects resources tend to have the best performance, i.e., the lowest possible resource overhead. Therefore, according to preset rules, based on the similarity score and resource overhead score, the level score of the second special effects resource is calculated, including:
[0104] For different special effects levels, the level scores of the second special effects resource for different special effects levels are calculated based on the corresponding similarity score weights and resource cost score weights, as well as the similarity score and resource cost score.
[0105] In this embodiment, the advanced preset similarity score weight Qh1 and resource cost score weight Qh2, the intermediate preset similarity score weight Qm1 and resource cost score weight Qm2, and the advanced preset similarity score weight Ql1 and resource cost score weight Ql2 can be assigned respectively.
[0106] Therefore, after obtaining the similarity score S1 and resource cost score S2 of the second special effects resource, the scores for each level can be calculated according to their respective weights:
[0107] Advanced score Sh = Qh1*S1 + Qh2*S2;
[0108] Intermediate score Sm = Qm1*S1 + Qm2*S2;
[0109] The lower-order fraction Sl = Ql1*S1 + Ql2*S2;
[0110] If the grade score meets the preset threshold, then the second special effects resource is determined to be of the corresponding grade, including:
[0111] If one of the calculated scores of different levels meets the corresponding preset threshold, then the second special effects resource is determined to be of the corresponding level;
[0112] After calculating the scores for each level of the second special effects resource, it is possible to determine whether the second special effects resource can be of the corresponding level based on the corresponding preset thresholds. For example, the preset threshold for high level is Ph, the preset threshold for medium level is Pm, and the preset threshold for high level is Pl. If Sh meets Ph, then the second special effects resource is determined to be high level.
[0113] In addition, in order to emphasize different indicators for different special effects levels, in one embodiment of this application, the weight settings for different levels can be adjusted accordingly so that the similarity between the special effects resources of the intermediate special effects level and the original special effects resources is greater than the preset similarity and the resource cost score of the special effects resources of the low special effects level is less than the preset resource cost.
[0114] Considering that advanced special effects are intended to display the best effect on terminal devices, that is, advanced special effects can display the original special effects, in one embodiment of this application, the similarity score weight is 0 in the score calculation method of advanced special effects level;
[0115] In the scoring method for intermediate-level special effects, the similarity score has a greater weight than the resource cost score.
[0116] In the scoring method for low-level special effects, the similarity score has a lower weight than the resource cost score.
[0117] In this embodiment, the specific value of the similarity score is inversely proportional to the similarity, and the specific value of the resource cost score is directly proportional to the resource cost; that is, the higher the similarity, the lower the similarity score; the smaller the resource cost, the smaller the resource cost score. Therefore, in one embodiment of this application, the lower the grade score calculated based on the similarity score and the resource cost score, the better. Only when it is small enough can it fall into the preset threshold of the corresponding grade.
[0118] It is understood that in this embodiment, the grade score is set to be as small as possible after calculation; in another embodiment, the grade score can also be set to be as large as possible after calculation. Correspondingly, the weight settings of similarity score and resource cost score and the threshold settings of each grade can be adjusted accordingly, which will not be elaborated here.
[0119] To more accurately calculate the grade score of the second special effects resource, the resource cost score is calculated based on at least one of the following: average number of rendering passes, average number of particles, screen ratio, and duration of the second special effects resource, including:
[0120] The resource cost score is calculated based on several factors, including the average number of rendering processes, the average number of particles, the screen ratio, and the duration of the second special effects resource.
[0121] For each resource cost score, the score calculation method for each effect level has multiple preset different resource cost score weights;
[0122] In one embodiment of this application, resource cost scores A, B, C, and D are calculated based on the average number of rendering processes, average number of particles, screen ratio, and duration of the second special effects resource. Therefore, in one embodiment of this application, the level score of the second special effects can be determined by comprehensively considering the resource cost scores of the four dimensions A, B, C, and D; specifically, different weights can be preset for each resource cost score according to the score calculation method for each level, for example:
[0123] Advanced score Sh = Qh1*S1 + Qha*A + Qhb*B + Qhc*C + Qhd*D;
[0124] Intermediate score Sm = Qm1*S1 + Qma*A + Qmb*B + Qmc*C + Qmd*D;
[0125] The lower-order fraction Sl = Ql1*S1 + Qla*A + Qlb*B + Qlc*C + Qld*D;
[0126] It is understood that in some embodiments, the similarity score is also referred to as E, that is, E and S1 in this embodiment can both represent the similarity score;
[0127] In addition, in order to emphasize different dimensions of indicators for different levels of special effects resources, in the scoring method of intermediate special effects level, the similarity score has a greater weight than the individual resource cost scores; in the scoring method of low-level special effects level, the similarity score has a smaller weight than the individual resource cost scores.
[0128] It is understood that the above embodiments describe a real-time (online) rating method for special effects. For example, when special effects artists are editing special effects, they can rate the special effects resources in real time and recommend the level of special effects. In one embodiment, the method described above can be integrated into a special effects editor (e.g., Figure 3 The effects editor (as shown) allows effects creators to promptly grade the effects they are working on.
[0129] The above embodiments of this application describe how to rate special effects resources in real time and recommend special effects levels when special effects producers are editing special effects. Next, in another embodiment of this application, we describe how to automatically classify existing special effects resources, that is, how to process special effects resources offline to obtain a complete set of special effects resources with different level configurations for children.
[0130] In this embodiment, the second special effects resource is the same as the first special effects resource. If the sum of the similarity score and the resource cost score of the second special effects resource does not meet the preset threshold, one sub-effect of the second special effects resource is turned off to obtain an updated second special effects resource. The similarity score and resource cost score between the updated second special effects resource and the first special effects resource are recalculated until the sum of the similarity score and the resource cost score between the updated second special effects resource and the first special effects resource meets the preset threshold. The updated second special effects resource is then determined to be of the corresponding level.
[0131] In this embodiment, firstly, different scoring methods can be used to calculate the score of the second special effects resource at each level. Then, it is determined whether the second special effects resource naturally meets a certain level. The specific scoring methods for each level can adopt the various methods listed in the real-time grading embodiment, which will not be elaborated here. If the second special effects resource meets the preset threshold of a certain level (e.g., advanced), then the second special effects resource can be determined to correspond to the advanced child special effects resource (i.e., the second special effects resource itself is an advanced special effects resource).
[0132] If the second special effects resource does not meet the preset threshold of a certain level (e.g., intermediate), then the corresponding intermediate-level child special effects resource for the second special effects resource needs to be determined step by step. Specifically, the initial state of the second special effects resource is the same as that of the first special effects resource, that is, it includes all the complete sub-effects. See [link to relevant documentation]. Figure 5 The second special effects resource can be a tree structure formed by various sub-effects. Then, each sub-effect node can be opened and closed in sequence. The difference in level score before and after opening and closing each sub-effect can be calculated. The sub-effect with the largest difference can be closed first. The child special effects resources that meet the preset threshold of the corresponding level can be determined step by step.
[0133] For example, in one embodiment of this application, the sub-effects of the second effect resource can be turned off in order of the difference between the sum of the similarity score and the resource cost score of the second effect resource before and after turning off the sub-effects.
[0134] Specifically, assuming the second special effects resource is special effects B, including sub-effects b1~b7, we can first keep sub-effects b2~b7 on, and then calculate the score difference of the sub-effect set before and after sub-effect b1 is turned on and off. Next, keep sub-effects b1 and b3~b7 on, and calculate the score difference of the sub-effect set before and after sub-effect b2 is turned on and off, and so on, until the score difference of the sub-effect set before and after sub-effect b7 is calculated. Then, we sort the differences of each sub-effect before and after turning on and off, and prioritize turning off the sub-effect with the largest difference before and after turning on and off to form the second special effects resource. Then, we determine whether the second special effects resource meets the preset threshold of the corresponding level.
[0135] If it does not meet the requirements, continue to turn off the sub-effects one by one for comparison. At this time, the total number of sub-effects turned off in the second effect resource is 2. Thus, by recursively traversing each sub-effect, the second effect resource that meets the preset threshold of the corresponding level can be obtained, which is the child effect resource of the first effect resource.
[0136] In the above embodiments of this application, how to classify real-time edited special effects resources and existing special effects resources is described respectively. It can be understood that in order to facilitate the display of different levels of special effects on terminal devices with different performance, it is generally necessary to generate special effects display configuration files of corresponding levels. Therefore, in one embodiment of this application, in order to facilitate the display of special effects resources of various levels on terminal devices, after determining that the second special effects resource is of the corresponding level, the method further includes:
[0137] Based on the composition structure of the second special effects resource, generate the corresponding configuration file;
[0138] The configuration file is used to instruct the client to display the corresponding special effects resources according to the configuration file.
[0139] The special effects resource processing method according to embodiments of this application automatically determines the level of the special effects resource by calculating the similarity score between the special effects resource to be processed and the original special effects resource, as well as the resource cost score of the special effects resource itself, and comparing them with a preset threshold. This requires no manual intervention, facilitating automatic grading by special effects creators during special effects production. It significantly reduces the processing cost and time for special effects resource grading, providing a better user experience. Furthermore, the special effects resource processing method provided in this application can also automatically process and grade existing special effects resources without manual intervention, further reducing the grading cost and time for existing special effects resources.
[0140] Exemplary device
[0141] After introducing the special effects resource processing method of the exemplary embodiments of this application, the following references... Figure 6 The apparatus for processing special effects resources according to the exemplary embodiments of this application can also be applied to the computing devices shown in the application scenarios, and the apparatus includes:
[0142] The acquisition module 610 is configured to acquire a first special effects resource and a second special effects resource, wherein both the first and second special effects resources include at least one sub-effect, and the second special effects resource is a subset of the first special effects resource;
[0143] The calculation module 620 is configured to calculate the similarity score between the second special effects resource and the first special effects resource, as well as the resource cost score of the second special effects resource;
[0144] The determination module 630 is configured to determine the second special effects resource as the corresponding level if the sum of the similarity score and the resource cost score of the second special effects resource meets a preset threshold.
[0145] In one embodiment of this application, the second special effects resource is the same as the first special effects resource;
[0146] The calculation module 620 is further configured to, if the sum of the similarity score and the resource cost score of the second special effect resource does not meet a preset threshold, close one sub-effect of the second special effect resource, obtain an updated second special effect resource, and recalculate the similarity score and resource cost score between the updated second special effect resource and the first special effect resource until the sum of the similarity score and the resource cost score between the updated second special effect resource and the first special effect resource meets the preset threshold;
[0147] The determining module 630 is also configured to determine the updated second special effects resource as the corresponding level.
[0148] In one embodiment of this application, the calculation module 620 is further configured to disable each sub-effect of the second effect resource in order of the difference between the sum of the similarity score and the resource cost score of the second effect resource before and after each sub-effect is turned on and off.
[0149] In one embodiment of this application, the calculation module 620 is further configured to calculate a similarity score between the second special effects resource and the first special effects resource by at least one of the following:
[0150] Structural similarity, Hausdorff distance, and root mean square error;
[0151] In one embodiment of this application, the computing module 620 is further configured to acquire a frame image of the first special effects resource and the second special effects resource, respectively; and
[0152] Calculate the structural similarity score between two frame images, and use the structural similarity score as the similarity score between the second special effects resource and the first special effects resource.
[0153] In one embodiment of this application, the calculation module 620 is further configured to use a one-dimensional Gaussian convolution kernel to process the two frame images respectively when calculating the structural similarity between the two frame images, so as to calculate the average gray level, brightness contrast value and contrast contrast value of the two frame images.
[0154] In one embodiment of this application, the calculation module 620 is further configured to use a symmetric filter to process the two frame images respectively when calculating the structural similarity between the two frame images, so as to calculate the average gray level, brightness contrast value and contrast contrast value of the two frame images.
[0155] In one embodiment of this application, the calculation module 620 is further configured to calculate the resource overhead score based on at least one of the following: the average number of rendering processes of the second special effects resource, the average number of particles, the screen ratio, and the duration.
[0156] In one embodiment of this application, the calculation module 620 is further configured to calculate the grade score of the second special effects resource based on the similarity score and the resource cost score according to preset rules;
[0157] The determining module 630 is further configured to determine the second special effects resource as the corresponding level if the level score meets a preset threshold.
[0158] In one embodiment of this application, the preset rules include multiple preset score calculation methods for different special effects levels, and each special effects level score calculation method presets different similarity score weights and resource cost score weights;
[0159] In one embodiment of this application, the calculation module 620 is further configured to calculate the level score of the second special effect resource for different special effect levels based on the corresponding similarity score weight and resource cost score weight, as well as the similarity score and resource cost score;
[0160] The determining module 630 is further configured to determine the second special effects resource as the corresponding level if one of the calculated different level scores meets the corresponding preset threshold.
[0161] In one embodiment of this application, the preset rules include a score calculation method for three different special effects levels: high, medium, and low.
[0162] Among them, the similarity between the medium-level special effects resources and the original special effects resources is greater than the preset similarity.
[0163] The resource cost score for low-level special effects is less than the preset resource cost.
[0164] In one embodiment of this application, the similarity score weight is 0 in the score calculation method for advanced special effects level;
[0165] In the scoring method for intermediate-level special effects, the similarity score has a greater weight than the resource cost score.
[0166] In the scoring method for low-level special effects, the similarity score has a lower weight than the resource cost score.
[0167] In one embodiment of this application, the calculation module 620 is further configured to calculate a resource overhead score based on multiple factors including the average number of rendering processes, the average number of particles, the screen ratio, and the duration of the second special effects resource.
[0168] For each resource cost score, the score calculation method for each effect level has multiple preset different resource cost score weights;
[0169] In the scoring method for intermediate-level special effects, the similarity score has a greater weight than the individual resource cost scores.
[0170] In the scoring method for low-level special effects, the similarity score has a smaller weight than the partial resource cost score.
[0171] In one embodiment of this application, the apparatus further includes:
[0172] The generation module is configured to generate a corresponding configuration file based on the composition structure of the second special effects resource;
[0173] The configuration file is used to instruct the client to display the corresponding special effects resources according to the configuration file.
[0174] The special effects resource processing apparatus according to embodiments of this application automatically determines the level of the special effects resource to be processed by calculating the similarity score between the special effects resource to be processed and the original special effects resource, as well as the resource cost score of the special effects resource itself, and comparing them with a preset threshold. This requires no manual intervention, facilitating automatic grading by special effects creators during special effects production. It significantly reduces the processing cost and time for special effects resource grading, providing a better user experience. Furthermore, the special effects resource processing method provided in this application can also automatically process and grade existing special effects resources without manual intervention, further reducing the grading cost and time for existing special effects resources.
[0175] Exemplary media
[0176] After introducing the methods and apparatus of exemplary embodiments of this application, the following references are made. Figure 7The computer-readable storage medium of the exemplary embodiment of this application will be described. The computer-readable storage medium shown is an optical disc 70, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it implements the steps described in the above method embodiment. For example, it acquires a first special effects resource and a second special effects resource, both of which include at least one sub-special effects. The second special effects resource is a subset of the first special effects resource. It calculates the similarity score between the second special effects resource and the first special effects resource, as well as the resource cost score of the second special effects resource. If the sum of the similarity score and the resource cost score of the second special effects resource meets a preset threshold, the second special effects resource is determined to be of the corresponding level. The specific implementation of each step will not be repeated here.
[0177] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here.
[0178] Exemplary computing device
[0179] After introducing the methods, apparatus, and storage media of exemplary embodiments of this application, the following references are made. Figure 8 A computing device for processing special effects resources according to an exemplary embodiment of this application.
[0180] Figure 8 A block diagram is shown of an exemplary computing device 80 suitable for implementing embodiments of the present application. The computing device 80 may be a computer system or a server. Figure 8 The computing device 80 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0181] like Figure 8 As shown, the components of the computing device 80 may include, but are not limited to: one or more processors or processing units 801, system memory 802, and bus 803 connecting different system components (including system memory 802 and processing unit 801).
[0182] The computing device 80 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computing device 80, including volatile and non-volatile media, removable and non-removable media.
[0183] System memory 802 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 8021 and / or cache memory 8022. Computing device 80 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, ROM 8023 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 8 (Not shown in the image, usually referred to as "hard drive"). Although not shown in... Figure 8 The diagram illustrates that a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) can be provided. In these cases, each drive can be connected to bus 803 via one or more data media interfaces. System memory 802 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.
[0184] A program / utility 8025 having a set (at least one) of program modules 8024 may be stored, for example, in system memory 802, and such program modules 8024 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment. Program modules 8024 typically perform the functions and / or methods described in the embodiments of this application.
[0185] The computing device 80 can also communicate with one or more external devices 804 (such as a keyboard, pointing device, display, etc.). This communication can be performed through the input / output (I / O) interface 805. Furthermore, the computing device 80 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 806. Figure 8 As shown, network adapter 806 communicates with other modules of computing device 80 (such as processing unit 801) via bus 803. It should be understood that, although... Figure 8 As not shown, it can be used in conjunction with computing device 80 with other hardware and / or software modules.
[0186] The processing unit 801 executes various functional applications and data processing by running programs stored in the system memory 802. For example, it acquires a first special effects resource and a second special effects resource, each including at least one sub-effect, with the second special effects resource being a subset of the first special effects resource; calculates the similarity score between the second and first special effects resources, and the resource cost score of the second special effects resource; if the sum of the similarity score and the resource cost score of the second special effects resource meets a preset threshold, then the second special effects resource is determined to be of the corresponding level. The specific implementation methods of each step will not be repeated here.
[0187] It should be noted that although several units / modules or sub-units / sub-modules of the special effects resource processing device are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules for embodiment.
[0188] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0189] While the spirit and principles of this application have been described with reference to several specific embodiments, it should be understood that this application is not limited to the specific embodiments claimed, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for convenience of expression. This application is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A method for processing special effects resources, characterized in that, The method includes: Obtain a first special effects resource and a second special effects resource, each of which includes at least one sub-effect, and the second special effects resource is a subset of the first special effects resource; Calculate the similarity score between the second special effects resource and the first special effects resource, as well as the resource cost score of the second special effects resource; If the sum of the similarity score and the resource cost score of the second special effects resource meets the preset threshold, then the second special effects resource is determined to be of the corresponding level. The second special effects resource is the same as the first special effects resource; If the sum of the similarity score and the resource cost score of the second special effect resource does not meet the preset threshold, then one sub-effect of the second special effect resource is turned off to obtain an updated second special effect resource. The similarity score and resource cost score between the updated second special effect resource and the first special effect resource are recalculated until the sum of the similarity score and resource cost score between the updated second special effect resource and the first special effect resource meets the preset threshold, and the updated second special effect resource is determined to be of the corresponding level.
2. The special effects resource processing method as described in claim 1, characterized in that, The sub-effects of the second effect resource are turned off in order of the difference between the sum of the similarity score and the resource cost score before and after each sub-effect is turned on and off.
3. The special effects resource processing method as described in claim 1, characterized in that, The method for calculating the similarity score between the second special effects resource and the first special effects resource includes at least one of the following: Structural similarity, Hausdorff distance, and root mean square error; The calculation of the similarity score between the second special effects resource and the first special effects resource based on structural similarity includes: Obtain one frame image of the first special effects resource and the second special effects resource respectively; Calculate the structural similarity score between two frame images, and use the structural similarity score as the similarity score between the second special effects resource and the first special effects resource.
4. The special effects resource processing method as described in claim 3, characterized in that, When calculating the structural similarity between two frame images, a one-dimensional Gaussian convolution kernel is used to process the two frame images respectively, so as to calculate the average gray level, brightness contrast value and contrast contrast value of the two frame images.
5. The special effects resource processing method as described in claim 3, characterized in that, When calculating the structural similarity between two frame images, a symmetric filter is used to process the two frame images respectively in order to calculate the average gray level, brightness contrast value and contrast contrast value of the two frame images.
6. The special effects resource processing method as described in claim 1, characterized in that, Calculating the resource cost score for the second special effects resource includes: The resource overhead score is calculated based on at least one of the following: average number of rendering processes, average number of particles, screen ratio, and duration of the second special effects resource.
7. The special effects resource processing method as described in any one of claims 1-3, characterized in that, If the sum of the similarity score and resource cost score of the second special effects resource meets a preset threshold, then the second special effects resource is determined to be of the corresponding level, including: According to preset rules, the grade score of the second special effects resource is calculated based on the similarity score and resource cost score; If the grade score meets the preset threshold, then the second special effects resource is determined to be of the corresponding grade.
8. The special effects resource processing method as described in claim 7, characterized in that, The preset rules include multiple preset score calculation methods for different special effects levels, and each special effects level score calculation method presets different similarity score weights and resource cost score weights; According to preset rules, based on the similarity score and resource cost score, the grade score of the second special effects resource is calculated, including: For different special effects levels, the level scores of the second special effects resource for different special effects levels are calculated based on the corresponding similarity score weights and resource cost score weights, as well as the similarity score and resource cost score. If the grade score meets the preset threshold, then the second special effects resource is determined to be of the corresponding grade, including: If one of the calculated scores for different levels meets the corresponding preset threshold, then the second special effects resource is determined to be of the corresponding level.
9. The special effects resource processing method as described in claim 8, characterized in that, The preset rules include three different score calculation methods for special effects levels: high, medium, and low. Among them, the similarity between the medium-level special effects resources and the original special effects resources is greater than the preset similarity. The resource cost score for low-level special effects is less than the preset resource cost.
10. The special effects resource processing method as described in claim 9, characterized in that, In the scoring method for advanced special effects, the similarity score has a weight of 0. In the scoring method for intermediate-level special effects, the similarity score has a greater weight than the resource cost score. In the scoring method for low-level special effects, the similarity score has a lower weight than the resource cost score.
11. The special effects resource processing method as described in claim 8, characterized in that, The resource overhead score is calculated based on at least one of the following: average number of rendering passes, average number of particles, screen ratio, and duration of the second special effects resource, including: The resource cost score is calculated based on several factors, including the average number of rendering processes, the average number of particles, the screen ratio, and the duration of the second special effects resource. For each resource cost score, the score calculation method for each effect level has multiple preset different resource cost score weights; In the scoring method for intermediate-level special effects, the similarity score has a greater weight than the individual resource cost scores. In the scoring method for low-level special effects, the similarity score has a smaller weight than the partial resource cost score.
12. The special effects resource processing method as described in claim 1, characterized in that, After determining that the second special effects resource is of the corresponding level, the method further includes: Based on the composition structure of the second special effects resource, generate the corresponding configuration file; The configuration file is used to instruct the client to display the corresponding special effects resources according to the configuration file.
13. A special effects processing device, characterized in that, The device includes: The acquisition module is configured to acquire a first special effects resource and a second special effects resource, wherein both the first and second special effects resources include at least one sub-effect, and the second special effects resource is a subset of the first special effects resource; The calculation module is configured to calculate the similarity score between the second special effects resource and the first special effects resource, as well as the resource cost score of the second special effects resource; The determination module is configured to determine the second special effects resource as the corresponding level if the sum of the similarity score and the resource cost score of the second special effects resource meets a preset threshold. The second special effects resource is the same as the first special effects resource; If the sum of the similarity score and the resource cost score of the second special effect resource does not meet the preset threshold, then one sub-effect of the second special effect resource is turned off to obtain an updated second special effect resource. The similarity score and resource cost score between the updated second special effect resource and the first special effect resource are recalculated until the sum of the similarity score and resource cost score between the updated second special effect resource and the first special effect resource meets the preset threshold, and the updated second special effect resource is determined to be of the corresponding level.
14. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-12.
15. A computing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 12.
Citation Information
Patent Citations
Game-special-effect processing method and device
CN109529329A