Data processing method and device, equipment, storage medium and product
By sampling and rendering the virtual scene information, combined with parameter analysis of multiple rendering modules, the problem of low performance analysis of virtual scene information is solved, and fast and accurate performance analysis and optimization are achieved.
Patent Information
- Application Number
- CN202311250452.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2025-04-01
AI Technical Summary
In the prior art, the performance analysis process of virtual scene information is complicated and it is difficult to improve the analysis efficiency.
By obtaining the sampling information and scene information of the virtual scene, at least two rendering modules are used to render the view frames of each sampling point, and the parameters of each rendering module are analyzed separately, the performance data of each view frame is obtained, and performance analysis is performed based on these data.
It improves the performance analysis efficiency of virtual scene information, and can determine problems during the rendering process more quickly and accurately, thereby optimizing scene information.
Smart Images

Figure CN119733237A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, a data processing apparatus, a computer device, a computer-readable storage medium, and a data processing product. Background Art
[0002] With the advancement of scientific and technological research, virtual reality technology has developed rapidly. Virtual reality technology is widely used in game development, video production and other fields. The view frames of virtual scenes in games or videos at different positions are usually rendered based on scene information. In order to ensure the smoothness of view frame rendering, it is usually necessary to perform performance analysis on the scene information. Studies have found that the performance analysis process of scene information is relatively complicated (for example, it is necessary to debug the scene information to analyze the problem). How to improve the efficiency of performance analysis of scene information has become a hot issue in current research. Summary of the invention
[0003] The embodiments of the present application provide a data processing method, apparatus, device, computer-readable storage medium and product, which can improve the performance analysis efficiency of scene information.
[0004] On the one hand, an embodiment of the present application provides a data processing method, including:
[0005] Acquire sampling information and scene information of the virtual scene, where the sampling information includes the position of at least one sampling point in the virtual scene; the scene information is used to render view frames of the virtual scene at different sampling points;
[0006] Rendering the view frame corresponding to each sampling point by at least two rendering modules to obtain a view frame set corresponding to the sampling information;
[0007] Analyze the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame;
[0008] The scene information is subjected to a performance analysis based on the performance data of each view frame to obtain a performance analysis result of the scene information, and the performance analysis result is used to indicate whether the scene information meets the performance index.
[0009] On the one hand, an embodiment of the present application provides a data processing device, the data processing device comprising:
[0010] An acquisition unit, used to acquire sampling information and scene information of a virtual scene, wherein the sampling information includes the position of at least one sampling point in the virtual scene; the scene information is used to render view frames of the virtual scene at different sampling points;
[0011] A processing unit, configured to render the view frame corresponding to each sampling point through at least two rendering modules to obtain a view frame set corresponding to the sampling information;
[0012] and for performing parameter analysis on the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame;
[0013] And it is used to perform performance analysis on the scene information based on the performance data of each view frame to obtain a performance analysis result of the scene information, and the performance analysis result is used to indicate whether the scene information meets the performance index.
[0014] In one embodiment, any one of the view frames in the view frame set is represented as the hth view frame; the performance data of the hth view frame includes: the number of times each rendering module performs drawing operations in the process of rendering the hth view frame;
[0015] The processing unit is used to analyze the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame, specifically for:
[0016] Counting the number of times the i-th rendering module calls the graphics processing interface in the process of rendering the h-th view frame; the i-th rendering module is any one of the at least two rendering modules;
[0017] The number of times the i-th rendering module calls the graphics processing interface during the process of rendering the h-th view frame is determined as the number of times the i-th rendering module performs drawing operations during the process of rendering the h-th view frame.
[0018] In one embodiment, the virtual scene includes M types of scene elements; any view frame in the view frame set is represented as the hth view frame; the hth view frame includes P grids, M and P are both integers greater than 1; at least two rendering modules include a grid transformation module; the performance data of the hth view frame includes: the number of grids corresponding to each type of scene element in the hth view frame;
[0019] The processing unit is used to analyze the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame, specifically for:
[0020] Obtaining a mesh rendering command and first mapping information of the hth view frame, wherein the mesh rendering command is generated by the mesh transformation module based on the scene information, and the mesh rendering command carries material information of P meshes; the first mapping information is used to indicate a mapping relationship between each type of scene element and the material information of the mesh;
[0021] Based on the first mapping information and the material information of the P meshes, the number of meshes corresponding to each type of scene element in the h-th view frame is counted.
[0022] In one embodiment, the virtual scene includes M types of scene elements, where M is an integer greater than 1; any one of the view frames in the view frame set is represented as the h-th view frame; at least two rendering modules include a mesh transformation module; the performance data of the h-th view frame includes: the number of vertices corresponding to each type of scene element in the h-th view frame, and the number of drawing operations associated with each type of scene element in the h-th view frame;
[0023] The processing unit analyzes the parameters of each rendering module in the process of rendering each view frame, and the process of obtaining the performance data of each view frame includes:
[0024] Obtaining a graphics processing interface call instruction of the h-th view frame, where the graphics processing interface call instruction is generated by the mesh transformation module based on the scene information, and the graphics processing interface call instruction carries vertex information and a type identifier; the vertex information is used to indicate the number of vertices associated with the graphics processing interface call instruction in the h-th view frame, and the type identifier is used to indicate the type of scene element associated with the graphics processing interface call instruction;
[0025] Based on the vertex information, the number of vertices corresponding to the scene elements of the target type in the h-th view frame is updated; and,
[0026] The number of drawing operations associated with the scene element of the target type in the hth view frame is incremented by one; the target type matches the type identifier.
[0027] In one implementation, the processing unit is used to perform performance analysis on the scene information based on the performance data of each view frame to obtain a performance analysis result of the scene information, specifically for:
[0028] Determine the performance data of the sampling point by using the performance data of the view frame associated with each sampling point in the sampling information;
[0029] Get the sample data associated with each sampling point;
[0030] Compare the performance data of each sampling point with the sample data associated with the sampling point to obtain difference information of each sampling point; the difference information of any sampling point is used to indicate the difference between the performance data of the sampling point and the corresponding sample data;
[0031] Based on the difference information of each sampling point, the performance analysis result of the scene information is determined.
[0032] In one implementation, the sampling information further includes a sampling direction of each sampling point; the view frame set includes R view frames, the R view frames are all view frames of the j-th sampling point in the k-th sampling direction, the j-th sampling point is any sampling point in the sampling information, the k-th sampling direction is any sampling direction of the j-th sampling point, and R is a positive integer; the performance data of any sampling point includes the performance data of the sampling point in each sampling direction;
[0033] The processing unit is used to determine the performance data of each sampling point through the performance data of the view frame associated with each sampling point in the sampling information, specifically for:
[0034] If R is equal to 1, the performance data of the view frame of the j-th sampling point in the k-th sampling direction is determined as the performance data of the j-th sampling point in the k-th sampling direction;
[0035] If R is greater than 1, the performance data of the R view frames are averaged to obtain the performance data of the j-th sampling point in the k-th sampling direction.
[0036] In one implementation, if the number of sampling directions of each sampling point is greater than 1, the performance data of any sampling point also includes the performance mean of the sampling point; and the processing unit is further configured to:
[0037] The performance data of the j-th sampling point in each sampling direction are averaged to obtain the performance mean of the j-th sampling point.
[0038] In one implementation, the sampling information further includes a sampling direction of each sampling point; the processing unit is used to determine a performance analysis result of the scene information based on the difference information of each sampling point, specifically for:
[0039] If the difference information of at least one sampling point does not meet the preset condition, it is determined that the scene information does not meet the performance indicator;
[0040] If the difference information of each sampling point in the sampling information meets the preset conditions, it is determined that the scene information meets the performance indicator;
[0041] The difference information of the j-th sampling point includes a difference value of the j-th sampling point in at least one sampling direction, and the j-th sampling point is any sampling point in the sampling information; the difference value of the j-th sampling point in any sampling direction includes at least one of the following: a difference value of the number of drawing operations, a difference value of the number of vertices, and a difference value of the number of meshes; the difference information of the j-th sampling point does not meet the preset condition, which means that the difference value of the j-th sampling point in any sampling direction includes a target difference value, the target difference value is greater than the difference threshold, and the target difference value is any one of the following: a difference value of the number of drawing operations, a difference value of the number of vertices, and a difference value of the number of meshes.
[0042] In one implementation, the sampling information includes a target sampling point, and the difference information of the target sampling point does not meet a preset condition; the processing unit is further configured to:
[0043] Acquire second mapping information, where the second mapping information is used to indicate a correspondence between different categories of difference information and optimization strategies;
[0044] Determining an optimization strategy for the scene information based on the category to which the difference information between the second mapping information and the target sampling point belongs;
[0045] According to the optimization strategy, the scene information is optimized to obtain optimized scene information.
[0046] In one embodiment, the processing unit performs parameter analysis on the parameters of each rendering module in the process of rendering each view frame, and the process of obtaining the performance data of each view frame includes:
[0047] In response to the fact that the performance data of the view frame that has been counted meets the storage condition, pausing the performance data of the view frame that has been counted, and storing the performance data that has been counted;
[0048] When it is detected that the storage of the statistical performance data is complete, the performance data of the view frame continues to be counted.
[0049] In one embodiment, the processing unit is used to obtain sampling information of the virtual scene, specifically to:
[0050] Obtaining starting position information and step length information, where the step length information is used to indicate the moving distance of each sampling in the virtual scene;
[0051] Starting from the position indicated by the starting position information, traverse the virtual scene according to the moving distance indicated by the step information to obtain at least two sampling points;
[0052] Based on the positions of the at least two sampling points, sampling information of the virtual scene is generated.
[0053] In one embodiment, the processing unit is used to obtain sampling information of the virtual scene, specifically to:
[0054] Obtaining preset route and step information, where the step information is used to indicate the moving distance of each sampling in the virtual scene;
[0055] The preset route is divided according to the moving distance indicated by the step information to obtain at least two sampling points, and the position of each sampling point is on the preset route;
[0056] Based on the positions of the at least two sampling points, sampling information of the virtual scene is generated.
[0057] Accordingly, the present application provides a computer device, the computer device comprising:
[0058] a memory, wherein a computer program is stored in the memory;
[0059] The processor is used to load the computer program to implement the above data processing method.
[0060] Accordingly, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded by a processor and executing the above-mentioned data processing method.
[0061] Accordingly, the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned data processing method.
[0062] In the embodiment of the present application, sampling information and scene information of a virtual scene are obtained, the sampling information includes the position of at least one sampling point in the virtual scene, and the view frame corresponding to each sampling point is rendered by at least two rendering modules to obtain a view frame set corresponding to the sampling information, and the parameters of each rendering module in the process of rendering each view frame are analyzed to obtain performance data of each view frame, and the scene information is analyzed based on the performance data of each view frame to obtain a performance analysis result of the scene information. It can be seen that by performing parameter analysis on the parameters of each rendering module in the process of rendering each view frame, the problems existing in the rendering process can be determined more quickly and accurately, thereby improving the efficiency of performance analysis of scene information. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0064] Figure 1 A data processing scenario diagram provided for an embodiment of the present application;
[0065] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;
[0066] Figure 3 A flowchart of another data processing method provided in an embodiment of the present application;
[0067] Figure 4a A schematic diagram of type classification provided in an embodiment of the present application;
[0068] Figure 4b A schematic diagram of a view frame provided in an embodiment of the present application;
[0069] Figure 4c A performance data statistics diagram provided for an embodiment of the present application;
[0070] Figure 4d A schematic diagram of an abnormality repair process provided in an embodiment of the present application;
[0071] Figure 4e A performance analysis flow chart provided for an embodiment of the present application;
[0072] Figure 4f A data processing architecture diagram provided for an embodiment of the present application;
[0073] Figure 5 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;
[0074] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0075] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0076] This application involves technologies related to rendering performance and artificial intelligence. The following is a brief introduction to the related technologies involved:
[0077] Frames Per Second (FPS): Indicates the number of view frames that can be rendered in 1 second. The larger the FPS value, the faster the view frame rendering speed (the smoother the video), and the better the user experience.
[0078] DrawCall (DC): It is used to indicate the number of drawing operations that need to be performed during the image rendering process. Generally speaking, the fewer DrawCalls, the better the rendering performance and the faster the view frame rendering speed (the smoother the video).
[0079] Artificial Intelligence (AI): AI is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making. The embodiments of the present application mainly involve analyzing difference information through a difference analysis model to obtain an optimization strategy for scene information.
[0080] AI technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operating / interactive systems, mechatronics, etc. Among them, pre-trained models are also called large models or basic models. After fine-tuning, they can be widely used in downstream tasks in various major directions of AI. AI software technologies mainly include computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0081] Machine Learning (ML) is a multi-disciplinary interdisciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithmic complexity theory and other disciplines. It specializes in how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all fields of artificial intelligence. Machine learning and deep learning generally include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning. The pre-trained model is the latest development in deep learning, which integrates the above technologies. The embodiment of the present application mainly involves training a differential analysis model to be trained based on a training data set to further improve the accuracy of the prediction results of the differential analysis model.
[0082] Based on the above-mentioned technologies related to rendering performance and artificial intelligence, an embodiment of the present application provides a data processing solution that can improve the efficiency of performance analysis of scene information. Figure 1 A data processing scenario diagram provided in an embodiment of the present application, such as Figure 1As shown, the data processing scenario provided by the present application includes a terminal device 101 and a server 102, and the data processing scheme provided by the present application can be executed by the server 102. Among them, the terminal device may include but is not limited to: smart phones (such as Android phones, IOS phones, etc.), tablet computers, portable personal computers, mobile Internet devices (Mobile Internet Devices, referred to as MID), vehicle terminals, smart home appliances, wearable devices, unmanned aerial vehicles, etc., and the embodiments of the present application do not limit this. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, and the embodiments of the present application do not limit this.
[0083] It should be noted that Figure 1 The number of terminal devices and servers is only used as an example and does not constitute an actual limitation of this application; for example, Figure 1 The terminal device 101 and the server 102 may also include a terminal device 103, a server 104, etc. The terminal device 101 and the server 102 may be connected via a wired or wireless method, which is not limited in this application. Figure 1 The data processing scenario shown may also include only the terminal device 101 . In this case, the data processing solution provided in the present application may be executed by the terminal device 101 .
[0084] The following takes the server 102 executing the data processing method provided by the present application as an example to illustrate the general process of the data processing solution provided by the present application:
[0085] (1) The server 102 obtains the sampling information and scene information of the virtual scene sent by the terminal device 101. The virtual scene may specifically refer to a scene in a video (such as a three-dimensional animation) or a scene in a game. When the data processing method provided in the present application is applied to a game scene, the performance data of different rendering modules and the performance data of different types of scene elements in the view frame can be used to intuitively and quickly determine the cause of the view frame rendering exception, without rebuilding the troubleshooting (Debug) package or performing other exception analysis operations, thereby improving the performance analysis efficiency of the scene information and the exception repair efficiency. The virtual scene may include one or more scene elements, each of which may be constructed by a grid, and the shape of the grid may include but is not limited to a triangle or a quadrilateral. The sampling information includes the position of at least one sampling point in the virtual scene, and the scene information is used to render the view frame of the virtual scene at different sampling points. The view frame may specifically be a two-dimensional view frame or a three-dimensional view frame, and the present application does not limit this.
[0086] (2) The server 102 renders the view frame corresponding to each sampling point through at least two rendering modules to obtain a view frame set corresponding to the sampling information. The rendering module may include but is not limited to: a grid transformation (Pass) module, an interaction (User Interface, UI) module, and a post-processing module. The view frame set corresponding to the sampling information includes the view frame corresponding to each sampling point, and the number of view frames corresponding to each sampling point is one or more. Specifically, let any sampling point in the sampling information be represented as the jth sampling point, and the view frame corresponding to the jth sampling point includes the view frame of the jth sampling point in one or more sampling directions, and the view frame of the jth sampling point in each sampling direction may be one or more.
[0087] (3) The server 102 performs parameter analysis on the parameters of each rendering module in the process of rendering each view frame to obtain the performance data of each view frame. The performance data of each view frame may specifically include one or more of the following: the number of drawing operations (i.e., the number of drawing operations performed in the process of rendering the view frame), the number of vertices, and the number of meshes; wherein, the number of drawing operations can be subdivided into the number of drawing operations performed by each rendering module in the process of rendering the view frame; the number of drawing operations performed by the mesh transformation (Pass) module in the process of rendering the view frame can be further subdivided into the number of drawing operations associated with different types of scene elements in the view frame; similarly, the number of vertices can be subdivided into the number of vertices corresponding to different types of scene elements in the view frame, and the number of meshes can be subdivided into the number of meshes corresponding to different types of scene elements in the view frame. The vertices in this application refer to the vertices of the meshes, and a triangular mesh includes three vertices; similarly, a quadrilateral mesh includes four vertices.
[0088] In one embodiment, the server 102 counts the number of times the i-th rendering module calls the graphics processing interface in the process of rendering the h-th view frame, and determines the number of times the i-th rendering module calls the graphics processing interface in the process of rendering the h-th view frame as the number of times the i-th rendering module performs drawing operations in the process of rendering the h-th view frame; wherein the i-th rendering module is any rendering module of at least two rendering modules, and the h-th view frame is any view frame in the view frame set.
[0089] (4) The server 102 performs a performance analysis on the scene information based on the performance data of each view frame to obtain a performance analysis result of the scene information; wherein the performance analysis result is used to indicate whether the scene information meets the performance index (such as the FPS index). In one embodiment, on the one hand, the server 102 determines the performance data of the sampling point through the performance data of the view frame associated with each sampling point in the sampling information; for example, the performance data of the view frame associated with each sampling point is averaged to obtain the performance data of the sampling point. On the other hand, the server 102 obtains the sample data associated with each sampling point. After obtaining the performance data of each sampling point and the sample data associated with each sampling point, the server 102 compares the performance data of each sampling point with the sample data associated with the sampling point to obtain the difference information of each sampling point; the difference information of any sampling point is used to indicate the difference between the performance data of the sampling point and the corresponding sample data. Further, the server 102 determines the performance analysis result of the scene information based on the difference information of each sampling point; for example, it is detected whether there is difference information in the difference information of each sampling point that does not meet the performance index.
[0090] In the embodiment of the present application, sampling information and scene information of a virtual scene are obtained, the sampling information includes the position of at least one sampling point in the virtual scene, and the view frame corresponding to each sampling point is rendered by at least two rendering modules to obtain a view frame set corresponding to the sampling information, and the parameters of each rendering module in the process of rendering each view frame are analyzed to obtain performance data of each view frame, and the scene information is analyzed based on the performance data of each view frame to obtain a performance analysis result of the scene information. It can be seen that by performing parameter analysis on the parameters of each rendering module in the process of rendering each view frame, the problems existing in the rendering process can be determined more quickly and accurately, thereby improving the efficiency of performance analysis of scene information.
[0091] Based on the above data processing scheme, the embodiment of the present application proposes a more detailed data processing method. The data processing method proposed in the embodiment of the present application will be described in detail below in conjunction with the accompanying drawings.
[0092] See also Figure 2 , Figure 2A flowchart of a data processing method provided in an embodiment of the present application, the data processing method can be executed by a computer device; for example, Figure 1 The terminal device 101 shown in , or the server 102 executes. Figure 2 As shown, the data processing method may include the following steps S201-S204:
[0093] S201. Acquire sampling information and scene information of a virtual scene.
[0094] A virtual scene may specifically refer to a scene in a video (such as a 3D animation) or a scene in a game. A virtual scene may include one or more scene elements; for example, a virtual character model, a plant model, a building model, a virtual animal model, and the like. Each scene element may be constructed by a grid, and the shape of the grid may include, but is not limited to, a triangle and a quadrilateral. In practical applications, the scene elements in a virtual scene may be divided into multiple types based on actual needs (such as according to a preset classification basis); for example, a shadow type, a character type, a plant type, and the like.
[0095] The sampling information includes the position (such as coordinates) of at least one sampling point in the virtual scene; in addition, the sampling information may also include one or more sampling directions for each sampling point; for example, when the virtual scene is a three-dimensional virtual scene, sampling may be performed at the same sampling point in different sampling directions. The scene information is used to render the view frames of the virtual scene at different sampling points; for example, the scene information may include material information of different scene elements in the scene. The view frame of the virtual scene may specifically be a two-dimensional view frame or a three-dimensional view frame, and this application does not limit this.
[0096] S202: Rendering the view frame corresponding to each sampling point by at least two rendering modules to obtain a view frame set corresponding to the sampling information.
[0097] The rendering module may include, but is not limited to: a grid transformation (Pass) module, an interaction (User Interface, UI) module, and a post-processing module. The view frame set corresponding to the sampling information includes the view frame corresponding to each sampling point, and the number of view frames corresponding to each sampling point is one or more. Specifically, let any sampling point in the sampling information be represented as the jth sampling point, and the view frame corresponding to the jth sampling point includes the view frame of the jth sampling point in one or more sampling directions, and the view frame of the jth sampling point in each sampling direction may be one or more.
[0098] In the present application, the number of rendering modules is T, where T is an integer greater than 1; the i-th rendering module is any rendering module among the T rendering modules, that is, i is a positive integer less than or equal to T. The number of view frames in the view frame set is S, where S is a positive integer; the h-th view frame is any view frame in the view frame set, that is, h is a positive integer less than or equal to S. The sampling information includes the positions of U sampling points, where U is a positive integer; the j-th sampling point is any sampling point in the sampling information, that is, j is a positive integer less than or equal to U. Each sampling point corresponds to N sampling directions, where N is a positive integer, and the k-th sampling direction is any sampling direction among the N sampling directions, that is, k is a positive integer less than or equal to N. In one embodiment, the computer device renders one or more view frames of the j-th sampling point in the k-th sampling direction through T rendering modules to obtain one or more view frames of the j-th sampling point in the k-th sampling direction. For example, the computer device may render multiple view frames of the jth sampling point in the kth sampling direction within a preset time (such as 1 second) through T rendering modules to obtain multiple view frames of the jth sampling point in the kth sampling direction. For another example, the computer device may render the view frame of the jth sampling point in the kth sampling direction at the current moment through T rendering modules to obtain a view frame of the jth sampling point in the kth sampling direction.
[0099] According to the above implementation, the computer device renders the view frames of each sampling point in the sampling information in each sampling direction through at least two rendering modules, so as to obtain a set of view frames corresponding to the sampling information.
[0100] S203 , respectively analyzing the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame.
[0101] The performance data of each view frame may specifically include one or more of the following: the number of drawing operations (i.e., the number of drawing operations performed in the process of rendering the view frame), the number of vertices, and the number of meshes; wherein, the number of drawing operations of each view frame can be subdivided into the number of drawing operations performed by each rendering module in the process of rendering the view frame; for example, assuming that the hth view frame in the view frame set is rendered by the mesh transformation module, the interaction module, and the post-processing module, the number of drawing operations performed by the mesh transformation module in the process of rendering the hth view frame is x1, the number of drawing operations performed by the interaction module in the process of rendering the hth view frame is x2, and the number of drawing operations performed by the post-processing module in the process of rendering the hth view frame is x3, then the number of drawing operations of the hth view frame = x1+x2+x3. Similarly, the number of vertices of each view frame can be subdivided into the number of vertices corresponding to each rendering module, and the number of meshes of each view frame can be subdivided into the number of meshes corresponding to each rendering module.
[0102] The number of drawing operations performed by the mesh transformation (Pass) module in the process of rendering the view frame can be further subdivided into the number of drawing operations associated with different types of scene elements in the view frame; for example, assuming that the number of drawing operations performed by the mesh transformation module in the process of rendering the h-th view frame is x1, and the virtual scene includes 2 types of scene elements, the number of drawing operations performed by the mesh transformation module in the process of rendering the first type of scene elements in the h-th view frame is y1, and the number of drawing operations performed by the mesh transformation module in the process of rendering the second type of scene elements in the h-th view frame is y2, then x1=y1+y2. Similarly, the number of vertices corresponding to the mesh transformation (Pass) module can be further subdivided into: the number of vertices corresponding to different types of scene elements in the view frame; the number of meshes corresponding to the mesh transformation (Pass) module can be further subdivided into: the number of meshes corresponding to different types of scene elements in the view frame.
[0103] In one embodiment, the performance data of each view frame includes: the number of times each rendering module performs drawing operations in the process of rendering the view frame. Any view frame in the view frame set is represented as the hth view frame. The parameters of the i-th rendering module in the process of rendering the h-th view frame include a graphics processing interface call instruction. The computer device counts the number of times the i-th rendering module calls the graphics processing interface in the process of rendering the h-th view frame based on the number of graphics processing interface call instructions, and determines the number of times the i-th rendering module calls the graphics processing interface in the process of rendering the h-th view frame as the number of times the i-th rendering module performs drawing operations in the process of rendering the h-th view frame; wherein the i-th rendering module is any one of the at least two rendering modules. For example, assuming that the computer device statistics that the number of times the i-th rendering module calls the graphics processing interface in the process of rendering the h-th view frame is z, then the computer device determines that the number of times the i-th rendering module performs drawing operations in the process of rendering the h-th view frame is z, and z is a positive integer.
[0104] That is to say, in the rendering process of any view frame, the DrawCalls triggered by different rendering modules are counted respectively, and the number of DrawCalls and related data (such as the number of meshes and vertices, etc.) of each rendering module in the process of rendering the view frame are obtained. According to the above method, the computer device can obtain the number of times each rendering module performs drawing operations in the process of rendering each view frame.
[0105] In another embodiment, the virtual scene includes M types of scene elements, where M is an integer greater than 1. Any view frame in the view frame set is represented as the h-th view frame, and the h-th view frame includes P grids, where P is an integer greater than 1. The rendering module includes a grid transformation module. The performance data of each view frame includes: the number of grids corresponding to each type of scene element in the view frame. The parameters of the grid transformation module in the process of rendering the h-th view frame include a grid rendering command. The computer device obtains the grid rendering command and the first mapping information of the h-th view frame; wherein the grid rendering command is generated by the grid transformation module based on the scene information, and the grid rendering command carries the material information of each grid in the h-th view frame, and the first mapping information is used to indicate the mapping relationship between each type of scene element and the material information of the grid. In one embodiment, different material information can be distinguished by different identifiers; or, different material information can be stored in different directories (folders) (of scene information) for easy distinction.
[0106] After obtaining the grid rendering command and the first mapping information of the h-th view frame, the computer device counts the number of grids corresponding to each type of scene element in the h-th view frame based on the first mapping information and the material information of each grid; for example, assuming that the h-th view frame includes 1000 grids (i.e., P=1000), of which 200 grids have material A, 300 grids have material B, and 500 grids have material C, and the first mapping information indicates that material A corresponds to the second type of scene element, material B corresponds to the third type of scene element, and material C corresponds to the first type of scene element. Then, based on the first mapping information and the material information of each grid, the computer device can obtain that the number of grids corresponding to the first type of scene element is 500, the number of grids corresponding to the second type of scene element is 200, and the number of grids corresponding to the third type of scene element is 300.
[0107] In another embodiment, the virtual scene includes M types of scene elements, where M is an integer greater than 1. Any view frame in the view frame set is represented as the hth view frame. The rendering module includes a mesh transformation module. The performance data of each view frame includes: the number of vertices corresponding to each type of scene element in the view frame, and the number of drawing operations associated with each type of scene element in the view frame. The parameters of the mesh transformation module in the process of rendering the hth view frame include a graphics processing interface call instruction. The computer device obtains the graphics processing interface call instruction of the hth view frame; wherein the graphics processing interface call instruction is generated by the mesh transformation module based on the scene information, and the graphics processing interface call instruction carries vertex information and a type identifier; the vertex information is used to indicate the number of vertices associated with the graphics processing interface call instruction in the hth view frame, and the type identifier is used to indicate the type of scene element associated with the graphics processing interface call instruction. Based on the vertex information, the computer device updates the number of vertices corresponding to the scene element of the target type in the hth view frame, and adds one to the number of drawing operations associated with the scene element of the target type in the hth view frame; wherein the target type matches the type identifier.
[0108] For example, assuming that the vertex information of the target graphics processing interface calling instruction indicates that the number of vertices associated with the target graphics processing interface calling instruction in the hth view frame is x1, and the type identifier of the target graphics processing interface calling instruction indicates that the type of scene element associated with the target graphics processing interface calling instruction is the second type, and the number of vertices corresponding to the current second type of scene element is x2, and the number of drawing operations associated with the second type of scene element is y; then, based on the vertex information and type identifier in the target graphics processing interface calling instruction, the computer device updates the number of vertices corresponding to the second type of scene element to: x1+x2, and based on the type identifier in the target graphics processing interface calling instruction, updates the number of drawing operations associated with the second type of scene element to: y+1.
[0109] It is understandable that the performance data of each view frame may include: the number of vertices corresponding to each type of scene element in the view frame, and any one of the number of drawing operations associated with each type of scene element in the view frame; for example, the performance data of each view frame only includes the number of vertices corresponding to each type of scene element in the view frame, or the performance data of each view frame only includes the number of drawing operations associated with each type of scene element in the view frame. In this case, the computer device can still obtain the performance data of each view frame according to the above implementation, which will not be repeated here.
[0110] In another embodiment, the computer device detects in real time (or periodically) whether the counted performance data meets the storage condition; for example, the computer device detects whether the amount of the counted performance data is greater than a quantity threshold. When the computer device detects that the counted performance data meets the storage condition, the computer device pauses counting the performance data and stores the counted performance data (such as writing the counted performance data to a disk). Further, when the computer device detects that the storage of the counted performance data is complete, the computer device continues to count the performance data.
[0111] It can be seen that, on the one hand, by storing the counted performance data in batches, data anomalies caused by excessive performance data statistics (such as data loss, data overflow, etc.) can be reduced, and the time of each data storage can be controlled (avoiding excessive data storage due to excessive data storage); on the other hand, suspending performance data statistics during the storage period can avoid the problem of inaccurate performance data statistics caused by data writing occupying computer equipment resources, thereby improving the accuracy of the statistical performance data.
[0112] S204: Perform performance analysis on the scene information based on the performance data of each view frame to obtain a performance analysis result of the scene information.
[0113] The performance analysis result is used to indicate whether the scene information meets the performance index (such as the FPS index). In one embodiment, on the one hand, the computer device determines the performance data of the sampling point through the performance data of the view frame associated with each sampling point in the sampling information. In one embodiment, the sampling information includes the sampling direction of each sampling point, and the view frame set includes R view frames, and these R view frames are all view frames of the jth sampling point in the kth sampling direction; wherein the jth sampling point is any sampling point in the sampling information, the kth sampling direction is any sampling direction of the jth sampling point, and R is a positive integer. The performance data of any sampling point includes the performance data of the sampling point in each sampling direction. If R=1, the computer device determines the performance data of the view frame of the jth sampling point in the kth sampling direction as the performance data of the jth sampling point in the kth sampling direction; accordingly, if R>1, the computer device performs mean processing on the performance data of the R view frames to obtain the performance data of the jth sampling point in the kth sampling direction.
[0114] On the other hand, the computer device obtains sample data associated with each sampling point. The sample data set may be prediction data, or may be obtained by collecting performance data of other versions of scene information, or may be configured by the developer, and this application does not impose any restrictions on this. After obtaining the performance data of each sampling point and the sample data associated with each sampling point, the computer device compares the performance data of each sampling point with the sample data associated with the sampling point to obtain difference information of each sampling point; wherein the difference information of any sampling point is used to indicate the difference between the performance data of the sampling point and the corresponding sample data.
[0115] Any sampling point in the sampling information is represented as the jth sampling point, and the difference information of the jth sampling point includes the difference value of the jth sampling point in at least one sampling direction, and the difference value of the jth sampling point in any direction includes at least one of the following: a difference value of the number of drawing operations, a difference value of the number of vertices, and a difference value of the number of meshes. In one embodiment, the difference value of the number of drawing operations of the jth sampling point in the kth sampling direction is obtained based on the difference between the number of drawing operations of the jth sampling point in the kth sampling direction and the corresponding sample data; similarly, the difference value of the number of vertices of the jth sampling point in the kth sampling direction is obtained based on the difference between the number of vertices of the jth sampling point in the kth sampling direction and the corresponding sample data; in addition, the difference value of the number of vertices of the jth sampling point in the kth sampling direction can be further subdivided into the difference values of the number of vertices of different types of scene elements in the view frame of the jth sampling point in the kth sampling direction. The difference value of the number of grids at the j-th sampling point in the k-th sampling direction is obtained based on the difference between the number of grids at the j-th sampling point in the k-th sampling direction and the corresponding sample data; in addition, the difference value of the number of grids at the j-th sampling point in the k-th sampling direction can be further subdivided into the difference values of the number of grids of different types of scene elements in the view frame at the j-th sampling point in the k-th sampling direction.
[0116] Further, the computer device determines the performance analysis result of the scene information based on the difference information of each sampling point. In one embodiment, the sampling information includes the sampling direction of each sampling point. If the difference information of at least one sampling point does not meet the preset condition, the computer device determines that the scene information does not meet the performance index; accordingly, if the difference information of each sampling point in the sampling information meets the preset condition, the computer device determines that the scene information meets the performance index. Among them, the difference information of the jth sampling point does not meet the preset condition means that: the difference value of the jth sampling point in any sampling direction includes a target difference value, the target difference value is greater than the difference threshold, and the target difference value is any one of the following: the number difference value of the drawing operation, the number difference value of the vertex, and the number difference value of the mesh. For example, the sampling information includes sampling points 1-sampling point 3, and the difference information of sampling points 1-sampling point 3 includes: the number difference value of the drawing operation, the number difference value of the vertex, and the number difference value of the mesh; if the vertex number difference value of sampling point 2 (i.e., the target difference value) is greater than the difference threshold, the computer device determines that the scene information does not meet the performance index; if the difference information of sampling points 1-sampling point 3 meets the preset condition, the computer device determines that the scene information meets the performance index. For another example, the sampling information includes sampling point 1-sampling point 3, and the difference information of sampling point 1-sampling point 3 includes: a grid quantity difference value; if the grid quantity difference value of sampling point 1 (i.e., the target difference value) is greater than the difference threshold, the computer device determines that the scene information does not meet the performance indicator; if the difference information of sampling point 1-sampling point 3 meets the preset conditions, the computer device determines that the scene information meets the performance indicator.
[0117] In an embodiment of the present application, sampling information and scene information of a virtual scene are obtained, the sampling information includes the position of at least one sampling point in the virtual scene, and the view frame corresponding to each sampling point is rendered by at least two rendering modules to obtain a view frame set corresponding to the sampling information, and the parameters of each rendering module in the process of rendering each view frame are respectively analyzed to obtain the performance data of each view frame, and the scene information is analyzed based on the performance data of each view frame to obtain the performance analysis result of the scene information. It can be seen that by performing parameter analysis on the parameters of each rendering module in the process of rendering each view frame, the problems existing in the rendering process can be determined more quickly and accurately, thereby improving the performance analysis efficiency of the scene information. In addition, by storing the statistical performance data in batches, data anomalies (such as data loss, data overflow, etc.) caused by too much performance data statistics can be reduced, and the time of each data storage can be controlled; suspending performance data statistics during the storage period can avoid the problem of inaccurate performance data statistics caused by occupying computer equipment resources due to data writing, thereby improving the accuracy of the statistical performance data.
[0118] See also Figure 3 , Figure 3 A flowchart of another data processing method provided in an embodiment of the present application, the data processing method can be executed by a computer device; for example, Figure 1 The terminal device 101 shown in , or the server 102 executes. Figure 3 As shown, the data processing method may include the following steps S301-S307:
[0119] S301: Acquire sampling information and scene information of a virtual scene.
[0120] In one embodiment, the virtual scene includes multiple scene elements; for example, virtual character models, plant models, building models, virtual animal models, etc. The scene elements in the virtual scene can be divided into different types according to the classification basis, and the material information corresponding to different types of scene elements is different. The scene information of the virtual scene includes material information corresponding to each scene element. The computer device can add different type identifiers to the material information corresponding to different types of scene elements; or, the material information corresponding to different types of scene elements is stored in different directories (files) of the scene information, so as to achieve the purpose of distinguishing the material information corresponding to different types of scene elements.
[0121] Figure 4a A schematic diagram of type classification provided in the embodiment of the present application. Figure 4a As shown, the scene elements in the virtual scene include: trees, grass, virtual characters, and shadows; among them, trees and grass are plant types, virtual characters are role types, and shadows are shadow types (that is, the scene elements in the virtual scene are divided into three types). The type identifier of the material information corresponding to each type of scene element is different; or, the material information corresponding to each type of scene element is stored in different directories (files) of the scene information.
[0122] In one embodiment, the virtual scene may be a game scene, which is developed through a game engine. The game engine may include but is not limited to: Unity engine and Unreal engine.
[0123] In another embodiment, the computer device obtains the starting position information and the step information, and the step information is used to indicate the moving distance of each sampling in the virtual scene. Starting from the position indicated by the starting position information, the virtual scene is traversed according to the moving distance indicated by the step information to obtain at least two sampling points, and based on the position of each sampling point in the virtual scene, the sampling information of the virtual scene is generated. For example, assuming that starting from the position indicated by the starting position information, the virtual scene is traversed according to the moving distance indicated by the step information through a total of 8 sampling points (including the starting point and the end point), then the computer device generates the sampling information of the virtual scene based on the positions of the 8 sampling points in the virtual scene.
[0124] In another embodiment, the computer device obtains a preset route and step information, and the step information is used to indicate the moving distance of each sampling in the virtual scene. The preset route includes a starting point, an end point, and a travel route. The computer device divides the preset route according to the moving distance indicated by the step information to obtain at least two sampling points, and the position of each sampling point is on the preset route. Then, based on the position of each sampling point in the virtual scene, the sampling information of the virtual scene is generated. For example, assuming that the preset route can be divided into at least one section according to the moving distance indicated by the step information, the computer device generates the sampling information of the virtual scene based on the position of the sampling points associated with each preset route in the virtual scene.
[0125] In one embodiment, the sampling information includes a location of a sampling point. The location of the sampling point may be a preset location or may be indicated by a developer, and this application does not impose any limitation on this.
[0126] S302: Rendering the view frame corresponding to each sampling point by at least two rendering modules to obtain a view frame set corresponding to the sampling information.
[0127] The specific implementation of step S302 can be found in Figure 2 The implementation of step S202 will not be repeated here.
[0128] Figure 4b A schematic diagram of a view frame of a game scene provided in an embodiment of the present application. Figure 4b As shown, the view frame includes scene elements 1 to 4; wherein scene elements 1 and 2 are game props type scene elements, scene element 3 is a shadow type scene element, and scene element 4 is a plant type scene element. In addition, Figure 4b The steps, floor, etc. in the view frame shown can be uniformly used as scene elements of the background type of the view frame. It can be understood that Figure 4bThis is only used as an example and does not constitute an actual limitation of the present application; for example, steps can be classified as terrain-type scene elements, and floors can be classified as decoration-type scenes.
[0129] S303 , respectively analyzing the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame.
[0130] Figure 4c A performance data statistics diagram provided in an embodiment of the present application. Figure 4c As shown, the rendering module includes a mesh transformation module, an interaction module and a post-processing module. The mesh transformation module may include a geometry channel (BasePass / Translucency), a shadow channel (ShadowPass), and a pre-rendering processing channel (PrePass). In the process of rendering each view frame by the mesh transformation module, when constructing a mesh rendering command, the type of scene element to which the mesh belongs can be determined based on the material of the mesh; when submitting a graphics processing interface call instruction, the number of drawing operations associated with the scene element of the target type can be updated based on the type identifier in the graphics processing interface call instruction; the number of vertices associated with the scene element of the target type can also be updated based on the type identifier and vertex information in the graphics processing interface call instruction; wherein the target type matches the type identifier in the graphics processing interface call instruction. In the process of rendering the view frame by the interaction module, when the interaction module submits the graphics processing interface call instruction, the number of drawing operations performed by the interaction module in the process of rendering the view frame is updated. In the process of rendering the view frame by the post-processing module, when a new rendering operation step is added (adding post-processing AddPass), the number of drawing operations performed by the post-processing module in the process of rendering the view frame is updated.
[0131] In one embodiment, the rendering module includes a mesh transformation module, and the parameters of the mesh transformation module in the process of rendering each view frame include a scriptable rendering pipeline (SRP), and different types of scene elements in each view frame are rendered by different programmable rendering pipelines. Each programmable rendering pipeline carries mesh information, vertex information and graphics processing interface call instructions; wherein the mesh information is used to indicate the mesh associated with the programmable rendering pipeline in the view frame, and the vertex information is used to indicate the vertex associated with the programmable rendering pipeline in the view frame. The computer device obtains a target programmable rendering pipeline, which is a programmable rendering pipeline for rendering the target type of scene elements in the hth view frame by the mesh transformation rendering module, and the hth view frame is any view frame in the view frame set. The computer device updates the number of vertices corresponding to the target type of scene elements in the hth view frame based on the vertex information in the target programmable rendering pipeline; and updates the number of meshes corresponding to the target type of scene elements in the hth view frame based on the mesh information in the target programmable rendering pipeline; and updates the number of drawing operations associated with the target type of scene elements in the hth view frame based on the number of graphics processing interface call instructions in the target programmable rendering pipeline.
[0132] Optionally, the parameters of each rendering module in the process of rendering each view frame may also include a shader. The computer device may obtain the performance data of each view frame by distinguishing the shader corresponding to each type of scene element (such as by type identification). For specific implementation methods, please refer to Figure 2 The implementation of step S203 will not be repeated here.
[0133] S304: Determine the performance data of each sampling point through the performance data of the view frame associated with each sampling point in the sampling information.
[0134] In one embodiment, the sampling information includes the sampling direction of each sampling point. The view frame set includes R view frames, and the R view frames are all view frames of the jth sampling point in the kth sampling direction; wherein the jth sampling point is any sampling point in the sampling information, the kth sampling direction is any sampling direction of the jth sampling point, and R is a positive integer. The performance data of any sampling point includes the performance data of the sampling point in each sampling direction. If R is equal to 1, the computer device determines the performance data of the view frame of the jth sampling point in the kth sampling direction as the performance data of the jth sampling point in the kth sampling direction; accordingly, if R is greater than 1, the performance data of the R view frames are averaged to obtain the performance data of the jth sampling point in the kth sampling direction.
[0135] Furthermore, if the number of sampling directions of each sampling point is greater than 1, the performance data of any sampling point also includes the performance mean of the sampling point. The computer device performs mean processing on the performance data of the j-th sampling point in each sampling direction to obtain the performance mean of the j-th sampling point.
[0136] Optionally, the performance data of the jth sampling point in the kth sampling direction includes FPS. Specifically, if R=1, the computer device counts the rendering time of the view frame of the jth sampling point in the kth sampling direction, and calculates the FPS of the jth sampling point in the kth sampling direction based on the rendering time; if R>1, the computer device averages the rendering time of the R view frames of the jth sampling point in the kth sampling direction, and calculates the FPS of the jth sampling point in the kth sampling direction based on the average of the rendering time of the R view frames. In addition, the computer device can also count the number of view frames of the jth sampling point in the kth sampling direction rendered within a preset time period (such as 1 second) to obtain the FPS of the jth sampling point in the kth sampling direction.
[0137] In one embodiment, the performance data of a sampling point may be shown in Table 1 below:
[0138] Table 1
[0139]
[0140]
[0141] Among them, Pos is the sampling information, P1 represents the location of the sampling point, and D1-D4 represent four different sampling directions. a is the performance mean of the sampling points. In Table 1, P1 aThe value of each attribute is the average of the values of "P1D1", "P1D2", "P1D3" and "P1D4" under the attribute. The basic information includes the performance information of each sampling point in each sampling direction, FPS is the number of frames per second, DC is the number of drawing operations, Verts is the number of vertices, and Prims is the number of meshes; among them, DC, Prims, Verts of the j-th sampling point in the k-th sampling direction are obtained from the performance data of R view frames in the k-th sampling direction of the j-th sampling point. The FPS corresponding to "P1D1" means that when the sampling point position is P1 and the sampling direction is D1, the FPS value is 50.4; similarly, the Prims corresponding to "P1D1" means that when the sampling point position is P1 and the sampling direction is D1, the number of meshes in the view frame is 4644. The performance data of the first type of scene elements include DC1, Verts1, and Prims1; wherein DC1 indicates the number of times the first type of scene elements in the view frame perform drawing operations during the rendering process, Verts1 indicates the number of vertices of the first type of scene elements in the view frame, and Prims1 indicates the number of meshes of the first type of scene elements in the view frame. Verts1 corresponding to "P1D2" indicates that when the sampling point position is P1 and the sampling direction is D2, the number of meshes in the view frame is 5315. The performance data of the interaction module include DC2, Verts2, and Prims2; wherein DC2 indicates the number of times the interaction module performs drawing operations during the rendering of the view frame, Verts2 indicates the number of vertices associated with the interaction module during the rendering of the view frame, and Prims2 indicates the number of meshes associated with the interaction module during the rendering of the view frame. It should be noted that Table 1 may also include performance data of the second type of scene elements, performance data of the grid transformation module in the process of rendering the view frame (which can be obtained by summing the performance data of each type of scene elements), performance data of the post-processing module in the process of rendering the view frame, etc. The values in Table 1 are for example only and do not constitute actual limitations of the present application.
[0142] S305: Obtain sample data associated with each sampling point.
[0143] The sample data set may be prediction data, or may be obtained by collecting performance data of other versions of scene information of the virtual scene (different from the version of the current scene information), or may be configured by the developer, and this application does not limit this. In one embodiment, the computer device reads performance data of other versions of scene information of the virtual scene from the disk as sample data.
[0144] S306: Compare the performance data of each sampling point with the sample data associated with the sampling point to obtain difference information of each sampling point.
[0145] The difference information of any sampling point is used to indicate the difference between the performance data of the sampling point and the corresponding sample data.
[0146] In one embodiment, the data items in the performance data of each sampling point correspond to the data items of the sample data associated with the sampling point. The computer device compares the performance data of each sampling point with the sample data associated with the sampling point, which means comparing the performance data of each sampling point with the corresponding data items in the sample data associated with the sampling point to obtain the difference information of each sampling point.
[0147] In one embodiment, the performance data of a sampling point is compared with the sample data associated with the sampling point in a manner as shown in Table 2 below:
[0148] Table 2
[0149]
[0150] Among them, Pos is the sampling information, P1 represents the location of the sampling point, D1-D4 represent 4 different sampling directions, P1 a is the performance mean of the sampling points. The basic information includes the performance information of each sampling point in each sampling direction, FPS is the number of frames per second, DC is the number of drawing operations performed, Verts is the number of vertices, and Prims is the number of meshes. The performance data of the first type of scene elements include DC1, Verts1, and Prims1; wherein DC1 represents the number of drawing operations performed by the first type of scene elements in the view frame during the rendering process, Verts1 represents the number of vertices of the first type of scene elements in the view frame, and Prims1 represents the number of meshes of the first type of scene elements in the view frame. In a:b, a is the performance data and b is the sample data; a:b represents comparing the performance data a with the corresponding sample data b. It should be noted that Table 2 may also include the performance data of the second type of scene elements, the performance data of the interaction module, the performance data of the mesh transformation module in the process of rendering the view frame (which can be obtained by summing the performance data of each type of scene element), the performance data of the post-processing module in the process of rendering the view frame, and the like. The values in Table 2 are for example only and do not constitute an actual limitation of this application.
[0151] S307: Determine a performance analysis result of the scene information based on the difference information of each sampling point.
[0152] The performance analysis result of the scene information is used to indicate whether the scene information meets the performance index. In one embodiment, the sampling information includes the sampling direction of each sampling point. If there is at least one sampling point whose difference information does not meet the preset condition, the computer device determines that the scene information does not meet the performance index; accordingly, if the difference information of each sampling point in the sampling information meets the preset condition, the computer device determines that the scene information meets the performance index. Among them, the difference information of the jth sampling point does not meet the preset condition means that the difference value of the jth sampling point in any sampling direction includes a target difference value, the target difference value is greater than the difference threshold, and the target difference value is any one of the following: the difference value of the number of drawing operations, the difference value of the number of vertices, and the difference value of the number of meshes. For example, the sampling information includes sampling points 1-sampling points 3, and the difference information of sampling points 1-sampling points 3 includes: the difference value of the number of drawing operations, the difference value of the number of vertices, and the difference value of the number of meshes; if the difference value of the number of vertices of sampling point 2 (i.e., the target difference value) is greater than the difference threshold, the computer device determines that the scene information does not meet the performance index; if the difference information of sampling points 1-sampling points 3 meets the preset condition, the computer device determines that the scene information meets the performance index. For another example, the sampling information includes sampling point 1-sampling point 3, and the difference information of sampling point 1-sampling point 3 includes: a grid quantity difference value; if the grid quantity difference value of sampling point 1 (i.e., the target difference value) is greater than the difference threshold, the computer device determines that the scene information does not meet the performance indicator; if the difference information of sampling point 1-sampling point 3 meets the preset conditions, the computer device determines that the scene information meets the performance indicator.
[0153] In one embodiment, the difference comparison methods of different performance data may be the same or different, and the difference comparison methods may include but are not limited to: value comparison (difference comparison where the value change range is less than the range threshold may be applied), percentage comparison (difference comparison where the value change range is greater than the range threshold may be applied). The difference comparison methods of various performance data and the corresponding difference thresholds are shown in Table 3 below:
[0154] Table 3
[0155] Differences Comparison Difference threshold Differences in the number of times the interactive module performs drawing operations Value comparison 2 Vertex differences of the first type of scene elements Percentage comparison 0.1 Mesh differences for the second type of scene elements Percentage comparison 0.2 … … …
[0156] The difference item is the difference contained in the difference information, and the difference item has an index function. The corresponding comparison method and difference threshold can be determined through the difference item; for example, it can be seen from Table 3 that the comparison method corresponding to "vertex difference of the first type of scene element" is "percentage comparison", and the difference threshold is "0.1". It should be noted that the difference items and thresholds in Table 3 are only used for example and do not constitute actual limitations of this application. In actual applications, the difference items may also include the difference in the number of times the post-processing module performs the drawing operation, the mesh difference of the third type of scene element, and so on.
[0157] In another embodiment, the difference information of the sampling points may be as shown in Table 4 below:
[0158] Table 4
[0159]
[0160] As shown in Table 4, the difference information of the sampling point includes the difference values of various performance data, including basic information difference, module difference and difference coordinates (for the sampling point to which the difference information belongs). Among them, "FPS = -1.11" means that the FPS decreases by 1.11 compared with the sample data; "DrawCal1 = 9.38" means that the number of drawing operations performed increases by 9.38 times compared with the sample data; "Prims = 201,235.25" means that the number of meshes increases by 201,235.25 compared with the sample data; "Verts = 150,189.25" means that the number of vertices increases by 150,189.25 compared with the sample data. "Module Difference" is used to indicate more detailed performance data differences (such as performance data differences of different types of scene elements, performance data differences of various rendering modules). "ShadowPrims = 201,231.75" means that compared with the sample data, the number of meshes of the shadow type scene element has increased by 201,231.75; "ShadowVerts = 150,011" means that compared with the sample data, the number of vertices of the shadow type scene element has increased by 150,011. "Difference Coordinates = (103770, 203095, 0)" indicates the coordinates of the sampling point.
[0161] In another embodiment, the sampling information includes a target sampling point, and the difference information of the target sampling point does not meet the above preset conditions. The computer device performs an abnormal analysis on the difference information of the target sampling point to obtain an optimization strategy for the scene information. In one implementation, the difference information of the sampling point can be divided into different categories, and each category corresponds to an optimization strategy. The computer device obtains second mapping information, and the second mapping information is used to indicate the correspondence between the difference information of different categories and the optimization strategy, and determines the optimization strategy for the scene information based on the second mapping information and the category to which the difference information of the target sampling point belongs. In another implementation, the computer device analyzes the difference information of the target sampling point through a difference analysis model to obtain an optimization strategy for the scene information; wherein the difference analysis model is obtained by the computer device using a training data set to train the difference analysis model to be trained. Specifically, the training data set includes the data to be processed and the reference results corresponding to the data to be processed, and the difference analysis model to be trained is called to analyze the data to be processed to obtain the prediction results corresponding to the data to be processed, and then the difference analysis model to be trained is trained based on the difference between the prediction results corresponding to the data to be processed and the reference results corresponding to the data to be processed (such as adjusting the parameters or the number of network layers in the model) to obtain the difference analysis model. After determining the optimization strategy for the scene information, the computer device optimizes the scene information (repairs abnormalities) according to the optimization strategy to obtain the optimized scene information.
[0162] Figure 4d A schematic diagram of an abnormality repair process provided in an embodiment of the present application. Figure 4d As shown, when the difference information of the sampling point is detected to be abnormal (such as not meeting the preset conditions), the computer device performs abnormal analysis and optimizes the scene information based on the analysis results (abnormal repair). It should be noted that in the performance data statistics stage, in addition to the (global) performance data of each sampling point, the performance data of each rendering module and the performance data corresponding to each type of scene element (which can be understood as local performance data) are also counted. In the process of abnormal analysis, the computer device can quickly and accurately locate the abnormality based on these performance data, and perform targeted abnormal analysis, thereby improving the efficiency of troubleshooting and abnormal repair. In practical applications, factors that lead to abnormal performance data may include but are not limited to: (1) The post-processing effect of the view frame is increased. (2) The density of the scene element of the plant (Foliage) type in the view frame is adjusted or the corresponding mesh (Mesh) accuracy is modified. (3) The shadow strategy in the view frame is changed. (4) The character model in the view frame is upgraded or the character special effects are changed. (5) There is a new function UI or UI content in the view frame.
[0163] For example, in conjunction with Table 2, if it is detected that the FPS corresponding to "P1, D1" decreases (such as the FPS difference value is greater than the FPS difference threshold) during the comparison between the performance data and the sample data, the DC, Verts and Prims corresponding to "P1, D1" are further compared. If the DC, Verts and Prims corresponding to "P1, D1" all increase (such as the DC difference value is greater than the DC difference threshold, the Verts difference value is greater than the Verts difference threshold, and the Prims difference value is greater than the Prims difference threshold), the DC1, Verts1 and Prims1 corresponding to the scene elements of the first type (such as the shadow type) are further compared. If the Verts1 and Prims1 corresponding to "P1, D1" both increase (such as the Verts1 difference value is greater than the Verts difference threshold, and the Prims1 difference value is greater than the Prims difference threshold), an abnormality analysis is performed based on the above difference information (such as inferring that the terrain system (Landscape) is abnormal), and the scene information is optimized based on the abnormality analysis results (such as repairing the terrain system).
[0164] Figure 4e A performance analysis flow chart provided in the embodiment of the present application. Figure 4e As shown, the virtual scene is first traversed, and the performance data of each sampling point is counted during the traversal process; for example, the starting position of the traversal in the virtual scene is first specified, and the step size (such as a fixed step size, a random step size) is defined. The virtual scene is traversed based on the starting position and the step size, and each sampling point is sampled in one or more directions (i.e., the view frame corresponding to the current position and viewing angle is rendered), and the performance data of each view frame is counted. During the performance data statistics process, the statistical performance data is stored in stages (such as when it is detected that the statistical performance data meets the storage conditions). After completing the performance data statistics of all sampling points, the statistical performance data is archived, and the statistical performance data is compared with the sample data. Finally, the key performance data (such as the performance data selected by the developer) and the data comparison results (such as abnormal information) are archived.
[0165] Figure 4f A data processing architecture diagram provided in an embodiment of the present application. Figure 4f As shown, the data processing flow includes scene element classification, performance data statistics and performance analysis; the specific implementation method of scene element classification can be referred to Figure 4a For details on how to implement performance data statistics, please refer to Figure 4c For details on how to implement performance analysis, please refer to Figure 4e , I will not go into details here.
[0166] Combination Figure 4bFor example, scene elements 1 to 4 in the view frame are classified, and the classification results are: scene elements 1 and 2 are game props type scene elements, scene element 3 is a shadow type scene element, and scene element 4 is a plant type scene element. Assume that the rendering module includes: a grid transformation module, an interaction module, and a post-processing module. The computer device counts the number of times each rendering module is rendered. Figure 4b The performance data of the interactive module during the rendering of the view frame shown in FIG. Figure 4b The number of drawing operations performed during the view frame shown, as well as the number of vertices and meshes in the view frame associated with the interactive module; similarly, the performance data of the post-processing module includes the number of drawing operations performed during the rendering of the interactive module. Figure 4b The number of drawing operations performed during the view frame shown, as well as the number of vertices and meshes in the view frame associated with the interactive module; the performance data of the mesh transformation module includes the number of vertices and meshes in the view frame associated with the interactive module during rendering. Figure 4b The number of drawing operations performed during the process of the view frame shown, as well as the number of vertices and the number of meshes in the view frame associated with the interaction module. Further, the performance data of the mesh transformation module can also be divided into performance data of different types of scene elements, including: performance data of the mesh transformation module in the process of rendering game props type scene elements in the view frame, performance data of the mesh transformation module in the process of rendering shadow type scene elements in the view frame, and performance data of the mesh transformation module in the process of rendering plant type scene elements in the view frame; wherein, the performance data of the game prop type scene elements include the number of drawing operations performed by the mesh transformation module in the process of rendering game props type scene elements, and the number of vertices and the number of meshes associated with the game type scene elements; the performance data of the mesh transformation module in the process of rendering shadow type scene elements in the view frame, and the performance data of the mesh transformation module in the process of rendering plant type scene elements in the view frame are similar to the performance data of the mesh transformation module in the process of rendering game props type scene elements in the view frame, and will not be repeated here. From the above, it can be seen that when the data processing method provided by the present application is applied in a game scene, the performance data of different rendering modules and the performance data of different types of scene elements in the view frame can be counted by module. When there is a rendering abnormality in the view frame (such as the rendering time of the view frame is greater than the time threshold), the performance data of different rendering modules and the performance data of different types of scene elements in the view frame can be used to intuitively and quickly determine the cause of the view frame rendering abnormality (such as inferring the existence of an abnormality in the terrain system (Landscape) through the abnormal performance data of the shadow-type scene elements), without rebuilding the troubleshooting (Debug) package or performing other exception analysis operations, thereby improving the performance analysis efficiency of the scene information and the efficiency of exception repair.
[0167] In an embodiment of the present application, sampling information and scene information of a virtual scene are obtained, the sampling information includes the position of at least one sampling point in the virtual scene, and the view frame corresponding to each sampling point is rendered by at least two rendering modules to obtain a view frame set corresponding to the sampling information, and parameter analysis is performed on the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame, and performance analysis is performed on the scene information based on the performance data of each view frame to obtain a performance analysis result of the scene information. It can be seen that by performing parameter analysis on the parameters of each rendering module in the process of rendering each view frame, the problems existing in the rendering process can be determined more quickly and accurately, thereby improving the performance analysis efficiency of the scene information. In addition, in the process of performing exception analysis, the computer device can quickly and accurately locate the exception based on the performance data of each rendering module (or each type of scene element), thereby improving the efficiency of troubleshooting and repairing the scene information.
[0168] The method of the embodiment of the present application is described in detail above. In order to facilitate better implementation of the above scheme of the embodiment of the present application, the device of the embodiment of the present application is provided below accordingly.
[0169] See also Figure 5 , Figure 5 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application is shown in FIG. Figure 5 The data processing apparatus shown may be mounted in a computer device, which may specifically be a terminal device or a server. Figure 5 The data processing device shown can be used to perform the above Figure 2 and Figure 3 Some or all of the functions of the described method embodiments. Figure 5 , the data processing device comprises:
[0170] An acquisition unit 501 is used to acquire sampling information and scene information of a virtual scene, wherein the sampling information includes the position of at least one sampling point in the virtual scene; and the scene information is used to render view frames of the virtual scene at different sampling points;
[0171] A processing unit 501 is configured to render a view frame corresponding to each sampling point through at least two rendering modules to obtain a view frame set corresponding to the sampling information;
[0172] and for performing parameter analysis on the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame;
[0173] And it is used to perform performance analysis on the scene information based on the performance data of each view frame to obtain a performance analysis result of the scene information, and the performance analysis result is used to indicate whether the scene information meets the performance index.
[0174] In one embodiment, any one of the view frames in the view frame set is represented as the hth view frame; the performance data of the hth view frame includes: the number of times each rendering module performs drawing operations in the process of rendering the hth view frame;
[0175] The processing unit 502 is used to analyze the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame, specifically for:
[0176] Counting the number of times the i-th rendering module calls the graphics processing interface in the process of rendering the h-th view frame; the i-th rendering module is any one of the at least two rendering modules;
[0177] The number of times the i-th rendering module calls the graphics processing interface during the process of rendering the h-th view frame is determined as the number of times the i-th rendering module performs drawing operations during the process of rendering the h-th view frame.
[0178] In one embodiment, the virtual scene includes M types of scene elements; any view frame in the view frame set is represented as the hth view frame; the hth view frame includes P grids, M and P are both integers greater than 1; at least two rendering modules include a grid transformation module; the performance data of the hth view frame includes: the number of grids corresponding to each type of scene element in the hth view frame;
[0179] The processing unit 502 is used to analyze the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame, specifically for:
[0180] Obtaining a mesh rendering command and first mapping information of the hth view frame, wherein the mesh rendering command is generated by the mesh transformation module based on the scene information, and the mesh rendering command carries material information of P meshes; the first mapping information is used to indicate a mapping relationship between each type of scene element and the material information of the mesh;
[0181] Based on the first mapping information and the material information of the P meshes, the number of meshes corresponding to each type of scene element in the h-th view frame is counted.
[0182] In one embodiment, the virtual scene includes M types of scene elements, where M is an integer greater than 1; any one of the view frames in the view frame set is represented as the h-th view frame; at least two rendering modules include a mesh transformation module; the performance data of the h-th view frame includes: the number of vertices corresponding to each type of scene element in the h-th view frame, and the number of drawing operations associated with each type of scene element in the h-th view frame;
[0183] The processing unit 502 performs parameter analysis on the parameters of each rendering module in the process of rendering each view frame, and the process of obtaining the performance data of each view frame includes:
[0184] Obtaining a graphics processing interface call instruction of the h-th view frame, where the graphics processing interface call instruction is generated by the mesh transformation module based on the scene information, and the graphics processing interface call instruction carries vertex information and a type identifier; the vertex information is used to indicate the number of vertices associated with the graphics processing interface call instruction in the h-th view frame, and the type identifier is used to indicate the type of scene element associated with the graphics processing interface call instruction;
[0185] Based on the vertex information, the number of vertices corresponding to the scene elements of the target type in the h-th view frame is updated; and,
[0186] The number of drawing operations associated with the scene element of the target type in the hth view frame is incremented by one; the target type matches the type identifier.
[0187] In one implementation, the processing unit 502 is configured to perform performance analysis on the scene information based on the performance data of each view frame to obtain a performance analysis result of the scene information, specifically for:
[0188] Determine the performance data of the sampling point by using the performance data of the view frame associated with each sampling point in the sampling information;
[0189] Get the sample data associated with each sampling point;
[0190] Compare the performance data of each sampling point with the sample data associated with the sampling point to obtain difference information of each sampling point; the difference information of any sampling point is used to indicate the difference between the performance data of the sampling point and the corresponding sample data;
[0191] Based on the difference information of each sampling point, the performance analysis result of the scene information is determined.
[0192] In one implementation, the sampling information further includes a sampling direction of each sampling point; the view frame set includes R view frames, the R view frames are all view frames of the j-th sampling point in the k-th sampling direction, the j-th sampling point is any sampling point in the sampling information, the k-th sampling direction is any sampling direction of the j-th sampling point, and R is a positive integer; the performance data of any sampling point includes the performance data of the sampling point in each sampling direction;
[0193] The processing unit 502 is configured to determine the performance data of each sampling point through the performance data of the view frame associated with each sampling point in the sampling information, specifically to:
[0194] If R is equal to 1, the performance data of the view frame of the j-th sampling point in the k-th sampling direction is determined as the performance data of the j-th sampling point in the k-th sampling direction;
[0195] If R is greater than 1, the performance data of the R view frames are averaged to obtain the performance data of the j-th sampling point in the k-th sampling direction.
[0196] In one implementation, if the number of sampling directions of each sampling point is greater than 1, the performance data of any sampling point also includes the performance mean of the sampling point; the processing unit 502 is further configured to:
[0197] The performance data of the j-th sampling point in each sampling direction are averaged to obtain the performance mean of the j-th sampling point.
[0198] In one implementation, the sampling information further includes a sampling direction of each sampling point; the processing unit 502 is used to determine a performance analysis result of the scene information based on the difference information of each sampling point, specifically for:
[0199] If the difference information of at least one sampling point does not meet the preset condition, it is determined that the scene information does not meet the performance indicator;
[0200] If the difference information of each sampling point in the sampling information meets the preset conditions, it is determined that the scene information meets the performance indicator;
[0201] The difference information of the j-th sampling point includes a difference value of the j-th sampling point in at least one sampling direction, and the j-th sampling point is any sampling point in the sampling information; the difference value of the j-th sampling point in any sampling direction includes at least one of the following: a difference value of the number of drawing operations, a difference value of the number of vertices, and a difference value of the number of meshes; the difference information of the j-th sampling point does not meet the preset condition, which means that the difference value of the j-th sampling point in any sampling direction includes a target difference value, the target difference value is greater than the difference threshold, and the target difference value is any one of the following: a difference value of the number of drawing operations, a difference value of the number of vertices, and a difference value of the number of meshes.
[0202] In one implementation, the sampling information includes a target sampling point, and the difference information of the target sampling point does not meet a preset condition; the processing unit 502 is further configured to:
[0203] Acquire second mapping information, where the second mapping information is used to indicate a correspondence between different categories of difference information and optimization strategies;
[0204] Determining an optimization strategy for the scene information based on the category to which the difference information between the second mapping information and the target sampling point belongs;
[0205] According to the optimization strategy, the scene information is optimized to obtain optimized scene information.
[0206] In one implementation, the processing unit 502 performs parameter analysis on the parameters of each rendering module in the process of rendering each view frame, and the process of obtaining the performance data of each view frame includes:
[0207] In response to the fact that the performance data of the view frame that has been counted meets the storage condition, pausing the performance data of the view frame that has been counted, and storing the performance data that has been counted;
[0208] When it is detected that the storage of the statistical performance data is complete, the performance data of the view frame continues to be counted.
[0209] In one implementation, the processing unit 502 is used to obtain sampling information of the virtual scene, specifically to:
[0210] Obtaining starting position information and step length information, where the step length information is used to indicate the moving distance of each sampling in the virtual scene;
[0211] Starting from the position indicated by the starting position information, traverse the virtual scene according to the moving distance indicated by the step information to obtain at least two sampling points;
[0212] Based on the positions of the at least two sampling points, sampling information of the virtual scene is generated.
[0213] In one implementation, the processing unit 502 is used to obtain sampling information of the virtual scene, specifically to:
[0214] Obtaining preset route and step information, where the step information is used to indicate the moving distance of each sampling in the virtual scene;
[0215] The preset route is divided according to the moving distance indicated by the step information to obtain at least two sampling points, and the position of each sampling point is on the preset route;
[0216] Based on the positions of the at least two sampling points, sampling information of the virtual scene is generated.
[0217] According to one embodiment of the present application, Figure 2 and Figure 3 Some of the steps involved in the data processing method shown can be represented by Figure 5 The data processing device shown in the figure is executed by each unit. For example, Figure 2 The step S201 shown in FIG. 1 can be performed by Figure 5 The acquisition unit 501 shown in FIG. 1 is executed, and steps S202 to S204 can be performed by Figure 5 The processing unit 502 shown executes; Figure 3 Steps S301 and S305 shown in FIG. 3 can be represented by Figure 5 The acquisition unit 501 shown in FIG. 1 is executed, and steps S302 to S304, steps S306 and S307 can be performed by Figure 5 Processing unit 502 is shown executing. Figure 5 The various units in the data processing device shown can be respectively or all combined into one or several other units to constitute, or some of the units (some) can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of a unit can also be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of the present application, the data processing device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0218] According to another embodiment of the present application, the program can be executed by running a program on a general computing device such as a computer device including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 and Figure 3 A computer program (including program code) for each step involved in the corresponding method shown in Figure 5 The data processing device shown in and the data processing method of the embodiment of the present application are implemented. The computer program can be recorded on, for example, a computer readable recording medium, and loaded into the above-mentioned computing device through the computer readable recording medium and run therein.
[0219] Based on the same inventive concept, the principles and beneficial effects of solving the problems by the data processing device provided in the embodiment of the present application are similar to the principles and beneficial effects of solving the problems by the data processing method in the method embodiment of the present application. Please refer to the principles and beneficial effects of the implementation of the method. For the sake of concise description, they will not be repeated here.
[0220] See also Figure 6 , Figure 6 The following is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a terminal device or a server. Figure 6As shown, the computer device at least includes a processor 601, a communication interface 602 and a memory 603. The processor 601, the communication interface 602 and the memory 603 can be connected via a bus or other means. The processor 601 (or central processing unit (CPU)) is the computing core and control core of the computer device, which can parse various instructions in the computer device and process various data of the computer device. For example, the CPU can be used to parse the power on and off instructions issued by the object to the computer device, and control the computer device to perform power on and off operations; for example, the CPU can transmit various interactive data between the internal structures of the computer device, and so on. The communication interface 602 can optionally include a standard wired interface, a wireless interface (such as WI-FI, a mobile communication interface, etc.), which can be used to send and receive data under the control of the processor 601; the communication interface 602 can also be used for the transmission and interaction of data within the computer device. The memory 603 (Memory) is a memory device in the computer device, which is used to store programs and data. It can be understood that the memory 603 here can include both the built-in memory of the computer device and the extended memory supported by the computer device. The memory 603 provides a storage space, which stores the operating system of the computer device, including but not limited to: Android system, iOS system, Windows Phone system, etc., which is not limited in this application.
[0221] The embodiment of the present application also provides a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the processing system of the computer device. In addition, a computer program suitable for being loaded and executed by the processor 601 is also stored in the storage space. It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory, such as at least one disk storage; optionally, it can also be at least one computer-readable storage medium located away from the aforementioned processor.
[0222] In one embodiment, the processor 601 performs the following operations by running the computer program in the memory 603:
[0223] Acquire sampling information and scene information of the virtual scene, where the sampling information includes the position of at least one sampling point in the virtual scene; the scene information is used to render view frames of the virtual scene at different sampling points;
[0224] Rendering the view frame corresponding to each sampling point by at least two rendering modules to obtain a view frame set corresponding to the sampling information;
[0225] Analyze the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame;
[0226] The scene information is subjected to a performance analysis based on the performance data of each view frame to obtain a performance analysis result of the scene information, and the performance analysis result is used to indicate whether the scene information meets the performance index.
[0227] As an optional embodiment, any view frame in the view frame set is represented as the h-th view frame; the performance data of the h-th view frame includes: the number of times each rendering module performs drawing operations in the process of rendering the h-th view frame; the processor 601 performs parameter analysis on the parameters of each rendering module in the process of rendering each view frame, and a specific embodiment of obtaining the performance data of each view frame is:
[0228] Counting the number of times the i-th rendering module calls the graphics processing interface in the process of rendering the h-th view frame; the i-th rendering module is any one of the at least two rendering modules;
[0229] The number of times the i-th rendering module calls the graphics processing interface during the process of rendering the h-th view frame is determined as the number of times the i-th rendering module performs drawing operations during the process of rendering the h-th view frame.
[0230] As an optional embodiment, the virtual scene includes M types of scene elements; any view frame in the view frame set is represented as the hth view frame; the hth view frame includes P grids, M and P are both integers greater than 1; at least two rendering modules include a grid transformation module; the performance data of the hth view frame includes: the number of grids corresponding to each type of scene element in the hth view frame;
[0231] The processor 601 performs parameter analysis on the parameters of each rendering module in the process of rendering each view frame, and obtains the specific embodiment of the performance data of each view frame as follows:
[0232] Obtaining a mesh rendering command and first mapping information of the hth view frame, wherein the mesh rendering command is generated by the mesh transformation module based on the scene information, and the mesh rendering command carries material information of P meshes; the first mapping information is used to indicate a mapping relationship between each type of scene element and the material information of the mesh;
[0233] Based on the first mapping information and the material information of the P meshes, the number of meshes corresponding to each type of scene element in the h-th view frame is counted.
[0234] As an optional embodiment, the virtual scene includes M types of scene elements, where M is an integer greater than 1; any view frame in the view frame set is represented as the h-th view frame; at least two rendering modules include a mesh transformation module; the performance data of the h-th view frame includes: the number of vertices corresponding to each type of scene element in the h-th view frame, and the number of drawing operations associated with each type of scene element in the h-th view frame;
[0235] The processor 601 performs parameter analysis on the parameters of each rendering module in the process of rendering each view frame, and the process of obtaining the performance data of each view frame includes:
[0236] Obtaining a graphics processing interface call instruction of the h-th view frame, where the graphics processing interface call instruction is generated by the mesh transformation module based on the scene information, and the graphics processing interface call instruction carries vertex information and a type identifier; the vertex information is used to indicate the number of vertices associated with the graphics processing interface call instruction in the h-th view frame, and the type identifier is used to indicate the type of scene element associated with the graphics processing interface call instruction;
[0237] Based on the vertex information, the number of vertices corresponding to the scene elements of the target type in the h-th view frame is updated; and,
[0238] The number of drawing operations associated with the scene element of the target type in the hth view frame is incremented by one; the target type matches the type identifier.
[0239] As an optional embodiment, the processor 601 performs performance analysis on the scene information based on the performance data of each view frame, and a specific embodiment of obtaining the performance analysis result of the scene information is:
[0240] Determine the performance data of the sampling point by using the performance data of the view frame associated with each sampling point in the sampling information;
[0241] Get the sample data associated with each sampling point;
[0242] Compare the performance data of each sampling point with the sample data associated with the sampling point to obtain difference information of each sampling point; the difference information of any sampling point is used to indicate the difference between the performance data of the sampling point and the corresponding sample data;
[0243] Based on the difference information of each sampling point, the performance analysis result of the scene information is determined.
[0244] As an optional embodiment, the sampling information further includes a sampling direction of each sampling point; the view frame set includes R view frames, the R view frames are all view frames of the j-th sampling point in the k-th sampling direction, the j-th sampling point is any sampling point in the sampling information, the k-th sampling direction is any sampling direction of the j-th sampling point, and R is a positive integer; the performance data of any sampling point includes the performance data of the sampling point in each sampling direction;
[0245] A specific embodiment in which the processor 601 determines the performance data of each sampling point through the performance data of the view frame associated with each sampling point in the sampling information is as follows:
[0246] If R is equal to 1, the performance data of the view frame of the j-th sampling point in the k-th sampling direction is determined as the performance data of the j-th sampling point in the k-th sampling direction;
[0247] If R is greater than 1, the performance data of the R view frames are averaged to obtain the performance data of the j-th sampling point in the k-th sampling direction.
[0248] As an optional embodiment, if the number of sampling directions of each sampling point is greater than 1, the performance data of any sampling point also includes the performance mean of the sampling point; the processor 601 further performs the following operations by running the computer program in the memory 603:
[0249] The performance data of the j-th sampling point in each sampling direction are averaged to obtain the performance mean of the j-th sampling point.
[0250] As an optional embodiment, the sampling information further includes a sampling direction of each sampling point; the processor 601 determines the performance analysis result of the scene information based on the difference information of each sampling point. The specific embodiment is:
[0251] If the difference information of at least one sampling point does not meet the preset condition, it is determined that the scene information does not meet the performance indicator;
[0252] If the difference information of each sampling point in the sampling information meets the preset conditions, it is determined that the scene information meets the performance indicator;
[0253] The difference information of the j-th sampling point includes a difference value of the j-th sampling point in at least one sampling direction, and the j-th sampling point is any sampling point in the sampling information; the difference value of the j-th sampling point in any sampling direction includes at least one of the following: a difference value of the number of drawing operations, a difference value of the number of vertices, and a difference value of the number of meshes; the difference information of the j-th sampling point does not meet the preset condition, which means that the difference value of the j-th sampling point in any sampling direction includes a target difference value, the target difference value is greater than the difference threshold, and the target difference value is any one of the following: a difference value of the number of drawing operations, a difference value of the number of vertices, and a difference value of the number of meshes.
[0254] As an optional embodiment, the sampling information includes a target sampling point, and the difference information of the target sampling point does not meet the preset condition; the processor 601 further performs the following operations by running the computer program in the memory 603:
[0255] Acquire second mapping information, where the second mapping information is used to indicate a correspondence between different categories of difference information and optimization strategies;
[0256] Determining an optimization strategy for the scene information based on the category to which the difference information between the second mapping information and the target sampling point belongs;
[0257] According to the optimization strategy, the scene information is optimized to obtain optimized scene information.
[0258] As an optional embodiment, the processor 601 performs parameter analysis on the parameters of each rendering module in the process of rendering each view frame, and the process of obtaining the performance data of each view frame includes:
[0259] In response to the fact that the performance data of the view frame that has been counted meets the storage condition, pausing the performance data of the view frame that has been counted, and storing the performance data that has been counted;
[0260] When it is detected that the storage of the statistical performance data is complete, the performance data of the view frame continues to be counted.
[0261] As an optional embodiment, a specific embodiment of the processor 601 obtaining the sampling information of the virtual scene is:
[0262] Obtaining starting position information and step length information, where the step length information is used to indicate the moving distance of each sampling in the virtual scene;
[0263] Starting from the position indicated by the starting position information, traverse the virtual scene according to the moving distance indicated by the step information to obtain at least two sampling points;
[0264] Based on the positions of the at least two sampling points, sampling information of the virtual scene is generated.
[0265] As an optional embodiment, a specific embodiment of the processor 601 obtaining the sampling information of the virtual scene is:
[0266] Obtaining preset route and step information, where the step information is used to indicate the moving distance of each sampling in the virtual scene;
[0267] The preset route is divided according to the moving distance indicated by the step information to obtain at least two sampling points, and the position of each sampling point is on the preset route;
[0268] Based on the positions of the at least two sampling points, sampling information of the virtual scene is generated.
[0269] Based on the same inventive concept, the principles and beneficial effects of solving the problems provided by the computer device in the embodiment of the present application are similar to the principles and beneficial effects of solving the problems provided by the data processing method in the method embodiment of the present application. Please refer to the principles and beneficial effects of the implementation of the method. For the sake of concise description, they will not be repeated here.
[0270] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program is suitable for being loaded by a processor and executing the data processing method of the above method embodiment.
[0271] The embodiment of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned data processing method.
[0272] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0273] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0274] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the readable storage medium can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0275] What is disclosed above is only a preferred embodiment of the present application, and it certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiment and equivalent changes made according to the claims of the present application are still within the scope covered by the application.
Claims
1. A data processing method, characterized in that: The method comprises: Acquire sampling information and scene information of a virtual scene, wherein the sampling information includes the position of at least one sampling point in the virtual scene; the scene information is used to render view frames of the virtual scene at different sampling points; Rendering the view frame corresponding to each sampling point by at least two rendering modules to obtain a view frame set corresponding to the sampling information; Analyze the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame; A performance analysis is performed on the scene information based on the performance data of each view frame to obtain a performance analysis result of the scene information, where the performance analysis result is used to indicate whether the scene information meets a performance indicator.
2. The method according to claim 1, characterized in that Any view frame in the view frame set is represented as the hth view frame; The performance data of the h-th view frame includes: the number of times each rendering module performs drawing operations in the process of rendering the h-th view frame; The performing parameter analysis on the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame includes: Counting the number of times the i-th rendering module calls the graphics processing interface in the process of rendering the h-th view frame; the i-th rendering module is any one of the at least two rendering modules; The number of times the i-th rendering module calls a graphics processing interface during the process of rendering the h-th view frame is determined as the number of times the i-th rendering module performs drawing operations during the process of rendering the h-th view frame.
3. The method according to claim 1, characterized in that The virtual scene includes M types of scene elements; any one of the view frames in the view frame set is represented as the hth view frame; the hth view frame includes P grids, where M and P are both integers greater than 1; The at least two rendering modules include a mesh transformation module; The performance data of the h-th view frame includes: the number of grids corresponding to each type of scene element in the h-th view frame; The performing parameter analysis on the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame includes: Acquire a mesh rendering command and first mapping information of the h-th view frame, wherein the mesh rendering command is generated by the mesh transformation module based on the scene information, and the mesh rendering command carries material information of the P meshes; the first mapping information is used to indicate a mapping relationship between each type of scene element and the material information of the mesh; Based on the first mapping information and the material information of the P meshes, the number of meshes corresponding to each type of scene element in the hth view frame is counted.
4. The method according to claim 1, characterized in that The virtual scene includes M types of scene elements, where M is an integer greater than 1; any view frame in the view frame set is represented as the hth view frame; The at least two rendering modules include a mesh transformation module; The performance data of the h-th view frame includes: the number of vertices corresponding to each type of scene element in the h-th view frame, and the number of drawing operations associated with each type of scene element in the h-th view frame; The process of performing parameter analysis on the parameters of each rendering module in the process of rendering each view frame to obtain the performance data of each view frame includes: Acquire a graphics processing interface call instruction of the h-th view frame, where the graphics processing interface call instruction is generated by the mesh transformation module based on the scene information, and the graphics processing interface call instruction carries vertex information and a type identifier; the vertex information is used to indicate the number of vertices associated with the graphics processing interface call instruction in the h-th view frame, and the type identifier is used to indicate the type of scene element associated with the graphics processing interface call instruction; Based on the vertex information, updating the number of vertices corresponding to the scene elements of the target type in the h-th view frame; and The number of drawing operations associated with the scene element of the target type in the h-th view frame is incremented by one; the target type matches the type identifier.
5. The method according to claim 1, characterized in that The performing performance analysis on the scene information based on the performance data of each view frame to obtain a performance analysis result of the scene information includes: Determine the performance data of the sampling point by using the performance data of the view frame associated with each sampling point in the sampling information; Get the sample data associated with each sampling point; Comparing the performance data of each sampling point with the sample data associated with the sampling point to obtain difference information of each sampling point; the difference information of any sampling point is used to indicate the difference between the performance data of the sampling point and the corresponding sample data; Based on the difference information of each sampling point, a performance analysis result of the scene information is determined.
6. The method according to claim 5, characterized in that The sampling information also includes a sampling direction of each sampling point; the view frame set includes R view frames, the R view frames are all view frames of the j-th sampling point in the k-th sampling direction, the j-th sampling point is any sampling point in the sampling information, the k-th sampling direction is any sampling direction of the j-th sampling point, and R is a positive integer; the performance data of any sampling point includes the performance data of the sampling point in each sampling direction; The determining the performance data of each sampling point by the performance data of the view frame associated with each sampling point in the sampling information includes: If R is equal to 1, the performance data of the view frame of the j-th sampling point in the k-th sampling direction is determined as the performance data of the j-th sampling point in the k-th sampling direction; If R is greater than 1, average processing is performed on the performance data of the R view frames to obtain the performance data of the j-th sampling point in the k-th sampling direction.
7. The method according to claim 6, characterized in that If the number of sampling directions of each sampling point is greater than 1, the performance data of any sampling point also includes the performance mean of the sampling point; the method further includes: The performance data of the j-th sampling point in each sampling direction are averaged to obtain the performance average of the j-th sampling point.
8. The method according to claim 5, characterized in that The sampling information also includes a sampling direction of each sampling point; and the performance analysis result of the scene information is determined based on the difference information of each sampling point, including: If the difference information of at least one sampling point does not meet the preset condition, it is determined that the scene information does not meet the performance indicator; If the difference information of each sampling point in the sampling information satisfies the preset condition, it is determined that the scene information meets the performance indicator; The difference information of the j-th sampling point includes a difference value of the j-th sampling point in at least one sampling direction, and the j-th sampling point is any sampling point in the sampling information; the difference value of the j-th sampling point in any sampling direction includes at least one of the following: a difference value of the number of drawing operations, a difference value of the number of vertices, and a difference value of the number of meshes; the difference information of the j-th sampling point does not meet the preset condition if: the difference value of the j-th sampling point in any sampling direction includes a target difference value, the target difference value is greater than a difference threshold, and the target difference value is any one of the following: a difference value of the number of drawing operations, a difference value of the number of vertices, and a difference value of the number of meshes.
9. The method according to claim 8, characterized in that The sampling information includes a target sampling point, and the difference information of the target sampling point does not meet the preset condition; the method further includes: Acquire second mapping information, where the second mapping information is used to indicate a correspondence between different categories of difference information and optimization strategies; Determining an optimization strategy for the scene information based on the category to which the difference information between the second mapping information and the target sampling point belongs; According to the optimization strategy, the scene information is optimized to obtain optimized scene information.
10. The method according to claim 1, characterized in that The process of performing parameter analysis on the parameters of each rendering module in the process of rendering each view frame to obtain the performance data of each view frame includes: In response to the fact that the performance data of the view frame that has been counted meets the storage condition, pausing the performance data of the view frame that has been counted, and storing the performance data that has been counted; When it is detected that the storage of the statistical performance data is complete, the performance data of the view frame continues to be counted.
11. The method according to claim 1, characterized in that The step of obtaining sampling information of a virtual scene includes: Acquire starting position information and step information, wherein the step information is used to indicate the moving distance of each sampling in the virtual scene; Starting from the position indicated by the starting position information, traversing the virtual scene according to the moving distance indicated by the step information to obtain at least two sampling points; Based on the positions of the at least two sampling points, sampling information of the virtual scene is generated.
12. The method according to claim 1, characterized in that The step of obtaining sampling information of a virtual scene includes: Acquire preset route and step information, wherein the step information is used to indicate the moving distance of each sampling in the virtual scene; Divide the preset route according to the moving distance indicated by the step information to obtain at least two sampling points, each sampling point being located on the preset route; Based on the positions of the at least two sampling points, sampling information of the virtual scene is generated.
13. A data processing device, characterized in that: The data processing device comprises: An acquisition unit, configured to acquire sampling information and scene information of a virtual scene, wherein the sampling information includes the position of at least one sampling point in the virtual scene; and the scene information is used to render view frames of the virtual scene at different sampling points; A processing unit, configured to render a view frame corresponding to each sampling point through at least two rendering modules to obtain a view frame set corresponding to the sampling information; and for performing parameter analysis on the parameters of each rendering module in the process of rendering each view frame to obtain performance data of each view frame; And it is used to perform performance analysis on the scene information based on the performance data of each view frame to obtain a performance analysis result of the scene information, wherein the performance analysis result is used to indicate whether the scene information meets the performance index.
14. A computer device, characterized in that: include: a memory, wherein a computer program is stored in the memory; A processor, used to load the computer program to implement the data processing method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the data processing method according to any one of claims 1 to 12.
16. A computer program product, characterized in that The computer program product comprises a computer program, and the computer program is suitable for being loaded by a processor and executing the data processing method according to any one of claims 1 to 12.