Wake rendering method and device, electronic equipment and storage medium

By performing trail rendering on the graphics processor and interpolation using appearance sampling data and survival time information, the problem of excessive CPU resource consumption in the prior art is solved, and efficient trail rendering is achieved.

CN119478164APending Publication Date: 2025-02-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310989980.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-07
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the prior art, the trail renderer built on JavaScript consumes a large amount of CPU resources during runtime, resulting in lag in picture and reducing the efficiency of trail rendering.

Method used

By implementing the trail rendering method on the graphics processor, the appearance sampling data of the to-be-rendered patch is obtained, and the data is interpolated according to the survival time information, the target appearance parameters are obtained, and then rendered to generate the target trail.

Benefits of technology

It effectively reduces the resource occupation of the central processor, improves the efficiency of trail rendering, and improves the parallel computing efficiency of the graphics processor through interpolation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478164A_ABST
    Figure CN119478164A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a wake rendering method and device, electronic equipment and a storage medium, a graphics processor obtains appearance sampling data of to-be-rendered patches, obtains survival time information and patch position information of each to-be-rendered patch in a current frame, and interpolates the appearance sampling data according to the survival time information to obtain a wake rendering result; according to the method, a central processing unit acquires appearance sampling data of to-be-rendered patches in a current frame to obtain target appearance parameters of the to-be-rendered patches, and then the to-be-rendered patches in the current frame are rendered according to the target appearance parameters and the patch position information to obtain target wakes, and the appearance sampling data are acquired by sampling appearance parameter change curves of the to-be-rendered patches by the central processing unit. The central processing unit only needs to carry out sampling, the calculation process of obtaining the target appearance parameters is sunk to the graphics processing unit, calculation resources of the central processing unit are released, resource occupation of the central processing unit is reduced, wake rendering efficiency is effectively improved, and the method can be applied to the technical fields of cloud technologies, games, intelligent traffic, auxiliary driving and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a trail rendering method, device, electronic device and storage medium. Background Art

[0002] At present, in order to make the movement of virtual objects more realistic and beautiful, the trails generated by the virtual objects when they move are usually rendered for the virtual objects. In the related art, when performing trail rendering, it is generally implemented by a renderer built based on JavaScript (referred to as "JS"), however, this type of renderer needs to consume a large amount of central processing unit (CPU) resources when running, which easily causes screen freezes and reduces the efficiency of trail rendering. Summary of the invention

[0003] The following is a summary of the subject matter described in detail in this application. This summary is not intended to limit the scope of the claims.

[0004] The embodiments of the present application provide a trail rendering method, device, electronic device and storage medium, which can effectively improve the efficiency of trail rendering.

[0005] On the one hand, an embodiment of the present application provides a trail rendering method, which is applied to a graphics processor, and the trail rendering method includes:

[0006] When the target virtual object moves, the appearance sampling data of the face to be rendered is obtained, wherein the appearance sampling data is obtained by sampling the appearance parameter change curve of the face to be rendered by the central processing unit, and the appearance parameter change curve is used to indicate the mapping relationship between the appearance parameters of the face to be rendered and time;

[0007] Acquire the survival time information and the patch position information of each of the to-be-rendered patches in the current frame, interpolate the appearance sampling data according to the survival time information, and obtain the target appearance parameters of the to-be-rendered patches;

[0008] Render each of the to-be-rendered facets in the current frame according to the target appearance parameters and the facet position information to obtain a target trail generated by the target virtual object in the current frame.

[0009] On the other hand, an embodiment of the present application further provides a trail rendering method, which is applied to a central processing unit. The trail rendering method includes:

[0010] When the target virtual object moves, obtaining an appearance parameter change curve of the face to be rendered, wherein the appearance parameter change curve is used to indicate a mapping relationship between the appearance parameters of the face to be rendered and time;

[0011] Sampling the appearance parameter change curve to obtain appearance sampling data of the to-be-rendered face, and sending the appearance sampling data to a graphics processor;

[0012] The lifetime information and the patch position information of each of the to-be-rendered patches in the current frame are obtained, and the lifetime information and the patch position information are sent to the graphics processor so that the graphics processor interpolates the appearance sampling data according to the lifetime information. After obtaining the target appearance parameters of the to-be-rendered patches, each of the to-be-rendered patches in the current frame is rendered according to the target appearance parameters and the patch position information to obtain the target trail generated by the target virtual object in the current frame.

[0013] On the other hand, an embodiment of the present application further provides a trail rendering device, characterized in that it is applied to a graphics processor, and the trail rendering device includes:

[0014] A data acquisition module, used for acquiring appearance sampling data of a to-be-rendered face when the target virtual object moves, wherein the appearance sampling data is obtained by sampling an appearance parameter variation curve of the to-be-rendered face by a central processing unit, and the appearance parameter variation curve is used for indicating a mapping relationship between the appearance parameters of the to-be-rendered face and time;

[0015] A parameter generation module, used to obtain the survival time information and the patch position information of each of the to-be-rendered patches in the current frame, and interpolate the appearance sampling data according to the survival time information to obtain the target appearance parameters of the to-be-rendered patches;

[0016] A rendering module is used to render each of the to-be-rendered facets in the current frame according to the target appearance parameters and the facet position information, so as to obtain a target trail generated by the target virtual object in the current frame.

[0017] Further, the target appearance parameters include vertex color values ​​and patch width values ​​of the to-be-rendered patch, the patch position information includes the endpoint positions of the moving track of the target virtual object in the to-be-rendered patch, and the rendering module is specifically used for:

[0018] Determine the vertex position of each vertex of the to-be-rendered face according to the endpoint position and the face width value;

[0019] Each of the to-be-rendered face pieces in the current frame is rendered according to the vertex positions and the vertex color values, so as to obtain a target trail generated by the target virtual object in the current frame.

[0020] Furthermore, the rendering module is also used for:

[0021] Extending half of the patch width value in two opposite target directions based on the endpoint position to obtain the vertex position of each vertex of the patch to be rendered, wherein the target direction is perpendicular to the moving trajectory;

[0022] Alternatively, the endpoint position is used as the vertex position of one of the vertices of the face patch to be rendered, and the face patch width value is extended toward a target direction based on the endpoint position to obtain the vertex positions of other vertices of the face patch to be rendered.

[0023] Furthermore, the rendering module is also used for:

[0024] Determine the pixel point position of each pixel point in the face to be rendered according to the vertex position;

[0025] Interpolating the vertex color values ​​to obtain pixel color values ​​of each pixel of the surface;

[0026] Rendering is performed at the vertex position according to the vertex color value, and rendering is performed at the pixel position according to the pixel color value to obtain a target trail generated by the target virtual object in the current frame.

[0027] Further, the survival time information includes a first cumulative survival time of the current face to be rendered and a second cumulative survival time of the previous face to be rendered. The parameter generation module is specifically used for:

[0028] Interpolate the appearance sampling data according to the first accumulated survival time to obtain a first appearance parameter of the current face to be rendered;

[0029] Interpolating the appearance sampling data according to the second accumulated survival time to obtain a second appearance parameter of the current face to be rendered;

[0030] The first appearance parameter and the second appearance parameter are used as target appearance parameters of the current face to be rendered.

[0031] Furthermore, the appearance sampling data includes sampling appearance parameters at least three different sampling moments, and the parameter generation module is further used for:

[0032] Determine a target time interval in which the first accumulated survival time is located from a plurality of candidate time intervals, wherein the candidate time interval is a time interval with two adjacent sampling moments as endpoints;

[0033] In the target time interval, the sampled appearance parameters are interpolated according to the first accumulated survival time to obtain target appearance parameters of the to-be-rendered face.

[0034] Furthermore, the parameter generation module is also used for:

[0035] Initialize first patch data variables corresponding to respective patches to be rendered based on the first storage qualifier;

[0036] Based on the first patch data variable, the lifetime information and patch position information of each patch to be rendered in the current frame are received, wherein the lifetime information and the patch position information are transmitted based on the first storage address after the central processing unit obtains the first storage address of the first patch data variable.

[0037] Furthermore, the data acquisition module is specifically used for:

[0038] Initialize a second patch data variable shared by all the patches to be rendered based on a second storage qualifier;

[0039] The appearance sampling data of the to-be-rendered face is received based on the second face data variable, wherein the appearance sampling data is transmitted based on the second storage address after the central processing unit obtains the second storage address of the second face data variable.

[0040] On the other hand, an embodiment of the present application further provides a trail rendering device, which is applied to a central processing unit, and the trail rendering device includes:

[0041] A curve acquisition module, used for acquiring a curve of appearance parameter changes of a to-be-rendered face when the target virtual object moves, wherein the curve of appearance parameter changes is used for indicating a mapping relationship between appearance parameters of the to-be-rendered face and time;

[0042] A data sampling module, used for sampling the appearance parameter change curve to obtain the appearance sampling data of the to-be-rendered face, and sending the appearance sampling data to a graphics processor;

[0043] A time and position information acquisition module is used to obtain the lifetime information and the patch position information of each of the to-be-rendered patches in the current frame, and send the lifetime information and the patch position information to the graphics processor so that the graphics processor can interpolate the appearance sampling data according to the lifetime information, and after obtaining the target appearance parameters of the to-be-rendered patches, render each of the to-be-rendered patches in the current frame according to the target appearance parameters and the patch position information to obtain the target trail generated by the target virtual object in the current frame.

[0044] Furthermore, the above-mentioned time and location information acquisition module is specifically used for:

[0045] Whenever the distance moved by the target virtual object is greater than or equal to the preset target distance, a new face to be rendered is created and the lifetime information and face position information of the face to be rendered are initialized;

[0046] Add the survival time information and the patch position information corresponding to each of the to-be-rendered patches in the current frame to the patch information list;

[0047] The patch information list is sent to the graphics processor.

[0048] Furthermore, the survival time information includes the first accumulated survival time of the current face to be rendered, and the time and position information acquisition module is further used to:

[0049] When the first accumulated survival time is greater than or equal to a preset survival time threshold, deleting the survival time information and the face position information corresponding to the face to be rendered from the face information list to obtain an updated face information list;

[0050] The updated face information list is sent to the graphics processor.

[0051] On the other hand, an embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned trail rendering method when executing the computer program.

[0052] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is executed by a processor to implement the above-mentioned trail rendering method.

[0053] On the other hand, the embodiment of the present application further provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned trail rendering method.

[0054] The embodiments of the present application include at least the following beneficial effects: when the target virtual object moves, the graphics processor obtains the appearance sampling data of the to-be-rendered facets, obtains the survival time information and facet position information of each to-be-rendered facet in the current frame, interpolates the appearance sampling data according to the survival time information, obtains the target appearance parameters of the to-be-rendered facets, and then renders each to-be-rendered facet in the current frame according to the target appearance parameters and the facet position information, and obtains the target trail generated by the target virtual object in the current frame. Since the appearance sampling data is obtained by the central processing unit sampling the appearance parameter change curve of the to-be-rendered facets, the central processing unit only needs to sample the appearance parameter change curve, which is equivalent to sinking the calculation process of obtaining the target appearance parameters to the graphics processor, thereby releasing the computing resources of the central processing unit, reducing the resource occupancy of the central processing unit, and effectively improving the efficiency of trail rendering. On this basis, the graphics processor obtains the target appearance parameters by interpolation. Compared with the iterative calculation method, it can effectively improve the parallel computing efficiency of the graphics processor, thereby further improving the efficiency of trail rendering.

[0055] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent from the description, or may be understood by practicing the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0057] Figure 1 A schematic diagram of an optional implementation environment provided for an embodiment of the present application;

[0058] Figure 2 A schematic diagram of an optional flow chart of a trail rendering method provided in an embodiment of the present application;

[0059] Figure 3 A schematic diagram of an optional process for a graphics processor to obtain a target trail provided by an embodiment of the present application;

[0060] Figure 4 A schematic diagram of an optional process of configuring a trail renderer interface provided in an embodiment of the present application;

[0061] Figure 5 A schematic diagram of an optional process of constructing a resource interface provided in an embodiment of the present application;

[0062] Figure 6 A schematic diagram of an optional process for obtaining a target trail by cooperating between a central processing unit and a graphics processing unit provided in an embodiment of the present application;

[0063] Figure 7 An optional schematic diagram of an appearance parameter change curve provided in an embodiment of the present application;

[0064] Fig. 8A An optional schematic diagram of a face to be rendered provided in an embodiment of the present application;

[0065] Figure 8B Another optional schematic diagram of a face to be rendered provided in an embodiment of the present application;

[0066] Fig.9A Another optional schematic diagram of a face to be rendered provided in an embodiment of the present application;

[0067] Fig. 9B Another optional schematic diagram of a face to be rendered provided in an embodiment of the present application;

[0068] Fig.10 An optional schematic diagram of a target trail obtained by rendering in different shades of colors provided in an embodiment of the present application;

[0069] Fig.11 A schematic diagram of another optional flow chart of the trail rendering method provided in an embodiment of the present application;

[0070] Fig.12 A schematic diagram of an optional structure of a trail rendering device provided in an embodiment of the present application;

[0071] Fig.13 A schematic diagram of another optional structure of the trail rendering device provided in an embodiment of the present application;

[0072] Fig.14 A partial structural block diagram of a terminal provided in an embodiment of the present application;

[0073] Fig.15 A partial structural block diagram of the server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0074] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0075] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to the characteristics of the target object such as target object attribute information or attribute information set, the permission or consent of the target object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. Among them, the target object can be a user. In addition, when the embodiment of the present application needs to obtain the target object attribute information, the target object's separate permission or separate consent will be obtained by means of a pop-up window or jumping to a confirmation page, etc., and after the separate permission or separate consent of the target object is clearly obtained, the necessary target object-related data for enabling the normal operation of the embodiment of the present application will be obtained.

[0076] To facilitate understanding of the technical solutions provided in the embodiments of the present application, some key terms used in the embodiments of the present application are explained here:

[0077] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to achieve data computing, storage, processing and sharing. It is also a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application. It can form a resource pool and be used on demand, which is flexible and convenient. Cloud computing technology will become an important support in the field of cloud technology. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, each item may have its own identification mark in the future, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can be achieved through cloud computing.

[0078] The Central Processing Unit (CPU) is one of the core components of a computer system and the main component for executing instructions and processing data in a computer. The CPU is responsible for executing instructions in computer programs and processing various data operations. It is an integrated circuit chip that contains functional units such as a controller, an arithmetic logic unit (ALU), registers, and cache. The controller is the main component of the CPU and is responsible for reading instructions from memory, parsing and executing these instructions, and coordinating the operations of various functional units. The arithmetic logic unit (ALU) is responsible for performing arithmetic and logical operations, such as addition, subtraction, and bit operations. Registers are a high-speed memory used to temporarily store instructions and data for quick access by the CPU. The CPU continuously retrieves instructions and data from memory and performs calculations and processing according to the instructions, thereby realizing the operation of various applications.

