Method and device for performing texture rendering on model, electronic equipment, computer readable storage medium and computer program product

By predicting the rendering computation and device performance of each edge of the model, the rendering rate and texture quality parameters are determined, solving the problem of balancing device performance and image quality in the game, and achieving stable high-quality rendering effects.

CN122072991APending Publication Date: 2026-05-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2024-11-22
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

Existing technologies have failed to effectively balance the performance of electronic devices and the quality of rendered images in games, resulting in texture data sizes that are too large or too small, affecting GPU and CPU load or image quality.

Method used

By predicting the rendering computation cost of each edge in the model to be rendered, and combining this with the performance parameters of the electronic device, the rendering rate and texture quality parameters are determined. Texture data that meets the quality parameters is then used for rendering to ensure that the rendering effect is within the device's capabilities.

Benefits of technology

It achieves optimal rendering results with limited electronic device configurations, ensuring stable performance and image quality, and avoiding performance degradation caused by texture data exceeding device capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122072991A_ABST
    Figure CN122072991A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for performing texture rendering on a model, electronic equipment, a computer readable storage medium and a computer program product. The method comprises the steps that the rendering calculation amount of each edge in a to-be-rendered model is predicted, and the rendering calculation amount represents the predicted calculation amount needed for rendering each edge; predicting a total rendering calculation amount of the model based on the predicted rendering calculation amount; based on the performance parameters of the electronic equipment and the total rendering calculation amount, the rendering rate is determined, and the rendering rate represents the number of models which can be rendered by the electronic equipment in unit time; and determining a texture quality parameter matched with the rendering rate, and rendering the surface of the model by using texture data corresponding to the texture quality parameter to obtain a texture map. Through the method, the quality of the texture data of the model can be accurately adapted according to the performance of the electronic equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to computer graphics processing technology, and more particularly to a method, apparatus, electronic device, computer-readable storage medium, and computer program product for texture rendering of a model. Background Technology

[0002] Taking games as an example, unreasonable texture data can lead to a decrease in game performance during gameplay. For instance, if the size is too large, it will increase the load on the graphics processing unit (GPU) and the central processing unit (CPU), while if the size of the texture data is too small, it will affect the quality of the image.

[0003] There is currently no effective solution for balancing the performance of electronic devices and the quality of rendered images. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for texture rendering of a model, which can accurately adapt the quality of the model's texture data according to the performance of the electronic device.

[0005] The technical solution of this application embodiment is implemented as follows:

[0006] This application provides a method for texture rendering of a model, the method comprising:

[0007] Predict the rendering computation amount for each edge in the model to be rendered, wherein the rendering computation amount represents the prediction computation amount required to render each edge;

[0008] Based on the predicted rendering computation amount, predict the total rendering computation amount of the model;

[0009] The rendering rate is determined based on the performance parameters of the electronic device and the total amount of rendering computation, wherein the rendering rate represents the number of models that the electronic device can render per unit time.

[0010] Determine the texture quality parameters that match the rendering rate, and use the texture data corresponding to the texture quality parameters to render the model surface to obtain a texture map.

[0011] This application provides an apparatus for texture rendering of a model, the apparatus comprising:

[0012] The first determining module is used to predict the rendering computation amount of each edge in the model to be rendered, wherein the rendering computation amount represents the prediction computation amount required to render each edge;

[0013] The second determining module is used to predict the total rendering computation of the model based on the predicted rendering computation amount;

[0014] A speed determination module is used to determine the rendering rate based on the performance parameters of the electronic device and the total amount of rendering computation, wherein the rendering rate represents the number of models that the electronic device can render per unit time.

[0015] The model rendering module is used to determine the texture quality parameters that match the rendering rate, and to render the model surface using texture data corresponding to the texture quality parameters to obtain a texture map.

[0016] This application provides an electronic device, the electronic device comprising:

[0017] Memory is used to store executable instructions or computer programs.

[0018] The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the method for texture rendering of a model provided in the embodiments of this application.

[0019] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the method for texture rendering of a model provided in this application when executed by a processor.

[0020] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the method for texture rendering of a model provided in this application.

[0021] The embodiments of this application have the following beneficial effects:

[0022] The amount of computation consumed by the model to be rendered depends mainly on the characteristics of the model's structure. The rendering computation of the model to be rendered is decomposed into the edge level for calculation. Combining the rendering computation of the edges can accurately predict the total rendering computation of the model to be rendered.

[0023] The rendering rate is determined by the performance parameters of the electronic device and the total rendering computation of the model to be rendered. Based on the rendering rate, the texture quality parameters of the texture data of the model to be rendered are determined. Texture data that conforms to the texture quality parameters is used to render the texture data. The texture data that conforms to the texture quality parameters will not exceed the rendering capability of the electronic device, thus ensuring the performance stability of the electronic device during the rendering process. On the other hand, the quality of the rendered texture data is the optimal quality that can be achieved within the rendering capability of the electronic device, ensuring the best rendering effect under the limited configuration conditions of the electronic device. Attached Figure Description

[0024] Figure 1 This is a schematic diagram of the architecture of the texture rendering system 100 of the model provided in this application embodiment;

[0025] Figure 2 This is a schematic diagram of the structure of the electronic device 500 provided in the embodiments of this application;

[0026] Figure 3A This is a first flowchart illustrating the method for texture rendering of a model provided in an embodiment of this application;

[0027] Figure 3B This is a second flowchart illustrating the method for texture rendering of a model provided in an embodiment of this application;

[0028] Figure 3C This is a schematic diagram of the third process of the method for texture rendering of a model provided in the embodiments of this application;

[0029] Figure 3D This is a schematic diagram of the fourth process of the method for texture rendering of a model provided in the embodiments of this application;

[0030] Figure 3E This is a fifth flowchart illustrating the method for texture rendering of a model provided in this application embodiment;

[0031] Figure 3F This is a sixth flowchart illustrating the method for texture rendering of a model provided in this application embodiment;

[0032] Figure 3G This is a seventh flowchart illustrating the method for texture rendering of a model provided in this application embodiment;

[0033] Figure 3H This is the eighth flowchart of the method for texture rendering of a model provided in the embodiments of this application;

[0034] Figure 3I This is a ninth flowchart illustrating the method for texture rendering of a model provided in this application embodiment;

[0035] Figure 3J This is a schematic diagram of the tenth process of the method for texture rendering of a model provided in the embodiments of this application;

[0036] Figure 3K This is a schematic diagram of the eleventh step of the method for texture rendering of a model provided in the embodiments of this application;

[0037] Figure 3L This is a schematic diagram of the twelfth step of the method for texture rendering of a model provided in the embodiments of this application;

[0038] Figure 3M This is a schematic diagram of the thirteenth step of the method for texture rendering of a model provided in the embodiments of this application;

[0039] Figure 3N This is a schematic diagram of the overall process of the method for texture rendering of a model provided in the embodiments of this application;

[0040] Figure 4A This is a schematic diagram of the model to be rendered provided in an embodiment of this application;

[0041] Figure 4B This is a partial structural diagram of the model to be rendered provided in an embodiment of this application;

[0042] Figure 4C This is a diagram showing the correspondence between device performance level, rendering rate, and texture quality parameters provided in the embodiments of this application.

[0043] Figure 4D This is a comparative diagram showing the texture quality before and after improvement provided in an embodiment of this application;

[0044] Figure 5 This is a diagram illustrating the training principle of the performance classification model provided in this application embodiment;

[0045] Figure 6 This is a schematic diagram illustrating the training principle of the texture quality parameter prediction model provided in this application embodiment;

[0046] Figure 7 This is a schematic diagram of the structure of the pre-trained super-resolution model provided in the embodiments of this application;

[0047] Figure 8 This is a schematic diagram of the texture optimization process provided in an embodiment of this application;

[0048] Figure 9 This is a schematic diagram of the loading process during texture debugging provided in an embodiment of this application;

[0049] Figure 10 This is a logical schematic diagram of texture selection and optimization based on device level provided in the embodiments of this application.

[0050] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0052] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0053] In the following description, the terms "first / second / third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0054] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0055] Unless otherwise specified, "at least one" as used below refers to one or more cases, and "multiple" can refer to two or more cases.

[0056] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.

[0057] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0058] 1) A 3D model is a digital representation of an object in three-dimensional space. It describes the shape and structure of the object through a series of basic geometric elements such as points, lines, and surfaces. 3D models can be divided into different types, such as polygonal models, surface models, and volumetric models.

[0059] 2) Performance parameters, which are parameters that reflect the computing performance of electronic devices. For example, they may include at least one of the following:

[0060] FLOPS (Functions Per Second): This indicates the number of operations a computer can perform per second. The higher the FLOPS, the more powerful the computer is at handling complex computational tasks.

[0061] Instructions per second (IPS): This indicates how many instructions a computer device can execute per second, reflecting the processor's instruction execution efficiency.

[0062] Trillion operations per second (TOPS): A parameter used to measure the performance of a computer device's processor. The higher the TOPS, the more powerful the processor's computing capabilities.

[0063] 3) Rendering computational cost refers to the number of times an electronic device needs to perform calculations for each edge of the model to be rendered. The rendering computational cost for each edge of the model can be represented by FLOPS.

[0064] 4) Total rendering computation refers to the total number of calculations (such as floating-point operations) required to render a model. It is a predicted value of the actual computing resources consumed by the model during the rendering phase. For example, the total rendering computation can be measured by the number of operations required, the amount of data processed, or the complexity of the problem solved.

[0065] 5) Texture quality parameters are a set of parameters used to measure and define the visual representation of textures in digital images or 3D models. These parameters determine the level of detail, sharpness, and performance of the texture during rendering. Texture quality parameters may include the following:

[0066] Resolution: Texture resolution refers to the size of the texture image, usually measured in pixels. High-resolution textures contain more pixels and can display richer details, while low-resolution textures are relatively blurry.

[0067] Compression Ratio: Texture compression is a technique that reduces texture size and memory footprint without significantly sacrificing image quality. The texture compression ratio describes the ratio between the original image data and the compressed data.

[0068] Mipmap levels: Mipmap is a technique that optimizes texture rendering at different viewing distances by creating a series of texture images with progressively decreasing resolution (called mipmap levels).

[0069] Texture filtering: Texture filtering technology determines how textures are sampled during rendering, including point sampling, linear sampling, anisotropic sampling, etc.

[0070] Color depth and bit depth: The color depth of a texture determines color precision, and is usually expressed in bits per pixel.

[0071] 6) Frequency features refer to the distribution of different frequency components in a texture image. These frequency components reflect the detail and complexity of the texture. In image processing and computer vision, frequency features can be analyzed by performing a Fourier transform on performance data over a period of time.

[0072] 7) Rendering rate refers to the number of 3D models rendered under given hardware conditions and time constraints. Factors determining the rendering rate include, but are not limited to, the performance parameters of the electronic device and the total amount of computation required to render the model.

[0073] 8) Complexity: A quantitative metric that measures the structural complexity of a portion of the mesh in a 3D model. For example, it can be defined from the following aspects:

[0074] 1. Number of vertices and edges. The number of vertices, V, refers to the total number of vertices in this part of the grid; the number of edges, E, refers to the total number of edges in this part of the grid.

[0075] 2. Number and type of faces. The number of faces, F, refers to the total number of faces in this part of the grid; the face type complexity, T, refers to the proportion of different types of faces, such as triangles, quadrilaterals, etc.

[0076] 3. Grid density. Grid density D refers to the number of grid cells per unit area or volume.

[0077] 4. Topological complexity. The number of holes H refers to the number of holes in this part of the mesh; the boundary complexity B refers to the number and complexity of the edges at the boundary.

[0078] 5. Degree of refinement of geometric features. Curvature variation K refers to the degree of curvature variation in this part of the mesh; number of feature edges C refers to the number of feature edges such as sharp edges, concave and convex edges.

[0079] 6. Regularity of the grid. The shape factor S measures the regularity of the grid shape, such as the aspect ratio of a triangle.

[0080] Taking all the above factors into account, the complexity Z of a partial grid can be defined as: Z = f(V, E, F, T, D, H, B, K, C, S), where the function f is a weighted function that combines various factors, and the specific form can be determined according to the application requirements.

[0081] In practical applications, the definition of complexity can be selected and adjusted according to specific needs. For example, in finite element analysis, more attention may be paid to mesh density and shape factor; while in computer graphics, more attention may be paid to the number of vertices and edges and the refinement of geometric features. Through this technical definition, the complexity of some meshes in a 3D model can be more accurately quantified, thus providing a scientific basis for model optimization, analysis, and processing.

[0082] 9) Responding to: used to indicate the conditions or states on which the operation performed depends. When the conditions or states on which it depends are met, one or more operations performed may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.

[0083] 10) Human-computer interaction interface, which is used to provide human-computer interaction functions or to display the rendered model to be rendered.

[0084] For example, graphical user interfaces (GUIs) include augmented reality (AR) interfaces, virtual reality (VR) interfaces, voice user interfaces (VUIs), interactive projection interfaces (using projection technology to display information on a flat surface), eye-tracking interfaces (interfaces controlled by detecting the user's gaze), holographic interfaces (three-dimensional holograms formed by projecting images using holographic projection technology, allowing users to see stereoscopic images without wearing special glasses), multimodal interfaces (interfaces that combine multiple interaction methods, such as tactile, visual, and auditory interaction), and brain-machine interfaces (BMIs).

[0085] The related technologies have the following technical problems when rendering textures on models:

[0086] 1) The related technologies only pre-set different texture qualities for different computer configurations, and do not involve the process of predicting the total rendering computation of the model based on the rendering computation of each edge in the current model, so as to determine the texture quality parameters. Therefore, it cannot guarantee that the current texture quality parameters match the computational amount required by the model.

[0087] 2) When related technologies improve the quality of low-quality textures, high-frequency information may be lost, and the clarity of the reconstructed texture cannot be guaranteed.

[0088] To address the aforementioned technical problems, embodiments of this application provide a method for texture rendering of a model, which can accurately adapt the quality of the model's texture data according to the performance of the electronic device.

[0089] The following describes exemplary applications of the electronic devices provided in the embodiments of this application. These electronic devices can be implemented as various types of terminals such as laptops, tablets, desktop computers, set-top boxes, smartphones, smart speakers, smartwatches, smart TVs, and in-vehicle terminals, or as servers. The following will describe exemplary applications when the electronic device is implemented as an electronic device.

