Interactive interface rendering method and device, equipment, medium and program product
By combining the rendering information of animation and UI and directly rendering it in the animation rendering thread, the problem of low UI animation rendering performance in the existing technology is solved, and efficient and seamless animation and UI integration is achieved.
Patent Information
- Application Number
- CN202411780862.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-07
AI Technical Summary
The prior art has performance problems when dealing with animations in user interaction interfaces (UIs). The multi-step rendering process is redundant and complex, resulting in large resource consumption and affecting the overall performance and user experience.
By obtaining the texture information of the target animation and the rendering information of the interactive interface, the target rendering information is merged and formed. When receiving the rendering instruction, the combined information is directly used in the animation rendering thread to render, avoiding the process of multiple outputs to the rendering target.
It significantly improves rendering efficiency and performance, reduces redundant steps and overhead, ensures seamless integration of animation and UI, and optimizes resource usage and reduces rendering complexity.
Smart Images

Figure CN119579750A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to an interactive interface rendering method, device, equipment, medium and program product. Background Art
[0002] In modern games and virtual reality environments, animation effects in user interfaces (UI) have become very common. Animation not only provides a rich visual experience, but also enhances the interactivity between users and the interface. For example, changes in character status and dynamic prompt information are all achieved through animation, making the UI more vivid and intuitive.
[0003] However, existing rendering solutions have obvious performance issues when processing animations in UI. Usually, the UI is rendered first, then the animation is rendered, and the result is output to a render target (RenderTarget). This method is not only redundant and complex, but also leads to high overhead. This multi-step rendering process consumes a lot of resources and has poor optimization effects, affecting the overall performance and user experience.
[0004] Therefore, there is an urgent need for a UI animation rendering method that reduces overhead. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides an interactive interface rendering method. One or more embodiments of the present invention also relate to an interactive interface rendering device, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.
[0006] According to a first aspect of an embodiment of the present invention, there is provided an interactive interface rendering method, comprising: Acquire first rendering information of the target animation, wherein the first rendering information is used to represent texture information of each animation frame in the target animation; Acquire second rendering information of an interactive interface associated with a target animation, and combine the second rendering information with texture information of each animation frame to obtain target rendering information; In response to a rendering instruction for the interactive interface, the rendering target rendering information of the animation rendering thread corresponding to the interactive interface is determined to obtain the interactive interface including the target animation.
[0007] According to a second aspect of an embodiment of the present invention, there is provided an interactive interface rendering device, comprising: An acquisition module is configured to acquire first rendering information of a target animation, wherein the first rendering information is used to represent texture information of each animation frame in the target animation; A merging module is configured to obtain second rendering information of an interactive interface associated with a target animation, and merge the second rendering information with texture information of each animation frame to obtain target rendering information; The rendering module is configured to respond to a rendering instruction for the interactive interface, determine the rendering target rendering information of the animation rendering thread corresponding to the interactive interface, and obtain the interactive interface including the target animation.
[0008] According to a third aspect of an embodiment of the present invention, there is provided a computing device, including: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above-mentioned interactive interface rendering method are implemented.
[0009] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the above-mentioned interactive interface rendering method are implemented.
[0010] According to a fifth aspect of an embodiment of the present invention, a computer program product is provided, including a computer program / instruction, which implements the steps of the above-mentioned interactive interface rendering method when executed by a processor.
[0011] An embodiment of the present invention implements obtaining first rendering information of a target animation, wherein the first rendering information is used to characterize the texture information of each animation frame in the target animation; obtaining second rendering information of an interactive interface associated with the target animation, and merging the second rendering information with the texture information of each animation frame to obtain target rendering information; in response to a rendering instruction for the interactive interface, determining the animation rendering thread corresponding to the interactive interface to render the target rendering information, and obtaining an interactive interface including the target animation. The target rendering information is formed by obtaining the texture information of each animation frame of the target animation and merging it with the rendering information of the interactive interface. When a rendering instruction is received, the merged information is directly used for rendering in the rendering thread, thereby avoiding the process of multiple outputs to the rendering target, reducing redundant steps and overhead, and significantly improving rendering efficiency and performance. This not only ensures the seamless integration of animation and UI, but also optimizes resource usage and reduces rendering complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 is an interactive schematic diagram of an interactive interface rendering system provided by an embodiment of the present invention; Figure 2 is a flow chart of an interactive interface rendering method provided by an embodiment of the present invention; Figure 3It is a processing flow chart of an interactive interface rendering method provided by an embodiment of the present invention; Figure 4 It is a structural schematic diagram of an interactive interface rendering device provided by an embodiment of the present invention; Figure 5 It is a structural block diagram of a computing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0013] Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited to the specific implementation disclosed below.
[0014] The terms used in one or more embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present invention. The singular forms of "a", "said" and "the" used in one or more embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present invention refers to and includes any or all possible combinations of one or more associated listed items.
[0015] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present invention, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present invention, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0016] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0017] First, the terms involved in one or more embodiments of the present invention are explained.
[0018] Spine: Spine is a tool for 2D skeletal animation, commonly used in game development.
[0019] SceneCapture: SceneCapture is a technology that captures scene images by rendering the scene from a specified camera view.
[0020] Pass: A processing or rendering stage in the rendering process.
[0021] Shader: Shader is used to process tasks such as vertex and pixel color calculation.
[0022] RenderBatch: A batch of vertex data that needs to be drawn together.
[0023] RenderTarget: Rendering target refers to the texture used to save rendering results.
[0024] In modern games and virtual reality environments, animation effects in user interfaces (UI) have become very common. Animation not only provides a rich visual experience, but also enhances the interactivity between users and the interface. For example, changes in character status and dynamic prompt information are all achieved through animation, making the UI more vivid and intuitive.
[0025] Existing rendering solutions have obvious performance issues when processing animations in the UI. Usually, the UI is rendered first, then the animation is rendered, and the result is output to a render target (RenderTarget). This method is not only redundant and complex, but also leads to large overhead. Specifically, when processing animations in the UI, the existing solution needs to first render the UI elements to an intermediate RenderTarget, and then render the animation frame by frame to the same RenderTarget. This multi-step rendering process not only adds unnecessary rendering steps, but also leads to a large amount of resource consumption. Especially in the case of high frame rates and complex animations, this redundant rendering process will significantly increase the burden on the GPU, reduce rendering efficiency, and affect overall performance and user experience.
[0026] In view of the above problems, the present invention provides an interactive interface rendering method, which re-customizes the rendering process for spine animation rendering in the interactive interface and simplifies the pass and shader in the rendering process. The present invention also relates to an interactive interface rendering system, an interactive interface rendering device, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0027] See also Figure 1 , Figure 1It is an interaction schematic diagram of an interactive interface rendering system provided by an embodiment of the present invention. The interactive interface rendering system includes a user end and a server end. The user end is used to send a rendering instruction to the server end, and the server end is used to obtain first rendering information of a target animation, wherein the first rendering information is used to represent texture information of each animation frame in the target animation; obtain second rendering information of an interactive interface associated with the target animation, and merge the second rendering information with the texture information of each animation frame to obtain target rendering information; in response to a rendering instruction for the interactive interface, determine that an animation rendering thread corresponding to the interactive interface renders target rendering information, and obtain an interactive interface including the target animation.
[0028] Applied to the interactive interface rendering system, the seamless integration of animation and UI is achieved and the rendering performance is optimized through the collaboration between the client and the server: the client is responsible for sending rendering instructions to the server, and the server receives these instructions and starts processing the first rendering information of the target animation (that is, the texture information of each animation frame) and the second rendering information of the interactive interface (such as buttons, text boxes and other UI elements), and then merges these two parts of information into the target rendering information. When the rendering instruction is received, the corresponding animation rendering thread is scheduled, and the merged information is used to directly render the complete interactive interface including the target animation. The whole process avoids the steps of multiple outputs to the intermediate rendering target and avoids rendering redundant passes in SceneCapture, thereby reducing unnecessary overhead and significantly improving rendering efficiency and overall performance.
[0029] See also Figure 2 , Figure 2 It is a flowchart of an interactive interface rendering method provided by an embodiment of the present invention, which specifically includes the following steps.
[0030] Step 202: Acquire first rendering information of the target animation, wherein the first rendering information is used to represent texture information of each animation frame in the target animation.
[0031] In practical applications, obtaining the first rendering information of the target animation usually includes reading and processing the texture data of the animation frame. The system first determines the frame sequence of the target animation, and each frame represents a time point of the animation. For each frame, the system needs to read the texture information of the frame, which usually includes pixel color, transparency, and other attributes that may affect the rendering effect. For example, if the target animation is an animation of a game character casting magic, then the texture information of each frame may contain details such as the color change, brightness, and transparency of the flame when casting. The system also needs to ensure that the texture information of each frame is complete and can correctly reflect the state of the frame in the animation sequence. Once the texture information of each frame is obtained, the system can organize it into the first rendering information for use in subsequent processing steps. For the step of obtaining the first rendering information of the target animation, one implementation method is to read the pre-saved texture data from the file system; another implementation method is to generate these texture data from the memory in real time, which is suitable for dynamically generated animations.
[0032] It is understandable that in certain scenarios, texture information can also be bone information. For example, in character animation, texture information may include the character's bone position, rotation angle, and joint motion data, which also need to be read and processed to ensure the smoothness and authenticity of the animation. In this way, the system can capture and render the details of the animation more comprehensively and improve the final visual effect.
[0033] In a specific embodiment of the present invention, suppose a skill learning interface in a game, with learnable skills on the left, and after clicking, the skill animation can be displayed on the right. The system needs to obtain the texture information of each frame to display the skill animation clicked by the player. Assuming that the player clicks on a skill called "flame impact", the system first determines the frame sequence of the skill animation, and each frame represents a moment of the flame impact animation. For each frame, the system reads and processes the texture data of the frame, such as the color gradient, brightness change and transparency effect of the flame. The system ensures that the texture information of each frame is complete and can truly reflect the state of the flame impact animation at this moment. Once the texture information of each frame is obtained, the system organizes it into the first rendering information for subsequent rendering processing. For example, the system can read texture files stored on the hard disk, which contain detailed texture information of each frame. Alternatively, the system can generate these texture data in real time from the memory, which is suitable for dynamically generated skill animations.
[0034] Step 204: Acquire second rendering information of the interactive interface associated with the target animation, and combine the second rendering information with the texture information of each animation frame to obtain target rendering information.
[0035] Among them, the second rendering information refers to the rendering data of the interactive interface elements associated with the target animation, including the position, size, color and other attributes of UI elements such as buttons, text, and images; the target rendering information is the final rendering data formed by merging the second rendering information with the texture information of the animation frame.
[0036] In actual applications, the system first needs to obtain the second rendering information of the interactive interface associated with the target animation. This includes reading the position, size, color and other properties of the UI elements. For example, if the target animation is a skill display animation in a game, the UI elements associated with it may include skill name, skill description, skill icon, etc. The system needs to read the attribute data of these UI elements and organize them into the second rendering information. For the step of obtaining the second rendering information of the interactive interface associated with the target animation, one implementation method is to directly read the attribute data of the UI element from the UI framework; another implementation method is to read the data of the UI element from a predefined configuration file.
[0037] Next, the system merges the second rendering information with the texture information of each animation frame to obtain the target rendering information. This step usually involves combining each pixel of the animation frame with the corresponding position pixel of the UI element. For example, when displaying the "Fire Impact" skill animation, the system needs to merge the texture of each frame of the flame with the position, background color, border style and other information of the skill name text box to ensure that these UI elements and animation frames can be seamlessly integrated. The system can achieve this by performing pixel-level merging operations in the synthesis layer to generate a final rendered image containing animation and UI elements.
[0038] In a specific embodiment of the present invention, consider the skill learning interface in the game, where the left side is the learnable skills, and after clicking, the skills can be animated on the right. When the player clicks on a skill on the left, the system needs to obtain UI element information related to the skill display. For example, suppose the player clicks on a skill called "Flame Shock", the system needs to read the font color, size and position on the screen of the skill name "Flame Shock", and ensure that these UI elements do not block the key parts of the animation. In addition, the system also needs to read the position, background color, border style, etc. of the skill description text box. After obtaining the information of these UI elements, the system merges it with the texture information of each frame of the flame shock animation. For example, when displaying the "Flame Shock" skill animation, the system needs to merge the texture of each frame of the flame with the position, background color, border style and other information of the skill name text box to ensure that these UI elements and animation frames can be seamlessly integrated.
[0039] Furthermore, the second rendering information and the texture information of each animation frame are combined to obtain the target rendering information, including: based on the second rendering information, creating a template instance corresponding to the interactive interface; in response to the creation instruction of the front end, determining the display area of the target animation in the template instance; pre-rendering the texture information of each animation frame into the display area to obtain the target rendering information.
[0040] Among them, the second rendering information refers to the rendering data of the interactive interface elements associated with the target animation, including the position, size, color and other attributes of UI elements such as buttons, text and images; the template instance is a specific instance used to display the interactive interface; the display area refers to the specific area on the interactive interface used to display the target animation; the target rendering information is the final rendering data formed by merging the second rendering information with the texture information of the animation frame.
[0041] In actual applications, the system first creates a template instance corresponding to the interactive interface based on the second rendering information. That is, the system will create a specific instance for displaying the interactive interface based on the attribute data of the UI element. For example, in the skill learning interface in the game, the left side is a list of learnable skills, and the right side is a skill display area. The system needs to create a template instance containing these UI elements to ensure that the attributes of each UI element, such as position, size, and color, are set correctly.
[0042] Next, the system responds to the creation instruction from the front end and determines the display area of the target animation in the template instance. The creation instruction is usually triggered by the user's interactive behavior, such as clicking on an item in the skill list. The system will find the display area for displaying the target animation in the template instance based on the creation instruction. For example, when the player clicks the "Fire Blast" skill on the left, the system will determine the display area on the right in the template instance for displaying the skill animation.
[0043] Finally, the system pre-renders the texture information of each animation frame into the display area to obtain the target rendering information. That is, the system will place the texture information of each frame of animation in the display area and merge it with the second rendering information of the UI element. For example, when displaying the "Flame Impact" skill animation, the system will place the texture information of each frame of flame in the display area on the right, and merge it with UI elements such as the skill list and skill description on the left to generate the final target rendering information.
[0044] In a specific embodiment of the present invention, consider the skill learning interface in the game, the left side is the learnable skills, and after clicking, the skills can be animated on the right side. When the player clicks on a skill in the list on the left, the system will respond to this operation and create a template instance corresponding to the interactive interface. For example, assuming that the player clicks on the "flame shock" skill, the system will create a template instance containing UI elements such as the skill name and description, and ensure that the properties of these elements such as the position, size and color are correctly set. Then, the system responds to the creation instruction of the front end and determines the display area of the target animation in the template instance. For example, the system will find the right display area for displaying the "flame shock" skill animation in the template instance. Finally, the system pre-renders the texture information of each frame of the flame shock animation into the display area, and merges it with the UI elements such as the skill list and skill description on the left to generate the final target rendering information. Finally, the player can see the animation display of the "flame shock" skill on the right, while the skill name and other related information are displayed on the left.
[0045] Based on this, by processing the second rendering information and creating a template instance corresponding to the interactive interface, the system can accurately determine the display area of the target animation, and merge the texture information of the animation frame with the UI element to generate the final target rendering information. This not only ensures the high quality of the animation display, but also optimizes resource usage and reduces rendering complexity. The system can effectively pre-render the texture information of the animation frame into the display area and seamlessly integrate it with the UI elements, providing users with a smooth and high-quality animation display experience.
[0046] Furthermore, the texture information of each animation frame is pre-rendered into the display area to obtain target rendering information, including: for the texture information of the first animation frame in each animation frame, the texture information of the first animation frame is rendered into the display area to obtain target primitive information corresponding to the first animation frame, wherein the first animation frame is any animation frame in each animation frame; and the target primitive information corresponding to each animation frame is assembled into target rendering information.
[0047] Among them, the first animation frame refers to any frame among the animation frames, the target primitive information refers to the primitive data used for rendering, including vertex, texture coordinate and other information; the target rendering information is the final rendering data after assembling the target primitive information of all animation frames.
[0048] In actual applications, the system first processes the texture information of the first animation frame in each animation frame. Specifically, the system selects a certain animation frame (i.e., the first animation frame) as the processing object, renders the texture information of the frame into the display area, and generates the target primitive information corresponding to the frame. This process includes converting the texture information into primitive data that can be used for rendering, such as vertex coordinates, texture coordinates, etc. For example, when displaying the "Fire Impact" skill animation, the system can select the first frame of the animation, render the flame texture information of the frame into the display area on the right, and generate the target primitive information corresponding to the first frame.
[0049] Next, the system assembles the target primitive information corresponding to each animation frame to obtain the final target rendering information. That is, the system will process the texture information of each frame of animation in turn, generate the target primitive information of each frame, and assemble these primitive information to form complete rendering data. For example, the system will continue to process each frame of the "Fire Impact" skill animation, convert the flame texture information of each frame into target primitive information, and combine the target primitive information of all frames together to form the final target rendering information.
[0050] In a specific embodiment of the present invention, consider the skill learning interface in the game, the left side is the learnable skills, and after clicking, the skills can be animated on the right. When the player clicks on the "Flame Impact" skill in the list on the left, the system first processes the texture information of the first frame, renders it to the display area on the right, and generates the target primitive information corresponding to the first frame. Then, the system continues to process the flame texture information of each frame, generates the target primitive information of each frame, and assembles these primitive information. For example, the system converts the flame texture information of the first frame into primitive data, and processes each subsequent frame in turn until the last frame. Finally, the system combines the target primitive information of all frames together to form the final target rendering information. In this way, the player can see the animated display of the "Flame Impact" skill on the right, while the skill name and other related information are displayed on the left.
[0051] Based on this, by pre-rendering the texture information of each animation frame into the display area and generating the target primitive information, the system can effectively assemble the final target rendering information. This not only ensures the high quality of the animation display, but also optimizes resource usage and reduces rendering complexity. The system can effectively convert the texture information of each frame into primitive data and combine them together to provide users with a smooth and high-quality animation display experience.
[0052] Step 206: In response to the rendering instruction for the interactive interface, determine the rendering target rendering information of the animation rendering thread corresponding to the interactive interface, and obtain the interactive interface including the target animation.
[0053] In actual applications, after receiving the rendering instruction, the system will schedule an animation rendering thread dedicated to the interactive interface for subsequent rendering operations. This instruction can be triggered by any interactive behavior of the user, such as click, touch, or keyboard input. When the user clicks on a skill on the left side of the skill learning interface in the game, the system will detect this operation and issue a rendering instruction in response to this operation. At this time, the system will start an animation rendering thread dedicated to the skill display interface. This animation rendering thread will be responsible for processing the target rendering information, that is, the first rendering information (texture information of the animation frame) and the second rendering information (rendering information of the UI element) that were previously acquired and merged will be finally rendered. The animation rendering thread will render the animation frame by frame according to the data in the target rendering information, and merge the animation frame with the UI element to generate a complete interactive interface. During the entire rendering process, the animation rendering thread can run independently of the main thread of the game, thereby avoiding the impact of the rendering task on the game logic processing and improving the rendering efficiency.
[0054] In a specific embodiment of the present invention, assume that the skill learning interface in the game has learnable skills on the left, and after clicking, the skills can be animated on the right. When the player clicks on a skill in the list on the left, the system will detect this operation and issue a rendering instruction in response to this operation. The system then starts a dedicated animation rendering thread, which will be responsible for processing the target rendering information. For example, when the player clicks on a skill called "Flame Impact", the system starts the animation rendering thread and passes the first rendering information (texture information of the flame impact animation frame) and the second rendering information (rendering information of UI elements such as skill name and description) previously acquired and merged to the animation rendering thread. Based on this information, the animation rendering thread renders the flame impact animation frame by frame, and merges the animation frame with the UI element to generate a complete interactive interface. Throughout the process, the animation rendering thread runs independently and does not interfere with the normal logical processing of the main thread of the game. In the end, the player can see the flame impact skill animation displayed on the right, while the skill name and other related information are displayed on the left.
[0055] Furthermore, in response to a rendering instruction for the interactive interface, the animation rendering thread corresponding to the interactive interface is determined to render target rendering information, and an interactive interface including a target animation is obtained, including: in response to a rendering instruction for the interactive interface, the target rendering information is divided into multiple rendering batches of information according to rendering attributes; the animation rendering thread corresponding to the interactive interface is determined, and the multiple rendering batches of information are rendered in a preset order.
[0056] Among them, rendering instructions refer to system commands triggered by user operations, which are used to instruct the system to start rendering a specific interactive interface; rendering attributes include vertex information, indexes, materials, shaders and other information; rendering batch information refers to the small batches of data into which the target rendering information is divided according to vertex information, indexes, materials, shaders and other attributes, so as to facilitate batch processing; the animation rendering thread is a thread specifically used to process rendering tasks, which can run independently of the main thread to improve rendering efficiency.
[0057] In actual applications, after the system responds to the rendering instructions for the interactive interface, it will divide the target rendering information into multiple rendering batches according to the rendering attributes. This means that the system will decompose the rendering task of the entire interactive interface into multiple smaller task units based on vertex information, indexes, materials, shaders and other attributes. For example, the system can process vertex and index information with the same material and shader as a batch. Specifically, the system checks the texture information and related attributes of each frame, and creates corresponding rendering batches based on this information. For the step of responding to the rendering instructions for the interactive interface, one implementation method is that the UI framework automatically triggers the rendering instructions when a user interaction event occurs; another implementation method is to manually send rendering instructions through a programming interface.
[0058] Subsequently, the system determines the animation rendering thread corresponding to the interactive interface, and renders multiple rendering batches of information in a preset order. This means that the system will start a thread dedicated to processing rendering tasks, which will process these rendering batches of information one by one in a predetermined order. For example, when displaying the "Fire Impact" skill animation, the system will first render the vertex information and index information of the first frame with the same material and shader, then the second frame, and so on, until all frames are rendered. This ensures the continuity and smoothness of the animation frames, while also avoiding the interference of rendering tasks on the main thread, improving the overall rendering efficiency.
[0059] Based on this, by starting a dedicated animation rendering thread in response to the rendering instructions of the interactive interface, and dividing the target rendering information into multiple rendering batches according to vertex information, index, material, shader and other attributes for processing one by one, the system can effectively separate rendering tasks from game logic processing, thereby improving rendering efficiency.
[0060] Furthermore, the target rendering information includes texture information of the animation frame and shader program information of the interactive interface; the target rendering information is divided into multiple rendering batch information according to the rendering attributes, including: grouping the target rendering information according to the rendering attributes to obtain multiple rendering groups; for the first rendering group, merging the texture information of the animation frame and the shader program information of the interactive interface in the first rendering group to obtain rendering batch information corresponding to the first rendering group, wherein the first rendering group is any rendering group among the multiple rendering groups.
[0061] In actual applications, the system first groups the target rendering information according to the rendering attributes to obtain multiple rendering groups. This means that the system divides the target rendering information into different groups according to attributes such as vertex information, index, material, shader, etc. For example, the system can put vertex and index information with the same material and shader into the same group. Specifically, the system checks the texture information and related attributes of each frame and creates corresponding groups based on this information.
[0062] Next, the system merges the texture information of the animation frames in the first rendering group and the shader program information of the interactive interface for the first rendering group, and obtains the rendering batch information corresponding to the first rendering group. This means that the system will merge the texture information and shader program information in each group to form batch information that can be processed in batches. For example, for the first rendering group with the same material and shader, the system will merge all the texture information and shader program information in the group to generate the rendering batch information corresponding to the first rendering group. For the step of grouping the target rendering information according to the rendering attributes, one implementation method is to traverse the target rendering information and group it according to the material and shader attributes; another implementation method is to predefine the grouping rules and group them according to these rules.
[0063] In a specific embodiment of the present invention, consider the skill learning interface in the game, where the left side is the learnable skills, and after clicking, the skills can be animated on the right. When the player clicks on a skill in the list on the left, the system will respond to this operation and group the target rendering information according to the rendering attributes to obtain multiple rendering groups. For example, assuming that the "Fire Impact" skill animation has ten frames, the system can put the vertex and index information with the same material and shader into the same group. Then, for the first rendering group, the system merges the texture information of the animation frames in the group and the shader program information of the interactive interface to obtain the rendering batch information corresponding to the first rendering group. The animation rendering thread will first process the texture information and related attributes of the first group, followed by the second group, until all groups are processed. In this way, the player can see the animation display of the "Fire Impact" skill on the right, while the skill name and other related information are displayed on the left.
[0064] Based on this, the system can effectively process the texture information and related attributes of each frame as a batch, and render it in a preset order, providing users with a smooth and high-quality animation display experience.
[0065] Furthermore, the animation rendering thread corresponding to the interactive interface is determined, and multiple rendering batch information is rendered in a preset order, including: determining the animation rendering thread corresponding to the interactive interface, calling the shader corresponding to the interactive interface, and rendering multiple rendering batch information in a preset order.
[0066] In actual applications, the system determines the animation rendering thread corresponding to the interactive interface, and calls the shader corresponding to the interactive interface to render multiple rendering batches of information in a preset order. This means that the system will start a thread dedicated to processing rendering tasks, which will be responsible for rendering animations and UI elements in the interactive interface. Starting the animation rendering thread can ensure that the rendering task does not interfere with the logic processing of the main thread, thereby improving rendering efficiency and the overall performance of the game.
[0067] Specifically, in the animation rendering thread, the system only needs to set the RenderPass rendering command once, and then use a streamlined SlateShader with fewer instructions to complete the drawing in one go. This means that in the animation rendering thread, the system will set the rendering command once and use a streamlined shader program to process the rendering batch information. This can reduce the number of instructions in the rendering process, avoid additional rendering state changes, and thus improve rendering efficiency. For example, when showing the "Fire Impact" skill animation, the system will process the texture information and UI element information of the first frame in a preset order, and use a streamlined shader program to draw it in one go, followed by the second frame, and so on, until all frames are rendered.
[0068] Based on this, the system can effectively render the texture information and UI element information of each frame in a preset order, and complete the drawing in one go through a streamlined shader program, avoiding additional rendering state changes and overhead, and achieving higher rendering efficiency.
[0069] One embodiment of the present invention implements obtaining first rendering information of a target animation, wherein the first rendering information is used to characterize the texture information of each animation frame in the target animation; obtaining second rendering information of an interactive interface associated with the target animation, and merging the second rendering information with the texture information of each animation frame to obtain target rendering information; in response to a rendering instruction for the interactive interface, determining that an animation rendering thread corresponding to the interactive interface renders the target rendering information, and obtaining an interactive interface including the target animation. The target rendering information is formed by obtaining the texture information of each animation frame of the target animation and merging it with the rendering information of the interactive interface. When a rendering instruction is received, the merged information is directly used for rendering in the animation rendering thread, thereby avoiding the process of multiple outputs to the rendering target, avoiding rendering redundant passes in SceneCapture, reducing redundant steps and overhead, and significantly improving rendering efficiency and performance. This not only ensures seamless integration of animation and UI, but also optimizes resource usage and reduces rendering complexity.
[0070] The following combination Figure 3 , taking the application of the interactive interface rendering method provided by the present invention in the game spine animation as an example, the interactive interface rendering method is further explained.
[0071] In the existing technology, the Spine rendering solution uses the SceneCapture technology provided by the engine. SceneCapture draws Spine in the scene, outputs the drawing results to a RenderTarget, and then takes this RenderTarget as a texture resource, inputs it into a new Shader for further processing to present the final effect. However, the process of drawing to this RenderTarget is redundant and complicated, and uses a scene Shader with high overhead. In addition, since the drawing of Spine involves a high Shader complexity and additionally draws a transparent Pass, it is not controlled by some rendering commands, and the performance problem is particularly prominent on low-end devices. In order to optimize the rendering of Spine, Figure 3The solution customized Spine's rendering pipeline, developed a dedicated SpineRenderer (spine animation renderer), removed unnecessary SlatePrePass (Slate pre-drawing process) in the game thread, and streamlined Spine's DrawCall (drawing call) in the animation rendering thread, using the most streamlined Shader to draw Spine, thereby significantly improving rendering efficiency. Figure 3 , Figure 3 It is a processing flow chart of an interactive interface rendering method provided by an embodiment of the present invention, which specifically includes the following steps.
[0072] Step 302: Initialization and creation.
[0073] Specifically, create a Spine UMG (a UI editor) template instance in the game thread and dynamically update the skeleton data of each frame. Step 304: Virtual window and binding.
[0074] Specifically, take out the Slate object (i.e., UI object) from the instance, register the virtual window (i.e., the display area mentioned above), specify the window parent container as the child component of the viewport, and bind Spine's Slate object to the virtual window. Step 306: Prepare graphic element information.
[0075] Specifically, the primitive information after the skeleton is updated is counted when Spine draws each frame, and the primitive information is assembled into RenderBatch data for use by the animation rendering thread.
[0076] Step 308: Rendering pipeline optimization.
[0077] Specifically, in the animation rendering thread, only one RenderPass rendering command needs to be set, and then a simplified SlateShader with fewer instructions is used to complete the drawing in one go. The entire process does not require any additional rendering state changes, redundant transparency pass writing, or additional Attachment Load / Store overhead, achieving higher rendering efficiency. Step 310: Remove unnecessary UI pre-rendering.
[0078] Specifically, step 310 is processed in the game thread, with the goal of updating the size of the window parent container when the layout (here refers to the scaling) of the window parent container and its child nodes changes. However, since Spine does not need child nodes and its own layout does not need to be updated in real time, this process can be removed, thus avoiding the overhead caused by recursive processing of child nodes.
[0079] Corresponding to the above method embodiment, the present invention also provides an interactive interface rendering device embodiment, Figure 4 FIG. 1 is a schematic diagram of the structure of an interactive interface rendering device provided by an embodiment of the present invention. Figure 4 As shown, the device comprises: The acquisition module 402 is configured to acquire first rendering information of the target animation, wherein the first rendering information is used to represent texture information of each animation frame in the target animation; A merging module 404 is configured to obtain second rendering information of an interactive interface associated with a target animation, and merge the second rendering information with texture information of each animation frame to obtain target rendering information; The rendering module 406 is configured to respond to the rendering instruction for the interactive interface, determine the rendering target rendering information of the animation rendering thread corresponding to the interactive interface, and obtain the interactive interface including the target animation.
[0080] Optionally, the merging module 404 is further configured to create a template instance corresponding to the interactive interface based on the second rendering information; determine the display area of the target animation in the template instance in response to the creation instruction of the front end; pre-render the texture information of each animation frame into the display area to obtain the target rendering information.
[0081] Optionally, the merging module 404 is further configured to render the texture information of the first animation frame in each animation frame into the display area to obtain target primitive information corresponding to the first animation frame, wherein the first animation frame is any animation frame in each animation frame; and assemble the target primitive information corresponding to each animation frame into target rendering information.
[0082] Optionally, the rendering module 406 is further configured to respond to a rendering instruction for the interactive interface, divide the target rendering information into multiple rendering batches according to rendering attributes; determine the animation rendering thread corresponding to the interactive interface, and render the multiple rendering batches in a preset order.
[0083] Optionally, the target rendering information includes texture information of the animation frame and shader program information of the interactive interface; accordingly, the rendering module 406 is further configured to group the target rendering information according to the rendering attributes to obtain multiple rendering groups; for the first rendering group, the texture information of the animation frame and the shader program information of the interactive interface in the first rendering group are merged to obtain rendering batch information corresponding to the first rendering group, wherein the first rendering group is any rendering group among the multiple rendering groups.
[0084] Optionally, the rendering module 406 is further configured to determine an animation rendering thread corresponding to the interactive interface, call a shader corresponding to the interactive interface, and render multiple rendering batches of information in a preset order.
[0085] Applied to the interactive interface rendering device, the acquisition module 402 is responsible for obtaining the first rendering information of the target animation, that is, the texture information of each animation frame; the merging module 404 obtains the second rendering information of the interactive interface associated with the target animation, and merges the two parts of information into the target rendering information; when receiving the rendering instruction, the rendering module 406 determines the animation rendering thread corresponding to the interactive interface, and directly uses the merged information for rendering, thereby avoiding the process of multiple outputs to the rendering target, avoiding redundant rendering passes in SceneCapture, reducing redundant steps and overhead, significantly improving rendering efficiency and performance, ensuring seamless integration of animation and UI, optimizing resource usage, and reducing rendering complexity.
[0086] The above is a schematic scheme of an interactive interface rendering device of this embodiment. It should be noted that the technical scheme of the interactive interface rendering device and the technical scheme of the interactive interface rendering method described above belong to the same concept, and the details not described in detail in the technical scheme of the interactive interface rendering device can be referred to the description of the technical scheme of the interactive interface rendering method described above.
[0087] Figure 5 The block diagram of a computing device 500 provided according to an embodiment of the present invention is shown. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and the database 550 is used to store data.
[0088] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).
[0089] In one embodiment of the present invention, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present invention. Those skilled in the art may add or replace other components as needed.
[0090] The computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 500 may also be a mobile or stationary server.
[0091] The processor 520 is used to execute the following computer program / instructions, which, when executed by the processor, implement the steps of the above-mentioned interactive interface rendering method.
[0092] Each embodiment of the present invention is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computing device embodiment, since it is basically similar to the interactive interface rendering method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the interactive interface rendering method embodiment.
[0093] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned interactive interface rendering method when executed by a processor.
[0094] Each embodiment of the present invention is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computer-readable storage medium embodiment, since it is basically similar to the interactive interface rendering method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the interactive interface rendering method embodiment.
[0095] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned interactive interface rendering method when executed by a processor.
[0096] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the above-mentioned interactive interface rendering method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above-mentioned interactive interface rendering method.
[0097] The above describes specific embodiments of the present invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0098] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0099] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of the present invention.
[0100] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0101] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of the present invention. The present invention selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A method for rendering an interactive interface, characterized in that: include: Acquire first rendering information of a target animation, wherein the first rendering information is used to represent texture information of each animation frame in the target animation; Acquire second rendering information of an interactive interface associated with the target animation, and combine the second rendering information with the texture information of each animation frame to obtain target rendering information; In response to a rendering instruction for the interactive interface, an animation rendering thread corresponding to the interactive interface is started to render the target rendering information, so as to obtain an interactive interface including the target animation.
2. The method according to claim 1, characterized in that The step of combining the second rendering information with the texture information of each animation frame to obtain target rendering information includes: Based on the second rendering information, create a template instance corresponding to the interactive interface; In response to a creation instruction from the front end, determining a display area of the target animation in the template instance; The texture information of each animation frame is pre-rendered into the display area to obtain target rendering information.
3. The method according to claim 2, characterized in that The pre-rendering of the texture information of each animation frame into the display area to obtain target rendering information includes: For texture information of a first animation frame among the animation frames, rendering the texture information of the first animation frame into the display area to obtain target primitive information corresponding to the first animation frame, wherein the first animation frame is any animation frame among the animation frames; The target primitive information corresponding to each animation frame is assembled into target rendering information.
4. The method according to claim 1, characterized in that The step of responding to the rendering instruction for the interactive interface, starting the animation rendering thread corresponding to the interactive interface to render the target rendering information, and obtaining the interactive interface including the target animation, comprises: In response to a rendering instruction for the interactive interface, dividing the target rendering information into a plurality of rendering batches of information according to rendering attributes; Determine the animation rendering thread corresponding to the interactive interface, and render the multiple rendering batches of information in a preset order.
5. The method according to claim 4, characterized in that The target rendering information includes texture information of the animation frame and shader program information of the interactive interface; The dividing the target rendering information into a plurality of rendering batches of information according to the rendering attributes includes: Grouping the target rendering information according to rendering attributes to obtain multiple rendering groups; For the first rendering group, the texture information of the animation frame and the shader program information of the interactive interface in the first rendering group are merged to obtain the rendering batch information corresponding to the first rendering group, wherein the first rendering group is any rendering group among the multiple rendering groups.
6. The method according to claim 4, characterized in that The determining the animation rendering thread corresponding to the interactive interface, and rendering the plurality of rendering batches of information in a preset order, includes: Start the animation rendering thread corresponding to the interactive interface, call the shader corresponding to the interactive interface, and render the multiple rendering batch information in a preset order.
7. An interactive interface rendering device, characterized in that: include: An acquisition module is configured to acquire first rendering information of a target animation, wherein the first rendering information is used to represent texture information of each animation frame in the target animation; a merging module configured to obtain second rendering information of an interactive interface associated with the target animation, and merge the second rendering information with the texture information of each animation frame to obtain target rendering information; The rendering module is configured to start the animation rendering thread corresponding to the interactive interface to render the target rendering information in response to the rendering instruction for the interactive interface, and obtain the interactive interface including the target animation.
8. A computing device, characterized in that include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the interactive interface rendering method described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: It stores a computer program / instruction, which, when executed by a processor, implements the steps of the interactive interface rendering method described in any one of claims 1-6.
10. A computer program product, characterized in that It includes a computer program / instruction, which, when executed by a processor, implements the steps of the interactive interface rendering method described in any one of claims 1 to 6.