[0079] Graphics Processing Unit (GPU) is a special hardware in computer systems, mainly used for processing and rendering graphics, images and parallel computing. Unlike CPU, GPU is designed to efficiently process large-scale graphics data and perform parallel computing. GPU contains a large number of parallel processing units, usually called stream processors or shaders. These stream processors can execute multiple threads at the same time and can efficiently process multiple data elements. Each stream processor has its own registers and cache to support fast data access and processing. GPU usually works in conjunction with CPU. CPU is responsible for controlling and coordinating the operation of the entire system, while GPU is responsible for parallel processing and rendering of graphics data. GPU has powerful performance and capabilities in graphics processing and rendering, and is widely used in games, computer graphics, data visualization, scientific computing, artificial intelligence and other fields.

[0080] Trails Renderer is a rendering technology in computer graphics. When a virtual object is moved, a trail is rendered. It can be used to emphasize the movement of the virtual object, or to highlight the path or the position of the virtual object. A trail renderer consists of several patches.

[0081] A shader is a special program in computer graphics that describes and controls lighting, shadows, materials, and other effects in the graphics rendering pipeline. It is a program that runs on the GPU and is responsible for calculating and processing the properties and appearance of each pixel or vertex of the graphics. In the graphics rendering process, a shader can define the color, texture, transparency, reflection, refraction, and other visual effects of an object, as well as how it is affected by light. By writing shader code, developers can customize rendering effects and achieve a variety of unique visual effects, making games or applications more realistic, artistic, or unique.

[0082] At present, in order to make the movement of virtual objects more realistic and beautiful, the trails generated by the virtual objects when they move are usually rendered for the virtual objects. In the related art, when performing trail rendering, it is generally implemented by a renderer built based on JavaScript (referred to as "JS"), however, this type of renderer consumes a lot of CPU resources when running, which easily causes screen freezes and reduces the efficiency of trail rendering.

[0083] In particular, when facing some scenarios with limited CPU resources, such as small program development, mobile application development on devices with weak computing power, front-end web page development, and multi-threaded applications, due to the limitations of software size and resource loading in such scenarios, there are situations where the CPU is limited. Therefore, when performing trail rendering in such scenarios, it will further cause screen freezes, further reducing the efficiency of trail rendering.

[0084] Based on this, the embodiments of the present application provide a trail rendering method, device, electronic device and storage medium, which can effectively improve the efficiency of trail rendering.

[0085] Reference Figure 1 , Figure 1 A schematic diagram of an optional implementation environment provided for an embodiment of the present application, the implementation environment includes a terminal 101 and a server 102, wherein the terminal 101 and the server 102 are connected via a communication network.

[0086] Exemplarily, taking the game scene as an example, the terminal 101 can receive the target virtual object position information and operation instructions sent by the server, and then read the local game resources, and control the movement of the target virtual object according to the target virtual object position information and the operation instructions. In the terminal 101, when the target virtual object moves, the terminal 101 can obtain the appearance sampling data of the to-be-rendered facet, wherein the appearance sampling data is obtained by sampling the appearance parameter change curve of the to-be-rendered facet by the central processor, and the appearance parameter change curve is used to indicate the mapping relationship between the appearance parameters of the to-be-rendered facet and time; obtain the survival time information and facet position information of each to-be-rendered facet in the current frame, interpolate the appearance sampling data according to the survival time information, and obtain the target appearance parameters of the to-be-rendered facet; render each to-be-rendered facet in the current frame according to the target appearance parameters and the facet position information, obtain the target trail generated by the target virtual object in the current frame and display it.

[0087] Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In addition, server 102 can also be a node server in a blockchain network.

[0088] The terminal 101 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, etc., but is not limited thereto. The terminal 101 and the server 102 may be directly or indirectly connected via wired or wireless communication, which is not limited in the present embodiment.

[0089] Exemplarily, the trail rendering method in the embodiment of the present application is applicable to a variety of specific scenarios, such as mini-program games, low-performance terminals, front-end web pages, and multi-threaded applications.

[0090] Among them, in the mini-program game scenario, compared with other development methods, mini-game development needs to be run on the mobile phone or inside the software, and the device performance is limited, so it is necessary to minimize the CPU usage to improve the performance and fluency of the game. By executing the trail rendering method, the terminal 101 can reduce the resource usage of the central processing unit, and the computing requirements of the terminal 101 are not high. It is suitable for use in the mini-program games on the terminal 101, so it not only effectively improves the efficiency of the trail rendering, but also improves the applicability of the trail rendering.

[0091] Among them, in terminal scenarios with lower performance, such as old smartphones or low-end computers, the use of the trail rendering method in the embodiment of the present application can help reduce CPU resource usage. This means that on these devices, even if the computing power is limited, a smooth trail rendering effect can still be achieved, which is very beneficial for games, graphical interfaces or other applications that require real-time rendering, and can improve the user experience and enable the device to handle more tasks.

[0092] Among them, in the front-end web page scenario, web page loading speed and user experience are key factors. Since the trail rendering method in the embodiment of the present application has a low CPU usage, the trail rendering effect can be efficiently applied in the front-end web page, which can reduce web page loading delays, improve page response speed, and maintain good rendering quality at the same time, which is very beneficial for displaying dynamic effects, user interaction, and visually attractive web pages.

[0093] Among them, in multi-threaded application scenarios, such as concurrent processing or applications that need to run multiple tasks at the same time, placing the trail rendering method in a separate thread can avoid blocking the main thread, which can improve the responsiveness and concurrent processing capabilities of the overall application. By using multi-threading, trail rendering can be executed in parallel with other tasks to avoid competition for CPU resources, thereby improving the performance and efficiency of the application.

[0094] The method provided in the embodiments of the present application can be applied to different technical fields, including but not limited to cloud technology, games, smart transportation, assisted driving and other technical fields.

[0095] Reference Figure 2 , Figure 2 An optional flow chart of a trail rendering method provided in an embodiment of the present application, the trail rendering method is applied in a graphics processor, and can be performed by the above Figure 1 The terminal 101 in the embodiment may execute the tail rendering method, or the terminal 101 and the server 102 may execute the tail rendering method in cooperation. In addition, the graphics processor may also be an external device independent of the terminal. In this case, the tail rendering method may be executed by the external device where the graphics processor is located, or the external device, the terminal 101 and the server 102 may execute the tail rendering method in cooperation. The tail rendering method includes but is not limited to the following steps 201 to 203.

[0096] Step 201: When the target virtual object moves, the appearance sampling data of the face to be rendered is obtained.

[0097] The appearance sampling data is obtained by sampling the appearance parameter variation curve of the to-be-rendered face piece by the central processing unit, and the appearance parameter variation curve is used to indicate the mapping relationship between the appearance parameters of the to-be-rendered face piece and time.

[0098] The target virtual object is a virtual object in a game or graphic application, and there may be multiple virtual objects in the game or graphic application. The one that currently needs to perform trail rendering is called the target virtual object. Taking the game as an example, the target virtual object may be a player character, an opponent character, a prop, etc. The target virtual object has a certain moving property in the game or graphic application. When a trail effect is generated during their movement, it can be achieved through the trail rendering method.

[0099] Among them, the patch to be rendered is a patch to be rendered. The patch is the basic unit used to form the trail of the target virtual object in the trail rendering method. The patch is a small graphic element or geometric shape used to construct the surface of the model or object, thereby defining the appearance and shape of the model or object. The patch to be rendered can be rendered by a graphics processor. A trail renderer is composed of several patches. The patches are used to draw and present the trail effect. Therefore, the appearance sampling data of the patch to be rendered is obtained for subsequent processing.

[0100] In one possible implementation, the shapes of the facets to be rendered can be multiple. For example, the facet to be rendered can be a triangle, composed of three vertices, and can express various triangular shapes; or, the facet to be rendered can also be a quadrilateral, composed of four vertices, and can represent shapes such as rectangles and parallelograms; or, the facet to be rendered can also be a curve shape, and these curves can be defined by control points or parameterized equations, and the facets to be rendered are generated by sampling the points on the curve; or, the facet to be rendered can also be a more complex polygonal shape, composed of more vertices, such as a pentagon, hexagon, etc. In the embodiment of the present application, the shape of the facet to be rendered is a quadrilateral as an example, and further, the facet to be rendered in the embodiment of the present application is a trapezoid. On the premise of meeting the requirements of the embodiment of the present application, different geometric shapes can be used to form the facets to be rendered according to specific needs and application scenarios.

[0101] In a possible implementation, there may be multiple patches to be rendered, and appearance sampling data will be obtained for each patch to be rendered, and the number and attributes of each patch can be adjusted according to the settings of the trail renderer, for example, by adjusting the shortest distance (minVertexDistance) parameter in the trail renderer to control the length and number of patches. For example, a fire effect in a game is used as the target virtual object, and the object is composed of multiple patches to be rendered. Each patch to be rendered can be a small trapezoid, and they form the shape of a flame with a certain density and arrangement.

[0102] The appearance sampling data is data describing the appearance characteristics of the face to be rendered, and is obtained by sampling by the central processor according to the appearance parameter change curve of the face to be rendered. The appearance sampling data may include the appearance attributes of the face to be rendered at different time points, such as width, color, texture, brightness, transparency, etc. Therefore, the appearance sampling data can be understood as a collection of a series of appearance parameters, which define the appearance characteristics of the face to be rendered in different frames.

[0103] Among them, the appearance parameter change curve is a curve that describes the changes in the appearance parameters of the face to be rendered over time. The appearance parameter change curve is also a calculation curve. Through the appearance parameter change curve, the appearance parameters can be calculated in the trail renderer, so it is used to sample and calculate the appearance parameters of the face during the trail rendering process. Furthermore, the appearance parameter change curve in the embodiment of the present application is used to describe the changes in the width and color of the face to be rendered over time. On the premise of meeting the requirements of the embodiment of the present application, more appearance parameters such as texture, brightness, transparency, etc. can be set. The embodiment of the present application is only illustrated by width and color as examples, and does not represent a limitation on the embodiment of the present application. The appearance parameter change curve can be obtained by pre-setting or by model training, and no specific limitation is made here.

[0104] In one possible implementation, the appearance parameter change curve plays a role in controlling and customizing the appearance of the trail in the trail renderer, so that the trail can dynamically and smoothly present different width and color effects according to the preset curve changes. Specifically, in the embodiment of the present application, a customized trail appearance can be achieved by defining different appearance parameter change curves. For example, a lower width and dim color can be used at the beginning of the trail, and the width and brightness can be gradually increased over time to achieve a realistic trail effect; by introducing the time dimension in the appearance parameter change curve, the dynamic change of the trail can be achieved, and by adjusting the sampling interval of the curve, the change speed of the trail can be controlled to coordinate with other elements in the scene; because the appearance parameter change curve can define the changes in width and color in a continuous manner, a smooth transition effect can be achieved. This smooth transition can reduce the jagged or discontinuous phenomenon in the trail rendering and improve the quality of the rendering.

[0105] In a possible implementation, the appearance sampling data is obtained by sampling the appearance parameter change curve of the rendered facet by the central processing unit. The embodiment of the present application can sample the appearance parameter change curve for appearance parameters, such as width and color, respectively, to obtain discrete data points, which represent the width value and color value corresponding to different positions (or times) on the curve. Finally, the central processing unit sends the sampled appearance sampling data to the graphics processor, and sinks part of the computing tasks to the graphics processor so that the subsequent graphics processor can perform further processing.

[0106] In one possible implementation, the graphics processor and the central processing unit are two core components that work together. The central processing unit can generate appearance sampling data and appearance parameter change curves of the face to be rendered, calculate the appearance features of the face to be rendered at different time points, and transmit these data to the graphics processor. The graphics processor is a processor specially designed for graphics calculation and rendering, which can receive appearance sampling data from the central processing unit and use it for subsequent calculation and processing. Therefore, the embodiment of the present application can reduce the workload of the central processing unit, improve the efficiency of trail rendering, and achieve better parallel computing by sinking part of the computing tasks to the graphics processor.

[0107] Step 202: Obtain the survival time information and the patch position information of each to-be-rendered patch in the current frame, interpolate the appearance sampling data according to the survival time information, and obtain the target appearance parameters of the to-be-rendered patch.

[0108] Among them, the current frame is a single frame or picture being processed by the graphics processor. When calculating the appearance parameters and trail effects of each facet, it is necessary to consider their survival time and position information in the current frame. It should be noted that the content of the screen is composed of a series of continuous frames, each frame represents a momentary picture, and in the trail rendering method, the embodiment of the present application focuses on the current frame, that is, the frame at the specific time point being processed by the graphics processor. This is because the rendering of the trail needs to consider the appearance changes and trail effects of the target virtual object when it moves. By obtaining the appearance sampling data, survival time information and position information of the facet to be rendered in the current frame, an accurate trail effect can be rendered based on this information.

[0109] The appearance sampling data is interpolated according to the survival time information, that is, the mapping relationship between the appearance parameters and the time is determined according to the appearance sampling data, and the corresponding target appearance parameters are determined according to the survival time information and the mapping relationship.

[0110] In one possible implementation, in addition to the current frame, the embodiment of the present application may also have other frames such as the previous frame and the next frame. The trail rendering may involve interpolation calculations between consecutive frames in order to smoothly transition and draw the trail effect. By processing and interpolating the information of the current frame, the previous frame, and the next frame, the trail of the target virtual object can be accurately, smoothly, and continuously rendered, thereby achieving a more continuous and realistic trail effect.

[0111] Among them, the life time information is information related to the life time of the face to be rendered, for example, it may include the cumulative life time of the face to be rendered, and the cumulative life time may be calculated from the time when the face is created, or from a defined time node after the face is created, such as the node when the data is sent. In an embodiment of the present application, the life time information is defined as the time interval from the generation of the face to be rendered to the current frame, which indicates the length of time the face exists, and can be expressed in frames or seconds. Through the life time information, the speed of change and the gradient effect of the trail can be controlled.

[0112] In a possible implementation, the lifetime information of the face to be rendered can determine the way and duration of the face's appearance change. For example, as the lifetime increases, the face's appearance may change, such as the color gradually fades, the size gradually decreases, etc. This change can create a fading trail effect. Therefore, by adjusting the face's lifetime information, different trail effects can be achieved, so that shorter lifetime information can produce a shorter trail effect, while longer lifetime information can produce a lasting trail effect.

[0113] In a possible implementation, the lifetime information can also be used to control the decay speed and gradient effect of the trail, so that the trail gradually disappears over a period of time. In the execution process of the trail renderer, for each face to be rendered, its current lifetime information is calculated, and the lifetime information is compared with the preset value to decide whether to remove the face. Only faces whose current lifetime is within the valid range are retained, which can ensure that only faces with a sufficiently long lifetime can participate in the rendering of the trail, thereby controlling the duration and effect of the trail.