[0090] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the texture rendering system 100 for the model provided in this application embodiment. In order to support the texture rendering application of a model, the terminal 400 connects to the server 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0091] Terminal 400 is used to determine the total amount of rendering computation for the model to be rendered, and to determine the rendering rate based on the total amount of rendering computation and the performance parameters of the electronic device. Based on the rendering rate, the texture quality parameters of the texture data of the model to be rendered are determined, and a texture map is rendered on the surface of the model to be rendered based on the texture data that conforms to the texture quality parameters. The rendered model to be rendered is then displayed on the human-computer interaction interface 410.

[0092] Taking a game scene as an example, terminal 400 identifies each edge in the model to be rendered, calculates the rendering computation of each edge, and sends the rendering computation of each edge to server 200. Server 200 predicts the total rendering computation of the model to be rendered based on the received rendering computation of each edge, determines the rendering rate based on the performance parameters of the electronic device and the total rendering computation, determines the texture quality parameters of the texture data of the model to be rendered based on the rendering rate, and returns the texture data that conforms to the texture quality parameters to terminal 400. Terminal 400 renders the shape on the surface of the model to be rendered using the received texture data that conforms to the texture quality parameters. The server 400 can either generate a texture map and display the rendered model on the human-computer interaction interface 410; or, the terminal 400 can independently determine the rendering rate based on the rendering computation of each edge, thereby determining the texture quality parameter corresponding to the rendering rate, and using texture data that conforms to the texture quality parameter to render a texture map on the surface of the model to be rendered, and display the rendered model on the human-computer interaction interface 410; or, the server 200 can independently determine the rendering rate based on the rendering computation of each edge, thereby determining the texture quality parameter corresponding to the rendering rate, and sending texture data that conforms to the texture quality parameter to the terminal 400 for texture rendering.

[0093] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals and servers can be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment.

[0094] See Figure 2 , Figure 2 This is a schematic diagram of the structure of the electronic device 500 provided in the embodiments of this application. Figure 2 The electronic device 500 shown can be Figure 1 The terminal 400 or server 200, and the electronic device 500 include: at least one processor 510, memory 550, at least one network interface 520, and user interface 530. The various components in the terminal 500 are coupled together via a bus system 540. It is understood that the bus system 540 is used to implement communication between these components. In addition to a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 2 The general labeled all buses as Bus System 540.

[0095] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0096] User interface 530 includes one or more output devices 531 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0097] The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 550 may optionally include one or more storage devices physically located away from the processor 510.

[0098] The memory 550 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 550 described in this application embodiment is intended to include any suitable type of memory.

[0099] In some embodiments, memory 550 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0100] Operating system 551 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0101] The network communication module 552 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.

[0102] Presentation module 553 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 531 (e.g., a display screen, a speaker, etc.) associated with user interface 530;

[0103] The input processing module 554 is used to detect and translate one or more user inputs or interactions from one or more input devices 532.

[0104] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 2 A device 555 for texture rendering of a model, stored in memory 550, is shown. This device can be software in the form of programs or plugins, and includes the following software modules: a first determination module 5551, a second determination module 5552, a speed determination module 5553, and a model rendering module 5554. These modules are logically connected and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.

[0105] In some embodiments, the terminal or server can implement the texture rendering method for the model provided in this application by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be microprogram-level commands, machine instructions, or software instructions. Computer programs can be native programs or software modules in an operating system; they can be native applications (APPs), i.e., programs that need to be installed in the operating system to run, such as game APPs; or they can be applets that can be embedded in any APP, i.e., programs that only need to be downloaded to a browser environment to run. In summary, the aforementioned computer-executable instructions can be any form of instruction, and the aforementioned computer programs can be any form of application, module, or plugin.

[0106] The following describes the method for texture rendering of a model provided in the embodiments of this application. As mentioned above, the electronic device implementing the method for texture rendering of a model in the embodiments of this application can be a terminal or a server, or a combination of both. Therefore, the executing entity of each step will not be described again below.

[0107] See Figure 3A , Figure 3A This is a first flowchart illustrating a method for texture rendering of a model provided in this application embodiment, which can be executed by the aforementioned terminal or server, and will be combined with... Figure 3A The steps shown are explained.

[0108] In step 101, the rendering computation cost of each edge in the model to be rendered is predicted, wherein the rendering computation cost represents the prediction computation cost required to render each edge.

[0109] In some embodiments, the model to be rendered includes multiple meshes, each mesh including multiple vertices and multiple edges, and the rendering computation cost of each edge in the model to be rendered is determined, wherein the rendering computation cost of each edge is an estimate of the actual rendering computation cost of that edge.

[0110] For example, see Figure 4A , Figure 4A This is a schematic diagram of the model to be rendered provided in an embodiment of this application. Figure 4A In the model 437 to be rendered, there are multiple meshes, such as mesh 420, mesh 430, mesh 431, mesh 432, and mesh 433. The mesh shape can be triangular, and each mesh consists of three vertices and three edges. See also Figure 4B , Figure 4B This is a partial structural diagram of the model to be rendered provided in an embodiment of this application. Figure 4B yes Figure 4AAn enlarged view of the shaded area (i.e., the connected component consisting of grids 420, 430, 431, 432, and 433), taking each grid as a triangle, such as grid 420, where grid 420 includes multiple vertices and multiple edges, such as edges 421, 422, and 423, and vertices 424, 425, and 426.

[0111] Here, the specific methods for predicting rendering computational load include any of the following:

[0112] Texture mapping calculation: For each edge, the UV coordinates of its vertices need to be calculated and these coordinates are mapped to the texture space. The time required to map the two vertices of the edge is summed as the rendering computation cost.

[0113] Texture sampling calculation: For each fragment (pixel), color values ​​need to be sampled from the texture. The sum of the number of texture sampling operations for all fragments on the edge can be used as the rendering computation cost.

[0114] Lighting and shading calculations: During rendering, each fragment needs to have its final color value calculated based on the lighting model. This includes calculations of texture color, lighting models (such as Phong or Blinn-Phong), and effects such as shadows and highlights. The number of fragments processed on an edge can be considered as the rendering computational cost.

[0115] Total computational cost: The total computational cost is the sum of the computational costs of the above items. {Total computational cost} = {Texture mapping computational cost} + {Texture sampling computational cost} + {Lighting and shading computational cost}.

[0116] Other factors can also be considered when measuring computational load, such as the parallel processing capabilities of the GPU or the impact of rendering optimization techniques. By comparing the computational load of different models or different rendering techniques, rendering performance can be evaluated and optimized.

[0117] In some embodiments, see Figure 3B , Figure 3B This is a schematic diagram of the second process of the method for texture rendering of a model provided in the embodiments of this application. Figure 3A Step 101, "Predicting the rendering computation cost of each edge in the model to be rendered," can be performed for each edge in the model. Figure 3B Steps 1011 to 1014 are explained in detail below.

[0118] In step 1011, at least one neighboring edge of an edge is found from the model.

[0119] In some embodiments, a mesh is a multidimensional graphical structure composed of discrete vertices and edges, commonly used in computer graphics to represent the geometry of 3D models to facilitate the simulation and rendering of the surfaces of 3D objects. Meshes are one of the most common methods for representing the geometry of objects in 3D modeling and rendering. Vertices are the basic building blocks of a mesh; each vertex represents a point in space, typically containing position coordinates and potentially additional information such as normals, color, and texture coordinates. Edges are line segments connecting vertices, defining the boundaries and topology of the mesh. In a triangular mesh, each edge connects two vertices and is part of a triangle. For any edge of any mesh, its adjacent edges are those that share a vertex with that edge.

[0120] Following the example of step 101 above, taking edge 422 of grid 420 as an example, at least one of the adjacent edges of edge 422 can be at least one of edge 421, edge 423, edge 427 and edge 428.

[0121] In step 1012, the first complexity of the region where the neighboring vertex of each neighboring edge is located is determined, where a neighboring vertex is a vertex that belongs to the neighboring edge but not to the edge, and the region where the neighboring vertex is located includes multiple meshes in the model to be rendered that intersect with the neighboring vertex.

[0122] In some embodiments, a neighboring vertex refers to a vertex in a mesh of a 3D model that is directly connected to a particular vertex, i.e., another vertex connected to that vertex via a shared edge. In a mesh model, each vertex can have multiple neighboring vertices, which are the other vertices that constitute the face on which that vertex is located.

[0123] Following the example of step 1011 above, taking edge 427 as the neighboring edge of edge 422, edge 427 has vertices 426 and 429. Since edge 422 also has vertex 426, the neighboring vertex is the vertex that belongs to the neighboring edge but does not belong to the edge. Therefore, for edge 427, the neighboring vertex is vertex 429.

[0124] In some embodiments, the region containing the neighboring vertices is a connected block consisting of multiple meshes in the model to be rendered that intersect at the neighboring vertices.

[0125] Following the example of step 1011 above, taking vertex 429 as an example, the region where vertex 429 is located is a connected component composed of grids 430, 431, 432 and 433.

[0126] In some embodiments, the first complexity can also be calculated from at least one of the following factors: number of vertices V, number of edges E, number of faces F, face type complexity T, mesh density D, number of holes H, boundary complexity B, curvature variation K, number of feature edges C, and shape factor S. The complexity Z of the region containing neighboring vertices can be defined as: Z = f(V, E, F, T, D, H, B, K, C, S), where the function f is a weighted function that integrates the various factors.

[0127] For example, the complexity Z of the region containing neighboring vertices can be expressed by the following formula:

[0128] Z=w1*V+w2*E+w3*F+w4*T+w5*D+w6*H+w7*B+w8*K+w9*C+w 10 *S (1)

[0129] Where w1 is the weight of the number of vertices V, w2 is the weight of the number of edges E, w3 is the weight of the number of faces F, w4 is the weight of the face type complexity T, w5 is the weight of the mesh density D, w6 is the weight of the number of holes H, w7 is the weight of the boundary complexity B, w8 is the weight of the curvature variation K, w9 is the weight of the number of feature edges C, w 10 It is the weight of the shape factor S.

[0130] In some embodiments, see Figure 3C , Figure 3C This is a schematic diagram of the third process of the method for texture rendering of a model provided in the embodiments of this application. Figure 3B Step 1012, "Determine the first complexity of the region containing the neighboring vertices of each neighboring edge," can be performed for each neighboring vertex. Figure 3C Steps 10121 to 10123 are explained in detail below.

[0131] In step 10121, the weights corresponding to the multiple grids intersecting with neighboring vertices are determined, and the weights of the multiple grids intersecting with neighboring vertices are summed.

[0132] Following the example of step 1012 above, determine the weight w1 of grid 430, the weight w2 of grid 431, the weight w3 of grid 432 and the weight w4 of grid 433, and determine the weight sum w = w1 + w2 + w3 + w4 corresponding to the weights of the multiple grids respectively.

[0133] In some embodiments, see Figure 3D , Figure 3D This is a schematic diagram of the fourth process of the method for texture rendering of a model provided in the embodiments of this application. Figure 3CStep 10121, "Determine the weights corresponding to the multiple grids intersecting with neighboring vertices," can be executed for any grid connected to a neighboring vertex. Figure 3D Steps 201 to 202 are explained in detail below.

[0134] In step 201, the number of neighboring vertices of each vertex in the mesh is determined, where the number of neighboring vertices is the number of vertices in the model that are adjacent to the vertex.

[0135] Following the example of step 1012 above, taking grid 430 as an example, grid 430 includes vertex 424, vertex 426 and vertex 429. Vertex 424 has 4 neighboring vertices, vertex 426 has 4 neighboring vertices, and vertex 429 has 5 neighboring vertices.

[0136] In step 202, the sum of the number of neighboring vertices of multiple vertices is used as the weight of the grid.

[0137] Following the example of step 201 above, the sum of the number of neighboring vertices of vertex 424, vertex 426, and vertex 429 is 4+4+5=13, so the weight of grid 430 is w1=13.

[0138] In some embodiments, the sum of the number of neighboring vertices of multiple vertices can be normalized, and the result of the normalization can be used as the weight of the grid.

[0139] For example, the ratio of the sum of the number of neighboring vertices of multiple vertices to the total number of vertices in the model to be rendered can be calculated, and this ratio can be used as the weight of the mesh. For instance, if the sum of the number of neighboring vertices of multiple vertices is 13 and the total number of vertices is 100, then the weight of mesh 430 is 13 / 100.

[0140] See also Figure 3C In step 10122, the distance between the neighboring vertex and other vertices in the model is determined, where other vertices are any vertex other than the neighboring vertices in the model.

[0141] Following the example from step 1012 above, if the neighboring vertex is vertex 429, then the other vertices are vertex 424, vertex 425, vertex 426, vertex 434, vertex 435, and vertex 436. Determine the distances between the neighboring vertex and the other vertices in the model to be rendered. If the coordinates of vertex 429 are (x1, y1, z1) and the coordinates of vertex 424 are (x2, y2, z2), then the distance between vertex 429 and vertex 424 can be expressed by the following formula:

[0142]

[0143] Where r1 is the distance between vertex 429 and vertex 424, (x1, y1, z1) are the coordinates of vertex 429, and (x2, y2, z2) are the coordinates of vertex 424.

[0144] In step 10123, the first complexity of the region where the neighboring vertices are located is determined based on the sum of distance and weight.

[0145] Following the examples of steps 202 and 10122 above, taking vertex 429 as an adjacent vertex, if the distances between vertex 429 and vertices 424, 425, 426, 434, 435 and 436 are r1, r2, r3, r4, r5 and r6 respectively, then the sum of the distances between vertex 429 and other vertices is r = r1 + r2 + r3 + r4 + r5 + r6. The region containing adjacent vertices is essentially a collection of grids intersecting at those adjacent vertices, such as grids 430, 431, 432, and 433. The weights of grids 430, 431, 432, and 433 are: w1 = 13; w2 = 4 + 5 + 3 = 12; w3 = 3 + 2 + 5 = 10; and w4 = 5 + 4 + 2 = 11. Therefore, the sum of the weights, w = w1 + w2 + w3 + w4 = 13 + 12 + 10 + 11 = 46. The ratio of the sum of the weights, w, to the sum of the distances, r, is taken as the first complexity of the region containing vertex 429. This first complexity can be expressed by the following formula:

[0146]

[0147] Where v1 is the first complexity of the region where vertex 429 is located, w is the weight sum, and r is the distance sum.

[0148] See also Figure 3B In step 1013, the second complexity of the region where the neighboring vertex of each neighboring vertex is located is determined, wherein the neighboring vertex is the vertex in the adjacent grid except for the vertex in the grid where the adjacent edge is located, and the adjacent grid is the grid that shares an edge with the grid where the adjacent edge is located.

