A method for batch testing the performance of Untiy special effect particles at runtime
By automatically scanning and detecting the performance of special effects particles when Unity special effects particles are running, a detailed detection report is generated, which solves the problem of low efficiency in the existing technology and achieves efficient and accurate performance detection of special effects particles.
Patent Information
- Application Number
- CN202111150941.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2041-09-29
AI Technical Summary
In the existing technology, the method of checking the performance of Unity special effect particles is inefficient and requires artists to manually check, resulting in a heavy workload and low efficiency.
Provides a method to batch detect the performance of Unity special effects particles at runtime by loading special effects files, mounting the special effects detection script module, traversing each special effects particle system, and using cameras and players to detect special effects parameters, including texture memory, in static special effects frames. , the number of textures, the number of particles, the number of draw calls and the overdraw rate, and generate a detection report.
It realizes automated detection of the performance of special effect particles, improves detection efficiency, and outputs true and accurate detection results, reducing the workload of artists and improving detection efficiency.
Smart Images

Figure CN113908541B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of special effect particle performance detection, and in particular relates to a method for batch detecting the performance of Unity special effect particles at runtime. Background Art
[0002] With the rapid development of the Internet and the upgrading of mobile technology, which have become an extension of digital infrastructure and interactive entertainment scenarios, online games have gradually become an indispensable life experience. Online games play a role in entertainment, social interaction and fun experience in society. With the continuous updating of various online game technologies and the improvement of peripheral equipment, the expressiveness of game graphics has become an important performance for players to experience and measure quality. Major game manufacturers actively promote the continuous improvement of R&D technology level of people in the online game industry, so as to optimize the quality of game graphics and enhance the player experience.
[0003] In online games, Unity is a game development engine, and special effect particles are a resource file that can be recognized by the Unity engine. Special effect particles are composed of a large number of simple small images or grids that are presented or moved. Each special effect particle represents a small part of a fluid or amorphous entity, and many special effect particles together create a complete sense of reality. Take the smoke cloud as an example. Each special effect particle has the texture of fine smoke, and its own shape is similar to a miniature cloud. In the scene, a large number of these miniature clouds are arranged and combined to create a larger overall cloud effect, which can increase the real effect performance in the game.
[0004] In the prior art, the quality of special effect images formed by special effect particles is checked manually by artists. Since the amount of special effect resources in game projects is very large, the workload of special effect particle performance inspection is large and the inspection efficiency is low. Summary of the invention
[0005] In view of the defects of the prior art, the present invention provides a method for batch detecting the performance of Untiy special effect particles at runtime, which can effectively solve the above problems.
[0006] The technical solution adopted by the present invention is as follows:
[0007] The present invention provides a method for batch detecting the performance of Unity special effect particles during runtime, comprising the following steps:
[0008] Step 1, loading a special effect file; wherein the special effect file includes n special effect particle systems; and the special effect file is mounted with a special effect detection script module;
[0009] Step 2, let i=1;
[0010] Step 3, traverse each of the special effect particle systems, and when traversing to the i-th special effect particle system, use the following method to detect the special effect parameters of the i-th special effect particle system:
[0011] Step 3.1, placing the i-th special effect particle system in the imaging field of view of the camera;
[0012] Step 3.1.1, specifically, the i-th special effect particle system includes m static special effect frames, and the m static special effect frames are stacked together in a top-down order, and are represented as: the first static special effect frame, the second static special effect frame, ..., the m-th static special effect frame;
[0013] Step 3.1.2, let j = 1;
[0014] Step 3.1.3, the camera is placed directly above the stacked static special effects frames, with the camera imaging direction facing the topmost static special effects frame;
[0015] Therefore, the jth static special effect frame is imaged into the imaging window of the camera;
[0016] Step 3.2, start the player, the player changes to the playing state, and at the same time triggers the running of the special effect detection script module;
[0017] The player uses the following method to play the jth static special effect frame: the player reads the imaging window of the camera, reads the jth static special effect frame, and draws the jth static special effect frame on the playback interface according to the read jth static special effect frame, thereby completing the playback of the first static special effect frame;
[0018] When the player plays the jth static special effect frame in the playing state, the special effect detection script module runs synchronously and detects the special effect parameters of the jth static special effect frame;
[0019] Step 3.3, then, in the imaging field of view of the camera, for the stacked static special effect frames, cancel the visibility of the jth static special effect frame;
[0020] Determine whether j is equal to m. If the determination result is no, set j=j+1 and return to step 3.2 to enable the player to play the next static special effect frame. During the playback of the next static special effect frame, detect its special effect parameters through the special effect detection script module, and continue to run in this way. If the determination result is yes, it indicates that the playback and special effect parameter detection of m static special effect frames have been completed, and then execute step 3.4;
[0021] Step 3.4, determine whether i is equal to n, if yes, execute step 4; if not, set i=i+1 and return to step 3;
[0022] Step 4: The special effect detection script module outputs the special effect parameters of each special effect particle system detected to form a special effect detection report of the special effect file.
[0023] Preferably, the special effect parameters of each special effect particle system output by the special effect detection script module are obtained in the following manner:
[0024] The special effect detection script module first obtains the special effect parameters corresponding to each static special effect frame belonging to the same special effect particle system; then, it performs statistical calculations on the special effect parameters corresponding to each static special effect frame to obtain the special effect parameters of the special effect particle system.
[0025] Preferably, the special effect parameters of each special effect particle system include: memory occupied by textures, total number of textures, number of special effect particle system components, number of particles, number of draw calls DrawCall, original special effect filling pixels, actual special effect filling pixels and overdraw rate OverDraw.
[0026] Preferably, in step 3.2, when the player plays the jth static special effect frame in the playing state, the special effect detection script module runs synchronously and detects the special effect parameters of the jth static special effect frame, specifically:
[0027] When the special effect detection script module is triggered to run, the special effect detection script module performs the following operations at the same time:
[0028] 1) The special effects detection script module triggers the memory monitoring submodule to detect the memory occupied by the texture when the jth static special effects frame is played;
[0029] 2) The special effect detection script module triggers the texture detection submodule, detects the number of textures used when the jth static special effect frame is played, and obtains the total number of textures;
[0030] 3) The special effect detection script module triggers the special effect particle system component number detection submodule to detect the camera visualization area and obtain the number of special effect particle system components;
[0031] 4) The special effect detection script module triggers the particle number detection submodule to detect the camera visualization area and obtain the particle number;
[0032] 5) The special effect detection script module triggers the first script rendering submodule to detect the number of draw calls DrawCall when the jth static special effect frame is played;
[0033] 6) The special effect detection script module triggers the second script rendering submodule to detect the overdrawing rate OverDraw when the jth static special effect frame is played;
[0034] 7) The special effect detection script module triggers the pixel detection submodule to perform pixel detection on the camera visualization area to obtain the original special effect filling pixel points and the actual special effect filling pixel points.
[0035] The method for batch detecting the performance of Untiy special effect particles during runtime provided by the present invention has the following advantages:
[0036] The present invention provides a method for batch detecting the performance of Untiy special effect particles during runtime, which is a method for automatically scanning and detecting the performance of special effect particles when the special effect particles are running and playing, and exporting a detection report. The method has the advantages of high efficiency in detecting the performance of special effect particles and true and accurate detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A flow chart of a method for batch detecting the performance of Untiy special effect particles during runtime provided by the present invention. DETAILED DESCRIPTION
[0038] In order to make the technical problems, technical solutions and beneficial effects solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0039] The present invention provides a method for batch detecting the performance of Untiy special effect particles during runtime, which is a method for automatically scanning and detecting the performance of special effect particles when the special effect particles are running and playing, and exporting a detection report. The method has the advantages of high efficiency in detecting the performance of special effect particles and true and accurate detection results.
[0040] refer to Figure 1 The present invention provides a method for batch detecting the performance of Untiy special effect particles at runtime, comprising the following steps:
[0041] Step 1, loading a special effect file; wherein the special effect file includes n special effect particle systems; and the special effect file is mounted with a special effect detection script module;
[0042] Step 2, let i=1;
[0043] Step 3, traverse each of the special effect particle systems, and when traversing to the i-th special effect particle system, use the following method to detect the special effect parameters of the i-th special effect particle system:
[0044] Step 3.1, placing the i-th special effect particle system in the imaging field of view of the camera;
[0045] Step 3.1.1, specifically, the i-th special effect particle system includes m static special effect frames, and the m static special effect frames are stacked together in a top-down order, and are represented as: the first static special effect frame, the second static special effect frame, ..., the m-th static special effect frame;
[0046] Step 3.1.2, let j = 1;
[0047] Step 3.1.3, the camera is placed directly above the stacked static special effects frames, with the camera imaging direction facing the topmost static special effects frame;
[0048] Therefore, the jth static special effect frame is imaged into the imaging window of the camera;
[0049] Step 3.2, start the player, the player changes to the playing state, and at the same time triggers the running of the special effect detection script module;
[0050] The player uses the following method to play the jth static special effect frame: the player reads the imaging window of the camera, reads the jth static special effect frame, and draws the jth static special effect frame on the playback interface according to the read jth static special effect frame, thereby completing the playback of the first static special effect frame;
[0051] When the player plays the jth static special effect frame in the playing state, the special effect detection script module runs synchronously and detects the special effect parameters of the jth static special effect frame;
[0052] In this step, when the player plays the jth static special effect frame in the playing state, the special effect detection script module runs synchronously and detects the special effect parameters of the jth static special effect frame, specifically:
[0053] When the special effect detection script module is triggered to run, the special effect detection script module performs the following operations at the same time:
[0054] 1) The special effects detection script module triggers the memory monitoring submodule to detect the memory occupied by the texture when the jth static special effects frame is played;
[0055] 2) The special effect detection script module triggers the texture detection submodule, detects the number of textures used when the jth static special effect frame is played, and obtains the total number of textures;
[0056] 3) The special effect detection script module triggers the special effect particle system component number detection submodule to detect the camera visualization area and obtain the number of special effect particle system components;
[0057] 4) The special effect detection script module triggers the particle number detection submodule to detect the camera visualization area and obtain the particle number;
[0058] 5) The special effect detection script module triggers the first script rendering submodule to detect the number of draw calls DrawCall when the jth static special effect frame is played;
[0059] 6) The special effect detection script module triggers the second script rendering submodule to detect the overdrawing rate OverDraw when the jth static special effect frame is played;
[0060] OverDraw rate: refers to the average overdraw rate per pixel. The calculation method is: the actual total number of drawing times divided by the total number of pixels to obtain the average overdraw rate per pixel.
[0061] 7) The special effect detection script module triggers the pixel detection submodule to perform pixel detection on the camera visualization area to obtain the original special effect filling pixel points and the actual special effect filling pixel points.
[0062] in:
[0063] Original pixel filling point: Get all pixels in all areas of the special effect, and divide the theoretical total rendering number by the number of rendering calls for each time to get the original pixel filling point.
[0064] Actual filled pixels: Get all pixels in the specified area of the special effect, and divide the actual total number of renderings by the number of renderings called each time to get the actual filled pixels.
[0065] Step 3.3, then, in the imaging field of view of the camera, for the stacked static special effect frames, cancel the visibility of the jth static special effect frame;
[0066] Determine whether j is equal to m. If the determination result is no, set j=j+1 and return to step 3.2 to enable the player to play the next static special effect frame. During the playback of the next static special effect frame, detect its special effect parameters through the special effect detection script module, and continue to run in this way. If the determination result is yes, it indicates that the playback and special effect parameter detection of m static special effect frames have been completed, and then execute step 3.4;
[0067] Step 3.4, determine whether i is equal to n, if yes, execute step 4; if not, set i=i+1 and return to step 3;
[0068] Step 4: The special effect detection script module outputs the special effect parameters of each special effect particle system detected to form a special effect detection report of the special effect file.
[0069] The special effect parameters of each special effect particle system output by the special effect detection script module are obtained in the following way:
[0070] The special effect detection script module first obtains the special effect parameters corresponding to each static special effect frame belonging to the same special effect particle system; then, it performs statistical calculations on the special effect parameters corresponding to each static special effect frame to obtain the special effect parameters of the special effect particle system.
[0071] Among them, the special effect parameters of each special effect particle system include but are not limited to: the memory occupied by the texture, the total number of textures, the number of special effect particle system components, the number of particles, the number of draw calls DrawCall, the original filling pixels of the special effect, the actual filling pixels of the special effect and the overdrawing rate OverDraw.
[0072] 6. Original pixel filling point: Get all pixels in all areas of the special effect, and divide the theoretical total rendering number by the number of rendering calls each time to get the original pixel filling point.
[0073] 7. Actual filled pixels: Get all pixels in the special effect area, and divide the actual total number of renderings by the number of renderings called each time to get the actual filled pixels.
[0074] 8. Average overdraw rate per pixel: The actual total number of drawing times divided by the total number of pixels gives the average overdraw rate per pixel.
[0075] A specific embodiment is described below:
[0076] Load the special effect file in the environment where the unity editor is running, instantiate the special effect file, and mount the special effect detection script module to the special effect file through the code interface AddComponent<>() method provided by Unity.
[0077] Mount the special effect detection script module to the special effect file, start the unity engine to run it, write the GetEffetcData() method to get the special effect data in each frame update Update() method, encapsulate different special effect parameter detection sub-modules in this method, call different special effect parameter detection sub-modules, and thus obtain the special effect parameters.
[0078] Specifically, the camera in the scene is pointed at a special effect particle system, and the player executes Play to start playing each special effect particle system. During the process of the player playing the special effect particle system, the special effect parameters of the special effect particle system are detected. After the detection is completed, the special effect parameters of the next special effect particle system are detected. This cycle is repeated to achieve batch detection.
[0079] First check whether the current special effect particle system is mounted <particlesystemrenderer>The particle system renderer component is used to determine whether it is a special effect particle, and then instantiate and display it.
[0080] Secondly, detect the <ParticleSystem particle system> component and analyze the CalculateEffectData to estimate the special effect data or the CountSubEmitterParticles to calculate the special effect emitter method.
[0081] Then start detecting a single special effect particle system, establish the ParticleEffectCurve.FPS special effect particle system curve frame rate, and create the ParticleEffectCurve special effect particle system curve.
[0082] Assign the following variables: the variable name of the m_CurveParticleCount special effect quantity curve, the variable name of the m_CurveDrawCallCount draw call quantity curve, the variable name of the m_CurveOverdraw overdraw curve, create the EffectEvla special effect pixel calculation and assign the m_EffectEvla special effect pixel calculation variable name, which is used to record the special effect particle quantity, the special effect particle DrawCall, the special effect particle Overdraw. Through the above data, establish, obtain and analyze the important indicators of the special effect particles: the memory occupied by the texture, the number of textures, the number of all particle system components, DrawCall, the number of particles, the original pixel filling points, the actual filled pixel points, and the average per-pixel overdraw rate.
[0083] After the above process is completed, create corresponding fields to store the values according to the important indicators of the special effect particles one by one, and export the configuration table. If it is not the playing environment currently, re-check the setting environment and play the special effect to implement the special effect detection until it ends.
[0084] A method for batch detecting the performance of Unity special effect particles at runtime provided by the present invention uses the function that can automatically scan the special effect particles at runtime. The optimization of the special effect particles does not need to be detected one by one. Once run, it can analyze the important indicators in the special effect particles: the memory occupied by the texture, DrawCall, the number of particles, OverDraw, the number of textures, the number of all particle system components in the special effect, the original filled pixel points of the special effect, the actual filled pixel points of the special effect, and display data such as the average per-pixel OverDraw rate, and give the recommended values of the corresponding indicators. It can export the detection report according to different problem classifications, which is convenient for the art staff to directly view and make optimizations according to the relevant content, and supports different versions of Unity, including Unity5.x, Unity2017.x, and versions above Unity2018.x.
[0085] The present invention provides a method for batch detecting the performance of Untiy special effect particles during runtime, which is a method for automatically scanning and detecting the performance of special effect particles when the special effect particles are running and playing, and exporting a detection report. The method has the advantages of high efficiency in detecting the performance of special effect particles and true and accurate detection results.
[0086] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be considered as the scope of protection of the present invention.< / particlesystemrenderer>
Claims
1. A method for batch testing the performance of Untiy special effect particles during runtime, characterized in that: The following steps are involved: Step 1, loading a special effect file; wherein the special effect file includes n special effect particle systems; and the special effect file is mounted with a special effect detection script module; Step 2, let i=1; Step 3, traverse each of the special effect particle systems, and when traversing to the i-th special effect particle system, use the following method to detect the special effect parameters of the i-th special effect particle system: Step 3.1, placing the i-th special effect particle system in the imaging field of view of the camera; Step 3.1.1, specifically, the i-th special effect particle system includes m static special effect frames, and the m static special effect frames are stacked together in a top-down order, and are represented as: the first static special effect frame, the second static special effect frame, ..., the m-th static special effect frame; Step 3.1.2, let j = 1; Step 3.1.3, the camera is placed directly above the stacked static special effects frames, with the camera imaging direction facing the topmost static special effects frame; Therefore, the jth static special effect frame is imaged into the imaging window of the camera; Step 3.2, start the player, the player changes to the playing state, and at the same time triggers the running of the special effect detection script module; The player uses the following method to play the jth static special effect frame: the player reads the imaging window of the camera, reads the jth static special effect frame, and draws the jth static special effect frame on the playback interface according to the read jth static special effect frame, thereby completing the playback of the first static special effect frame; When the player plays the jth static special effect frame in the playing state, the special effect detection script module runs synchronously and detects the special effect parameters of the jth static special effect frame; Step 3.3, then, in the imaging field of view of the camera, for the stacked static special effect frames, cancel the visibility of the jth static special effect frame; Determine whether j is equal to m. If the determination result is no, set j=j+1 and return to step 3.2 to enable the player to play the next static special effect frame. During the playback of the next static special effect frame, detect its special effect parameters through the special effect detection script module, and continue to run in this way. If the determination result is yes, it indicates that the playback and special effect parameter detection of m static special effect frames have been completed, and then execute step 3.4; Step 3.4, determine whether i is equal to n, if yes, execute step 4; if not, set i=i+1 and return to step 3; Step 4: The special effect detection script module outputs the special effect parameters of each special effect particle system detected to form a special effect detection report of the special effect file.
2. A method for batch detecting the performance of Untiy special effect particles during runtime according to claim 1, characterized in that: The special effect parameters of each special effect particle system output by the special effect detection script module are obtained in the following way: The special effect detection script module first obtains the special effect parameters corresponding to each static special effect frame belonging to the same special effect particle system; then, it performs statistical calculations on the special effect parameters corresponding to each static special effect frame to obtain the special effect parameters of the special effect particle system.
3. A method for batch detecting the performance of Untiy special effect particles during runtime according to claim 2, characterized in that: The special effect parameters of each special effect particle system include: memory occupied by textures, total number of textures, number of special effect particle system components, number of particles, number of draw calls DrawCall, original special effect filling pixels, actual special effect filling pixels and overdraw rate OverDraw.
4. The method for batch detecting the performance of Untiy special effect particles during operation according to claim 1, characterized in that: In step 3.2, when the player plays the jth static special effect frame in the playing state, the special effect detection script module runs synchronously and detects the special effect parameters of the jth static special effect frame, specifically: When the special effect detection script module is triggered to run, the special effect detection script module performs the following operations at the same time: 1) The special effects detection script module triggers the memory monitoring submodule to detect the memory occupied by the texture when the jth static special effects frame is played; 2) The special effect detection script module triggers the texture detection submodule, detects the number of textures used when the jth static special effect frame is played, and obtains the total number of textures; 3) The special effect detection script module triggers the special effect particle system component number detection submodule to detect the camera visualization area and obtain the number of special effect particle system components; 4) The special effect detection script module triggers the particle number detection submodule to detect the camera visualization area and obtain the particle number; 5) The special effect detection script module triggers the first script rendering submodule to detect the number of draw calls DrawCall when the jth static special effect frame is played; 6) The special effect detection script module triggers the second script rendering submodule to detect the overdrawing rate OverDraw when the jth static special effect frame is played; 7) The special effect detection script module triggers the pixel detection submodule to perform pixel detection on the camera visualization area to obtain the original special effect filling pixel points and the actual special effect filling pixel points.