[0114] The patch position information is information related to the position of the patch to be rendered, such as the 2D or 3D spatial coordinate information of the patch to be rendered in the current frame. These coordinates describe the position, direction and size of the patch to be rendered. Therefore, the position of the patch on the screen can be determined through the patch position information, and corresponding transformation and projection operations can be performed during rendering.

[0115] In a possible implementation, the lifetime information and the patch position information of each to-be-rendered face in the current frame are obtained by the central processing unit. After obtaining the lifetime information and the patch position information, the central processing unit can add the lifetime information and the patch position information to the patch information list, and then send the patch information list to the graphics processor. When each to-be-rendered face is generated, the central processing unit can set a start timestamp for each to-be-rendered face, and calculate the lifetime information based on the start timestamp and the current frame; and similarly, when each to-be-rendered face is generated, the central processing unit can save the initial position of each to-be-rendered face in the face data structure, and generate the face position information based on the position.

[0116] In a possible implementation, only when the distance moved by the target virtual object is greater than or equal to the preset target distance, the central processing unit will create a new face to be rendered and initialize the lifetime information and face position information of the face to be rendered. In the trail renderer, the effect of the trail is achieved through a series of interconnected faces. The density and position of these faces determine the visibility and appearance of the trail. If a new face is created every time the target object moves one pixel, the faces will be too dense, the trail will appear very thick, and a large amount of computing resources may be consumed. In order to avoid this situation, the embodiment of the present application sets a preset target distance. Only when the distance moved by the target object is greater than or equal to this target distance, a new face to be rendered will be created. This ensures that the density of the trail is moderate and not too dense, and also reduces the number of faces and computing overhead. Therefore, the density and rendering load of the trail effect can be effectively controlled, making it visually look smoother and more natural.

[0117] For example, a minimum distance threshold (minVertexDistance) for producing a trail can be set in the trail renderer of the terminal as the target distance, and the target virtual object position of the current frame is compared with the target virtual object position of the previous frame to determine whether the movement exceeds the set threshold. If the moving distance exceeds the distance threshold, a new patch to be rendered needs to be generated, and the patch position information is updated at the same time.

[0118] Among them, the target appearance parameters are parameters used to render the facets to be rendered, which can represent the visual features of the facets to be rendered and ultimately determine the appearance of the trail. The target appearance parameters correspond to the appearance sampling data. If the appearance sampling parameters contain information such as width, color, texture, brightness, and transparency, then the target appearance parameters also contain information such as the width, color, texture, brightness, and transparency of the facets to be rendered. These parameters can be obtained by interpolation calculation based on the survival time information of the facets to be rendered in the current frame, so that the graphics processor can render the facets to be rendered according to the target appearance parameters to generate the target trail effect. The embodiment of the present application can improve the efficiency of trail rendering and parallel computing efficiency by sinking the calculation process to the graphics processor and extracting the target appearance parameters by interpolation.

[0119] In a possible implementation, the target appearance parameters of the face to be rendered are obtained by interpolating the appearance sampling data according to the survival time information. Interpolation is a mathematical and computational method that can be used on a computer to infer the values ​​at other unknown positions based on the relationship between known data points. In the embodiment of the present application, the graphics processor can create a smooth transition effect through interpolation, generate continuous animations, and supplement missing data.

[0120] In one possible implementation, there are multiple ways to interpolate the target appearance parameters of the face to be rendered. For example, linear interpolation can be used to perform linear interpolation between two known data points, and the current value can be calculated according to the linear relationship based on the interpolation factor. Linear interpolation is simple and direct, and is suitable for scenes with low computing power requirements. Alternatively, interpolation can be performed using Bezier curves. Bezier curves can define the shape of the curve through multiple control points, so more complex interpolation effects can be produced to achieve more advanced animation effects. Alternatively, interpolation can be performed using Hermitian curves. Hermitian curves are defined by the starting point, the end point, and their corresponding tangent vectors, and can be used to generate a smooth interpolation path.

[0121] In a possible implementation, the Hermitian curve is used for interpolation in the embodiment of the present application, but it is not intended to be a limitation on the embodiment of the present application. It should be noted that the specific interpolation method and parameter selection may vary depending on the actual application. In trail rendering, the purpose of interpolation is to obtain target appearance parameters that adapt to the movement of the facets based on the lifetime information of the facets to be rendered by interpolating the appearance sampling data. By flexibly selecting appropriate interpolation methods and parameters, the appearance changes of the facets are "smoothly" transitioned, making the trail rendering look more natural and smooth. Therefore, while meeting the requirements of the embodiment of the present application, a suitable interpolation method can be selected according to actual needs.

[0122] Step 203: Render each to-be-rendered face in the current frame according to the target appearance parameters and face position information, and obtain the target trail generated by the target virtual object in the current frame.

[0123] Rendering refers to the process of presenting computer-generated images or animations in a visual form. The graphics processor renders the patches to produce smooth transition effects and visual effects, making the trail look more realistic and smooth. By rendering each patch to be rendered in the current frame, the rendered images of each patch to be rendered in the current frame can be obtained. These images can form the target trail generated by the target virtual object in the current frame.

[0124] In one possible implementation, rendering is performed based on target appearance parameters and facet position information. Rendering using target appearance parameters can enhance the expressiveness of an image or animation. When the target appearance parameters include width and color, the graphics processor can control the coloring and width details of the trail based on the width and color of each facet to be rendered. At the same time, the graphics processor can calculate the final position information based on the facet position information of each facet to be rendered to generate a suitable trail effect.

[0125] In a possible implementation, by acquiring appearance sampling data, life time information, and patch position information, the graphics processor can interpolate and render the patch to be rendered to obtain the trail effect generated by the target virtual object in the current frame. The target virtual object can be represented as a virtual object, which has a certain moving property and generates a trail effect during the movement. The graphics processor can achieve the trail effect generated by the target virtual object in the current frame by interpolating and rendering the appearance sampling data of the patch to be rendered. After acquiring the information of the current frame, the previous frame, and the next frame for rendering, a continuous and smooth target trail animation can be obtained.

[0126] The following describes the process of obtaining the target trail by the graphics processor in the embodiment of the present application in conjunction with the accompanying drawings.

[0127] Reference Figure 3 , shows an optional process schematic diagram of the graphics processor provided by the embodiment of the present application obtaining the target trail. In this example, a vertex shader (Vertex Shader) and a fragment shader (Fragment Shader) are provided in the graphics processor. The vertex shader is responsible for calculating the final position and color information of each patch vertex. It can receive the input vertex position, color and other attributes, and perform calculations and transformations based on these attributes to generate the final vertex position and color. The fragment shader is responsible for calculating the final color value of each patch (pixel). It receives the interpolated vertex attributes passed from the vertex shader, and generates the final color of each patch based on operations such as color interpolation, lighting calculation, and texture sampling, which is used to generate the final image.

[0128] Reference Figure 3 After sampling the appearance sampling data, the trail renderer in the CPU sends it to the vertex shader. After obtaining the lifetime information and patch position information of each to-be-rendered face in the current frame, the CPU also sends it to the vertex shader. The vertex shader interpolates the appearance sampling data according to the lifetime information to obtain the target appearance parameters of the to-be-rendered face. Then the vertex shader sends the target appearance parameters and patch position information to the patch shader. The patch shader renders each to-be-rendered face in the current frame according to the target appearance parameters and patch position information, and finally obtains the target trail generated by the target virtual object in the current frame.

[0129] In summary, in the embodiment of the present application, when the target virtual object moves, the graphics processor obtains the appearance sampling data of the to-be-rendered facets, and obtains the survival time information and facet position information of each to-be-rendered facet in the current frame, interpolates the appearance sampling data according to the survival time information, obtains the target appearance parameters of the to-be-rendered facets, and then renders each to-be-rendered facet in the current frame according to the target appearance parameters and the facet position information, to obtain the target trail generated by the target virtual object in the current frame. Since the appearance sampling data is obtained by the central processing unit sampling the appearance parameter change curve of the to-be-rendered facets, the central processing unit only needs to sample the appearance parameter change curve, which is equivalent to sinking the calculation process of obtaining the target appearance parameters to the graphics processor, thereby releasing the computing resources of the central processing unit, reducing the resource occupancy of the central processing unit, and effectively improving the efficiency of trail rendering. On this basis, the graphics processor obtains the target appearance parameters by interpolation. Compared with the iterative calculation method, it can effectively improve the parallel computing efficiency of the graphics processor, thereby further improving the efficiency of trail rendering.

[0130] In a possible implementation, each face to be rendered may have different lifetime information and position information, but for all faces to be rendered, they share the same appearance sampling data. Therefore, the lifetime information, position information and appearance sampling data of the face to be rendered need to be effectively transmitted between the central processing unit and the graphics processing unit, and the face to be rendered is interpolated and rendered in the current frame, so as to achieve the effect of the target trail generated by the target virtual object in the current frame. In order to effectively realize the transmission of lifetime information, position information and appearance sampling data, it is necessary to implement them based on different storage qualifiers respectively, among which the lifetime information and face position information need to be transmitted based on the first storage qualifier, and the appearance sampling data needs to be transmitted based on the second storage qualifier.

[0131] The following describes the process of transmitting the lifetime information, the position information and the number of appearance samples based on the storage qualifier. First, the process of how the graphics processor obtains the lifetime information and the patch position information in the above step 202 is described:

[0132] In a possible implementation, it is necessary to transmit the lifetime information and the patch position information based on the first storage qualifier. Specifically, it can be: initializing the first patch data variables corresponding to each patch to be rendered based on the first storage qualifier; receiving the lifetime information and the patch position information of each patch to be rendered in the current frame based on the first patch data variable, wherein the lifetime information and the patch position information are transmitted based on the first storage address after the central processing unit obtains the first storage address of the first patch data variable.

[0133] Among them, the first storage qualifier is a storage qualifier used to describe vertex attributes, which is used to associate data with each vertex in graphics rendering, and is used to initialize, update and transfer the attributes of each vertex inside the graphics processor. Exemplarily, in the vertex shader, the first storage qualifier represents the definition of an attribute variable (Attribute), which can also be called an Attribute variable, which is used to receive vertex data from the central processing unit and perform transformation, interpolation and other calculations on the vertex in the rendering pipeline. Through the Attribute variable, the central processing unit can pass information such as the position of the vertex to the graphics processor, so that the graphics processor can perform personalized processing on each vertex and generate corresponding geometric data.

[0134] Among them, the first patch data variable is a variable used to store the relevant data of each patch to be rendered. There can be multiple first patch data variables in the embodiment of the present application, and there can be a corresponding first patch data variable for each patch to be rendered to store its specific attributes. Exemplarily, the first patch data variable is an Attribute variable, which can receive the lifetime information and patch location information of each patch to be rendered based on the first storage address. The first storage address refers to the address of a storage unit, which is used here to reference the memory address where the first patch data variable is located. Through the first patch data variable, the attributes and data of each patch to be rendered can be easily transferred and managed. During the rendering process, the first patch data variable of each patch can be directly accessed and modified to obtain or update the corresponding attribute information.

[0135] In a possible implementation, the first patch data variables of each patch to be rendered are initialized based on the first storage qualifier to ensure that each patch has an independent storage space to store its specific attributes and data. It is understandable that each patch to be rendered may have different lifetime information and patch location information, which are associated with the specific patch and may be used and updated during the rendering process. By initializing a corresponding first patch data variable for each patch, it can be ensured that each patch has its own independent storage space, thereby achieving isolation between patches, which can prevent the attributes and data of different patches from interfering or confusing each other, and provide convenience and flexibility for subsequent rendering and processing processes.

[0136] Next, the process of how the graphics processor obtains the appearance sampling data in the above step 201 is described:

[0137] In a possible implementation, the appearance sampling data needs to be transmitted based on the second storage qualifier. Specifically, the second patch data variable shared by all the patches to be rendered is initialized based on the second storage qualifier; the appearance sampling data of the patches to be rendered is received based on the second patch data variable, wherein the appearance sampling data is transmitted based on the second storage address after the central processing unit obtains the second storage address of the second patch data variable.

[0138] Among them, the second storage qualifier is a storage qualifier used to describe global variables, which are used to pass data to all vertex or patch shaders in graphics rendering. Exemplarily, the second storage qualifier represents the definition of a global variable (Uniform), which can also be called a uniform variable. The uniform variable remains unchanged throughout the rendering process, and its value is the same for all vertices or patches in each rendering call. Uniform variables are usually used to pass global parameters, such as lighting information, material properties, projection matrices, etc. Through uniform variables, the central processing unit can pass global parameter data to the graphics processor, allowing the graphics processor to use this data during the rendering process to determine the consistency of the rendering effect, without the need to pass the same global parameter data for each vertex or patch separately.

[0139] Among them, the second patch data variable is a variable for storing the appearance sampling data of the patch to be rendered. Unlike the first patch data variable, the second patch data variable is shared by all the patches to be rendered and is used to save the appearance information of all patches. Exemplarily, the second patch data variable is a Uniform variable. The purpose of receiving the appearance sampling data of the patch to be rendered based on the second patch data variable is to facilitate the unified management and processing of the appearance information of all patches. Since all patches share the same second patch data variable, the storage space occupied can be effectively reduced, and the appearance sampling data can be transmitted more efficiently. The second storage address refers to the address of the second storage unit, which is used here to reference the memory address where the second patch data variable is located. The transmission based on the second storage address is to transmit data to the second patch data variable through the address and store it in the memory. By using the second storage address, the target location of the data transmission can be specified, thereby realizing the update and management of the second patch data variable.

[0140] In one possible implementation, the main reason why the second storage qualifier is used to initialize the second patch data variable shared by all patches to be rendered is to ensure that the variable is shared and consistent between different patches. It is understandable that since the second patch data variable is shared, only one copy of the data needs to be stored in the memory, rather than creating an independent copy of the data for each patch, which can significantly reduce storage overhead, especially when the number of patches is large. Therefore, the second patch data variable shared by all patches to be rendered can be used as a centralized storage area for centralized management of the appearance information of the patches. This not only facilitates the reading and writing of data, but also facilitates the unified processing and adjustment of the appearance information, while ensuring that they remain consistent during the rendering process. If each patch has its own independent copy of the data, it may cause inconsistencies between patches, thereby affecting the correctness and quality of the rendering results.

[0141] The following is a description of the process of transmitting the lifetime information, location information and appearance sampling number based on different storage qualifiers in the embodiment of the present application in conjunction with the accompanying drawings. First, the process of configuring the trail renderer in the central processing unit is introduced.