[0149] Following the example of step 1012 above, taking edge 427 as the neighboring edge and vertex 429 as the neighboring vertex, the grids containing the neighboring edge are grids 430 and 433. The grids adjacent to the grid containing the neighboring edge are grids 420, 431, 432, and 433. The vertices of grids 420, 431, and 432 include vertices 424, 425, 426, 434, 429, 435, and 436. Since vertex 429 is a neighboring vertex, and vertices 424 and 426 are vertices of edge 422, the neighboring vertex is any one of vertices 425, 434, 435, and 436.

[0150] The second complexity of the region containing the neighboring vertices of each neighboring vertex can be achieved by performing the following processing:

[0151] First, determine the weights of the multiple grids that intersect with each other at neighboring vertices, and then sum the weights of the multiple grids that intersect with each other at neighboring vertices.

[0152] Following the example of step 1013 above, taking vertex 434 as an example, the grids where vertex 434 is located are grids 431 and 432. The weight of grid 431 is 12 and the weight of grid 432 is 10. Therefore, the sum of the weights of the grids where vertex 434 is located is 22.

[0153] Secondly, determine the distance between the neighboring vertices and the candidate vertices in the model to be rendered, where the candidate vertex is any vertex other than the neighboring vertices in the model to be rendered.

[0154] Continuing with the example above, taking vertex 434 as an example, if the coordinates of vertex 434 are (x... 11 y 11 , z 11 The coordinates of any candidate vertex are (x, y). m y m , z m If the distance between a neighboring vertex and any candidate vertex in the model to be rendered is given by the following formula:

[0155]

[0156] Where, r 11 Let x be the distance between vertex 434 and any candidate vertex. 11 y 11 , z 11 (x) represents the coordinates of vertex 434. m y m , z m ) represents the coordinates of any candidate vertex.

[0157] Finally, based on the weighted sum and distance, the second complexity of the region where the neighboring vertices are located is determined.

[0158] Continuing with the example above, taking vertex 434 as an example, the weight sum is 22, and the distance between the neighboring vertex and any candidate vertex in the model to be rendered is represented as r. 11 If there are 10 candidate vertices, then the sum of the distances between vertex 434 and all candidate vertices is the sum of the distances. The second complexity of the region containing vertex 434 can be expressed as the ratio of the sum of the weights of the grid containing vertex 434 to the sum of the distances. For example, the second complexity can be expressed by the following formula:

[0159]

[0160] Where v2 represents the second complexity of the region where vertex 434 is located, s represents the sum of distances between vertex 434 and all candidate vertices, m represents the order of the candidate vertices, and 1≤m≤10.

[0161] In step 1014, the rendering computation of the edge is predicted based on the first complexity and the second complexity.

[0162] In some embodiments, the rendering computation of multiple edges can be calculated in batches using multiple threads. The mesh can be divided into multiple subsets, with one thread processing one subset. For each mesh, the number of neighboring vertices of its vertex and the second complexity of the neighboring vertices can be calculated in parallel. The distance between the neighboring vertex and other vertices in the model to be rendered can also be calculated in parallel.

[0163] This application embodiment uses multi-threaded parallel processing to quickly calculate the first complexity of each neighboring vertex and the second complexity of the neighboring vertices, thereby determining the rendering computation of the edge and improving the computational efficiency of the edge rendering computation.

[0164] In some embodiments, see Figure 3E , Figure 3E This is a fifth flowchart illustrating the method for texture rendering of a model provided in this application embodiment. Figure 3B Step 1014 can be achieved through Figure 3E Steps 10141 to 10145 are implemented, and the details are explained below.

[0165] In step 10141, for each neighboring vertex, the difference between the first complexity of the region where the neighboring vertex is located and the second complexity of the region where the neighboring vertex is located is determined.

[0166] Following the examples in steps 10123 and 1013 above, taking vertex 429 as a neighboring vertex, the first complexity of the region containing the neighboring vertex is... Taking vertex 434 as an example, the second complexity of the region containing the neighboring vertex is... The difference between the first complexity of the region containing neighboring vertices and the second complexity of the region containing neighboring vertices can be expressed by the following formula:

[0167]

[0168] Where a represents the difference between the first complexity of the region where the neighboring vertex is located and the second complexity of the region where the neighboring vertex is located, v1 represents the first complexity, v2 represents the second complexity, r represents the sum of the distances between vertex 494 and other vertices, and s represents the sum of the distances between vertex 434 and all candidate vertices.

[0169] Here, the first complexity of the region containing the neighboring vertex reflects the complexity of the local region centered on the neighboring vertex across all grids. A neighboring vertex is a vertex in a grid adjacent to the grid containing its neighboring edge. Determining the second complexity of the region containing the neighboring vertex helps compare the complexity of different grid regions, thus better representing changes in local structure. The difference in complexity represents the difference between the complexity of the region containing the neighboring vertex and the complexity of its neighboring vertices; this difference can reflect the degree of geometric change between local regions.

[0170] In step 10142, the first product of the eigenvectors of the adjacent edges and the difference is determined.

[0171] In some embodiments, the feature vector of an adjacent edge can be the direction vector from one vertex of the adjacent edge to another vertex, that is, the coordinate difference between the two vertices of the adjacent edge in each dimension is calculated and used as the vector representation of the feature vector of the adjacent edge in that dimension.

[0172] Following the example from step 10141 above, taking edge 427 as an adjacent edge, if the coordinates of vertex 429 are (x1, y1, z1) and the coordinates of vertex 426 are (x3, y3, z3), then the eigenvector of edge 427 is e1 = (x1 - x3, y1 - y3, z1 - z3). The first product of the eigenvector e of edge 427 and the difference a can be expressed by the following formula:

[0173]

[0174] Where b1 represents the first product of the eigenvector and the difference of edge 427, e1 represents the eigenvector of edge 427, and a represents the difference.

[0175] Here, by multiplying the feature vectors of neighboring edges by the difference in complexity, the information in the feature vectors related to local geometric changes is enhanced, so that these regions can be processed more accurately in subsequent rendering processes.

[0176] In step 10143, the first sum of the first products corresponding to the multiple neighboring vertices is determined.

[0177] Following the example from step 10142 above, taking edge 422 as an example, its multiple neighboring vertices are vertices 425, 429, 434, and 436. The first product corresponding to vertex 429 is b1. If the first product corresponding to vertex 425 is b2, the first product corresponding to vertex 434 is b3, and the first product corresponding to vertex 436 is b4, then the first sum can be expressed by the following formula:

[0178] c = b1 + b2 + b3 + b4 (8)

[0179] Where c represents the first sum, b1 represents the first product corresponding to vertex 429, b2 represents the first product corresponding to vertex 425, b3 represents the first product corresponding to vertex 434, and b4 represents the first product corresponding to vertex 436.

[0180] Here, the first summation is the accumulation of the first products corresponding to all neighboring vertices, which summarizes the local complexity information of the region where all neighboring vertices are located, providing a comprehensive complexity index.

[0181] In step 10144, the second product of the feature vector of the edge and the preset convolution kernel is determined.

[0182] In some embodiments, the feature vector of an edge can be the direction vector from one vertex of the edge to another vertex, that is, calculating the coordinate difference between the two vertices of the edge in each coordinate dimension, and using it as the vector representation of the edge's feature vector in that dimension. The convolution kernel can be preset according to the volume of the model to be rendered; the size of the convolution kernel is positively correlated with the volume of the model to be rendered. Models within the same size range can use the same convolution kernel.

[0183] Following the example from step 1011 above, taking edge 422 as an example, the two vertices of edge 422 are vertices 424 and 426, with coordinates of vertex 424 being (x2, y2, z2) and coordinates of vertex 426 being (x3, y3, z3). Therefore, the feature vector of edge 422 is e2 = (x2 - x3, y2 - y3, z2 - z3). If the preset convolution kernel is n0, the second product of the feature vector of edge 422 and the preset convolution kernel n0 can be expressed by the following formula:

[0184] d=e2·n0=(x2-x3, y2-y3, z2-z3)·n0 (9)

[0185] Where d represents the second product of the feature vector of edge 422 and the preset convolution kernel, e2 represents the feature vector of edge 422, and n0 represents the preset convolution kernel.

[0186] Here, the feature vector of the edge is multiplied by the convolution kernel to extract higher-level features of the edge, so as to reflect the geometric computational cost of the edge.

[0187] In step 10145, the second sum of the second product and the first sum is determined, and the second sum is used as the rendering computation cost of the predicted edge.

[0188] Following the examples of steps 10143 and 10144 above, the second sum f1 of the second product d and the first sum c is d·c, and the second sum f1 is used as the rendering computation amount of edge 422.

[0189] Here, the second sum combines the high-level features of the edge with the local complexity information of the region where the neighboring vertices are located. It can allocate corresponding computing resources according to the local geometric complexity and global features of the edge, and use the pre-allocated computing resources as the rendering computing amount of the edge.

[0190] This application's embodiments determine the rendering computational cost of edges from multiple dimensions, combining geometric complexity (first complexity and second complexity) and directional information (feature vectors) to provide a comprehensive assessment of rendering computational cost. By analyzing the complexity of neighboring vertices and edges, the rendering requirements of local regions in the mesh can be identified, facilitating more refined rendering optimization. Considering the directionality of edges, optimization can be performed for rendering requirements in different directions. By introducing preset convolution kernels, the impact of specific visual effects on rendering performance can be simulated, making the computational cost assessment more consistent with actual rendering scenarios. This provides a quantitative method to predict rendering computational cost, helping to make performance optimization and resource allocation decisions before rendering. By accurately assessing which regions require more computational resources, redundant computation in visually unimportant regions can be reduced, solving the aforementioned technical problem 1.

[0191] See also Figure 3A In step 102, the total amount of rendering computation of the predicted model is calculated based on the predicted rendering computation amount.

[0192] In some embodiments, the rendering computation of multiple edges in the model to be rendered is summed to obtain the total rendering computation of the model to be rendered.

[0193] Following the example in step 10145 above, if the model to be rendered has a total of n edges, the computational cost of rendering the i-th edge is f. i Where 1≤i≤n, the total rendering computation of the model to be rendered can be expressed by the following formula:

[0194]

[0195] Where F represents the total rendering computation of the model to be rendered, f i Let i represent the rendering computation cost of the i-th edge, where 1 ≤ i ≤ n, and i is a positive integer.

[0196] Here, the total amount of rendering computation for the model can also be predicted using the following methods:

[0197] Method 1: Record all layers in the model (such as convolutional layers, fully connected layers, and pooling layers) and their number; for each layer, calculate the number of operations required to perform one forward propagation; sum the number of operations for all layers to obtain the total rendering computation of the predicted model.

[0198] Method 2: Find a baseline model with a similar structure to the model to be predicted; record the resource usage of the baseline model on different hardware; use the data from the baseline model to compare the total computation of the prediction model.

[0199] Method 3: Collect performance data of different models, including model size, structure, number of operations, and rendering time; identify features associated with rendering time; use these features to train a regression model; use the trained regression model to predict the total rendering computation of the model.

[0200] In step 103, the rendering rate is determined based on the performance parameters of the electronic device and the total amount of rendering computation, wherein the rendering rate characterizes the number of models that the electronic device can render per unit time.

[0201] Here, the unit of time can be set according to the task requirements, for example, it can be one minute, fifteen minutes or one hour.

[0202] In some embodiments, see Figure 3F , Figure 3F This is a schematic diagram of the sixth process of the method for texture rendering of a model provided in the embodiments of this application. Figure 3A Step 103, "Determine the rendering rate based on the performance parameters of the electronic device and the total amount of rendering computation," can be achieved through... Figure 3F Steps 1031 to 1034 are implemented, and the details are explained below.

[0203] In some embodiments, when the total number of device performance levels of the electronic device sample is three, steps 1031 to 1034 are performed.

[0204] In step 1031, the frequency features of the first performance parameter sample are extracted, wherein the first performance parameter sample is the performance parameter of the first electronic device sample at a preset first device performance level.

[0205] For example, the frequency characteristics of the first performance parameter sample can be obtained by performing a Fourier transform on the first performance parameter sample. The preset first device performance level can be the highest device performance level among the three device performance levels of the electronic device sample.

[0206] Here, the first performance parameter sample may include multiple performance data points of a first electronic device sample at multiple sampling time points, representing a preset first device performance level. Performing a Fourier transform on the first performance parameter sample decomposes the various variation patterns (such as trends, periodic fluctuations, and random noise) contained in the multiple performance data into sine and cosine waves of different frequencies. This reveals the different frequency components contained in the performance data, each corresponding to a specific pattern. For example, low-frequency components may represent long-term trends, while high-frequency components may represent short-term fluctuations or noise, representing the main oscillations or noise sources in the operation of the electronic device. Frequency components with smaller amplitudes usually indicate that these frequencies contribute less to the overall signal and may be random noise or minor interference factors. By analyzing the amplitudes of these frequency components, a deeper understanding of the device's performance can be gained. The Fourier transform can not only identify components of different frequencies but also determine the amplitude (representing the intensity of the frequency component) and phase (representing the time position of the frequency component relative to a reference point) of each frequency component. Multiplying the frequency characteristics by the total rendering computation is equivalent to weighting the total rendering computation in the frequency domain. This can be seen as strengthening or weakening the influence of the total rendering computation at different frequencies, and can be used to indicate which frequency components have a greater impact on rendering performance and which have a smaller impact.

[0207] In step 1032, the ratio of the second performance parameter sample to the third performance parameter sample is determined. The second performance parameter sample is the performance parameter of the second electronic device sample at a preset second device performance level, and the third performance parameter sample is the performance parameter of the third electronic device sample at a preset third device performance level. The performance parameter of the first electronic device sample at the first device performance level is higher than that of the second electronic device sample at the second device performance level, and the performance parameter of the second electronic device sample at the second device performance level is higher than that of the third electronic device sample at the third device performance level.

[0208] For example, if the first performance parameter sample is D H The second performance parameter sample is D. M The third performance parameter sample is D. L Then D h At the preset first device performance level, D m At the preset second device performance level, D L It is at the preset third device performance level, where D H >D m >D l .

[0209] Here, the ratio of the second performance parameter sample to the third performance parameter sample quantifies the performance difference from the second device level to the third device level, helping to understand the performance gradient between different device levels. The rate of change from the second device level to the third device level provides an exponential decay factor to describe how the performance parameter changes with the device level, reflecting the relative importance of the performance parameter and its impact on rendering rate.

[0210] In step 1033, the product of frequency characteristics, ratios, and total rendering computation is determined.

[0211] In some embodiments, the ratio of the second performance parameter sample to the third performance parameter sample can be exponentially calculated to obtain the rate of change from the second device level where the second performance parameter sample is located to the third device level where the third performance parameter sample is located. The product of the frequency characteristics, the rate of change, and the total rendering computation is then determined.