[0142] Reference Figure 4 , showing an optional process schematic diagram of the trail renderer configuration interface provided by an embodiment of the present application. In the trail renderer, the left interface is the rendered image, and the right part is the configuration area. The contents configured in the configuration interface include: cast shadow (astShadow), an attribute used to specify whether the target virtual object can cast shadows; receive shadow (receiveShadow), an attribute used to specify whether the target virtual object can receive shadows; dynamic batch (dynamicBatch), an optimization technology used to merge rendering batches of multiple static objects to improve rendering performance; time (time), that is, the survival time information, in seconds, and the parameter in the figure is 5 seconds; width multiplier (widthMultiplier), a parameter for adjusting the width size of the trail renderer; distance threshold (minVertexDistance), specifies the distance between adjacent vertices in the trail. Minimum distance. A smaller value will increase the number of vertices, while a larger value will reduce the number of vertices. The figure shows that the distance threshold is 0.1 units, and the unit can be pixels, etc.; alignment (alignment), defines how the trail renderer is aligned with the direction of the object. You can choose "View" (based on the camera perspective) or "Transform" (based on the transformation of the object itself); texture mode (textureMode), specifies the texture mapping mode of the trail renderer, which can be "Stretch" (stretching) or "Tiling" (tiling); width (Width), specifies the width of the starting point and the ending point of the trail; color (color), used to configure the vertex color value; number of materials (materials size), specifies the number of materials used by the trail renderer, such as 1; the first material (materials 0 (type: material)), the first material used by the trail renderer, the type is material, such as .buildin / material / Effec3DMaterial.mat.

[0143] Reference Figure 5, showing an optional process diagram of the resource construction interface provided by the embodiment of the present application. The construction content includes: only build scripts: this is a parameter that indicates that the construction process only builds script files. During the development process, if only the script is modified without rebuilding the entire project, you can choose to only build the script to improve the construction speed and efficiency; 3D entry scene: this is a parameter that specifies the 3D entry scene, such as test.scene; 2D entry scene: this is a parameter that specifies the 2D entry scene; remote resource upload method: this is a parameter that specifies a remote resource upload method tool, such as the tool local LAN preview capability; put the first scene remotely: this refers to placing the first scene (usually the entry scene) on the remote server for verification after building; check whether it meets the upload specifications after building: this refers to the parameter that ensures that it meets the upload specifications and requirements; clear the build cache: this is a parameter used to clear the build cache; use LAN debugging, the tool and the real machine must be in the same wifi: this refers to the parameter for debugging using the LAN, which is used to require the debugging tool and the real machine to be connected to the same wireless network to facilitate game debugging and testing on the actual device.

[0144] After completing the above configuration, build the resources to build the resources required for running on the real machine. After the build is completed, you can scan the code on the real machine to preview the game screen. At this time, there is no CPU calculation process for the width and color of the trail renderer. The calculation and rendering are completed in the GPU, which improves the runtime performance without basically affecting the effect.

[0145] Reference Figure 6 , shows an optional schematic diagram of a process for obtaining a target trail by cooperating between a central processing unit and a graphics processing unit provided in an embodiment of the present application. A trail renderer is provided on the central processing unit, and a vertex shader and a patch shader are provided on the graphics processing unit. The functions of the trail renderer, the vertex shader and the patch shader have been described in the above embodiments and will not be repeated here.

[0146] In this example, the CPU first initializes the trail renderer. Similarly, the GPU will initialize the Attribute variables corresponding to each to-be-rendered face based on the first storage qualifier, and initialize the Uniform variable shared by all to-be-rendered faces based on the second storage qualifier. The CPU then samples the appearance parameter change curve of the trail renderer to obtain appearance sampling data. After obtaining the storage address of the uniform variable, the CPU passes the appearance sampling data to the vertex shader based on the storage address.

[0147] Next, the CPU sets the shortest distance threshold for producing tailing in the trail renderer as the target distance, and determines whether the movement exceeds the set threshold by comparing the target virtual object position of the current frame with the target virtual object position of the previous frame. If the moving distance exceeds the distance threshold, a new face to be rendered is generated, and initialized at the same time to update the face position information and appearance parameters, such as color, etc., and the new face to be rendered is stored in the face information list after initialization.

[0148] Afterwards, the CPU can obtain the survival time information of each to-be-rendered face, and when the survival time information is greater than or equal to a preset survival time threshold, the survival time information and face position information corresponding to the to-be-rendered face are deleted from the face information list, an updated face information list is obtained, and the moving distance of the target virtual object is detected again. On the contrary, if the survival time information is less than the preset survival time threshold, the survival time information and face position information corresponding to the to-be-rendered face are retained in the face information list, and the final face information list can be stored in a buffer.

[0149] Here, after checking whether the movement specifically exceeds the distance threshold and obtaining a negative conclusion, it is also possible to directly check whether the survival time information exceeds the survival time threshold, which is not specifically limited here.

[0150] Finally, the CPU obtains the patch information lists under different frames through continuous loops, and after obtaining each patch information list, the CPU obtains the storage address of the Attribute variable, and passes the patch information list to the vertex shader based on the storage address. The vertex shader can obtain the lifetime information and patch position information of each patch to be rendered.

[0151] In the graphics processor, after the vertex shader obtains the lifetime information and appearance sampling data of each to-be-rendered face, the vertex shader interpolates the appearance sampling data according to the lifetime information to obtain the target appearance parameters of the to-be-rendered face. Subsequently, the vertex shader sends the target appearance parameters and face position information to the patch shader, which renders each to-be-rendered face in the current frame according to the target appearance parameters and face position information, and finally obtains the target trail generated by the target virtual object in the current frame.

[0152] In addition, since trail rendering requires customized shading and rendering for each patch, the appearance sampling data needs to be re-entered in the patch shader, so the patch shader can also obtain the appearance sampling data sent by the CPU. The patch shader can use this data to render the patch, which can ensure that the patch shader has the required appearance parameters when rendering, thereby drawing the expected trail effect.

[0153] It should be noted that the CPU only needs to sample the appearance parameter change curve, which is equivalent to sinking the calculation process of obtaining the target appearance parameters to the GPU, thereby releasing the computing resources of the CPU, reducing the resource usage of the CPU, and effectively improving the efficiency of the trail rendering. On this basis, the GPU obtains the target appearance parameters by interpolation. Compared with the iterative calculation method, it can effectively improve the parallel computing efficiency of the GPU, thereby further improving the efficiency of the trail rendering.

[0154] In addition, after the graphics processor continues to receive data from each frame, it can eventually obtain the target trail generated by the target virtual object in multiple frames. The target trails of these different frames are synthesized with the original image to present the motion trajectory effect of the target virtual object and perform a visual display. The embodiments of the present application do not impose any specific restrictions on this.

[0155] Next, the process of obtaining the target appearance parameters in step 202 is described:

[0156] In a possible implementation, the life time information includes the first cumulative life time of the current face to be rendered and the second cumulative life time of the previous face to be rendered. After the life time information is obtained in step 202, the appearance sampling data needs to be interpolated according to different cumulative life times. Specifically, it can be: interpolating the appearance sampling data according to the first cumulative life time to obtain the first appearance parameter of the current face to be rendered; interpolating the appearance sampling data according to the second cumulative life time to obtain the second appearance parameter of the current face to be rendered; and using the first appearance parameter and the second appearance parameter as the target appearance parameter of the current face to be rendered.

[0157] In a possible implementation, the survival time information may include the survival time of multiple to-be-rendered facets. This is because when the target virtual object is moving, the central processor will continuously acquire data in a loop according to the distance and time interval of its movement. Therefore, for the target virtual object, its movement process is decomposed into a series of to-be-rendered facets, each of which represents the appearance of the object at different time points, and each to-be-rendered facet has its own survival time information, which is used to indicate the duration of its existence. The introduction of the cumulative survival time is to interpolate the appearance sampling data according to the survival time information of the to-be-rendered facets in the current frame. Since the survival time of the to-be-rendered facets may not completely correspond to the time of the current frame, there may be a certain time difference. Through the cumulative survival time of each to-be-rendered facet before and after, the two sampling points closest to the survival time of the to-be-rendered facets can be found in the appearance sampling data, and then the target appearance parameters of the to-be-rendered facets are calculated by the interpolation method, so as to ensure that the appearance rendering of the target virtual object during the movement is continuous, smooth and realistic.

[0158] In a possible implementation, the example in which the survival time information includes the first cumulative survival time of the current face to be rendered and the second cumulative survival time of the previous face to be rendered does not represent a limitation on the embodiments of the present application. The first cumulative survival time and the second cumulative survival time only represent the survival time of the previous and next faces to be rendered. When the central processing unit and the graphics processor in the embodiments of the present application continuously perform image processing, the current frame will be continuously updated to obtain the survival time of multiple consecutive faces to be rendered.

[0159] The first accumulated survival time indicates the time that the current face to be rendered exists. Similarly, this time can be calculated from the time when the face is created, or from a defined time node after creation, such as the node when data is sent. In an embodiment of the present application, the first accumulated survival time is defined as the time interval from the generation of the current face to be rendered to the current frame, indicating the time that the face exists, which can be expressed in frames or seconds.

[0160] The second accumulated survival time indicates the time that the previous face to be rendered existed. Similarly, this time can be calculated from the time when the face is created, or from a defined time node after creation, such as the node when data is sent. In an embodiment of the present application, the second accumulated survival time is defined as the time interval from the generation of the previous face to be rendered to the current frame, indicating the length of time that the face exists, which can be expressed in frames or seconds.

[0161] In a possible implementation, by obtaining these two cumulative survival times, the appearance sampling data can be interpolated. Specifically, the first cumulative survival time is used to interpolate the first appearance parameter of the current face to be rendered, and the second cumulative survival time is used to interpolate the second appearance parameter of the current face to be rendered. Then, these two appearance parameters can be used as target appearance parameters to render the face to be rendered in the current frame, and finally form the target trail. Through interpolation processing, the appearance of the trail can be made to transition more smoothly in time, enhancing the dynamic effect. At the same time, the appearance can be customized according to different cumulative survival times to achieve more diverse appearance effects.

[0162] In a possible implementation, there are multiple ways to use the first appearance parameter and the second appearance parameter as the target appearance parameter of the current face to be rendered. For example, the first appearance parameter and the second appearance parameter determined in advance can be directly assigned to the target appearance parameter of the current face to be rendered. This method does not consider the change of time or other factors and directly uses fixed appearance parameters; or, according to the cumulative survival time of the current face to be rendered, interpolation calculation can be performed between the existing first appearance parameter and the second appearance parameter, including using linear interpolation, cubic spline interpolation and other methods to smoothly adjust the appearance parameters according to the time, so that the appearance changes more naturally; or, based on the existing first appearance parameter and the second appearance parameter, a function describing the change of the appearance parameter over time can be generated through a curve fitting algorithm, and the target appearance parameter is calculated by the function according to the cumulative survival time of the current face to be rendered. In short, it can be selected according to specific needs and application scenarios. Different methods have different characteristics and applicable conditions. They need to be selected and adjusted according to the specific situation to achieve the desired trail appearance effect.

[0163] In addition, the survival time information may also include the patch creation time, which may indicate the time when the patch to be rendered is created. In an embodiment of the present application, a time operation may be performed between the timestamp defined by the patch creation time and the timestamp of the current frame, so as to determine the time interval between the patch to be rendered and the current frame. This time interval may indicate the time for which the patch to be rendered exists, which may be expressed in frames or seconds. Subsequently, the way and duration of the appearance change of the patch may be determined based on the time interval. For example, as the time interval increases, the appearance of the patch may change, such as the color gradually fading, the size gradually decreasing, etc. This change may create the effect of a trail fading. Therefore, by adjusting the patch creation time of the patch, different trail effects may be achieved, so that a shorter patch creation time may produce a shorter trail effect, while a longer patch creation time may produce a lasting trail effect.

[0164] Reference Figure 7 , showing an optional schematic diagram of the appearance parameter change curve provided by the embodiment of the present application. Specifically, the appearance sampling data is obtained by the central processor sampling the appearance parameter change curve of the rendered face. The curve in the figure is the appearance parameter change curve. The horizontal axis is time, and the vertical axis is the appearance parameter, such as width and color. For efficiency and real-time considerations, a discrete broken line is used to approximate the curve in the embodiment of the present application. Therefore, the curve calculation can be approximated as a broken line calculation to obtain the broken line in the figure.

[0165] In a possible implementation, the number of appearance sampling data can be set according to the need of fitting to the curve, and there are multiple appearance sampling data, each of which is obtained by sampling at a different sampling time. Furthermore, due to the limitation of uniform, the number of sampling points will be limited, that is, the sampling time of the appearance sampling data will be limited, for example, a maximum of 8 sampling points will be limited. Therefore, in the embodiment of the present application, 4 to 8 sampling points can be used to sample the appearance sampling data to obtain a Hermitian curve with at least 4 vertices, which is also convenient for the graphics processor to perform linear interpolation calculations on the appearance parameters.

[0166] In a possible implementation, the appearance sampling data includes sampling appearance parameters at least at three different sampling moments. Therefore, at least one of the candidate time intervals divided according to the sampling moments can be selected as a target time interval, and the sampling appearance parameters can be interpolated within the interval according to the first cumulative survival time. Specifically, the target time interval in which the first cumulative survival time is located can be determined from multiple candidate time intervals, wherein the candidate time interval is a time interval with two adjacent sampling moments as endpoints; in the target time interval, the sampling appearance parameters can be interpolated according to the first cumulative survival time to obtain the target appearance parameters of the face to be rendered.

[0167] Among them, the sampled appearance parameters are specific parameters sampled at different sampling times, and may include appearance attributes of the to-be-rendered face at different sampling times, such as width, color, texture, brightness, transparency and other information. Therefore, the sampled appearance parameters can be understood as a series of specific appearance parameters, and the collection of them is the appearance sampling data. These parameters define the appearance characteristics of the to-be-rendered face in different frames.

[0168] Among them, the candidate time interval is a time interval divided according to multiple different sampling moments, and is composed of time intervals with two adjacent sampling moments as endpoints. When processing appearance sampling data, the embodiment of the present application needs to select a candidate time interval, and then determine a target time interval from it for interpolation calculation, so that the sampled appearance parameters can be interpolated according to the residual survival time of the sampling moment, and the appearance parameters of the face in the target time interval can be more accurately estimated, thereby achieving a more realistic and continuous rendering effect.

[0169] Among them, the target time interval is a time period including the first cumulative survival time determined in the candidate time interval. In the appearance sampling data processing, the embodiment of the present application needs to select one as the target time interval according to the candidate time interval divided by the sampling time, and perform interpolation calculation within the interval. By interpolating the sampled appearance parameters within the target time interval, the target appearance parameters of the face to be rendered can be obtained to achieve a smooth and continuous rendering effect.

[0170] In a possible implementation, in a target time interval, the sampled appearance parameters are interpolated according to the first cumulative survival time to obtain the target appearance parameters of the face to be rendered, so as to achieve a smooth and continuous appearance change effect. Specifically, the appearance sampling data is the face appearance parameters obtained at different times. In the continuous rendering process, the embodiment of the present application needs to ensure that the appearance of the face is smooth and continuous in time, and the face appearance parameters will change over time. Therefore, it is necessary to estimate the appearance parameters of the face in the target time interval by interpolation and maintain its continuity. The first cumulative survival time refers to the time interval from the generation of the face to the target time. By interpolating the sampled appearance parameters according to the time, the appearance parameters of the face in the target time interval can be predicted. In this way, in the continuous rendering process, the appearance changes of the face can be smoothly transitioned, the mutations and discontinuities can be reduced, and the quality and realism of the rendering can be improved. Finally, the sampled appearance parameters can be interpolated in the target time interval to obtain the target appearance parameters of the face to be rendered, so as to achieve a smooth and continuous appearance change effect and improve the visual quality of the rendering.

[0171] In addition, due to the limitation of sampling resources, it may not be possible to sample and obtain appearance parameters at every time point. Therefore, the appearance sampling data can also include only the sampled appearance parameters at two different sampling moments. These two sampled appearance parameters are also used to approximately describe the appearance changes of the facet at different time points. The sampled appearance parameters at two different sampling moments can be used for linear interpolation to obtain the target appearance parameters of the current facet to be rendered. Specifically, by mapping the first cumulative survival time to the target time interval, and then using the linear interpolation method to perform an approximate estimate, the sampled appearance parameters are interpolated within the target time interval, and by assuming that the appearance parameters of the facet change uniformly between the two sampling moments, a smooth trail rendering effect is achieved, and the target appearance parameters of the facet to be rendered are obtained, so that the trail rendering is smoother and continuous, and the visual effect and user experience are improved.

[0172] Next, the process of obtaining the target trail in step 203 is described:

[0173] In a possible implementation, the target appearance parameters include the vertex color values ​​and the patch width value of the to-be-rendered patch, and the patch position information includes the endpoint positions of the moving track of the target virtual object in the to-be-rendered patch, so the graphics processor needs to render the to-be-rendered patch according to the vertex color values, patch width values, and endpoint positions. Specifically, it can be: determine the vertex positions of each vertex of the to-be-rendered patch according to the endpoint positions and patch width values; render each to-be-rendered patch in the current frame according to the vertex positions and vertex color values, and obtain the target trail generated by the target virtual object in the current frame.

[0174] The vertex color value refers to the color attribute of the vertex of the face to be rendered. During the rendering process, by specifying a color value for each vertex of the face to be rendered, a color gradient effect can be achieved when the face is drawn. For example, the vertex color value can be represented by RGB or RGBA, and the color of the vertex is determined by the proportion of red, green, and blue.

[0175] In a possible implementation, the number of vertex color values ​​is related to the number of facets to be rendered. In the embodiment of the present application, the position of each vertex can be defined to determine the shape and appearance of the facet, so each vertex has a corresponding color value for specifying the color of the vertex. Under the premise of meeting the requirements of the embodiment of the present application, it is also possible to determine which vertices to obtain according to actual conditions. For example, only the vertex color values ​​of the vertices corresponding to the moving direction of the target virtual object can be obtained, so that the trail rendering can measure the direction of movement of the target virtual object, and the computing power requirements can be reduced, and the efficiency of trail rendering can be improved. Therefore, the number of vertex color values ​​can be arbitrarily large and can be freely defined as needed, but it should be noted that the more vertices the facets used, the more vertex color values, and the more refined and smooth the trail effect drawn.

[0176] The patch width value refers to the width parameter of the patch to be rendered, which is used to define the width of the patch to be rendered during rendering. In trail rendering, the patch width value is usually used to control the thickness of the trail or the width of the line. A larger patch width value will make the trail look thicker, while a smaller patch width value will make the trail thinner.

[0177] In a possible implementation, the number of patch width values ​​can be set according to actual needs, and there can be multiple patch width values, and different numbers of patch width values ​​can be used to achieve different trail effects. In the embodiment of the present application, by adjusting the number and value of the patch width values, the thickness, gradient and other effects of the trail can be achieved. For example, using more patch width values ​​can make the trail smoother and more delicate, while using fewer patch width values ​​may make the trail appear rougher and simplified. Therefore, the number of patch width values ​​can be adjusted according to actual needs to achieve the desired trail effect.

[0178] In a possible implementation, vertex color values ​​and patch width values ​​are two important parameters used to describe the appearance of the patch to be rendered. By determining the vertex color values ​​and patch width values, trail rendering with different styles and effects can be achieved, such as multi-color gradients, line thickness changes, etc. These parameters are important for rendering the patch to be rendered in the current frame, thereby obtaining the target trail generated by the target virtual object in the current frame.

[0179] The endpoint position refers to the position of at least one of the multiple endpoints of the moving track of the target virtual object in the to-be-rendered face. For example, the endpoint position can be at the starting point and the ending point of the moving track, so the endpoint position can determine the starting position and the ending position of the trail; the endpoint position can also be at the point where the moving track changes and bends in the middle, so the endpoint position can determine the position of the changing moving direction of the trail.

[0180] In one possible implementation, by determining the endpoint positions of the face to be rendered, the specific positions of each vertex in the face to be rendered can be calculated based on the endpoint positions and the known face width value. These vertex positions will be used for subsequent rendering calculations to determine the shape and trajectory of the trail. At the same time, the moving trajectory determined by the endpoint position can affect the direction and length of the trail. The starting point and end point of the moving trajectory determine the starting position and end position of the trail, while the shape and angle of the moving trajectory determine the direction of the trail. Therefore, by determining the endpoint position, trail effects of different shapes and directions can be achieved, which can affect the shape, trajectory and direction of the trail, thereby achieving a variety of trail effects.

[0181] It should be noted that the target appearance parameters may also include only the vertex color values ​​of the face to be rendered, and the face position information includes the endpoint positions of the moving trajectory of the target virtual object in the face to be rendered. When the target appearance parameters include only the vertex color values, the graphics processor only renders according to the vertex color values ​​and the endpoint positions in the process of rendering the target trail, and in the rendering process, the color gradient effect can be achieved in the trail according to the change of the vertex color values. For example, if the vertex color value gradually changes from red to blue, the effect of the trail after rendering will show a gradient from red to blue. At this time, the graphics processor can keep the width of the face to be rendered unchanged, so that the width of the trail will always remain consistent.

[0182] It should be noted that the target appearance parameters may also include only the patch width value of the patch to be rendered, and the patch position information includes the endpoint position of the moving track of the target virtual object in the patch to be rendered. When the target appearance parameters include only the patch width value, the graphics processor only renders according to the patch width value and the endpoint position in the process of rendering the target trail. According to the change of the patch width value, the effect of presenting the width change in the trail can be achieved. For example, if the patch width value changes from thinner to wider, the effect after the trail is rendered will show the change of width from thin to wide, so that the line thickness of the trail can be determined. At this time, due to the lack of the participation of the vertex color value, the trail rendering method cannot express more information or visual effects through the change of color, so that the color of the trail will always remain consistent.

[0183] It should be noted that the patch position information may also include the starting point position and moving distance of the target virtual object in the patch to be rendered, and the starting point position may be used as one of the endpoint positions on the moving trajectory of the target virtual object. Then, since there is only the starting point position, only the endpoint position of one end of the moving trajectory is known at this time, so the ending point position of the target virtual object in the patch to be rendered can be calculated based on the starting point position and the moving distance, and finally the positions of the two end points on the moving trajectory of the target virtual object can be determined, and the graphics processor can also determine the starting position and the ending position of the trail, and the shape and angle of the moving trajectory determine the direction of the trail, so by determining the endpoint position, trail effects of different shapes and directions can be achieved, which can affect the shape, trajectory and direction of the trail, thereby achieving a variety of trail effects.

[0184] In a possible implementation, when determining the vertex position of each vertex of the face to be rendered, the vertex position can be extended based on the endpoint position. Specifically, it can be: based on the endpoint position, half of the face width value is extended in two opposite target directions to obtain the vertex position of each vertex of the face to be rendered, where the target direction is perpendicular to the moving trajectory; or, the endpoint position is used as the vertex position of one of the vertices of the face to be rendered, and the face width value is extended in the target direction based on the endpoint position to obtain the vertex positions of other vertices of the face to be rendered.

[0185] In one possible implementation, there are multiple ways to extend based on the endpoint position, which can be to extend half of the patch width in two opposite target directions, which can be used to create a polygonal patch. By using the endpoint position as one of the vertices and then extending half of the patch width in two opposite directions, the two vertex positions of the patch can be obtained, so that the patch can cover the area between the starting point and the end point, forming the width of the trail.

[0186] For example, when there are multiple patch width values, patches of various shapes can be obtained. Fig. 8A , shows an optional schematic diagram of a face to be rendered provided by an embodiment of the present application. If the face width value includes the width values ​​of the starting point and the ending point on the moving trajectory of the target virtual object, and the face width value of the starting point is smaller than the face width value of the ending point, the moving direction of the target virtual object can be represented by different widths. Therefore, by extending half of the face width value from the endpoints of the starting point and the ending point in two opposite target directions, four vertex positions can be obtained, thereby obtaining a trapezoidal face to be rendered; refer to Figure 8B, showing another optional schematic diagram of the face to be rendered provided by an embodiment of the present application, if the face width value includes the width value of the end point on the moving trajectory of the target virtual object, and the face width value of the starting point is zero, the direction of movement of the target virtual object can be represented by different widths. Therefore, by extending half of the face width value from the endpoint of the end point to the two opposite target directions, three vertex positions can be obtained, among which the endpoint position of the starting point can be used as a vertex position, thereby obtaining a triangular face to be rendered.

[0187] In a possible implementation, there are multiple ways to extend based on the endpoint position. You can also use the endpoint position as a vertex and extend the entire patch width value in the target direction based on the endpoint position. This method is also suitable for creating a polygonal patch. By using the endpoint position as a vertex and then extending the entire patch width in the target direction, you can get the position of another vertex. In this way, the patch can also cover the area between the starting point and the end point to represent the shape of the trail.

[0188] For example, when there are multiple patch width values, patches of various shapes can be obtained. Fig.9A , shows another optional schematic diagram of the face to be rendered provided by an embodiment of the present application. If the face width value includes the width values ​​of the starting point and the ending point on the moving trajectory of the target virtual object, and the face width value of the starting point is smaller than the face width value of the ending point, the moving direction of the target virtual object can be represented by different widths. Therefore, the endpoint positions of the starting point and the ending point are respectively used as vertices, and the entire face width value is extended in the target direction based on the endpoint positions, so that four vertex positions can be obtained, thereby obtaining a trapezoidal face to be rendered; refer to Fig. 9B , the figure shows another optional schematic diagram of the face to be rendered provided by an embodiment of the present application. If the face width value includes the width value of the end point on the moving trajectory of the target virtual object, and the face width value of the starting point is zero, the direction of movement of the target virtual object can be represented by different widths. Therefore, the endpoint position of the end point is taken as a vertex, and the entire face width value is extended in the target direction based on the endpoint position, and three vertex positions can be obtained, among which the endpoint position of the starting point can be taken as a vertex position, thereby obtaining a triangular face to be rendered.

[0189] The target direction is perpendicular to the moving track and can be used to determine the direction of the trail. By using the direction perpendicular to the moving track as the direction of the patch, the trail can appear perpendicular to the moving track when rendered, which can better describe the moving path of the object or virtual object and produce a more accurate trail effect.

[0190] It should be noted that during the rendering of the trail, the width of the trail needs to be determined, so that the trail can be more visible, which helps users to perceive the motion trajectory of the target virtual object more clearly, provides richer visual information, and increases the realism of the trail. Therefore, the purpose of extending the vertex position based on the endpoint position is to determine the shape and position of the face to be rendered. By extending based on the endpoint position, the face shape associated with the endpoint position can be generated, so that the trail has a certain width when rendered.

[0191] In addition, the target direction may also be at other angles to the moving track. In the embodiment of the present application, the tail can be customized to present an effect that is not perpendicular to the moving track during rendering, and the angle between the target direction and the moving track can be adjusted. It should be noted that the human eye has a stronger perception of oblique or tilted motion trajectories, so adjusting the angle between the target direction and the moving track can be used to represent the movement of the target virtual object. For example, if the angle between the target direction and the moving track is 45 degrees, then during the rendering process, the tail will present a certain inclination along the offset direction of the moving track, so that the shape and direction of the tail are closely related to the movement of the object or virtual object, and are more in line with the visual effects produced by the movement of objects in the real world, so that the tail can look more realistic and vivid. On this basis, changing to other angles can achieve different tail effects and presentation methods, produce a variety of tail effects, and increase visual changes and expressiveness.

[0192] In a possible implementation, when obtaining the target trail, the pixel position can be calculated by the vertex position, the color value can be interpolated, and then the process of rendering can be performed at the vertex position and the pixel position to finally obtain the target trail. Specifically, it can be: determine the pixel position of each patch pixel in the to-be-rendered patch according to the vertex position; interpolate the vertex color value to obtain the pixel color value of each patch pixel; render at the vertex position according to the vertex color value, and render at the pixel position according to the pixel color value to obtain the target trail generated by the target virtual object in the current frame.

[0193] Among them, the pixel position refers to the coordinate position on the image or screen, which is used to determine the specific position of each pixel. In a two-dimensional image or screen, the pixel position is usually represented by a horizontal coordinate (x) and a vertical coordinate (y). Through these coordinate values, the position of each pixel in the image or screen can be accurately determined. Determining the pixel position of each pixel in the face to be rendered according to the vertex position is achieved by determining the bounding box of the face and traversing each pixel in the bounding box. During the rendering process, the color value of the pixel can be calculated using interpolation operations, and finally the rendering effect of the target trail is obtained.

[0194] In one possible implementation, a patch is composed of several vertices, and each vertex has its own color value. However, the pixels inside the patch do not necessarily correspond to the vertex position, but are located somewhere between the vertices. Therefore, in order to obtain the accurate color value of each pixel, it is necessary to calculate the color value of the pixel by interpolation. The purpose of interpolation is to insert new pixel color values ​​in the patch according to the known vertex color values, so that the color change of the entire patch is smoother and continuous, and a more refined rendering effect is achieved. Finally, by interpolating the vertex color values, more color value samples can be generated inside the patch, thereby ensuring the authenticity and accuracy of the rendering results. Interpolation can supplement the color transition between vertices, so that each pixel can obtain a suitable color value, presenting a smooth color transition effect. In this way, when rendering the target trail, the trajectory and shape of the object's movement can be better expressed, and the visual quality of graphics rendering can be improved.