[0212] Following the examples of steps 102 and 1032 above, the frequency characteristics of the first performance parameter sample can be expressed as FFT(D H ), where FFT represents the Fourier transform. The ratio of the second performance parameter sample to the third performance parameter sample can be expressed as The rate of change from the second equipment level to the third equipment level can be expressed as: The product of frequency characteristics, rate of change, and total rendering computation can be expressed by the following formula:

[0213]

[0214] Where g represents the product of frequency characteristics, rate of change, and total rendering computation, FFT(D H ) represents frequency characteristics. This represents the rate of change, and F represents the total amount of rendering calculations.

[0215] Here, the performance metrics of the server cluster executing rendering tasks are statistically analyzed. Three performance metric intervals are defined according to a predetermined ratio. For example, the statistically obtained performance metrics are sorted in descending order, with each 1 / 3 of the performance metrics forming a performance metric interval. Each performance metric interval corresponds to a device performance level. For instance, the performance metric interval consisting of the first 1 / 3 of the metrics corresponds to the first device performance level, the middle 1 / 3 to the second device performance level, and the last 1 / 3 to the third device performance level. The median value or the average value of each performance metric interval is taken as the performance parameter sample for that interval.

[0216] This application embodiment uses the median or average value from the performance index range of different device performance levels as a sample of performance parameters that can characterize the device performance level of the performance index range. This makes the performance parameter sample representative, which can more accurately reflect the performance value of the performance index range and improve the accuracy of the calculation results.

[0217] In step 1034, the ratio of the performance parameters of the electronic device to the product is used as the rendering rate.

[0218] Following the example in step 1033 above, if the current performance parameter of the electronic device is P, the ratio of the electronic device's performance parameter to the product can be expressed by the following formula:

[0219]

[0220] Where v represents the ratio of the electronic device's performance parameters to the product, v is used as the rendering rate, P represents the electronic device's current performance parameters, and g represents the product.

[0221] This application's embodiments integrate the effects of frequency characteristics, rate of change, and rendering computational load, providing a comprehensive metric that reflects the combined impact of electronic device performance parameters on rendering speed. By analyzing the product, key factors affecting rendering speed can be identified, and corresponding optimization measures can be taken. For example, if a certain frequency component has a significant impact on rendering speed, hardware or software configurations can be optimized accordingly. Using the ratio of the electronic device's performance parameters to the product as the rendering speed provides a quantitative indicator to evaluate the performance of different devices, allowing for the selection of appropriate devices to meet specific rendering needs based on the rendering speed.

[0222] In some embodiments, the ratio of the performance parameters of the electronic device to the total amount of rendering computation can be used as the rendering rate.

[0223] For example, if the current performance parameter of the electronic device is P, the total rendering computation of the model to be rendered is... The ratio of the performance parameters of an electronic device to the total amount of rendering computation can be expressed by the following formula:

[0224]

[0225] Where v represents the ratio of the electronic device's performance parameters to the total amount of rendering computation, v is used as the rendering rate, P represents the current performance parameters of the electronic device, and F represents the total amount of rendering computation for the model to be rendered.

[0226] See also Figure 3A In step 104, a texture quality parameter matching the rendering rate is determined, and texture data corresponding to the texture quality parameter is used to render the model surface to obtain a texture map.

[0227] Here, the rendering rate is positively correlated with the texture quality parameters of the texture data of the model to be rendered; that is, the higher the rendering rate, the higher the texture quality parameters of the texture data of the model to be rendered.

[0228] For example, the relationship between rendering rate and texture quality parameters can be: y = f(x), where x represents the rendering rate, y represents the texture quality parameters, and f(x) can be a monotonically increasing linear function or a non-linear function.

[0229] In some embodiments, see Figure 3G , Figure 3G This is a schematic diagram of the seventh process of the method for texture rendering of a model provided in the embodiments of this application. Figure 3A Step 104, "Determine the texture quality parameters that match the rendering rate," can be achieved through... Figure 3G Steps 1041A to 1042A are implemented, and the details are explained below.

[0230] In step 1041A, the target rendering rate range within a preset plurality of rendering rate ranges is determined, wherein the plurality of rendering rate ranges correspond to a plurality of texture quality parameters and a plurality of device performance levels, including a first device performance level, a second device performance level, and a third device performance level.

[0231] Here, each rendering rate range corresponds to a texture quality parameter, and each rendering rate range corresponds to a device performance level; that is, one texture quality parameter corresponds to one device performance level. If the first device performance level is greater than the second device performance level, and the second device performance level is greater than the third device performance level, then the first texture quality parameter corresponding to the first device performance level is greater than the second texture quality parameter corresponding to the second device performance level, and the second texture quality parameter corresponding to the second device performance level is greater than the third texture quality parameter corresponding to the third device performance level.

[0232] In some embodiments, for each device performance level, the maximum and minimum rendering rates of the electronic device samples within that device performance level are determined as endpoints of the rendering rate intervals corresponding to that device performance level. Specifically, if the minimum rendering rate in the first rendering rate interval corresponding to the first device performance level is less than the maximum rendering rate in the second rendering rate interval corresponding to the second device performance level, a first average of the minimum rendering rate in the first rendering rate interval and the maximum rendering rate in the second rendering rate interval is determined, and this first average is used as the boundary between the first and second rendering rate intervals. If the minimum rendering rate in the second rendering rate interval corresponding to the second device performance level is less than the maximum rendering rate in the third rendering rate interval corresponding to the third device performance level, a second average of the minimum rendering rate in the second rendering rate interval and the maximum rendering rate in the third rendering rate interval is determined, and this second average is used as the boundary between the second and third rendering rate intervals.

[0233] For example, if the number of electronic device samples in the first device performance level is 3, namely electronic device sample 1, electronic device sample 2, and electronic device sample 3, and the rendering rate of electronic device sample 1 is v1 = 8, the rendering rate of electronic device sample 2 is v2 = 12, and the rendering rate of electronic device sample 3 is v3 = 14, then the maximum rendering rate in the first rendering rate interval formed by rendering rates v1, v2, and v3 is 14, and the minimum rendering rate is 8; if the number of electronic device samples in the second device performance level is 3, namely electronic device sample 4, electronic device sample 5, and electronic device sample 6, and the rendering rate of electronic device sample 4 is v4 = 10, the maximum rendering rate in the first rendering rate interval formed by rendering rates v1, v2, and v3 is 14, then the minimum rendering rate in the second device performance level is 8. If the rendering rate of electronic device sample 5 is v5 = 8 and the rendering rate of electronic device sample 6 is v6 = 5, then the maximum rendering rate in the second rendering rate interval formed by rendering rates v4, v5 and v6 is 10 and the minimum rendering rate is 5. If the number of electronic device samples in the third device performance level is 3, namely electronic device sample 7, electronic device sample 8 and electronic device sample 9, the rendering rate of electronic device sample 7 is v7 = 7, the rendering rate of electronic device sample 8 is v8 = 3 and the rendering rate of electronic device sample 9 is v9 = 2, then the maximum rendering rate in the third rendering rate interval formed by rendering rates v7, v8 and v9 is 7 and the minimum rendering rate is 2. At this point, the minimum rendering rate 8 in the first rendering rate interval corresponding to the first device performance level is less than the maximum rendering rate 10 in the second rendering rate interval corresponding to the second device performance level. Therefore, the first average 9 of the minimum rendering rate 8 in the first rendering rate interval and the maximum rendering rate 10 in the second rendering rate interval is determined. This first average 9 is used as the boundary between the first and second rendering rate intervals. All rendering rates in the first rendering rate interval are greater than 9, meaning the rendering rate v4 of electronic device sample 4 is added to the first rendering rate interval, and the rendering rate v1 of electronic device sample 1 is removed from the first rendering rate interval. The second rendering rate interval corresponding to the second device performance level... If the minimum rendering rate 5 is less than the maximum rendering rate 7 in the third rendering rate interval corresponding to the third device performance level, then the second average value 6 of the minimum rendering rate 5 in the second rendering rate interval and the maximum rendering rate 7 in the third rendering rate interval is determined. The second average value 6 is used as the dividing point between the second rendering rate interval and the third rendering rate interval. All rendering rates in the second rendering rate interval are between 6 and 9, and all rendering rates in the third rendering rate interval are less than 6. That is, the rendering rate v1 of electronic device sample 1 is added to the second rendering rate interval, the rendering rate v7 of electronic device sample 7 is added to the second rendering rate interval, and the rendering rate v6 of electronic device sample 6 is transferred to the third rendering rate interval.

[0234] For example, see Figure 4C , Figure 4C This is a diagram showing the correspondence between device performance level, rendering rate, and texture quality parameters provided in the embodiments of this application. Figure 4C In the first device performance level, the first rendering rate range is (9, 15), which means the minimum rendering rate in the first rendering rate range is 9 and the maximum rendering rate is 15. The second device performance level corresponds to the second rendering rate range, which is (6, 8), which means the minimum rendering rate in the second rendering rate range is 6 and the maximum rendering rate is 8. The third device performance level corresponds to the third rendering rate range, which is (1, 5), which means the minimum rendering rate in the third rendering rate range is 1 and the maximum rendering rate is 5.

[0235] In some embodiments, the maximum rendering rate and the minimum rendering rate are obtained by having the electronic device render the same model, that is, the number of models that can be rendered per unit of time.

[0236] For example, the unit of time is 1 hour. Calculate the number of times the model is fully rendered within 1 hour. If the last rendering is not completed, it is calculated according to the completion rate. For example, if it is fully rendered 2 times and the third rendering is only 50%, then the rendering rate is 2.5.

[0237] This application's embodiments, by determining the maximum and minimum rendering rates, can provide a precise rendering rate range for each device level. By calculating the boundary point between two adjacent rendering rate intervals, overlap between different rendering rate intervals can be avoided, ensuring the independence of each rendering rate interval. It is applicable to different device performance levels and scenarios, and can be flexibly adjusted according to the actual device performance. The clear boundary points improve the efficiency of performance classification and reduce computational load, as it eliminates the need for performance level testing on a per-device basis.

[0238] In step 1042A, the texture quality parameter corresponding to the target rendering rate range is used as the texture quality parameter that matches the rendering rate.

[0239] Following the example of step 1041A above, if the rendering rate is 11, and the rendering rate range in which the rendering rate 11 falls is the first rendering rate range, then the first rendering rate range is taken as the target rendering rate range. If the texture quality parameter corresponding to the first rendering rate range is the first texture quality parameter, then the first texture quality parameter is taken as the texture quality parameter that matches the rendering rate.

[0240] Here, the number of models to be rendered per unit time for electronic device samples of different device performance categories can be calculated. For each device performance category, the median or average number of electronic device samples rendered in that device performance category is taken as the rendering rate of that device performance category.

[0241] In some embodiments, see Figure 3H , Figure 3H This is the eighth flowchart of the method for texture rendering of a model provided in the embodiments of this application. Figure 3A Step 104, "Determine the texture quality parameters that match the rendering rate," can also be achieved through... Figure 3H Steps 1041B to 1042B are implemented, and the details are explained below.

[0242] In step 1041B, based on the rendering rate, the target device performance level of the electronic device is determined from a plurality of preset device performance levels, wherein the plurality of device performance levels are associated with different texture quality parameters, and the device performance level and texture quality parameters are positively correlated.

[0243] Here, the rendering rate is positively correlated with the device performance level; that is, the higher the rendering rate, the higher the device performance level, and the higher the texture quality parameters.

[0244] For examples, see below. Figure 4C The first device performance level is associated with the first texture quality parameter, the second device performance level is associated with the second texture quality parameter, and the third device performance level is associated with the third texture quality parameter. The first device performance level is greater than the second device performance level, the second device performance level is greater than the third device performance level, the first texture quality parameter is greater than the second texture quality parameter, and the second texture quality parameter is greater than the third texture quality parameter.

[0245] In some embodiments, see Figure 3I , Figure 3I This is a ninth flowchart illustrating the method for texture rendering of a model provided in this application embodiment. Figure 3H Step 1041B, "Determining the target device performance level of the electronic device from a set of preset device performance levels based on rendering rate," can also be achieved through... Figure 3I Steps 10411B to 10412B are implemented, and the details are explained below.

[0246] In step 10411B, the rendering rate, the performance parameters of the electronic device's processor, the storage space parameters of the electronic device, and their corresponding weight parameters are weighted and summed to obtain the performance parameters of the electronic device.

[0247] In some embodiments, the performance parameters of the processor of an electronic device include the performance parameters of the CPU and the performance parameters of the GPU, and the storage space parameters of the electronic device characterize the size of the storage space of the electronic device.

[0248] For example, if the weight parameter corresponding to the rendering rate v is m1, the weight parameter corresponding to the CPU performance parameter h1 is m2, the weight parameter corresponding to the GPU performance parameter h2 is m3, and the weight parameter corresponding to the electronic device's storage space parameter r is m4, then the electronic device's performance parameter H = m1*v + m2*h1 + m3*h2 + m4*r.

[0249] In step 10412B, the target performance parameter range in which the performance parameters of the electronic device are located is determined from the multiple performance parameter ranges corresponding to the multiple device performance levels, and the device performance level associated with the target performance parameter range is taken as the target device performance level in which the electronic device is located.

[0250] In some embodiments, the multiple device performance levels include a first device performance level, a second device performance level, and a third device performance level. The first device performance level corresponds to a first performance parameter range, the second device performance level corresponds to a second performance parameter range, and the third device performance level corresponds to a third performance parameter range. The first device performance level is greater than the second device performance level, the second device performance level is greater than the third device performance level, the minimum value of the first performance parameter range is greater than the maximum value of the second performance parameter range, and the minimum value of the second performance parameter range is greater than the maximum value of the third performance parameter range.

[0251] In some embodiments, before step 10412B "taking the device performance level associated with the target performance parameter range as the target device performance level of the electronic device", the following process is performed: inputting the performance parameters into a pre-trained performance classification model to obtain the device performance level corresponding to the performance parameters.

[0252] Here, the performance parameters are within the target performance parameter range, and the device performance level corresponding to the performance parameters is the device performance level associated with the target performance parameter range.

[0253] In some embodiments, see Figure 3J , Figure 3J This is a schematic diagram of the tenth step of the method for texture rendering of a model provided in this application embodiment. The above-mentioned "pre-trained performance classification model" can be executed... Figure 3J The training results obtained from steps 301 to 305 are explained in detail below.

[0254] In step 301, the initialized performance classification model is obtained.