[0195] In a possible implementation, after obtaining vertex color values ​​and pixel color values, the graphics processor renders the color value of each pixel to form a target trail effect generated by the target virtual object in the current frame.

[0196] For example, there are many ways to render the target trail by different colors. Fig.10 , shows an optional schematic diagram of a target trail obtained by rendering different color depths provided by an embodiment of the present application. From the starting point to the ending point on the target virtual object's moving trajectory, the vertex color value corresponding to the starting point is the lightest, such as light green, light red, and light gray, and between the vertices corresponding to the ending point, the pixel color values ​​of each patch pixel gradually deepen, and the vertex color value corresponding to the ending point is the darkest, such as dark green, dark red, and dark gray. In this way, the moving trajectory of the target virtual object can be judged by the depth of color; or, from the starting point to the ending point on the moving trajectory of the target virtual object, the vertex color value corresponding to the starting point corresponds to the first color, such as red, and between the vertices corresponding to the ending point, the pixel color values ​​of each patch pixel gradually change, and the vertex color value corresponding to the ending point is the second color, such as blue. In this way, the moving trajectory of the target virtual object can be judged by different colors. It can be understood that the colors of different positions on the moving trajectory of the target virtual object can be obtained by user customization, and no specific limitation is made here.

[0197] It should be noted that during the rendering of the trail, the appearance parameters (such as width, color, etc.) usually change over time. By calculating the pixel position based on the vertex position and interpolating the color value, the change of the appearance parameters can be smoothly processed on the patch, so that the trail presents a smooth and continuous appearance change during the rendering process, avoiding the effect of mutation or discontinuity. The trail usually has complex shapes and details, including curves, textures, etc. By using the vertex position to calculate the pixel position, the position of each pixel on the trail can be more accurately determined, thereby effectively presenting the details of the trail. At the same time, interpolating the color value can make the details richer and more realistic, making the trail rendering more realistic, and can better simulate the interaction between light and the trail, enhance the realism of the rendering, and make the trail look more natural and realistic, with good visual effects.

[0198] It is to be understood that, although the steps in the above-mentioned various flow charts are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned flow charts can include a plurality of steps or a plurality of stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps.

[0199] Reference Fig.11 , Fig.11 Another optional flow chart of the trail rendering method provided in the embodiment of the present application, the trail rendering method is applied to the central processing unit, and can be performed by the above Figure 1 The terminal 101 in the embodiment may execute the tail rendering method, or the terminal 101 and the server 102 may execute the tail rendering method in cooperation. In addition, when the graphics processor is an external device independent of the terminal, the tail rendering method may be executed by the external device, the terminal 101 and the server 102 in cooperation. The tail rendering method includes but is not limited to the following steps 1101 to 1103.

[0200] Step 1101: when the target virtual object moves, obtain the appearance parameter variation curve of the face to be rendered.

[0201] The appearance parameter variation curve is used to indicate the mapping relationship between the appearance parameters of the face to be rendered and time.

[0202] The target virtual object is a virtual object in a game or graphic application, and there may be multiple virtual objects in the game or graphic application. The one that currently needs to perform trail rendering is called the target virtual object. Taking the game as an example, the target virtual object may be a player character, an opponent character, a prop, etc. The target virtual object has a certain moving property in the game or graphic application. When a trail effect is generated during their movement, it can be achieved through the trail rendering method.

[0203] Among them, the patch to be rendered is a patch to be rendered. The patch is the basic unit used to form the trail of the target virtual object in the trail rendering method. The patch is a small graphic element or geometric shape used to construct the surface of the model or object, thereby defining the appearance and shape of the model or object. The patch to be rendered can be rendered by a graphics processor. A trail renderer is composed of several patches. The patches are used to draw and present the trail effect. Therefore, the appearance sampling data of the patch to be rendered is obtained for subsequent processing.

[0204] In one possible implementation, the shapes of the facets to be rendered can be multiple. For example, the facet to be rendered can be a triangle, composed of three vertices, and can express various triangular shapes; or, the facet to be rendered can also be a quadrilateral, composed of four vertices, and can represent shapes such as rectangles and parallelograms; or, the facet to be rendered can also be a curve shape, and these curves can be defined by control points or parameterized equations, and the facets to be rendered are generated by sampling the points on the curve; or, the facet to be rendered can also be a more complex polygonal shape, composed of more vertices, such as a pentagon, hexagon, etc. In the embodiment of the present application, the shape of the facet to be rendered is a quadrilateral as an example, and further, the facet to be rendered in the embodiment of the present application is a trapezoid. On the premise of meeting the requirements of the embodiment of the present application, different geometric shapes can be used to form the facets to be rendered according to specific needs and application scenarios.

[0205] In a possible implementation, there may be multiple patches to be rendered, and appearance sampling data will be obtained for each patch to be rendered, and the number and attributes of each patch can be adjusted according to the settings of the trail renderer, for example, by adjusting the shortest distance (minVertexDistance) parameter in the trail renderer to control the length and number of patches. For example, a fire effect in a game is used as the target virtual object, and the object is composed of multiple patches to be rendered. Each patch to be rendered can be a small trapezoid, and they form the shape of a flame with a certain density and arrangement.

[0206] Step 1102: Sample the appearance parameter variation curve to obtain appearance sampling data of the face to be rendered, and send the appearance sampling data to the graphics processor.

[0207] The appearance sampling data is data describing the appearance characteristics of the face to be rendered, and is obtained by sampling by the central processor according to the appearance parameter change curve of the face to be rendered. The appearance sampling data may include the appearance attributes of the face to be rendered at different time points, such as width, color, texture, brightness, transparency, etc. Therefore, the appearance sampling data can be understood as a collection of a series of appearance parameters, which define the appearance characteristics of the face to be rendered in different frames.

[0208] Among them, the appearance parameter change curve is a curve that describes the changes in the appearance parameters of the face to be rendered over time. The appearance parameter change curve is also a calculation curve. Through the appearance parameter change curve, the appearance parameters can be calculated in the trail renderer, so it is used to sample and calculate the appearance parameters of the face during the trail rendering process. Furthermore, the appearance parameter change curve in the embodiment of the present application is used to describe the changes in the width and color of the face to be rendered over time. On the premise of meeting the requirements of the embodiment of the present application, more appearance parameters such as texture, brightness, transparency, etc. can be set. The embodiment of the present application is only illustrated by width and color as examples, and does not represent a limitation on the embodiment of the present application. The appearance parameter change curve can be obtained by pre-setting or by model training, and no specific limitation is made here.

[0209] In one possible implementation, the appearance parameter change curve plays a role in controlling and customizing the appearance of the trail in the trail renderer, so that the trail can dynamically and smoothly present different width and color effects according to the preset curve changes. Specifically, in the embodiment of the present application, a customized trail appearance can be achieved by defining different appearance parameter change curves. For example, a lower width and dim color can be used at the beginning of the trail, and the width and brightness can be gradually increased over time to achieve a realistic trail effect; by introducing the time dimension in the appearance parameter change curve, the dynamic change of the trail can be achieved, and by adjusting the sampling interval of the curve, the change speed of the trail can be controlled to coordinate with other elements in the scene; because the appearance parameter change curve can define the changes in width and color in a continuous manner, a smooth transition effect can be achieved. This smooth transition can reduce the jagged or discontinuous phenomenon in the trail rendering and improve the quality of the rendering.

[0210] In a possible implementation, the appearance sampling data is obtained by sampling the appearance parameter change curve of the rendered facet by the central processing unit. The embodiment of the present application can sample the appearance parameter change curve for appearance parameters, such as width and color, respectively, to obtain discrete data points, which represent the width value and color value corresponding to different positions (or times) on the curve. Finally, the central processing unit sends the sampled appearance sampling data to the graphics processor, and sinks part of the computing tasks to the graphics processor so that the subsequent graphics processor can perform further processing.

[0211] In one possible implementation, the graphics processor and the central processing unit are two core components that work together. The central processing unit can generate appearance sampling data and appearance parameter change curves of the face to be rendered, calculate the appearance features of the face to be rendered at different time points, and transmit these data to the graphics processor. The graphics processor is a processor specially designed for graphics calculation and rendering, which can receive appearance sampling data from the central processing unit and use it for subsequent calculation and processing. Therefore, the embodiment of the present application can reduce the workload of the central processing unit, improve the efficiency of trail rendering, and achieve better parallel computing by sinking part of the computing tasks to the graphics processor.

[0212] Step 1103, obtain the lifetime information and patch position information of each to-be-rendered face in the current frame, send the lifetime information and patch position information to the graphics processor, so that the graphics processor interpolates the appearance sampling data according to the lifetime information, and after obtaining the target appearance parameters of the to-be-rendered face, render each to-be-rendered face in the current frame according to the target appearance parameters and patch position information, and obtain the target trail generated by the target virtual object in the current frame.

[0213] Among them, the current frame is a single frame or picture being processed by the graphics processor. When calculating the appearance parameters and trail effects of each facet, it is necessary to consider their survival time and position information in the current frame. It should be noted that the content of the screen is composed of a series of continuous frames, each frame represents a momentary picture, and in the trail rendering method, the embodiment of the present application focuses on the current frame, that is, the frame at the specific time point being processed by the graphics processor. This is because the rendering of the trail needs to consider the appearance changes and trail effects of the target virtual object when it moves. By obtaining the appearance sampling data, survival time information and position information of the facet to be rendered in the current frame, an accurate trail effect can be rendered based on this information.

[0214] In one possible implementation, in addition to the current frame, the embodiment of the present application may also have other frames such as the previous frame and the next frame. The trail rendering may involve interpolation calculations between consecutive frames in order to smoothly transition and draw the trail effect. By processing and interpolating the information of the current frame, the previous frame, and the next frame, the trail of the target virtual object can be accurately, smoothly, and continuously rendered, thereby achieving a more continuous and realistic trail effect.

[0215] Among them, the life time information can indicate the existence time of the face to be rendered. This time can be calculated from the time when the face is created, or from a defined time node after creation, such as the node when data is sent. In an embodiment of the present application, the life time information is defined as the time interval from the generation of the face to be rendered to the current frame, indicating the length of time the face exists, which can be expressed in frames or seconds. The life time information can be used to control the change speed and gradient effect of the trail.

[0216] In a possible implementation, the lifetime information of the face to be rendered can determine the way and duration of the face's appearance change. For example, as the lifetime increases, the face's appearance may change, such as the color gradually fades, the size gradually decreases, etc. This change can create a fading trail effect. Therefore, by adjusting the face's lifetime information, different trail effects can be achieved, so that shorter lifetime information can produce a shorter trail effect, while longer lifetime information can produce a lasting trail effect.

[0217] In a possible implementation, the lifetime information can also be used to control the decay speed and gradient effect of the trail, so that the trail gradually disappears over a period of time. In the execution process of the trail renderer, for each face to be rendered, its current lifetime information is calculated, and the lifetime information is compared with the preset value to decide whether to remove the face. Only faces whose current lifetime is within the valid range are retained, which can ensure that only faces with a sufficiently long lifetime can participate in the rendering of the trail, thereby controlling the duration and effect of the trail.

[0218] The patch position information is the 2D or 3D spatial coordinate information of the patch to be rendered in the current frame. These coordinates describe the position, direction and size of the patch to be rendered. Therefore, the position of the patch on the screen can be determined through the patch position information, and corresponding transformation and projection operations can be performed during rendering.

[0219] In a possible implementation, the lifetime information and the patch position information of each to-be-rendered face in the current frame are obtained by the central processing unit. After obtaining the lifetime information and the patch position information, the central processing unit can add the lifetime information and the patch position information to the patch information list, and then send the patch information list to the graphics processor. When each to-be-rendered face is generated, the central processing unit can set a start timestamp for each to-be-rendered face, and calculate the lifetime information based on the start timestamp and the current frame; and similarly, when each to-be-rendered face is generated, the central processing unit can save the initial position of each to-be-rendered face in the face data structure, and generate the face position information based on the position.

[0220] Among them, the target appearance parameters are appearance parameters used to render the facets to be rendered, which are used to represent the visual features of the facets to be rendered and ultimately determine the appearance of the trail. The target appearance parameters correspond to the appearance sampling data. If the appearance sampling parameters contain information such as width, color, texture, brightness, and transparency, then the target appearance parameters also contain information such as the width, color, texture, brightness, and transparency of the facets to be rendered. These parameters can be obtained by interpolation calculation based on the survival time information of the facets to be rendered in the current frame, so that the graphics processor can render the facets to be rendered according to the target appearance parameters to generate the target trail effect. The embodiment of the present application can improve the efficiency of trail rendering and parallel computing efficiency by sinking the calculation process to the graphics processor and extracting the target appearance parameters by interpolation.

[0221] In a possible implementation, the target appearance parameters of the face to be rendered are obtained by interpolating the appearance sampling data according to the survival time information. Interpolation is a mathematical and computational method that can be used on a computer to infer the values ​​at other unknown positions based on the relationship between known data points. In the embodiment of the present application, the graphics processor can create a smooth transition effect through interpolation, generate continuous animations, and supplement missing data.

[0222] In one possible implementation, there are multiple ways to interpolate the target appearance parameters of the face to be rendered. For example, linear interpolation can be used to perform linear interpolation between two known data points, and the current value can be calculated according to the linear relationship based on the interpolation factor. Linear interpolation is simple and direct, and is suitable for scenes with low computing power requirements. Alternatively, interpolation can be performed using Bezier curves. Bezier curves can define the shape of the curve through multiple control points, so more complex interpolation effects can be produced to achieve more advanced animation effects. Alternatively, interpolation can be performed using Hermitian curves. Hermitian curves are defined by the starting point, the end point, and their corresponding tangent vectors, and can be used to generate a smooth interpolation path.

[0223] In a possible implementation, the Hermitian curve is used for interpolation in the embodiment of the present application, but it is not intended to be a limitation on the embodiment of the present application. It should be noted that the specific interpolation method and parameter selection may vary depending on the actual application. In trail rendering, the purpose of interpolation is to obtain target appearance parameters that adapt to the movement of the facets based on the lifetime information of the facets to be rendered by interpolating the appearance sampling data. By flexibly selecting appropriate interpolation methods and parameters, the appearance changes of the facets are "smoothly" transitioned, making the trail rendering look more natural and smooth. Therefore, while meeting the requirements of the embodiment of the present application, a suitable interpolation method can be selected according to actual needs.

[0224] Rendering refers to the process of presenting computer-generated images or animations in a visual form. The graphics processor renders the patches to produce smooth transition effects and visual effects, making the trail look more realistic and smooth. By rendering each patch to be rendered in the current frame, the rendered images of each patch to be rendered in the current frame can be obtained. These images can form the target trail generated by the target virtual object in the current frame.

[0225] In one possible implementation, rendering is performed based on target appearance parameters and facet position information. Rendering using target appearance parameters can enhance the expressiveness of an image or animation. When the target appearance parameters include width and color, the graphics processor can control the coloring and width details of the trail based on the width and color of each facet to be rendered. At the same time, the graphics processor can calculate the final position information based on the facet position information of each facet to be rendered to generate a suitable trail effect.

[0226] In a possible implementation, by acquiring appearance sampling data, life time information, and patch position information, the graphics processor can interpolate and render the patch to be rendered to obtain the trail effect generated by the target virtual object in the current frame. The target virtual object can be represented as a virtual object, which has a certain moving property and generates a trail effect during the movement. The graphics processor can achieve the trail effect generated by the target virtual object in the current frame by interpolating and rendering the appearance sampling data of the patch to be rendered. After acquiring the information of the current frame, the previous frame, and the next frame for rendering, a continuous and smooth target trail animation can be obtained.

[0227] In summary, in the embodiment of the present application, when the target virtual object moves, the graphics processor obtains the appearance sampling data of the to-be-rendered facets, and obtains the survival time information and facet position information of each to-be-rendered facet in the current frame, interpolates the appearance sampling data according to the survival time information, obtains the target appearance parameters of the to-be-rendered facets, and then renders each to-be-rendered facet in the current frame according to the target appearance parameters and the facet position information, to obtain the target trail generated by the target virtual object in the current frame. Since the appearance sampling data is obtained by the central processing unit sampling the appearance parameter change curve of the to-be-rendered facets, the central processing unit only needs to sample the appearance parameter change curve, which is equivalent to sinking the calculation process of obtaining the target appearance parameters to the graphics processor, thereby releasing the computing resources of the central processing unit, reducing the resource occupancy of the central processing unit, and effectively improving the efficiency of trail rendering. On this basis, the graphics processor obtains the target appearance parameters by interpolation. Compared with the iterative calculation method, it can effectively improve the parallel computing efficiency of the graphics processor, thereby further improving the efficiency of trail rendering.

[0228] The detailed process of the above step 1103 is described below:

[0229] In a possible implementation, only when the distance moved by the target virtual object is greater than or equal to the preset target distance, the CPU will create a new face to be rendered and initialize the lifetime information and face position information of the face to be rendered. Specifically, it can be: whenever the distance moved by the target virtual object is greater than or equal to the preset target distance, create a new face to be rendered and initialize the lifetime information and face position information of the face to be rendered; add the lifetime information and face position information corresponding to each face to be rendered in the current frame to the face information list; send the face information list to the graphics processor.

[0230] Among them, the patch information list is a data structure used in the trail rendering method, which is used to store the collection of the lifetime information and patch position information of each patch to be rendered in the current frame. The purpose of the patch information list is to facilitate the management and transmission of relevant information of the patches to be rendered to the graphics processor. Specifically, whenever the distance moved by the target virtual object is greater than or equal to the preset target distance, a new patch to be rendered is created, and the lifetime information and patch position information of the patch are initialized. Then, the lifetime information and patch position information corresponding to each patch to be rendered are added to the patch information list. By setting the patch information list, the trail rendering method can effectively manage the information of the patches to be rendered and achieve the trail rendering effect of the target virtual object.

[0231] In a possible implementation, in a trail renderer, the trail effect is usually achieved through a series of interconnected patches, the density and position of these patches determine the visibility and appearance of the trail, if a new patch is created each time the target object moves one pixel, the patches will be too dense, the trail will appear very thick, and a large amount of computing resources may be consumed. In order to avoid this situation, the embodiment of the present application sets a preset target distance, and only when the distance moved by the target object is greater than or equal to this target distance, a new patch to be rendered will be created, which can ensure that the density of the trail is moderate and not too dense, and also reduce the number of patches and computing overhead, so that the density and rendering load of the trail effect can be effectively controlled, making it visually look smoother and more natural.

[0232] For example, a minimum distance threshold (minVertexDistance) for producing a trail can be set in the trail renderer of the terminal as the target distance, and the target virtual object position of the current frame is compared with the target virtual object position of the previous frame to determine whether the movement exceeds the set threshold. If the moving distance exceeds the distance threshold, a new patch to be rendered needs to be generated, and the patch position information is updated at the same time.

[0233] In a possible implementation, the survival time information includes the first cumulative survival time of the current face to be rendered, so the face information list needs to be sent to the graphics processor according to the first cumulative survival time. Specifically, it can be: when the first cumulative survival time is greater than or equal to the preset survival time threshold, the survival time information and face position information corresponding to the face to be rendered are deleted from the face information list to obtain an updated face information list; and the updated face information list is sent to the graphics processor.

[0234] In a possible implementation, the survival time information may include the survival time of multiple to-be-rendered facets. This is because when the target virtual object is moving, the central processor will continuously acquire data in a loop according to the distance and time interval of its movement. Therefore, for the target virtual object, its movement process is decomposed into a series of to-be-rendered facets, each of which represents the appearance of the object at different time points, and each to-be-rendered facet has its own survival time information, which is used to indicate the duration of its existence. The introduction of the cumulative survival time is to interpolate the appearance sampling data according to the survival time information of the to-be-rendered facets in the current frame. Since the survival time of the to-be-rendered facets may not completely correspond to the time of the current frame, there may be a certain time difference. Through the cumulative survival time of each to-be-rendered facet before and after, the two sampling points closest to the survival time of the to-be-rendered facets can be found in the appearance sampling data, and then the target appearance parameters of the to-be-rendered facets are calculated by the interpolation method, so as to ensure that the appearance rendering of the target virtual object during the movement is continuous, smooth and realistic.

[0235] In a possible implementation, the example in which the survival time information includes the first cumulative survival time of the current facet to be rendered does not represent a limitation on the embodiments of the present application. The first cumulative survival time only represents the survival time of the facet to be rendered in the current frame. When the central processing unit and the graphics processor in the embodiments of the present application continuously perform image processing, the current frame will be continuously updated to obtain the survival time of multiple consecutive facets to be rendered.

[0236] The first accumulated survival time indicates the time that the current face to be rendered exists. Similarly, this time can be calculated from the time when the face is created, or from a defined time node after creation, such as the node when data is sent. In an embodiment of the present application, the first accumulated survival time is defined as the time interval from the generation of the current face to be rendered to the current frame, indicating the time that the face exists, which can be expressed in frames or seconds.

[0237] When the accumulated survival time of the face to be rendered exceeds or equals the preset survival time threshold, it indicates that the face has existed for a long enough time and has completed its trail rendering function. In this case, the survival time information and face position information of the face to be rendered can be deleted from the face information list.

[0238] In a possible implementation, when the first cumulative survival time is greater than or equal to a preset survival time threshold, the survival time information and the patch position information corresponding to the to-be-rendered patch are deleted from the patch information list, and the information of the to-be-rendered patch that has completed the rendering function can be deleted, reducing the computational load of the graphics processor and speeding up the real-time update speed of the rendering effect. It is understandable that, as time goes by, a large amount of to-be-rendered patch information may continue to accumulate in the patch information list. If it is not cleaned up in time, it will occupy more system resources. Deleting the patch information that has completed the rendering function can release resources and improve the resource utilization efficiency of the system. In addition, by setting a preset survival time threshold, the duration of the trail rendering effect can be controlled. When the first cumulative survival time of the patch exceeds the threshold, even if the target virtual object is still moving, the patch will be deleted, thereby limiting the duration of the trail rendering effect and ensuring that the duration of the trail rendering effect meets expectations.

[0239] In summary, in the embodiment of the present application, when the target virtual object moves, the graphics processor obtains the appearance sampling data of the to-be-rendered facets, and obtains the survival time information and facet position information of each to-be-rendered facet in the current frame, interpolates the appearance sampling data according to the survival time information, obtains the target appearance parameters of the to-be-rendered facets, and then renders each to-be-rendered facet in the current frame according to the target appearance parameters and the facet position information, to obtain the target trail generated by the target virtual object in the current frame. Since the appearance sampling data is obtained by the central processing unit sampling the appearance parameter change curve of the to-be-rendered facets, the central processing unit only needs to sample the appearance parameter change curve, which is equivalent to sinking the calculation process of obtaining the target appearance parameters to the graphics processor, thereby releasing the computing resources of the central processing unit, reducing the resource occupancy of the central processing unit, and effectively improving the efficiency of trail rendering. On this basis, the graphics processor obtains the target appearance parameters by interpolation. Compared with the iterative calculation method, it can effectively improve the parallel computing efficiency of the graphics processor, thereby further improving the efficiency of trail rendering.

[0240] It is to be understood that, although the steps in the above-mentioned various flow charts are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned flow charts can include a plurality of steps or a plurality of stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps.

[0241] Reference Fig.12 , Fig.12 An optional structural diagram of a trail rendering device provided in an embodiment of the present application is provided. The trail rendering device 1200 is applied to a graphics processor, and includes:

[0242] The data acquisition module 1201 is used to acquire the appearance sampling data of the to-be-rendered face when the target virtual object moves, wherein the appearance sampling data is obtained by sampling the appearance parameter change curve of the to-be-rendered face by the central processor, and the appearance parameter change curve is used to indicate the mapping relationship between the appearance parameters of the to-be-rendered face and time;

[0243] The parameter generation module 1202 is used to obtain the survival time information and the patch position information of each to-be-rendered patch in the current frame, and interpolate the appearance sampling data according to the survival time information to obtain the target appearance parameters of the to-be-rendered patch;

[0244] The rendering module 1203 is used to render each to-be-rendered face in the current frame according to the target appearance parameters and face position information, and obtain the target trail generated by the target virtual object in the current frame.

[0245] Furthermore, the target appearance parameters include vertex color values ​​and patch width values ​​of the to-be-rendered patch, and the patch position information includes the endpoint positions of the moving track of the target virtual object in the to-be-rendered patch. The rendering module 1203 is specifically used for:

[0246] Determine the vertex position of each vertex of the patch to be rendered according to the endpoint position and the patch width value;

[0247] Each to-be-rendered face in the current frame is rendered according to the vertex position and vertex color value, and the target trail generated by the target virtual object in the current frame is obtained.

[0248] Furthermore, the rendering module 1203 is also used for:

[0249] Based on the endpoint position, half of the patch width is extended in two opposite target directions to obtain the vertex position of each vertex of the patch to be rendered, wherein the target direction is perpendicular to the moving trajectory;

[0250] Alternatively, the endpoint position is used as the vertex position of one of the vertices of the face to be rendered, and the face width value is extended toward the target direction based on the endpoint position to obtain the vertex positions of other vertices of the face to be rendered.

[0251] Furthermore, the rendering module 1203 is also used for:

[0252] Determine the pixel position of each pixel point in the face to be rendered according to the vertex position;

[0253] Interpolate the vertex color values ​​to obtain the pixel color values ​​of each face pixel;

[0254] Rendering is performed at the vertex position according to the vertex color value, and rendering is performed at the pixel position according to the pixel color value to obtain the target trail generated by the target virtual object in the current frame.

[0255] Further, the survival time information includes a first cumulative survival time of the current to-be-rendered face and a second cumulative survival time of the previous to-be-rendered face. The parameter generation module 1202 is specifically used for:

[0256] Interpolate the appearance sampling data according to the first accumulated survival time to obtain the first appearance parameter of the current face to be rendered;

[0257] Interpolate the appearance sampling data according to the second accumulated survival time to obtain a second appearance parameter of the current face to be rendered;

[0258] The first appearance parameter and the second appearance parameter are used as target appearance parameters of the current face to be rendered.

[0259] Furthermore, the appearance sampling data includes sampling appearance parameters at least at three different sampling moments, and the parameter generation module 1202 is further used for:

[0260] Determine a target time interval in which the first accumulated survival time is located from a plurality of candidate time intervals, wherein the candidate time interval is a time interval having two adjacent sampling moments as endpoints;

[0261] In the target time interval, the sampled appearance parameters are interpolated according to the first accumulated survival time to obtain target appearance parameters of the face to be rendered.

[0262] Furthermore, the parameter generation module 1202 is also used for:

[0263] Initialize first patch data variables corresponding to respective patches to be rendered based on the first storage qualifier;

[0264] Based on the first patch data variable, the lifetime information and patch position information of each patch to be rendered in the current frame are received, wherein the lifetime information and patch position information are transmitted based on the first storage address after the central processing unit obtains the first storage address of the first patch data variable.

[0265] Furthermore, the data acquisition module 1201 is specifically used for:

[0266] Initialize a second patch data variable common to all patches to be rendered based on a second storage qualifier;

[0267] The appearance sampling data of the to-be-rendered face is received based on the second face data variable, wherein the appearance sampling data is transmitted based on the second storage address after the central processing unit obtains the second storage address of the second face data variable.

[0268] The trail rendering device 1200 and the trail rendering method applied to the graphics processor are based on the same inventive concept. When the target virtual object moves, the graphics processor obtains the appearance sampling data of the to-be-rendered facets, and obtains the survival time information and facet position information of each to-be-rendered facet in the current frame, interpolates the appearance sampling data according to the survival time information, obtains the target appearance parameters of the to-be-rendered facets, and then renders each to-be-rendered facet in the current frame according to the target appearance parameters and the facet position information to obtain the target trail generated by the target virtual object in the current frame. Since the appearance sampling data is obtained by the central processing unit sampling the appearance parameter change curve of the to-be-rendered facets, the central processing unit only needs to sample the appearance parameter change curve, which is equivalent to sinking the calculation process of obtaining the target appearance parameters to the graphics processor, thereby releasing the computing resources of the central processing unit, reducing the resource occupation of the central processing unit, and effectively improving the efficiency of the trail rendering. On this basis, the graphics processor obtains the target appearance parameters by interpolation. Compared with the iterative calculation method, it can effectively improve the parallel computing efficiency of the graphics processor, thereby further improving the efficiency of the trail rendering.

[0269] Reference Fig.13 , Fig.13 Another optional structural diagram of a trail rendering device provided in an embodiment of the present application is shown. The trail rendering device 1300 is applied to a central processing unit and includes:

[0270] The curve acquisition module 1301 is used to acquire the appearance parameter change curve of the to-be-rendered face when the target virtual object moves, wherein the appearance parameter change curve is used to indicate the mapping relationship between the appearance parameters of the to-be-rendered face and time;

[0271] The data sampling module 1302 is used to sample the appearance parameter change curve to obtain the appearance sampling data of the face to be rendered, and send the appearance sampling data to the graphics processor;

[0272] The time and position information acquisition module 1303 is used to obtain the lifetime information and the patch position information of each to-be-rendered face in the current frame, and send the lifetime information and the patch position information to the graphics processor so that the graphics processor can interpolate the appearance sampling data according to the lifetime information, and after obtaining the target appearance parameters of the to-be-rendered face, render each to-be-rendered face in the current frame according to the target appearance parameters and the patch position information, and obtain the target trail generated by the target virtual object in the current frame.