[0255] Here, the initialization representation randomly assigns values ​​to the parameters of the performance classification model, for example, assigning all parameters of the performance classification model to 0 or all to 1. The performance classification model can be various neural network models, such as Multilayer Perceptron (MLP), Recurrent Neural Network (RNN), Long Short-Term Memory (LSTM), and Transformer.

[0256] In step 302, performance parameter samples and real category labels are obtained, wherein the real category label represents the real device performance level corresponding to the performance parameter sample.

[0257] Here, the actual category label can be manually labeled, and the device performance level can be represented by a numerical range, such as [1, 3], where 1 is the lowest, representing the lowest device performance level (third device performance level), and 3 is the highest, representing the highest device performance level (first device performance level).

[0258] In step 303, the initialized performance classification model is invoked based on the performance parameter samples to obtain the predicted category label. The predicted category label represents the predicted device performance level corresponding to the performance parameter samples.

[0259] For example, see Figure 5 , Figure 5 This is a schematic diagram illustrating the training principle of the performance classification model provided in this application embodiment. Based on performance parameter samples, the convolutional and fully connected layers of the initialized performance classification model can be invoked to obtain the predicted class labels.

[0260] In step 304, the category loss value is determined based on the true category label and the predicted category label.

[0261] In some embodiments, the class loss value can be determined by substituting the true class label and the predicted class label into the loss function.

[0262] For example, the loss function can be the mean squared error loss function, the cross-entropy loss function, the multi-label classification loss function, and the triplet loss function.

[0263] In step 305, the parameters of the initialized performance classification model are updated based on the category loss value to obtain the pre-trained performance classification model.

[0264] In some embodiments, the class loss value is backpropagated to update the parameters of the initialized performance classification model. The process of calculating the class loss value and updating the parameters is repeated multiple times until the class loss value no longer increases or decreases, at which point the iteration process stops, and a pre-trained performance classification model is formed.

[0265] For example, backpropagation is implemented using the backpropagation algorithm, which calculates the gradient of each neuron from the output layer to the input layer and updates the neuron's weights and biases based on the gradients. Gradient descent is used to continuously update the parameters, thus reducing the loss value. Various gradient descent algorithms can be used, such as batch gradient descent, stochastic gradient descent, adaptive gradient descent, and momentum gradient descent.

[0266] In this embodiment, the pre-trained performance classification model can accurately classify electronic devices into corresponding performance levels based on performance parameters, thus improving classification accuracy. By automatically processing performance parameters, the complexity and time cost of manual analysis and classification are reduced. The pre-trained model can be trained based on different performance parameter samples and category labels, adapting to various devices and scenarios.

[0267] See also Figure 3H In step 1042B, the texture quality parameter associated with the target device performance level is used as the texture quality parameter that matches the rendering rate.

[0268] In some embodiments, prior to step 1042B, the following process is performed: the performance parameters of the electronic device are input into a pre-trained texture quality parameter prediction model to perform texture quality prediction, thereby obtaining texture quality parameters associated with the performance level of the target device.

[0269] In some embodiments, see Figure 3K , Figure 3K This is a schematic diagram of the eleventh step in the method for texture rendering of a model provided in this application embodiment. The aforementioned "pre-trained texture quality parameter prediction model" can be executed... Figure 3K The training was completed in steps 401 to 405, and the details are explained below.

[0270] In step 401, the initialized texture quality parameter prediction model is obtained.

[0271] Here, the initialization representation randomly assigns values ​​to the parameters of the texture quality parameter prediction model, for example, assigning all parameters of the texture quality parameter prediction model to 0 or all to 1.

[0272] In step 402, multiple performance parameter samples corresponding to multiple device performance levels are obtained, and real texture quality parameter labels pre-labeled for the multiple performance parameter samples are obtained.

[0273] Here, we obtain the basic parameter samples of electronic devices at different performance levels. The labels of the real texture quality parameters can be manually annotated and can be represented by a numerical range, such as [1, 3], where 1 is the lowest, representing the lowest texture quality parameter (the third texture quality parameter), and 3 is the highest, representing the highest texture quality parameter (the first texture quality parameter).

[0274] In step 403, the initialized texture quality parameter prediction model is called based on multiple performance parameter samples to predict texture quality and obtain the predicted texture quality parameter labels.

[0275] For example, see Figure 6 , Figure 6 This is a schematic diagram illustrating the training principle of the texture quality parameter prediction model provided in this application embodiment. Based on multiple performance parameter samples, the convolutional and fully connected layers of the initialized texture quality parameter prediction model can be invoked to obtain the predicted texture quality parameter labels.

[0276] In step 404, the texture quality parameter loss is determined based on the true texture quality parameter labels and the predicted texture quality parameter labels.

[0277] In some embodiments, the texture quality parameter loss can be determined by substituting the true texture quality parameter labels and the predicted texture quality parameter labels into the loss function.

[0278] For example, the loss function can be the mean squared error loss function, the cross-entropy loss function, the multi-label classification loss function, and the triplet loss function.

[0279] In step 405, the parameters of the initialized texture quality parameter prediction model are updated based on the texture quality parameter loss to obtain the pre-trained texture quality parameter prediction model.

[0280] In some embodiments, the texture quality parameter loss is backpropagated to update the parameters of the initialized texture quality parameter prediction model. The process of calculating the texture quality parameter loss and updating the parameters is repeated multiple times until the texture quality parameter loss no longer increases or decreases, at which point the iteration process is stopped, and a pre-trained texture quality parameter prediction model is formed.

[0281] For example, backpropagation is implemented using the backpropagation algorithm, which calculates the gradient of each neuron from the output layer to the input layer and updates the neuron's weights and biases based on the gradients. Gradient descent is used to continuously update the parameters, thus reducing the loss value. Various gradient descent algorithms can be used, such as batch gradient descent, stochastic gradient descent, adaptive gradient descent, and momentum gradient descent.

[0282] In some embodiments, when the model to be rendered is a model of a virtual object in a virtual scene, during the operation of the virtual scene, after step 104 "determine the texture quality parameters that match the rendering rate", the following processing is performed: the target texture quality parameters preset for the target texture quality category, the texture quality parameters, the current frame rate of the virtual scene, the frame rate threshold, the rendering rate, and the performance parameters of the electronic device are substituted into a pre-built texture quality model for solving to obtain new texture quality parameters, wherein the texture quality model includes at least one of the following functions: quality function, frame rate function, and resource consumption function.

[0283] In some embodiments, the quality function includes a target texture quality parameter preset for the target texture quality category, a texture quality parameter, and a texture quality parameter to be selected; the frame rate function includes the current frame rate and frame rate threshold of the virtual scene; and the resource consumption function includes the rendering rate and the performance parameters of the electronic device. The weights corresponding to the quality function, frame rate function, and resource consumption function are obtained respectively. The quality product of the quality function and its corresponding first weight is determined; the frame rate product of the frame rate function and its corresponding second weight is determined; the resource consumption product of the resource consumption function and its corresponding third weight is determined; the sum of the quality product and the frame rate product is determined; the difference between the sum and the resource consumption product is determined; this difference is used as the texture quality model; the target texture quality parameter preset for the target texture quality category, the texture quality parameter, the current frame rate of the virtual scene, the frame rate threshold, the rendering rate, and the performance parameters of the electronic device are substituted into the texture quality model to determine the value of the texture quality parameter to be selected when the texture quality model reaches its minimum value; this value is used as the new texture quality parameter.

[0284] For example, the frame rate function can be the difference between the current frame rate of the virtual scene and a frame rate threshold. For instance, the frame rate function could be f = k1*x - k2*y, where f represents the difference, x represents the current frame rate, y represents the frame rate threshold, and k1 and k2 can be obtained by sampling the frame rate of electronic device samples at multiple times and fitting the sampled frame rates and the frame rate threshold together. The resource consumption function can be used to represent the relationship between the rendering rate and the performance parameters of the electronic device. This relationship can be positively correlated, negatively correlated, linear, or non-linear. For example, the resource consumption function could be p = k*g, where p represents the rendering rate, g represents the performance parameters of the electronic device, and k can be obtained by fitting the rendering rate and performance parameters of multiple electronic device samples together.

[0285] The texture quality model in this application dynamically adjusts texture quality parameters during rendering to adapt to real-time changing rendering conditions and performance metrics. By comprehensively considering frame rate, rendering speed, and device performance, the model can maximize texture quality while maintaining a smooth frame rate. The texture quality model helps optimize resource consumption, avoids using high-resolution textures in unnecessary scenes, thereby saving computational resources and storage space, and ensuring reasonable rendering results even on low-performance devices.

[0286] In some embodiments, see Figure 3L , Figure 3L This is a schematic diagram of the twelfth step of the method for texture rendering of a model provided in this application embodiment. After step 104, "determine the texture quality parameters that match the rendering rate", the following steps are executed: Figure 3L Steps 501 to 502 are explained in detail below.

[0287] In step 501, the scaling factor of the texture data resolution is determined based on the target texture quality parameters preset for the target texture quality category and the total amount of rendering calculations.

[0288] In some embodiments, a first candidate product of a first weight parameter and a target texture quality parameter is determined, a second candidate product of a second weight parameter and a total rendering computation is determined, and the sum of the first candidate product, the second candidate product, and a bias term (which may be a constant) is determined as a scaling factor function.

[0289] For example, the first weight parameter, the second weight parameter, and the bias term can be obtained by performing the following process: Obtain the target texture quality parameters and total rendering computation used in multiple historical model rendering processes, substitute them into the scaling factor function, and solve for the first weight parameter, the second weight parameter, and the bias term. Substitute the solved first weight parameter, second weight parameter, and bias term into the scaling factor function, and substitute the currently preset target texture quality parameters for the target texture quality category and the total rendering computation of the current model into the scaling factor function to obtain the calculation result. Use the calculation result as the scaling factor for the resolution of the texture data.

[0290] In step 502, the resolution of the texture data is scaled according to the scaling factor.

[0291] Here, when the scaling factor is greater than 1, the resolution of the texture data is enlarged, and the scaling factor is positively correlated with the degree of enlargement of the texture data resolution; when the scaling factor is less than 1, the resolution of the texture data is reduced, and the scaling factor is inversely proportional to the degree of reduction of the texture data resolution.

[0292] This application's embodiments dynamically adjust texture resolution based on the rendering rate, achieving optimal rendering results without excessively consuming hardware resources, thereby optimizing overall performance. It can preset parameters based on the target texture quality category to ensure texture quality meets expected visual effects. Texture data resolution scaling can adapt to hardware with different performance levels, ensuring optimal rendering results even on low-performance devices. By adaptively scaling texture data resolution, memory and video memory usage can be managed more effectively, avoiding resource waste caused by excessively large textures.

[0293] In some embodiments, see Figure 3M , Figure 3M This is a schematic diagram of the thirteenth step of the method for texture rendering of a model provided in this application embodiment. After step 104, "determine the texture quality parameters that match the rendering rate", the process is iteratively executed. Figure 3M Steps 503 to 508 are explained in detail below.

[0294] Here, in response to the texture quality parameter being classified as a low-quality texture, steps 503 to 508 are iteratively executed, wherein steps 503 to 508 can be implemented using a pre-trained super-resolution model, which is used to update the low-quality texture to a high-quality texture.

[0295] In step 503, the texture features obtained in the previous iteration are subjected to a nonlinear transformation to obtain candidate features.

[0296] For example, if the current iteration is the m-th iteration, the texture features obtained in the (m-1)-th iteration are subjected to a nonlinear transformation to obtain candidate features, where 2 ≤ m ≤ M, m is an integer variable, and M is the total number of iterations. Candidate features can be obtained by performing a nonlinear transformation on the texture features obtained in the previous iteration using any of the following methods: power transformation, exponential transformation, logarithmic transformation, or nonlinear function mapping (such as activation functions (sigmoid) or hyperbolic tangent functions (tanh)).

[0297] In step 504, the texture features obtained in the previous iteration are encoded to obtain the texture features to be processed in the current iteration.

[0298] Following the example of step 503 above, the texture features obtained in the (m-1)th iteration are encoded to obtain the texture features to be processed in the mth iteration.

[0299] For example, the texture features of the (m-1)th iteration are used as input to the pre-trained super-resolution model. The model is then forward-propagated through the first (m-1) layers to obtain the input of the m-th layer. The features of the (m-1)th iteration are encoded using the weights and activation function of the m-th layer. If the m-th layer of the pre-trained super-resolution model is a convolutional layer, a convolution operation is performed; if the m-th layer of the pre-trained super-resolution model is a fully connected layer, matrix multiplication is performed.

[0300] In step 505, the candidate features are summed with the texture features to be processed in the current iteration to obtain the texture features to be fused.

[0301] Following the example of step 504 above, the candidate features are summed with the texture features to be processed in the m-th iteration to obtain the texture features to be fused.

[0302] In step 506, multi-scale fusion is performed based on the texture features to be fused to obtain the texture features obtained in the current iteration.

[0303] In some embodiments, scale typically refers to different resolutions or levels of abstraction of features. Scale includes spatial scale and abstract scale. Spatial scale refers to the spatial resolution of the feature map, i.e., the size of the feature map. When processing images, different scales can capture image details of different sizes. Abstract scale refers to the level of abstraction of the feature map, i.e., the complexity of the information captured by the feature map. In deep networks, shallower layers may capture more specific local features, while deeper layers may capture more abstract global features.

[0304] Following the example of step 505 above, determine the m-th product of the texture features to be fused with the weights corresponding to multiple scales, and sum the multiple m-th products as the texture features obtained in the m-th iteration.

[0305] In some embodiments, before each iteration, the following processing may also be performed: if the current iteration is the first iteration, the initial texture features of the texture data of the model to be rendered are extracted, the first product of the initial texture features and the weights corresponding to multiple scales is determined, and the sum of the multiple first products is used as the texture features obtained in the first iteration.

[0306] For example, if the initial texture feature is F1, and the weights corresponding to the multiple scales are t1, t2, t3, and t4 respectively, then the first products of the initial texture feature F1 and the weights corresponding to the multiple scales are F1·t1, F1·t2, F1·t3, and F1·t4 respectively. The sum of the multiple first products can be expressed by the following formula:

[0307]

[0308] Among them, F (1) F1 represents the texture features obtained in the first iteration, j represents the weight corresponding to the j-th scale, 1≤j≤4, j is a positive integer, and t1, t2, t3 and t4 are the weights corresponding to multiple scales respectively.

[0309] In step 507, the texture features obtained in each iteration are spliced ​​together to obtain an initial feature map.

[0310] Following the example of step 506 above, the texture features obtained in the first iteration are concatenated with the texture features obtained in the M-1th iteration to obtain the initial feature map.