[0273] Furthermore, the time and location information acquisition module 1303 is specifically used for:

[0274] Whenever the distance moved by the target virtual object is greater than or equal to the preset target distance, a new face to be rendered is created and the lifetime information and face position information of the face to be rendered are initialized;

[0275] Add the survival time information and patch position information corresponding to each patch to be rendered in the current frame to the patch information list;

[0276] Sends a list of patch information to the GPU.

[0277] Furthermore, the survival time information includes the first accumulated survival time of the current face to be rendered. The time and position information acquisition module 1303 is also used to:

[0278] When the first accumulated survival time is greater than or equal to a preset survival time threshold, the survival time information and the face position information corresponding to the face to be rendered are deleted from the face information list to obtain an updated face information list;

[0279] Send the updated patch information list to the GPU.

[0280] The trail rendering device 1300 and the trail rendering method applied to the central processing unit are based on the same inventive concept. When the target virtual object moves, the graphics processor obtains the appearance sampling data of the to-be-rendered facets, and obtains the survival time information and facet position information of each to-be-rendered facet in the current frame, interpolates the appearance sampling data according to the survival time information, obtains the target appearance parameters of the to-be-rendered facets, and then renders each to-be-rendered facet in the current frame according to the target appearance parameters and the facet position information, and obtains the target trail generated by the target virtual object in the current frame. Since the appearance sampling data is obtained by the central processing unit sampling the appearance parameter change curve of the to-be-rendered facets, the central processing unit only needs to sample the appearance parameter change curve, which is equivalent to sinking the calculation process of obtaining the target appearance parameters to the graphics processor, thereby releasing the computing resources of the central processing unit, reducing the resource occupation of the central processing unit, and effectively improving the efficiency of the trail rendering. On this basis, the graphics processor obtains the target appearance parameters by interpolation. Compared with the iterative calculation method, it can effectively improve the parallel computing efficiency of the graphics processor, thereby further improving the efficiency of the trail rendering.

[0281] The electronic device for executing the trail rendering method provided in the embodiment of the present application may be a terminal. Fig.14 , Fig.14This is a partial structural block diagram of a terminal provided in an embodiment of the present application. The terminal includes: a camera assembly 1410, a memory 1420, an input unit 1430, a display unit 1440, a sensor 1450, an audio circuit 1460, a wireless fidelity (WiFi) module 1470, a processor 1440, and a power supply 1490. Those skilled in the art can understand that Fig.13 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0282] The camera assembly 1410 can be used to capture images or videos. Optionally, the camera assembly 1410 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal, and the rear camera is disposed on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions.

[0283] The memory 1420 may be used to store software programs and modules. The processor 1480 executes various functional applications and data processing of the terminal by running the software programs and modules stored in the memory 1420 .

[0284] The input unit 1430 may be used to receive input digital or character information and generate key signal input related to the terminal's settings and function control. Specifically, the input unit 1430 may include a touch panel 1431 and other input devices 1432 .

[0285] The display unit 1440 may be used to display input information or provided information and various menus of the terminal. The display unit 1440 may include a display panel 1441 .

[0286] The audio circuit 1460 , the speaker 1461 , and the microphone 1462 may provide an audio interface.

[0287] The power source 1490 may be alternating current, direct current, a disposable battery, or a rechargeable battery.

[0288] The number of sensors 1450 may be one or more, and the one or more sensors 1450 include but are not limited to: acceleration sensors, gyroscope sensors, pressure sensors, optical sensors, etc. Among them:

[0289] The acceleration sensor can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal. For example, the acceleration sensor can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 1480 can control the display unit 1440 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor. The acceleration sensor can also be used for collecting game or user motion data.

[0290] The gyroscope sensor can detect the body direction and rotation angle of the terminal, and the gyroscope sensor can cooperate with the acceleration sensor to collect the user's 3D actions on the terminal. The processor 1480 can implement the following functions based on the data collected by the gyroscope sensor: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0291] The pressure sensor can be set in the side frame of the terminal and / or the lower layer of the display unit 1440. When the pressure sensor is set in the side frame of the terminal, the user's holding signal of the terminal can be detected, and the processor 1480 performs left and right hand recognition or shortcut operations according to the holding signal collected by the pressure sensor. When the pressure sensor is set in the lower layer of the display unit 1440, the processor 1480 controls the operability controls on the UI interface according to the user's pressure operation on the display unit 1440. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0292] The optical sensor is used to collect the ambient light intensity. In one embodiment, the processor 1480 can control the display brightness of the display unit 1440 according to the ambient light intensity collected by the optical sensor. Specifically, when the ambient light intensity is high, the display brightness of the display unit 1440 is increased; when the ambient light intensity is low, the display brightness of the display unit 1440 is decreased. In another embodiment, the processor 1480 can also dynamically adjust the shooting parameters of the camera assembly 1410 according to the ambient light intensity collected by the optical sensor.

[0293] In this embodiment, the processor 1480 included in the terminal can execute the trail rendering method of the previous embodiment.

[0294] The electronic device for executing the trail rendering method provided in the embodiment of the present application may also be a server. Fig.15 , Fig.15Partial structural block diagram of the server provided in the embodiment of the present application. The server 1500 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 1522 (for example, one or more processors) and memory 1532, and one or more storage media 1530 (for example, one or more mass storage devices) storing application programs 1542 or data 1544. Among them, the memory 1532 and the storage medium 1530 can be short-term storage or permanent storage. The program stored in the storage medium 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server 1500. Furthermore, the central processing unit 1522 can be configured to communicate with the storage medium 1530 and execute a series of instruction operations in the storage medium 1530 on the server 1500.

[0295] The server 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1558, and / or, one or more operating systems 1541, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0296] The processor in the server 1500 may be used to execute the trail rendering method.

[0297] The embodiment of the present application further provides a computer-readable storage medium, which is used to store program code, and the program code is used to execute the trail rendering method of each of the above embodiments.

[0298] The embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned trail rendering method.

[0299] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate to describe the embodiments of the present application, for example, it can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0300] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0301] It should be understood that in the description of the embodiments of the present application, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to not include the number, and above, below, within, etc. are understood to include the number.

[0302] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0303] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0304] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0305] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0306] It should also be understood that the various implementations provided in the embodiments of the present application can be combined arbitrarily to achieve different technical effects.

[0307] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the above implementation mode. Technical personnel familiar with the field can also make various equivalent modifications or substitutions under the shared conditions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. A trail rendering method, characterized in that: Applied to a graphics processor, the trail rendering method includes: When the target virtual object moves, the appearance sampling data of the face to be rendered is obtained, wherein the appearance sampling data is obtained by sampling the appearance parameter change curve of the face to be rendered by the central processing unit, and the appearance parameter change curve is used to indicate the mapping relationship between the appearance parameters of the face to be rendered and time; Acquire the survival time information and the patch position information of each of the to-be-rendered patches in the current frame, interpolate the appearance sampling data according to the survival time information, and obtain the target appearance parameters of the to-be-rendered patches; Render each of the to-be-rendered facets in the current frame according to the target appearance parameters and the facet position information to obtain a target trail generated by the target virtual object in the current frame.

2. The trail rendering method according to claim 1, characterized in that: The target appearance parameters include vertex color values ​​and patch width values ​​of the to-be-rendered patch, the patch position information includes endpoint positions of the moving track of the target virtual object in the to-be-rendered patch, and rendering each of the to-be-rendered patches in the current frame according to the target appearance parameters and the patch position information to obtain a target trail generated by the target virtual object in the current frame, including: Determine the vertex position of each vertex of the to-be-rendered face according to the endpoint position and the face width value; Each of the to-be-rendered face pieces in the current frame is rendered according to the vertex positions and the vertex color values, so as to obtain a target trail generated by the target virtual object in the current frame.

3. The trail rendering method according to claim 2, characterized in that: The step of determining the vertex position of each vertex of the to-be-rendered face according to the endpoint position and the face width value includes: Extending half of the patch width value in two opposite target directions based on the endpoint position to obtain the vertex position of each vertex of the patch to be rendered, wherein the target direction is perpendicular to the moving trajectory; Alternatively, the endpoint position is used as the vertex position of one of the vertices of the face patch to be rendered, and the face patch width value is extended toward a target direction based on the endpoint position to obtain the vertex positions of other vertices of the face patch to be rendered.

4. The trail rendering method according to claim 2, characterized in that: The step of rendering each of the to-be-rendered face pieces in the current frame according to the vertex positions and the vertex color values ​​to obtain a target trail generated by the target virtual object in the current frame includes: Determine the pixel point position of each pixel point in the face to be rendered according to the vertex position; Interpolating the vertex color values ​​to obtain pixel color values ​​of each pixel of the surface; Rendering is performed at the vertex position according to the vertex color value, and rendering is performed at the pixel position according to the pixel color value to obtain a target trail generated by the target virtual object in the current frame.

5. The trail rendering method according to claim 1, characterized in that: The lifetime information includes a first accumulated lifetime of the current face to be rendered and a second accumulated lifetime of the previous face to be rendered, and interpolating the appearance sampling data according to the lifetime information to obtain a target appearance parameter of the face to be rendered includes: Interpolate the appearance sampling data according to the first accumulated survival time to obtain a first appearance parameter of the current face to be rendered; Interpolating the appearance sampling data according to the second accumulated survival time to obtain a second appearance parameter of the current face to be rendered; The first appearance parameter and the second appearance parameter are used as target appearance parameters of the current face to be rendered.

6. The trail rendering method according to claim 5, characterized in that: The appearance sampling data includes sampling appearance parameters at at least three different sampling moments, and the interpolation of the appearance sampling data according to the first accumulated survival time to obtain the first appearance parameter of the current face to be rendered includes: Determine a target time interval in which the first accumulated survival time is located from a plurality of candidate time intervals, wherein the candidate time interval is a time interval with two adjacent sampling moments as endpoints; In the target time interval, the sampled appearance parameters are interpolated according to the first accumulated survival time to obtain target appearance parameters of the to-be-rendered face.

7. The trail rendering method according to claim 1, characterized in that: The obtaining of the survival time information and the position information of each of the to-be-rendered face pieces in the current frame includes: Initialize first patch data variables corresponding to respective patches to be rendered based on the first storage qualifier; Based on the first patch data variable, the lifetime information and patch position information of each patch to be rendered in the current frame are received, wherein the lifetime information and the patch position information are transmitted based on the first storage address after the central processing unit obtains the first storage address of the first patch data variable.

8. The trail rendering method according to claim 1, characterized in that: The step of obtaining the appearance sampling data of the face to be rendered includes: Initialize a second patch data variable shared by all the patches to be rendered based on a second storage qualifier; The appearance sampling data of the to-be-rendered face is received based on the second face data variable, wherein the appearance sampling data is transmitted based on the second storage address after the central processing unit obtains the second storage address of the second face data variable.

9. A trail rendering method, characterized in that: Applied to a central processing unit, the trail rendering method includes: When the target virtual object moves, obtaining an appearance parameter change curve of the face to be rendered, wherein the appearance parameter change curve is used to indicate a mapping relationship between the appearance parameters of the face to be rendered and time; Sampling the appearance parameter change curve to obtain appearance sampling data of the to-be-rendered face, and sending the appearance sampling data to a graphics processor; The lifetime information and the patch position information of each of the to-be-rendered patches in the current frame are obtained, and the lifetime information and the patch position information are sent to the graphics processor, so that the graphics processor interpolates the appearance sampling data according to the lifetime information, and after obtaining the target appearance parameters of the to-be-rendered patches, each of the to-be-rendered patches in the current frame is rendered according to the target appearance parameters and the patch position information, so as to obtain the target trail generated by the target virtual object in the current frame.

10. The trail rendering method according to claim 9, characterized in that: The obtaining of the lifetime information and the patch position information of each of the to-be-rendered patches in the current frame, and sending the lifetime information and the patch position information to the graphics processor, comprises: Whenever the distance moved by the target virtual object is greater than or equal to the preset target distance, a new face to be rendered is created and the lifetime information and face position information of the face to be rendered are initialized; Add the survival time information and the patch position information corresponding to each of the to-be-rendered patches in the current frame to the patch information list; The patch information list is sent to the graphics processor.

11. The trail rendering method according to claim 10, characterized in that: The survival time information includes a first accumulated survival time of the current face to be rendered, and the sending of the face information list to the graphics processor includes: When the first accumulated survival time is greater than or equal to a preset survival time threshold, deleting the survival time information and the face position information corresponding to the face to be rendered from the face information list to obtain an updated face information list; The updated face information list is sent to the graphics processor.

12. A trail rendering device, characterized in that: Applied to a graphics processor, the trail rendering device comprises: A data acquisition module, used for acquiring appearance sampling data of a to-be-rendered face when the target virtual object moves, wherein the appearance sampling data is obtained by sampling an appearance parameter variation curve of the to-be-rendered face by a central processing unit, and the appearance parameter variation curve is used for indicating a mapping relationship between the appearance parameters of the to-be-rendered face and time; A parameter generation module, used to obtain the survival time information and the patch position information of each of the to-be-rendered patches in the current frame, and interpolate the appearance sampling data according to the survival time information to obtain the target appearance parameters of the to-be-rendered patches; A rendering module is used to render each of the to-be-rendered facets in the current frame according to the target appearance parameters and the facet position information, so as to obtain a target trail generated by the target virtual object in the current frame.

13. A trail rendering device, characterized in that: Applied to a central processing unit, the trail rendering device comprises: A curve acquisition module, used for acquiring a curve of appearance parameter changes of a to-be-rendered face when the target virtual object moves, wherein the curve of appearance parameter changes is used for indicating a mapping relationship between appearance parameters of the to-be-rendered face and time; A data sampling module, used for sampling the appearance parameter change curve to obtain the appearance sampling data of the to-be-rendered face, and sending the appearance sampling data to a graphics processor; A time and position information acquisition module is used to obtain the lifetime information and the patch position information of each of the to-be-rendered patches in the current frame, and send the lifetime information and the patch position information to the graphics processor so that the graphics processor can interpolate the appearance sampling data according to the lifetime information, and after obtaining the target appearance parameters of the to-be-rendered patches, render each of the to-be-rendered patches in the current frame according to the target appearance parameters and the patch position information to obtain the target trail generated by the target virtual object in the current frame.

14. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, it implements the trail rendering method described in any one of claims 1 to 8, or implements the trail rendering method described in any one of claims 9 to 11.

15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the computer program implements the trail rendering method described in any one of claims 1 to 8, or implements the trail rendering method described in any one of claims 9 to 11.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the trail rendering method described in any one of claims 1 to 8, or implements the trail rendering method described in any one of claims 9 to 11.