[0311] As an example, see Figure 7 , Figure 7 This is a schematic diagram of the structure of the pre-trained super-resolution model provided in this application embodiment. The initial feature texture is processed through the first layer of the pre-trained super-resolution model, undergoing multi-scale fusion to obtain the texture features obtained in the first iteration. For the m-th layer of the pre-trained super-resolution model, the features obtained from the (m-1)-th layer are nonlinearly transformed and summed with the texture features to be processed in the m-th iteration obtained from the m-th layer to obtain the texture features to be fused. Multi-scale fusion is then performed based on these texture features to obtain the texture features obtained in the m-th iteration. The texture features obtained in each iteration are concatenated to obtain the initial feature map.

[0312] In step 508, the initial feature map is decoded to obtain a decoded feature map, which is then used as new texture data.

[0313] In some embodiments, the initial feature map is deconvolved to obtain a candidate feature map, the candidate feature map is upsampled to obtain a decoded feature map, and the decoded feature map is used as new texture data.

[0314] For example, a deconvolution layer is added to a pre-trained super-resolution model. The initial feature map is input into the deconvolution layer, and deconvolution is performed on the initial feature map to obtain a candidate feature map. Nearest Neighbor, Bilinear, or Bicubic interpolation can be used to upsample the candidate feature map to obtain a decoded feature map, which is then used as new texture data.

[0315] For example, with Figure 4A Taking a portion of the structure in model 437 shown (e.g., the connected component composed of meshes 420, 430, 431, 432, and 433) as an example, see [link to model 437]. Figure 4D , Figure 4D This is a comparative diagram showing the texture quality before and after improvement provided in the embodiments of this application. Figure 4D The image on the left shows the original model texture without using the super-resolution model. Figure 4D The image on the right shows the new model texture after texture quality enhancement using a super-resolution model. The texture quality parameters of the new model texture are greater than those of the original model texture (for example, the texture density and sharpness of the new model texture are both greater than those of the original model texture).

[0316] This application embodiment improves low-quality textures in real time through a super-resolution model, obtaining the best texture quality under the current device performance. It balances the performance of the current electronic device with the texture quality of the model, makes full use of computing resources, and improves the clarity of the model while ensuring resource consumption, thus solving the above-mentioned technical problem 2.

[0317] In some embodiments, step 104, "Rendering the model surface using texture data corresponding to the texture quality parameters to obtain a texture map," can be achieved by performing the following processes: Mapping texture data conforming to the texture quality parameters onto the model's two-dimensional image coordinate system (UV) coordinates; adjusting the texture coordinates according to the geometric features and lighting conditions of the model surface to be rendered; configuring the model's material properties; and selecting the corresponding texture filtering method based on the characteristics of the texture map and the preset rendering effect; and setting rendering parameters to enhance the visual effect of the texture map.

[0318] For example, the model's material properties include diffuse, specularity, and transparency. Texture filtering methods include point sampling, linear sampling, and anisotropic sampling. Rendering parameters include at least one of the following: lighting model, shadow effects, ambient light, reflection, and refraction.

[0319] See here. Figure 3N , Figure 3NThis is a schematic diagram of the overall process of a method for texture rendering of a model provided in this application embodiment. First, the complexity of the neighboring vertices on the adjacent edges of each edge of the model to be rendered is calculated, the complexity of the neighboring vertices of each adjacent vertex is calculated, and the difference between the two complexities is calculated. Second, the rendering computation of the edge is determined based on the difference, and the rendering computation of all edges is added together as the total rendering computation of the predicted model. Then, the rendering rate is determined based on the total rendering computation and the performance parameters of the electronic device. Next, the target device performance level of the electronic device is determined based on the rendering rate, and the texture quality parameter corresponding to the target device performance level is used as the texture quality parameter matching the rendering rate. If the texture quality parameter represents a low-quality texture, the texture features of the current texture data are input into the pre-trained super-resolution model to update the texture data, and the model surface is rendered based on the updated texture data to obtain a texture map. If the texture quality parameter does not represent a low-quality texture, the model surface is rendered directly based on the texture data to obtain a texture map.

[0320] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.

[0321] In games, inappropriate texture data can lead to performance degradation. For example, excessively large texture sizes increase the load on the GPU and CPU, while insufficient texture sizes waste hardware resources. Ensuring texture clarity while minimizing CPU and GPU resource consumption is a key consideration in game development and optimization.

[0322] Current rendering techniques often assign different texture quality levels to electronic devices with different configurations. They determine the texture quality level corresponding to the configuration of the electronic device used to render the model, and then render the model's texture using texture data at that quality level. However, these techniques only consider the configuration of the electronic device, ignoring the computational load required to render the current model. This results in the texture data used failing to simultaneously balance the performance of the electronic device and the computational load of the model, thus compromising rendering quality.

[0323] This application embodiment determines the total rendering computation of the model by calculating the rendering computation of each edge of the model. Based on the performance parameters of the electronic device and the total rendering computation, the rendering rate is determined, and the texture quality parameters of the texture data of the model to be rendered are determined based on the rendering rate. Texture data that conforms to the texture quality parameters is used to render the first resource, ensuring that the texture quality parameters of the current texture data not only conform to the total rendering computation when rendering the model to be rendered, but are also related to the performance parameters of the electronic device. The texture quality parameters can be dynamically adjusted according to the current rendering load and device performance, thereby reasonably allocating computing resources and ensuring the best rendering effect under limited hardware conditions.

[0324] See Figure 8 , Figure 8 This is a schematic diagram of the texture optimization process provided in an embodiment of this application. Figure 8 First, the texture data of a single frame in the game is extracted using a debug tool. After extraction, it is fed into an optimization network for optimization. Then, the original texture is replaced, and the texture loading process is rerun. Performance is compared; if loading time and GPU consumption are reduced, the optimization requirements are met. See also... Figure 9 , Figure 9 This is a schematic diagram illustrating the loading process during texture debugging provided in this application embodiment. The texture debugging process may experience slow loading and consume significant GPU resources, as shown below. Figure 9 As shown in the diagram, the texture loading circle represents textures that significantly impact performance. To optimize resources and improve performance, it's essential to address this issue.

[0325] See Figure 10 , Figure 10 This is a logical diagram illustrating texture selection and optimization based on device level, provided in an embodiment of this application. An application combining device performance detection, texture quality classification and selection, and a deep learning model is designed to achieve multi-device level super-resolution rendering optimization. First, the model (i.e., the model to be rendered) texture (i.e., texture data) is acquired. Second, the current device (i.e., the electronic device) is classified. Specifically, at game startup, the hardware configuration of the mobile device is detected, such as the processor, memory, and graphics card, and the device's performance indicators (i.e., performance parameters) are acquired. Based on these performance indicators, the device is divided into multiple levels, such as high, medium, and low, and the relevant information is saved. Then, texture quality classification is performed. Specifically, textures of different quality levels are prepared in advance, such as high, medium, and low resolution textures. The appropriate texture quality (i.e., texture quality parameters) is dynamically selected based on the device's performance level. For example, high... For high-performance devices (i.e., the first device performance level), high-quality textures are selected; for medium-performance devices (i.e., the second device performance level), medium-quality textures are selected; and for low-performance devices (i.e., the third device performance level), low-quality textures are selected. Finally, a super-resolution model is trained using both high-quality and low-quality textures, enabling the model to upscale low-quality textures to high-quality textures. A skip upsampling network is integrated into the deep learning model to enhance the model's ability to preserve texture details, reduce computation time, and improve real-time performance. The trained deep learning model is then integrated into the game engine, which can automatically call the appropriate super-resolution model for texture quality enhancement based on device performance.

[0326] At game launch, device performance testing and classification are fundamental to ensuring optimized texture rendering. The goal of this step is to accurately detect the device's hardware performance and categorize devices into different tiers based on performance metrics. The specific steps are as follows:

[0327] The performance metrics (such as CPU computing power (i.e., the performance parameters of the electronic device's processor), GPU computing power (i.e., the performance parameters of the electronic device's processor), and RAM and storage space size (i.e., the storage space parameters of the electronic device)) are weighted and summed to obtain the device's comprehensive performance score S (i.e., the aforementioned performance parameters of the electronic device). Based on the comprehensive performance score S, the device is divided into different performance levels. Assume the device is divided into three levels: High, Medium, and Low. Two thresholds T are set. H and T M The different levels can be distinguished using the following formula:

[0328] High:S≥T H (15)

[0329] Medium:T M ≤S <T H (16)

[0330] Low:S <T M (17)

[0331] Where S represents the overall performance score, T H T represents the high threshold, used to distinguish between high performance and medium performance. M This indicates a low threshold, used to distinguish between medium and low performance.

[0332] A mesh is a framework used by graphics hardware to draw complex objects. It contains at least a set of vertices and a set of triangles connecting these vertices. The set of points and edges that make up these triangles constitutes the mesh. During device rendering, there is a strong correlation between the mesh and the vertices; for example, a triangle mesh is a mesh containing three vertices, but there are also cases where vertices are shared. A model can be built based on experience, which can be represented by the following formula:

[0333]

[0334] Among them, V i Let represent the complexity of grid vertex i (which can be either the first or second complexity mentioned above), n be the total number of vertices, k be the number of grids connected to vertex i, and w be the complexity of the grid. i R is the weight of the grid containing vertex i. The weight of a grid is the sum of the weights of all vertices in that grid. The weight of a vertex is the number of other vertices connected to it. ij It is the Euclidean distance between vertex i and vertex j (i.e., other vertices), and α0 is a constant.

[0335] Then, each edge of the model is defined as e, and the vector representation of edge e is formed by the 3D world coordinates of the two vertices of edge e. A convolution operation is defined for the edges of the 3D model. Traditional convolution is the dot product of the convolution kernel and a neighborhood, while the method for texture rendering of the model provided in this application embodiment performs a convolution operation based on an edge e and its three neighboring edges, which can be expressed by the following formula:

[0336]

[0337] Where n0 is the convolution kernel, V j It is vertex j (the neighboring edge e of the current edge e) j The time complexity (i.e., first complexity) is V, where V is a vertex (i.e., a neighboring vertex) that is not part of the current edge e. other When convolution V j The complexity of the neighboring vertices (i.e., the second complexity).

[0338] Finally, by combining the machine's performance and the model using the normalized exponential function (Softmax), the computational cost of classification can be estimated, which can be expressed by the following formula:

[0339]

[0340] Where S represents the overall performance score of the device, FFT() refers to Fourier transform (i.e., extracting the frequency features of the first performance parameter sample), q is the total number of edges, and D H D represents the representative value of the performance of equipment belonging to the high-end equipment category (i.e., the first performance parameter sample). M D represents the representative performance value of equipment belonging to the mid-range equipment category (i.e., the second performance parameter sample). L This represents the representative performance value of devices belonging to the low-end device category (i.e., the third performance parameter sample), CNN edge This refers to the convolution of edges (i.e., the computational cost of rendering edges), reflecting the geometric calculations, specifically the computational cost per edge. `exp()` represents the exponential function, and `Classifer(D)`... M D H D L CNN edge The final computational load classification can be determined by determining how much computational load a device can process per unit of time for one edge, thus determining the final device adaptation level classification.

[0341] In practical applications, different games have different requirements for various performance metrics. The weights of each performance metric can be dynamically adjusted based on the game type and specific runtime requirements. i To improve classification accuracy, the weights can be represented by the following formula:

[0342] w i =softmax(game_type) (21)

[0343] The function `softmax()` represents the rules for dynamically adjusting weights based on game type and runtime conditions. `game_type` represents different game types; for example, first-person shooter (FPS) games and multiplayer online battle arena (MOBA) games have different weights.

[0344] Different games have different device performance requirements. Machine learning methods can be used to adaptively adjust the classification threshold T based on historical running data. H and T M To improve the adaptability and accuracy of equipment classification, the threshold can be expressed by the following formula:

[0345] T H ,T M =SVM(historical_data) (22)

[0346] Here, the function SVM() represents a rule for adaptively adjusting the classification threshold based on historical data. SVM is used for classification; for example, historical data is divided into two classes using SVM(), with the higher-ranking class being T. H The lower category is T. M .

[0347] By following the steps and formulas described above, device performance can be accurately detected and categorized, providing a reliable foundation for subsequent texture quality rendering optimization.

[0348] After performing device performance testing and classification, the next step is to classify and select texture quality. Texture quality optimization involves several aspects, including preprocessing textures of different quality levels, dynamically selecting textures suitable for the current device, and making appropriate texture adjustments at runtime.

[0349] First, prepare textures of different quality levels in advance. Divide the textures into three quality levels: high quality (HQ), medium quality (MQ), and low quality (LQ).

[0350] High-quality textured T HQ It boasts the highest resolution and detail, making it suitable for high-performance devices. Assuming the original texture is a high-quality texture with a resolution of R... HQ Texture size is S HQ .

[0351] Medium quality texture T MQIt features medium resolution and detail, suitable for mid-range performance devices. Assume the resolution of the medium-quality texture is R. MQ Texture size is S MQ It can be expressed by the following formula:

[0352] R MQ =R HQ / k1 (23)

[0353]

[0354] Here, k1 is a scaling factor, which is usually 2.

[0355] Low-quality texture T LQ It has the lowest resolution and detail, suitable for low-performance devices. Assume the resolution of a low-quality texture is R. LQ Texture size is S LQ It can be expressed by the following formula:

[0356] R LQ =R HQ / k2 (25)

[0357]

[0358] Here, k2 is a scaling factor, which is usually set to 4.

[0359] The texture quality is dynamically selected based on the device's performance level. Assume the device performance score S has been calculated and categorized as High, Medium, and Low. The texture selection mechanism is as follows: For high-performance devices, when the device performance score S ≥ T... H When choosing a high-quality texture T HQ For medium-performance devices, when T M ≤S <T H When selecting medium quality texture T MQ For low-performance devices, when S <T M When selecting a low-quality texture T lQ .

[0360] During gameplay, dynamic texture adjustments can be made based on the device's real-time performance data. Assuming the current frame rate is FPS and the target frame rate is FPS... target (That is, the frame rate threshold) can adjust the texture quality according to changes in the frame rate.

[0361] If the current frame rate (FPS) <FPS target To improve the frame rate, the texture quality is reduced. Let's assume the currently used texture is T. current The adjusted texture is T.adjusted It can be expressed by the following formula:

[0362] T adjusted =T MQ ifT current =T HQ (27)

[0363] T adjusted =T LQ ifT current =T MQ (28)

[0364] If the current frame rate (FPS) > FPS target This can improve texture quality, thereby enhancing image quality. Let's assume the currently used texture is T. current The adjusted texture is T. adjusted It can be expressed by the following formula:

[0365] T adjusted =T HQ ifT current =T MQ (29)

[0366] T adjusted =T MQ ifT current =T LQ (30)

[0367] The scaling factor k is used to adjust the texture resolution. Traditionally, the texture scaling factor k is usually fixed, but in practical applications, it can be adaptively adjusted according to the specific texture characteristics and device performance.

[0368] If a machine learning model M is used to predict the optimal scaling factor k, it can be expressed by the following formula:

[0369] k = w1T HQ +w2S+b (31)

[0370] Where w1 and w2 are the model's weight parameters, b is the bias term, and these parameters are learned during training by minimizing the error. T HQ It represents a high-quality texture, and S is the device performance rating. The scaling factor k reflects the different texture resolution scaling required for different devices.

[0371] When selecting texture quality, not only device performance but also quality loss must be considered. Assume the quality loss function is L(T) HQ ,T selected If the goal of texture selection is to minimize quality loss, it can be expressed by the following formula:

[0372] Loss=L(T HQ ,T selected )+λC(T selected (32)

[0373] Among them, C(T) selected ) represents the computational cost of the texture, and λ is a weighting factor used to balance quality loss and computational cost.

[0374] Texture quality selection and adjustment can be viewed as a multi-objective optimization problem, aiming to ensure both image quality and frame rate / smoothness. Let the objective function be O, which can be expressed by the following formula:

[0375] O=α·Q(T seiected )+β·F(FPS)-γ·E(CPU,GPU,Mem) (33)

[0376] Among them, Q(T) selected ) is the image quality function (also known as the quality function), F(FPS) is the frame rate function, E(CPU, GPU, Mem) is the resource consumption function, and α, β and γ are weighting factors.

[0377] By following the steps and formulas above, we can effectively classify and select texture quality, optimize the gaming experience based on device performance, and dynamically adjust texture quality during operation to adapt to different devices and real-time performance changes.

[0378] After completing device performance testing and classification, and texture quality classification and selection, the next step is to apply deep learning models to improve the quality of low-quality textures, so as to ensure that high-quality visual effects can be presented even on low-performance devices.

[0379] The application of deep learning models in texture quality enhancement mainly involves training a super-resolution model to upscale low-quality textures to high-quality textures. First, high-quality and low-quality texture pairs are prepared for model training. Let's assume the high-quality texture is T. HQ The corresponding low-quality texture is T. LQ Then, a suitable super-resolution model architecture is selected. A suitable super-resolution model architecture is also known as an upsampling deep learning architecture. The super-resolution level (the degree or effect of upsampling a low-resolution image to a high-resolution image) is determined by multi-scale fusion and upsampling in deep learning. For example, multi-scale fusion can help the network recover high-frequency details lost during upsampling; by fusing features at different scales, the texture information of the image can be enhanced, making the super-resolution image more natural; multi-scale fusion can reduce noise that may be introduced during upsampling; and a reasonable fusion strategy can reduce computation and improve the running efficiency of the super-resolution model. Assuming the model parameters are θ, and the input is a low-quality texture... LQOutput high-quality texture T HQ .

[0380] A loss function L is defined to guide model training. Common loss functions include Mean Squared Error (MSE) and Perceptual Loss. The loss function L can be expressed by the following formula:

[0381]

[0382] Among them, T HQ Represents realistic textures. This represents the predicted texture, where α and β are weighting factors used to balance the mean squared error loss. and perceived loss

[0383] The model parameters θ are adjusted using an optimization algorithm (such as Adaptive Moment Estimation (Adam)) to minimize the loss function L. The training process can be represented by the following formula:

[0384]

[0385] Where, θ * T represents the adjusted model parameters. HQ Represents realistic textures. This represents the predicted texture.

[0386] Integrating skip upsampling networks into deep learning models enhances their ability to preserve texture details, reduces computation time, and improves real-time performance. Skip connections are introduced into the model architecture to directly pass low-level features to higher levels, preserving more detailed information. Assume the input texture features after passing through the l-th layer are F( l (That is, the texture features to be processed in the current iteration), can be represented by the following formula:

[0387]

[0388] Among them, H (l) It is the nonlinear transformation of the l-th layer, F (l-1) It is the texture feature after the (l-1)th layer (that is, the texture feature obtained in the previous iteration).

[0389] A multi-scale fusion mechanism is introduced into the model to enhance texture quality using features at different scales. Assume the multi-scale features of the l-th layer are... The features after multi-scale fusion of the l-th layer (That is, the texture features to be fused) can be represented by the following formula:

[0390]

[0391] w s =Normal(w i (38)

[0392] Among them, w s These are the weights of features at different scales, where S is the scale number, Normal() is the Gaussian distribution function, and w i It is the weight of the i-th scale feature.

[0393] The feature F obtained after the lth layer (l) After the jump connection, we get Then After weighted multi-scale fusion, the features of the l-th fusion layer are obtained. After concatenating the fused features from each layer, the input feature map F is obtained. in (That is, the initial feature map).

[0394] In skip upsampling networks, various upsampling techniques are employed, such as deconvolution and subpixel convolution. Assume the input feature map is F. in The upsampled feature map is F up (That is, decoding the feature map), can be expressed by the following formula:

[0395] (F up =U(RCONV(F) in (39)

[0396] Where U is the upsampling operation of subpixel convolution, and RCONV is the deconvolution operation.

[0397] The trained deep learning model is integrated into the game engine, and the corresponding super-resolution model is automatically called to improve texture quality.

[0398] Integrate super-resolution models into the game engine and dynamically select the appropriate model based on device performance. Assume the selected model is M and the input texture is T. input The output high-quality texture is T. output It can be expressed by the following formula:

[0399] T output =U(RCONV(T) input (40)

[0400] By optimizing texture data in the game, low-quality textures processed by the device are updated to high-quality textures. This takes into account the performance of the current device and optimizes the texture quality based on the existing device, thus balancing the texture rendering quality and performance of the model.

[0401] This application's embodiments determine the rendering computational load of edges from multiple dimensions, combining geometric complexity (first and second complexity) and directional information (feature vectors) to provide a comprehensive assessment of rendering computational load. By analyzing the complexity of neighboring vertices and edges, the rendering requirements of local regions in the mesh can be identified, facilitating more refined rendering optimization. Considering the directionality of edges, optimization can be performed for rendering requirements in different directions. By introducing preset convolution kernels, the impact of specific visual effects on rendering performance can be simulated, making the computational load assessment more consistent with actual rendering scenarios. A quantitative method is provided to predict rendering computational load, helping to make performance optimization and resource allocation decisions before rendering. By accurately assessing which regions require more computational resources, redundant computation in visually unimportant regions can be reduced. Integrating the effects of frequency characteristics, rate of change, and rendering computational load, a comprehensive metric is provided, reflecting the combined impact of electronic device performance parameters on rendering speed. By analyzing the product, key factors affecting rendering speed can be identified, and corresponding optimization measures can be taken. For example, if a certain frequency component has a significant impact on rendering speed, hardware or software configurations can be optimized accordingly. Using the ratio of the performance parameters of electronic devices to their product as the rendering rate provides a quantitative indicator to evaluate the performance of different devices, allowing for the selection of appropriate devices to meet specific rendering needs based on the rendering rate.

[0402] The following description continues to illustrate the exemplary structure of the apparatus 555 for texture rendering of a model provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2 As shown, the software modules stored in the memory 550 for texture rendering of the model may include:

[0403] The first determining module 5551 is used to predict the rendering computation amount of each edge in the model to be rendered, wherein the rendering computation amount represents the prediction computation amount required to render each edge.

[0404] The second determining module 5552 is used to predict the total amount of rendering computation of the model based on the predicted rendering computation amount.

[0405] The speed determination module 5553 is used to determine the rendering rate based on the performance parameters of the electronic device and the total amount of rendering computation, wherein the rendering rate characterizes the number of models that the electronic device can render per unit time.

[0406] The model rendering module 5554 is used to determine the texture quality parameters that match the rendering rate, and to render the model surface using texture data corresponding to the texture quality parameters to obtain a texture map.

[0407] In some embodiments, the model includes multiple meshes, each mesh including multiple vertices and multiple edges. The first determining module 5551 is further configured to perform the following processing for each edge in the model: find at least one neighboring edge of the edge in the model; determine a first complexity of the region where the neighboring vertex of each neighboring edge is located, wherein a neighboring vertex is a vertex that belongs to the neighboring edge but does not belong to the edge, and the region where the neighboring vertex is located includes multiple meshes in the model that intersect with the neighboring vertex; determine a second complexity of the region where the neighboring vertex is located, wherein a neighboring vertex is a vertex that shares an edge with the neighboring mesh, except for the vertices in the mesh where the neighboring edge is located; and predict the rendering computation of the edge based on the first complexity and the second complexity.

[0408] In some embodiments, the first determining module 5551 is further configured to perform the following processing for each neighboring vertex: determine the weights corresponding to the multiple grids intersecting the neighboring vertex respectively, determine the weight sum of the weights corresponding to the multiple grids intersecting the neighboring vertex respectively; determine the distance between the neighboring vertex and other vertices in the model, wherein the other vertices are any vertex other than the neighboring vertices in the model; and determine the first complexity of the region where the neighboring vertex is located based on the distance and the weight sum.

[0409] In some embodiments, the first determining module 5551 is further configured to perform the following processing for any grid connected to neighboring vertices: determine the number of neighboring vertices of each vertex in the grid, wherein the number of neighboring vertices is the number of vertices in the model that are adjacent to the vertex; and sum the number of neighboring vertices of multiple vertices as the weight of the grid.

[0410] In some embodiments, the first determining module 5551 is further configured to, for each neighboring vertex, determine the difference between the first complexity of the region where the neighboring vertex is located and the second complexity of the region where the neighboring vertex is located; determine the first product of the feature vector of the neighboring edge and the difference; determine the first sum of the first products corresponding to the multiple neighboring vertices respectively; determine the second product of the feature vector of the edge and a preset convolution kernel; determine the second sum of the second product and the first sum, and use the second sum as the rendering computation amount of the predicted edge.

[0411] In some embodiments, the speed determination module 5553 is further configured to extract frequency features of a first performance parameter sample, wherein the first performance parameter sample is the performance parameter of a first electronic device sample at a preset first device performance level; determine the ratio of a second performance parameter sample to a third performance parameter sample, wherein the second performance parameter sample is the performance parameter of a second electronic device sample at a preset second device performance level, and the third performance parameter sample is the performance parameter of a third electronic device sample at a preset third device performance level, wherein the performance parameter of the first electronic device sample at the first device performance level is higher than the performance parameter of the second electronic device sample at the second device performance level, and the performance parameter of the second electronic device sample at the second device performance level is higher than the performance parameter of the third electronic device sample at the third device performance level; determine the product of the frequency features, the ratio, and the total amount of rendering computation; and use the ratio of the electronic device performance parameter to the product as the rendering rate.

[0412] In some embodiments, the model rendering module 5554 is further configured to determine the target rendering rate range in which the rendering rate falls within a preset plurality of rendering rate ranges, wherein the plurality of rendering rate ranges correspond to a plurality of texture quality parameters, the plurality of rendering rate ranges correspond to a plurality of device performance levels, and the plurality of device performance levels include a first device performance level, a second device performance level, and a third device performance level; and to use the texture quality parameter corresponding to the target rendering rate range as the texture quality parameter that matches the rendering speed.

[0413] In some embodiments, the model rendering module 5554 is further configured to determine, for each device performance level, the maximum and minimum rendering rates of the electronic device samples within that device performance level, as endpoints of the rendering rate intervals corresponding to the device performance level; wherein, if the minimum rendering rate in the first rendering rate interval corresponding to the first device performance level is less than the maximum rendering rate in the second rendering rate interval corresponding to the second device performance level, a first average of the minimum rendering rate in the first rendering rate interval and the maximum rendering rate in the second rendering rate interval is determined, and the first average is used as the boundary point between the first and second rendering rate intervals; if the minimum rendering rate in the second rendering rate interval corresponding to the second device performance level is less than the maximum rendering rate in the third rendering rate interval corresponding to the third device performance level, a second average of the minimum rendering rate in the second rendering rate interval and the maximum rendering rate in the third rendering rate interval is determined, and the second average is used as the boundary point between the second and third rendering rate intervals.

[0414] In some embodiments, the model rendering module 5554 is further configured to determine the target device performance level of the electronic device from a plurality of preset device performance levels based on the rendering rate, wherein the plurality of device performance levels are associated with different texture quality parameters, and the device performance level is positively correlated with the texture quality parameters; and the texture quality parameters associated with the target device performance level are used as texture quality parameters that match the rendering rate.

[0415] In some embodiments, the model rendering module 5554 is further configured to perform a weighted summation of the rendering rate, the performance parameters of the processor of the electronic device, the storage space parameters of the electronic device, and the corresponding weight parameters to obtain the performance parameters of the electronic device; determine the target performance parameter interval in which the performance parameters of the electronic device are located from multiple performance parameter intervals corresponding to multiple device performance levels, and take the device performance level associated with the target performance parameter interval as the target device performance level in which the electronic device is located.

[0416] In some embodiments, the model rendering module 5554 is further configured to input performance parameters into a pre-trained performance classification model to obtain the device performance level corresponding to the performance parameters. The pre-trained performance classification model is trained by performing the following processes: obtaining an initialized performance classification model; obtaining performance parameter samples and true class labels, wherein the true class labels represent the true device performance level corresponding to the performance parameter samples; calling the initialized performance classification model based on the performance parameter samples to obtain predicted class labels, which represent the predicted device performance level corresponding to the performance parameter samples; determining a class loss value based on the true class labels and the predicted class labels; and updating the parameters of the initialized performance classification model based on the class loss value to obtain the pre-trained performance classification model.

[0417] In some embodiments, the model rendering module 5554 is further configured to input the performance parameters of the electronic device into a pre-trained texture quality parameter prediction model to perform texture quality prediction, thereby obtaining texture quality parameters associated with the performance level of the target device. The pre-trained texture quality parameter prediction model is trained by performing the following processes: obtaining an initialized texture quality parameter prediction model; obtaining multiple performance parameter samples corresponding to multiple device performance levels, and obtaining pre-labeled true texture quality parameter labels for the multiple performance parameter samples; calling the initialized texture quality parameter prediction model based on the multiple performance parameter samples to perform texture quality prediction, thereby obtaining predicted texture quality parameter labels; determining the texture quality parameter loss based on the true texture quality parameter labels and the predicted texture quality parameter labels; and updating the parameters of the initialized texture quality parameter prediction model based on the texture quality parameter loss, thereby obtaining the pre-trained texture quality parameter prediction model.

[0418] In some embodiments, the model rendering module 5554 is further configured to, when the model is a model of a virtual object in a virtual scene, during the operation of the virtual scene, substitute the target texture quality parameters, texture quality parameters, the current frame rate, frame rate threshold, rendering rate of the virtual scene, and the performance parameters of the electronic device, which are preset for the target texture quality category, into a pre-built texture quality model for solving to obtain new texture quality parameters. The texture quality model includes at least one of the following functions: a quality function, a frame rate function, and a resource consumption function.

[0419] In some embodiments, the model rendering module 5554 is further configured to determine a scaling factor for the resolution of the texture data based on the target texture quality parameters preset for the target texture quality category and the total amount of rendering computation; and to scale the resolution of the texture data according to the scaling factor.

[0420] In some embodiments, the model rendering module 5554 is further configured to: perform nonlinear transformation on the texture features obtained in the previous iteration to obtain candidate features; encode the texture features obtained in the previous iteration to obtain the texture features to be processed in the current iteration; sum the candidate features with the texture features to be processed in the current iteration to obtain the texture features to be fused; perform multi-scale fusion based on the texture features to be fused to obtain the texture features obtained in the current iteration; concatenate the texture features obtained in each iteration to obtain an initial feature map; decode the initial feature map to obtain a decoded feature map, and use the decoded feature map as new texture data.

[0421] In some embodiments, the model rendering module 5554 is further configured to, if the current iteration is the first iteration, extract the initial texture features of the texture data of the model to be rendered, determine the first product of the initial texture features and the weights corresponding to multiple scales respectively, and use the sum of the multiple first products as the texture features obtained in the first iteration.

[0422] In some embodiments, the model rendering module 5554 is further configured to: if the current iteration is the m-th iteration, perform nonlinear transformation on the texture features obtained in the (m-1)-th iteration to obtain candidate features, where 2≤m≤M, m is an integer variable, and M is the total number of iterations; encode the texture features obtained in the (m-1)-th iteration to obtain the texture features to be processed in the m-th iteration; sum the candidate features with the texture features to be processed in the m-th iteration to obtain the texture features to be fused; determine the m-th product of the texture features to be fused with the weights corresponding to multiple scales, and sum the multiple m-th products as the texture features obtained in the m-th iteration.

[0423] This application provides a computer program product including a computer program or computer-executable instructions stored in a computer-readable storage medium. An electronic device's processor reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the texture rendering method for a model described in this application embodiment.

[0424] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the method for texture rendering of a model provided in this application, for example... Figure 3A The method for texture rendering of the model is shown.

[0425] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0426] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0427] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0428] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0429] In summary, this application's embodiments determine the rendering computational cost of edges from multiple dimensions, combining geometric complexity (first and second complexity) and directional information (feature vectors) to provide a comprehensive assessment of rendering computational cost. By analyzing the complexity of neighboring vertices and edges, the rendering requirements of local regions in the mesh can be identified, facilitating more refined rendering optimization. Considering the directionality of edges, optimization can be performed for rendering requirements in different directions. By introducing preset convolution kernels, the impact of specific visual effects on rendering performance can be simulated, making the computational cost assessment more consistent with actual rendering scenarios. A quantitative method is provided to predict rendering computational cost, aiding in performance optimization and resource allocation decisions before rendering. By accurately assessing which regions require more computational resources, redundant computation in visually unimportant areas can be reduced. Integrating the effects of frequency characteristics, rate of change, and rendering computational cost, a comprehensive metric is provided, reflecting the combined impact of electronic device performance parameters on rendering speed. By analyzing the product, key factors affecting rendering speed can be identified, and corresponding optimization measures can be taken. For example, if a certain frequency component has a significant impact on rendering speed, hardware or software configurations can be optimized accordingly. Using the ratio of the performance parameters of electronic devices to their product as the rendering rate provides a quantitative indicator to evaluate the performance of different devices, allowing for the selection of appropriate devices to meet specific rendering needs based on the rendering rate.

[0430] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A method for texture rendering of a model, characterized in that, The method includes: Predict the rendering computation amount for each edge in the model to be rendered, wherein the rendering computation amount represents the prediction computation amount required to render each edge; Based on the predicted rendering computation amount, predict the total rendering computation amount of the model; The rendering rate is determined based on the performance parameters of the electronic device and the total amount of rendering computation, wherein the rendering rate represents the number of models that the electronic device can render per unit time. Determine the texture quality parameters that match the rendering rate, and use the texture data corresponding to the texture quality parameters to render the model surface to obtain a texture map.

2. The method according to claim 1, characterized in that, The model includes multiple grids, and each grid includes multiple vertices and multiple edges; The rendering computation cost for each edge in the model to be rendered includes: For each edge in the model, perform the following processing: Find at least one neighboring edge of the edge in the model; Determine the first complexity of the region where the neighboring vertex of each of the neighboring edges is located, wherein the neighboring vertex is a vertex that belongs to the neighboring edge but does not belong to the edge, and the region where the neighboring vertex is located includes multiple meshes in the model that intersect with the neighboring vertex; Determine the second complexity of the region containing the neighboring vertices of each of the neighboring vertices, wherein the neighboring vertices are vertices in the adjacent grid other than those in the grid containing the neighboring edge, and the adjacent grid is a grid that shares an edge with the grid containing the neighboring edge; Based on the first complexity and the second complexity, the rendering computation cost of the edge is predicted.

3. The method according to claim 2, characterized in that, The first complexity of determining the region containing the neighboring vertices of each of the adjacent edges includes: For each of the neighboring vertices, the following processing is performed: Determine the weights corresponding to the multiple grids intersecting the neighboring vertices, and determine the weight sum of the weights corresponding to the multiple grids intersecting the neighboring vertices; Determine the distance between the neighboring vertex and other vertices in the model, wherein the other vertices are any vertex other than the neighboring vertex in the model; The first complexity of the region where the neighboring vertex is located is determined based on the sum of the distance and the weight.

4. The method according to claim 2 or 3, characterized in that, Determining the weights corresponding to the multiple grids intersecting the adjacent vertices includes: For any of the meshes connected to the neighboring vertices, perform the following processing: Determine the number of neighboring vertices for each vertex in the grid, wherein the number of neighboring vertices is the number of vertices in the model that are adjacent to the vertex; The sum of the number of neighboring vertices of multiple vertices is used as the weight of the grid.

5. The method according to any one of claims 2 to 4, characterized in that, The step of predicting the rendering computation cost of the edge based on the first complexity and the second complexity includes: For each of the neighboring vertices, determine the difference between the first complexity of the region where the neighboring vertex is located and the second complexity of the region where the neighboring vertex is located; Determine the first product of the feature vector of the adjacent edge and the difference; Determine the first sum of the first products corresponding to the plurality of adjacent vertices; Determine the second product of the feature vector of the edge and the preset convolution kernel; Determine the second sum of the second product and the first sum, and use the second sum as the rendering computation cost of the predicted edge.

6. The method according to any one of claims 1 to 5, characterized in that, The rendering rate is determined based on the performance parameters of the electronic device and the total amount of rendering computation, including: Extract the frequency features of the first performance parameter sample, wherein the first performance parameter sample is the performance parameter of the first electronic device sample at a preset first device performance level; Determine the ratio of the second performance parameter sample to the third performance parameter sample, wherein the second performance parameter sample is the performance parameter of the second electronic device sample at a preset second device performance level, and the third performance parameter sample is the performance parameter of the third electronic device sample at a preset third device performance level, wherein the performance parameter of the first electronic device sample at the first device performance level is higher than the performance parameter of the second electronic device sample at the second device performance level, and the performance parameter of the second electronic device sample at the second device performance level is higher than the performance parameter of the third electronic device sample at the third device performance level; Determine the product of the frequency characteristics, the ratio, and the total amount of rendering calculations; The ratio of the performance parameters of the electronic device to the product is used as the rendering rate.

7. The method according to claim 6, characterized in that, The determination of texture quality parameters matching the rendering rate includes: Determine the target rendering rate range within a preset plurality of rendering rate ranges, wherein the plurality of rendering rate ranges correspond to a plurality of texture quality parameters, and the plurality of rendering rate ranges correspond to a plurality of device performance levels, including a first device performance level, a second device performance level, and a third device performance level; The texture quality parameter corresponding to the target rendering rate range is used as the texture quality parameter that matches the rendering rate.

8. The method according to claim 7, characterized in that, The method further includes: For each electronic device sample at each device performance level, determine the maximum and minimum rendering rates of the electronic device samples at that device performance level, as the endpoints of the rendering rate range corresponding to that device performance level. Specifically, if the minimum rendering rate in the first rendering rate interval corresponding to the first device performance level is less than the maximum rendering rate in the second rendering rate interval corresponding to the second device performance level, then a first average of the minimum rendering rate in the first rendering rate interval and the maximum rendering rate in the second rendering rate interval is determined, and the first average is used as the boundary point between the first rendering rate interval and the second rendering rate interval; if the minimum rendering rate in the second rendering rate interval corresponding to the second device performance level is less than the maximum rendering rate in the third rendering rate interval corresponding to the third device performance level, then a second average of the minimum rendering rate in the second rendering rate interval and the maximum rendering rate in the third rendering rate interval is determined, and the second average is used as the boundary point between the second rendering rate interval and the third rendering rate interval.

9. The method according to any one of claims 1 to 6, characterized in that, The determination of texture quality parameters matching the rendering rate includes: Based on the rendering rate, the target device performance level of the electronic device is determined from a plurality of preset device performance levels, wherein the plurality of device performance levels are associated with different texture quality parameters, and the device performance level is positively correlated with the texture quality parameters; The texture quality parameter associated with the target device performance level is used as the texture quality parameter to match the rendering rate.

10. The method according to claim 9, characterized in that, Before using the texture quality parameter associated with the target device performance level as a texture quality parameter to match the rendering rate, the method further includes: The performance parameters of the electronic device are input into a pre-trained texture quality parameter prediction model to predict texture quality, thereby obtaining the texture quality parameters associated with the performance level of the target device. The pre-trained texture quality parameter prediction model is trained in the following way: Obtain the initialized texture quality parameter prediction model; Obtain multiple performance parameter samples corresponding to the multiple device performance levels, and obtain real texture quality parameter labels pre-labeled for the multiple performance parameter samples; Based on the multiple performance parameter samples, the initialized texture quality parameter prediction model is called to predict texture quality and obtain the predicted texture quality parameter labels. Based on the true texture quality parameter labels and the predicted texture quality parameter labels, determine the texture quality parameter loss; The parameters of the initialized texture quality parameter prediction model are updated based on the texture quality parameter loss to obtain the pre-trained texture quality parameter prediction model.

11. The method according to claim 9 or 10, characterized in that, The step of determining the target device performance level of the electronic device from a preset plurality of device performance levels based on the rendering rate includes: The performance parameters of the electronic device are obtained by weighted summing of the rendering rate, the performance parameters of the processor of the electronic device, the storage space parameters of the electronic device, and their respective weight parameters. From the multiple performance parameter ranges corresponding to the multiple device performance levels, determine the target performance parameter range in which the performance parameters of the electronic device are located, and take the device performance level associated with the target performance parameter range as the target device performance level in which the electronic device is located.

12. The method according to claim 11, characterized in that, Before defining the device performance level associated with the target performance parameter range as the target device performance level of the electronic device, the method further includes: The performance parameters are input into a pre-trained performance classification model to obtain the device performance level corresponding to the performance parameters. The pre-trained performance classification model is trained in the following way: Obtain the initialized performance classification model; Obtain performance parameter samples and real category labels, wherein the real category labels represent the real device performance level corresponding to the performance parameter samples; Based on the performance parameter sample, the initialized performance classification model is called to obtain a predicted category label, which represents the predicted device performance level corresponding to the performance parameter sample. The category loss value is determined based on the true category label and the predicted category label; The parameters of the initialized performance classification model are updated based on the category loss value to obtain the pre-trained performance classification model.

13. The method according to any one of claims 1 to 12, characterized in that, When the model is a model of a virtual object in a virtual scene, during the operation of the virtual scene, after determining the texture quality parameters that match the rendering rate, the method further includes: The target texture quality parameters, the texture quality parameters, the current frame rate of the virtual scene, the frame rate threshold, the rendering rate, and the performance parameters of the electronic device are substituted into a pre-built texture quality model for solving to obtain new texture quality parameters. The texture quality model includes at least one of the following functions: a quality function, a frame rate function, and a resource consumption function.

14. The method according to any one of claims 1 to 12, characterized in that, After determining the texture quality parameters that match the rendering rate, the method further includes: Based on the target texture quality parameters preset for the target texture quality category and the total amount of rendering calculations, the scaling factor of the texture data resolution is determined; The resolution of the texture data is scaled according to the scaling factor.

15. The method according to any one of claims 1 to 12, characterized in that, After determining the texture quality parameters that match the rendering rate, the method further includes: The following processes are performed iteratively: The texture features obtained from the previous iteration are subjected to a non-linear transformation to obtain candidate features; The texture features obtained in the previous iteration are encoded to obtain the texture features to be processed in the current iteration; The candidate features are summed with the texture features to be processed in the current iteration to obtain the texture features to be fused. Multi-scale fusion is performed based on the texture features to be fused to obtain the texture features obtained in the current iteration; The texture features obtained in each iteration are concatenated to obtain an initial feature map; The initial feature map is decoded to obtain a decoded feature map, which is then used as new texture data.

16. The method according to claim 15, characterized in that, Before each iteration, the method further includes: If the current iteration is the first iteration, the initial texture features of the texture data of the model to be rendered are extracted, the first product of the initial texture features and the weights corresponding to multiple scales is determined, and the sum of the multiple first products is used as the texture features obtained in the first iteration.

17. An apparatus for texture rendering of a model, characterized in that, The device includes: The first determining module is used to predict the rendering computation amount of each edge in the model to be rendered, wherein the rendering computation amount represents the prediction computation amount required to render each edge; The second determining module is used to predict the total rendering computation of the model based on the predicted rendering computation amount; A speed determination module is used to determine the rendering rate based on the performance parameters of the electronic device and the total amount of rendering computation, wherein the rendering rate represents the number of models that the electronic device can render per unit time. The model rendering module is used to determine the texture quality parameters that match the rendering rate, and to render the model surface using texture data corresponding to the texture quality parameters to obtain a texture map.

18. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the method for texture rendering of a model as described in any one of claims 1 to 16.

19. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method for texture rendering of a model as described in any one of claims 1 to 16.

20. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method for texture rendering of a model as described in any one of claims 1 to 16.