Model rendering method and device and electronic equipment

By combining batch rendering and patch modeling techniques, the performance bottleneck of traditional 3D character rendering methods when processing a large number of characters is solved, achieving improved rendering efficiency while maintaining visual effects, and is suitable for model rendering in the field of game technology.

CN120976383APending Publication Date: 2025-11-18NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510865419.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Traditional 3D character rendering methods suffer from a sharp decline in rendering performance when dealing with a large number of characters, making it difficult to strike a balance between maintaining visual effects and rendering efficiency. This is especially true on mobile devices and low-end hardware platforms where real-time requirements cannot be met.

Method used

By acquiring character model files and animation files, instantiating a character model array, performing batch rendering to generate sequence frame images, using multi-level compositing to generate a total sequence frame texture, and creating a shader program containing a two-layer UV coordinate mapping mechanism to construct a patch model for rendering.

Benefits of technology

It significantly reduces the computational burden of real-time rendering, improves the rendering efficiency of large-scale character array scenes, solves the performance bottleneck problem of traditional 3D model rendering, and maintains good visual effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976383A_ABST
    Figure CN120976383A_ABST
Patent Text Reader

Abstract

The model rendering method provided by the invention comprises the following steps: acquiring a role model file and an animation file; instantiating the role model file to form a role model array; performing batch rendering on the role model array according to a plurality of preset rendering angles and the animation file to generate a plurality of groups of sequence frame images; performing multi-level synthesis on the multiple groups of sequence frame images according to a preset synthesis rule to generate a total sequence frame texture; creating a shader program, the shader program including a double-layer UV coordinate mapping mechanism for positioning image frames of a specific action and angle in the total sequence frame texture; and constructing a patch model, and applying the total sequence frame texture and the shader program to the patch model to replace the role model array for rendering. Through the method provided by the embodiment of the invention, the calculation burden of real-time rendering is remarkably reduced while the visual effect is maintained, so that the rendering efficiency of a large-scale role array scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of games, and particularly relates to a model rendering method and device, a storage medium and an electronic device. BACKGROUND

[0002] In the field of three-dimensional graphics rendering, real-time rendering of a large number of character models has always been an important challenge for performance optimization. The traditional three-dimensional character rendering method needs to perform complete geometric calculation, lighting calculation and texture mapping on each character model. When there are a large number of characters in the scene, a large number of drawing calls and vertex processing overheads will be generated, which will cause the rendering performance to drop sharply and seriously affect the smoothness of the application program. Especially on mobile devices and low-end hardware platforms, the GPU (Graphics Processing Unit) resources are limited, and the traditional rendering method often cannot meet the real-time requirements. Existing optimization schemes mainly include methods such as level of detail control and occlusion culling, but these schemes still have performance bottlenecks when dealing with large-scale character scenes, and the optimization effect is limited. At the same time, the existing schemes are difficult to achieve a good balance between maintaining visual quality and improving rendering performance, and need to make compromises between rendering efficiency and picture expressiveness. Therefore, there is an urgent need for a technical scheme that can significantly improve the rendering performance of a large number of characters while maintaining good visual effects.

[0003] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0004] The purpose of the present disclosure is to provide a model rendering method and device, a storage medium and an electronic device, thereby at least partially overcoming one or more problems caused by the limitations and defects of related technologies.

[0005] According to one aspect of the present disclosure, a model rendering method is provided, the method further comprising: obtaining a character model file and an animation file; instantiating the character model file to form a character model array; performing batch rendering on the character model array according to a plurality of preset rendering angles and the animation file, to generate a plurality of groups of sequence frame images; performing multi-level synthesis on the plurality of groups of sequence frame images according to a preset synthesis rule, to generate a total sequence frame texture; creating a shader program, the shader program containing a double-layer UV coordinate mapping mechanism for locating image frames of specific actions and angles in the total sequence frame texture; construct a patch model, apply the total sequence frame texture and the shader program to the patch model, and render instead of the character model array.

[0006] According to another aspect of the present disclosure, A model rendering device, the device comprising: an acquisition module configured to acquire a character model file and an animation file; an array module configured to instantiate the character model file to form a character model array; a first generation module configured to perform batch rendering on the character model array according to a plurality of preset rendering angles and the animation file, and generate a plurality of groups of sequence frame images; a second generation module configured to perform multi-level synthesis on the plurality of groups of sequence frame images according to a preset synthesis rule, and generate a total sequence frame texture; a creation module configured to create a shader program, the shader program comprising a double-layer UV coordinate mapping mechanism for locating image frames of specific actions and angles in the total sequence frame texture; a rendering module configured to construct a patch model, apply the total sequence frame texture and the shader program to the patch model, and render instead of the character model array.

[0007] According to another aspect of the present disclosure, a computer readable storage medium is provided, which stores a computer program, the computer program being executed by a processor to implement the model rendering method of any one of the above.

[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor, a display device, and a memory configured to store executable instructions of the processor; wherein the processor is configured to execute the model rendering method of any one of the above by executing the executable instructions.

[0009] By the model rendering method provided in the application, the method comprises: acquiring a role model file and an animation file; instantiating the role model file to form a role model array; performing batch rendering on the role model array according to a plurality of preset rendering angles and the animation file, to generate a plurality of groups of sequence frame images; performing multi-level synthesis on the plurality of groups of sequence frame images according to a preset synthesis rule, to generate a total sequence frame texture; creating a shader program, the shader program comprising a double-layer UV coordinate mapping mechanism, for locating image frames of a specific action and angle in the total sequence frame texture; constructing a patch model, and applying the total sequence frame texture and the shader program to the patch model to replace the role model array for rendering. By the method provided in the embodiment, the complex three-dimensional role model is converted into a pre-rendered sequence frame texture, and the patch model is used for rendering, so that the visual effect is maintained while the computational burden of real-time rendering is significantly reduced, thereby improving the rendering efficiency of a large-scale role array scene, and solving the technical problem of performance bottleneck of traditional three-dimensional model rendering when processing a large number of roles. BRIEF DESCRIPTION OF DRAWINGS

[0010] The above and other features and advantages of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings. It is to be understood that the following drawings are merely some embodiments of the present disclosure and that other drawings can be derived from these drawings by those of ordinary skill in the art without any inventive effort. In the drawings: Figure 1 is a cloud interaction system architecture diagram in an exemplary embodiment of the present disclosure; Figure 2 is a flowchart of a model rendering method in an exemplary embodiment of the present disclosure; Figure 3 is a schematic diagram of a sequence frame in an exemplary embodiment of the present disclosure; Figure 4 is a schematic diagram of a single-action sequence frame image in an exemplary embodiment of the present disclosure; Figure 5 is a composition diagram of a model rendering device in an exemplary embodiment of the present disclosure; Figure 6 is a structural schematic diagram of a computer-readable storage medium in an exemplary embodiment of the present disclosure; Figure 7 is a composition diagram of an electronic device in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0011] It should be noted that the embodiments and features in the embodiments in the present application can be combined with each other without conflict. The present application will be described in detail below with reference to the drawings and in combination with the embodiments.

[0012] In order to make the person skilled in the art better understand the technical scheme of the present application, the technical scheme in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by the person skilled in the art without creative labor should belong to the protection scope of the present application.

[0013] It should be noted that the information (including but not limited to: user input information, etc., for example, information input by the user into the input box), data (including but not limited to data for analysis, stored data, displayed data, etc., for example, context code, all code of the current project, service pressure corresponding to the operation on all code of the current project, code development state of the current project) and signals involved in the present application are authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards. For example, the context code, the operation on all code of the current project, and the service pressure corresponding to the operation and the code development state involved in the present application are all obtained under full authorization.

[0014] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0015] It should also be noted that the various trigger events disclosed in the specification can be pre-set, and different trigger events can trigger the execution of different functions.

[0016] In one of the embodiments of the present disclosure, a model rendering method can run on a terminal device or a server. The terminal device can be a local terminal device. When the display control method runs on the server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device. For example, Figure 1As shown, the cloud interaction system can include a client device 10 and a server 20, wherein the client device 10 can be connected with the server 20 through a network 30.

[0017] In an optional embodiment, various cloud applications can be run under the cloud interaction system, for example, cloud gaming. Taking cloud gaming as an example, cloud gaming refers to a game mode based on cloud computing. In the running mode of cloud gaming, the running subject of the game program and the presentation subject of the game picture are separated, and the storage and running of the model rendering method are completed on the cloud gaming server. The client device is used for receiving and sending data and presenting the game picture. For example, the client device can be a display device close to the user side with data transmission function, such as a mobile terminal, a television, a computer, a palm computer, etc. However, the terminal device for information processing is the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation instructions to the cloud gaming server, the cloud gaming server runs the game according to the operation instructions, encodes and compresses the game picture and other data, returns the data to the client device through the network, and finally decodes and outputs the game picture through the client device.

[0018] In an optional embodiment, the terminal device can be a local terminal device. Taking a game as an example, the local terminal device stores a game program and is used for presenting a game picture. The local terminal device is used for interacting with the player through a graphical user interface, that is, a conventional game program is downloaded and installed on an electronic device and is run. The way in which the local terminal device provides the graphical user interface to the player can include various ways, for example, the graphical user interface can be rendered and displayed on the display screen of the terminal, or the graphical user interface can be provided to the player through holographic projection. For example, the local terminal device can include a display screen and a processor, the display screen is used for presenting a graphical user interface, the graphical user interface includes a game picture, and the processor is used for running the game, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.

[0019] Figure 2 In this embodiment, a model rendering method is provided. Figure 2 is a flowchart of the model rendering method according to the embodiments of the present disclosure, as shown in the figure, the flow includes the following steps: Figure 2 Step S1, obtaining a role model file and an animation file; step S2, instantiating the role model file to form a role model array; step S3, performing batch rendering on the role model array according to a plurality of preset rendering angles and the animation file, to generate a plurality of groups of sequence frame images; step S4, performing multi-level synthesis on the plurality of groups of sequence frame images according to a preset synthesis rule, to generate a final image. ​​Step S4, generating a total sequence frame texture; Step S5, creating a shader program containing a double-layer UV coordinate mapping mechanism for the total sequence frame texture Step S6, constructing a patch model, and applying the total sequence frame texture and the shader program to the patch model for rendering the patch model instead of the character model array.

[0020] The method provided by the embodiment enables the technical means of converting a complex three-dimensional character model into a pre-rendered sequence frame texture and combining a patch model for rendering, thereby achieving a significant reduction in the computational burden of real-time rendering while maintaining visual effects, improving the rendering efficiency of large-scale character array scenes, and solving the technical problem of performance bottlenecks in processing a large number of characters in traditional three-dimensional model rendering.

[0021] The above steps are described in detail below.

[0022] In step S1, a character model file and an animation file are obtained.

[0023] The character model file is a three-dimensional model data file containing character geometry, material information, and bone structure, used to define the basic appearance and structural characteristics of the character.

[0024] In an optional embodiment, the character model file usually adopts a standard three-dimensional model format, containing vertex data, patch information, material map reference, and bone binding weight, and the like, to provide basic data support for subsequent model instantiation and animation application. For example, the terminal device can obtain an FBX format model file containing a warrior character, which contains the mesh geometry of the character, the skin material map, the bone hierarchy structure, and the binding weight information between each bone and the vertex.

[0025] In an optional embodiment, the character model file can also contain multi-level detail (LOD) information and material variants, which can provide corresponding model accuracy according to different rendering requirements, and ensure the best performance in different application scenarios. For example, the terminal device can extract a high-precision version from the character model file for close-up observation, and at the same time, extract a simplified version for long-distance display, to realize dynamic optimization of rendering performance.

[0026] The animation file is a data file defining the motion behavior of the character, containing key frame information, bone transformation data, and time axis control parameters, used to drive the character model to produce various action effects.

[0027] In an optional implementation, the animation file adopts a keyframe-based animation data structure, records the rotation, displacement and scaling transformation information of the skeleton at each time point, and realizes smooth animation transition effect through interpolation algorithm, thereby providing rich motion performance capability for the character. For example, the terminal device can load an animation file containing multiple actions such as walking, running and attacking, and the file records the skeleton transformation matrix at different time points of each action, so that the character can exhibit natural and smooth motion performance.

[0028] In an optional implementation, the animation file also supports animation fusion and state machine control functions, can realize smooth transition and complex action combination among multiple animations, and provides more rich and real character behavior performance. For example, the terminal device can realize the continuous action sequence of the character from the smooth transition from the static state to the walking state and then to the running state through the state transition rules in the animation file.

[0029] In a specific application, the terminal device obtains a model file containing the geometric information of the soldier character and an animation file containing action sequences such as marching, fighting and standby from a game resource library, thereby providing basic data support for subsequent construction of a large-scale army array scene.

[0030] In step S2, the character model file is instantiated to form a character model array.

[0031] The instantiation is a process of creating multiple independent model instances based on a single character model file, and each instance has independent spatial position and transformation attributes, and is used to construct an array scene containing a large number of characters.

[0032] In an optional implementation, the instantiation process creates multiple model copies by copying the geometric data and material information of the character model, and each copy has an independent world coordinate transformation matrix, can occupy different positions and orientations in the three-dimensional space, and realizes the spatial layout of the character array. For example, the terminal device can create 100 model instances based on a soldier model file, each instance has a different world coordinate position, and forms a 10×10 square layout.

[0033] In an optional implementation, the instantiation also supports assigning different material variants and animation states to each model instance, thereby realizing the diversity of character appearance and behavior through parameterized control, and avoiding the visual effect of too homogeneous characters in the array. For example, the terminal device can assign different armor colors, weapon types and action play time offsets to different character instances in the array, so that the entire array presents a more rich and real visual effect.

[0034] The character model array is a collection of multiple character model instances arranged according to a specific spatial layout, has a unified management and control mechanism, and is used to realize unified rendering and animation playback of a large-scale character scene.

[0035] In an optional embodiment, the character model array adopts a hierarchical data structure for organization, contains overall transformation information of the array, relative positions of individual instances, and shared model and animation resource references, and realizes batch operation and management of the entire array through a unified interface. For example, the terminal device can construct a character model array containing a cavalry formation, which contains the overall marching direction and speed, while each cavalry instance maintains a relative formation position.

[0036] In an optional embodiment, the character model array also supports dynamic adjustment and real-time update functions, and can increase or decrease the number of characters, adjust the array layout, or modify the animation state according to the scene requirements, providing flexible character management capabilities for complex game scenes. For example, the terminal device can dynamically remove defeated character instances from the character model array according to the needs of the battle scene, or adjust the positions of the remaining characters to maintain the integrity of the formation.

[0037] In a specific application, the terminal device instantiates the knight character model file obtained to 50 independent model instances, arranges these instances according to the cavalry charge formation, and forms a character model array with unified animation control and spatial transformation management.

[0038] In step S3, batch rendering is performed on the character model array according to the preset multiple rendering angles and the animation file, to generate multiple sets of sequence frame images.

[0039] The preset multiple rendering angles are fixed camera direction settings for capturing the appearance of the character from different perspectives, and contain multiple representative observation directions to ensure that the character has accurate visual performance under each main perspective.

[0040] In an optional embodiment, the preset rendering angles are realized by setting multiple virtual camera positions around the character, each camera corresponding to a specific observation direction, covering the front, side, back, and various diagonal angles of the character, to ensure that the complete appearance information of the character can be captured. For example, the terminal device can set 8 rendering angles, including front, back, left, right, and four diagonal directions, each angle being separated by 45 degrees to form a comprehensive observation system around the character.

[0041] In an optional implementation, the preset rendering angle also takes into account common perspective requirements in game scenes, focusing on the directions most frequently observed from the player's perspective, and balancing the relationship between visual quality and data volume by optimizing angle selection. For example, the terminal device can set angles such as 45 degrees above, left above, and right above based on the characteristics of the top-down game perspective, to ensure the best visual effect in the main game perspective.

[0042] Batch rendering is a technique that renders all model instances in the character model array simultaneously. It achieves efficient image generation through a parallel rendering pipeline, enabling the rapid acquisition of large amounts of character image data.

[0043] In an optional implementation, batch rendering leverages the parallel computing capabilities of the graphics processing unit (GPU) to distribute rendering tasks for multiple character instances across different processing cores for simultaneous execution. This maximizes rendering performance through efficient task scheduling and resource management. For example, a terminal device can divide the rendering task for 100 character instances into 10 batches, each containing 10 characters, utilizing the GPU's multi-core architecture for parallel rendering processing.

[0044] In an optional implementation, batch rendering also employs instantiation rendering techniques and a unified shader procedure to further improve rendering efficiency by reducing rendering state switching and optimizing the rendering pipeline, ensuring stable performance even when processing large-scale character arrays. For example, terminal devices can use a unified character shader and shared texture resources, passing transformation information and material variants for each character through instantiation parameters to achieve efficient batch rendering processing.

[0045] Among them, the sequence frame images are a static image sequence that records the appearance of the character at consecutive time points. They are arranged in chronological order to form a complete animation performance, which is used for subsequent texture synthesis and shader sampling.

[0046] In an alternative implementation, the sequence of frame images is generated by periodically capturing the rendering results of the character during animation playback. Each frame corresponds to a specific moment on the animation timeline, and the animation effect is reproduced by playing these images continuously. For example, the terminal device can render a 2-second walking animation at a frequency of 15 frames per second, generating 30 sequence of frame images to completely record the character's walking action.

[0047] In an optional implementation, the sequence frame images are further processed in terms of format optimization and compression, and are set with an image format and resolution suitable for texture sampling, so as to ensure the control of data volume and memory occupation while maintaining the visual quality. For example, the terminal device can save the sequence frame images in the PNG format with a resolution of 512x512 and optimize the transparent channel, so as to balance the image quality and storage efficiency.

[0048] In a specific application, the terminal device performs batch rendering on an array of character models containing 50 knights according to five preset rendering angles, i.e., the upper, lower, left, right, and upper left, renders the attack animation of the knights at each angle, generates a sequence frame containing 16 images at each angle, and finally generates five groups of a total of 80 sequence frame images. Figure 3

[0049] In step S4, the multiple groups of sequence frame images are synthesized according to a preset synthesis rule to generate a total sequence frame texture.

[0050] The preset synthesis rule is a layout criterion for guiding the arrangement and organization of the sequence frame images, defines the position allocation and spatial relationship of the images in the synthesized texture, and is used to realize the ordered texture data organization.

[0051] In an optional implementation, the preset synthesis rule adopts a grid layout manner, arranges the sequence frame images in a row-column structure, and ensures the regularity and predictability of the texture through uniform size and spacing settings, so as to facilitate subsequent coordinate calculation and texture sampling. For example, the terminal device can arrange 16 sequence frame images into a uniform texture block in a 4x4 grid layout, and each image occupies a cell in the grid.

[0052] In an optional implementation, the preset synthesis rule further includes an image scaling and boundary processing strategy, and the quality and consistency of the synthesized texture are ensured through standardized image size and transparent area filling. For example, the terminal device can uniformly scale the sequence frame images of different sizes to 256x256 pixels and add a transparent border at the edge of the image, so as to ensure that the synthesized texture has a uniform visual effect.

[0053] The multi-level synthesis is a processing process of gradually merging the sequence frame images in a hierarchical organization manner, realizes the hierarchical construction from a single image to a final texture through multiple synthesis stages, and is used to manage a complex texture data structure.

[0054] ​In an optional embodiment, the multi-level synthesis first synthesizes multiple sequence frame images belonging to the same action and angle into a single action texture block, and then further synthesizes texture blocks of different actions into a total texture containing a complete set of actions, simplifying the construction process of complex textures through hierarchical processing. For example, the terminal device first synthesizes 16 sequence frames of attack actions into an attack action texture block, and then synthesizes multiple action texture blocks such as attack, defense, and movement into a complete character action texture.

[0055] In an optional embodiment, the multi-level synthesis also supports dynamic texture combination and real-time update functions, and can add new action types or adjust existing texture layouts as needed, providing flexible support for game content expansion and modification. For example, the terminal device can add a new magic attack action texture block to the idle area of the total texture without affecting the existing texture structure.

[0056] Among them, the total sequence frame texture is a complete texture resource containing all action types and rendering angles, using a unified data format and access interface for texture sampling and image rendering of the shader program.

[0057] In an optional embodiment, the total sequence frame texture is stored by high-resolution texture images, containing clear index structure and coordinate mapping relationship, supporting fast positioning and accurate sampling of image frames of specific actions and angles. For example, the terminal device can generate a total sequence frame texture with a resolution of 2048x2048, which contains complete image data of 5 action types and 8 rendering angles.

[0058] In an optional embodiment, the total sequence frame texture is also optimized to improve rendering performance, including texture compression, mipmap generation, and format conversion techniques, to ensure good rendering effect and performance on different hardware platforms. For example, the terminal device can apply the DXT compression algorithm to the total sequence frame texture, significantly reducing the memory usage while maintaining visual quality.

[0059] In a specific application, the terminal device processes 80 sequence frame images under 5 rendering angles according to the two-level synthesis rule of first synthesizing single-action texture blocks and then synthesizing total textures, and finally generates a 1024x1024 total sequence frame texture containing complete character action data.

[0060] In step S5, a shader program is created, which contains a double-layer UV coordinate mapping mechanism for locating image frames of specific actions and angles in the total sequence frame texture.

[0061] The shader program is a special program running on the graphics processing unit, responsible for controlling the rendering process of vertex transformation and pixel shading, used to realize specific visual effects and texture sampling logic.

[0062] In an optional embodiment, the shader program is written in a standard graphics programming language, including two main components of vertex shader and fragment shader, receiving various data required for rendering through a unified parameter interface, realizing flexible and controllable rendering effect. For example, the terminal device can create a shader program based on HLSL language, including vertex shader for processing vertex transformation and fragment shader for processing texture sampling.

[0063] In an optional embodiment, the shader program also supports multiple rendering modes and effect parameters, which can adjust the rendering mode and visual performance according to different scene requirements, providing rich customization options for character rendering. For example, the terminal device can integrate transparency control, color adjustment and lighting calculation function modules in the shader program.

[0064] The double-layer UV coordinate mapping mechanism is a hierarchical texture coordinate calculation system, which realizes accurate positioning of complex textures through inner and outer coordinate transformation, and is used to accurately find the target image area in the composite texture.

[0065] In an optional embodiment, the inner layer of the double-layer UV coordinate mapping mechanism is responsible for coordinate calculation within a single action texture block, and determines the specific image frame position according to the animation time and frame index, and the outer layer is responsible for positioning the correct action texture block in the total texture. For example, the terminal device determines the position of the 8th frame of the attack action through inner layer UV calculation, and locates the area of the attack action texture block in the total texture through outer layer UV calculation.

[0066] In an optional embodiment, the double-layer UV coordinate mapping mechanism adopts a parameterized calculation method, dynamically calculates the texture coordinates through action type, rendering angle, time parameter and other input values, realizes real-time texture positioning and sampling control. For example, the terminal device can automatically calculate the accurate UV coordinates of the corresponding image frame by inputting the parameter combination of action ID 2, angle ID 1 and time parameter 0.5.

[0067] In a specific application, the terminal device creates a shader program containing the double-layer UV coordinate mapping mechanism, which can accurately position and sample the corresponding image frame in the total sequence frame texture according to the input action type and rendering angle parameters, and display it.

[0068] In step S6, a patch model is constructed, and the total sequence frame texture and the shader program are applied to the patch model to replace the character model array for rendering.

[0069] The patch model is a simple planar geometric body, contains minimum vertex and patch data, is used to carry texture display and shader effect, and realizes a lightweight rendering object.

[0070] In an optional embodiment, the patch model generally adopts a quadrilateral or triangular basic geometric structure, contains basic vertex attributes such as position, texture coordinates and normal vector, and greatly reduces rendering calculation amount through simplified geometric complexity. For example, the terminal device can construct a quadrilateral patch model composed of two triangles, and only contains 4 vertices and corresponding UV coordinate information.

[0071] In an optional embodiment, the patch model also supports dynamic orientation and size adjustment function, can automatically adjust the orientation of the patch according to the observation angle, and ensures that the best visual effect can be obtained at any viewing angle. For example, the terminal device can set the patch model to always face the camera direction, and dynamically adjust the display size of the patch according to the distance.

[0072] In a specific application, the terminal device constructs a simple quadrilateral patch model to replace a complex character model array, applies total sequence frame texture and double-layer UV mapping shader program to the patch, and realizes the target of greatly improving rendering performance while maintaining visual effect.

[0073] In a specific application of the embodiment, the terminal device first acquires a model file containing geometry information and bone structure of a warrior character and an animation file containing actions such as attack, defense and movement, then instantiates the character model into 100 independent instances and arranges them into a 10x10 square array, then batch renders the entire character array according to 5 preset angles such as top, top-left, left, bottom-left and bottom, generates 16 frame sequence images for each action and each angle, arranges these images according to a 4x4 grid layout to synthesize a single-action texture block, and further synthesizes a total sequence frame texture containing all actions and angles, finally creates a shader program containing a double-layer UV coordinate mapping mechanism and constructs a simple patch model, applies the total texture and the shader to the patch model to replace the original complex character array for rendering.

[0074] In a model rendering method provided in an embodiment of the application, acquiring a character model file and an animation file includes: Step S21, acquiring a three-dimensional scene containing an empty node and a time axis file; and step S22, extracting the character model file and the animation file from the three-dimensional scene.

[0075] The method provided by the embodiment enables the acquired files to have complete scene structure information and timing animation data by extracting the required character model files and animation files from a three-dimensional scene containing empty nodes and timeline files, thereby providing accurate data basis for subsequent model instantiation and batch rendering, and thus improving rendering efficiency and image quality.

[0076] The above scheme will be described in detail below.

[0077] In step S21, a three-dimensional scene containing empty nodes and timeline files is acquired.

[0078] The three-dimensional scene containing empty nodes and timeline files is a complete three-dimensional scene file, which contains hierarchy information of all objects in the scene and time control information of animation sequences. The empty node is used as an organizational unit of the scene hierarchy to manage and control the spatial relationship and transformation attributes of each object in the scene. The timeline file records the timing information of animation playback, including key frame time points, animation duration, and frame rate parameters.

[0079] In an optional embodiment, the three-dimensional scene file is usually stored in a standard three-dimensional format, such as FBX, GLTF, or a custom scene format, which can completely save the geometry information, material information, animation data, and scene hierarchy of the scene. For example, a terminal device can load a battlefield scene file containing a soldier character, which contains an empty node structure for organizing the formation of the soldiers and a timeline file for controlling the walking, attacking, and other actions of the soldiers.

[0080] In an optional embodiment, the empty node is used as a basic unit of scene management, which provides the ability to perform batch operations and unified management on child objects, and can also carry transformation information and animation control logic in the scene. For example, in a scene containing multiple characters, the same type of characters can be grouped and managed by empty nodes, and each empty node can control the overall position, rotation, and scaling transformation of a group of characters.

[0081] In a specific application, a terminal device loads a complete three-dimensional scene file from a project resource library, which contains complete scene information of a certain level in a game. The empty nodes define the division of regions and the hierarchy relationship of objects in the scene, and the timeline file records the playback timing of all animation effects in the level.

[0082] In step S22, the character model files and the animation files are extracted from the three-dimensional scene.

[0083] In an optional embodiment, the extraction process of the character model file includes parsing the hierarchy of the three-dimensional scene, identifying the geometric mesh data belonging to the character object, and extracting the material information and the skeleton binding data associated with the character. For example, from a scene file containing multiple game characters, the terminal device can accurately identify the model data of the main character according to the object name or tag information, and extract the geometric mesh, map reference, and skeleton hierarchy information of the character as an independent character model file.

[0084] In an optional embodiment, the extraction of the animation file involves separating the animation sequence of a specific character from the timeline data, including the skeleton animation data, deformation animation data, and material animation data of the character. For example, the terminal device can extract the walking animation sequence of the character from the timeline file of the scene, which contains the skeleton pose data of the character at each key frame during walking and the time control information of the animation playback.

[0085] In a specific application, the terminal device analyzes the loaded three-dimensional scene file through the scene parser, identifies the main character object in the scene, and then extracts the complete model data (including mesh, material, skeleton, etc.) of the character and the associated animation data (including standby, walking, attack, etc. action sequence) into independent character model files and animation files, respectively, to prepare the data for subsequent batch rendering processing.

[0086] In a specific application of the present embodiment, the terminal device receives a three-dimensional file containing an RTS game scene, which includes an empty node structure for managing unit formations and timeline data for controlling unit action playback. The terminal device extracts the complete model information of the soldier character and the corresponding animation sequence data from the scene parsing module.

[0087] In a model rendering method provided in an embodiment of the present application, instantiating the model file to form a model array includes: Step S31, parsing the mesh, material reference, and skeleton structure of the model file; Step S32, determining the coordinate position of each model instance according to the preset formation configuration; Step S33, deploying the model instance to the coordinate position to form a model array.

[0088] Through the method provided by the present embodiment, a large-scale model array can be efficiently created by structurally analyzing and standardizing deploying the model file, improving the data organization efficiency and processing performance during batch rendering, while ensuring accurate positioning and unified management of each model instance in the three-dimensional space.

[0089] The above scheme will be described in detail below.

[0090] In step S31, the mesh, material reference and skeleton structure of the model file are parsed.

[0091] The mesh data is the geometric shape information of the model, including vertex coordinates, normal vectors, texture coordinates and other basic geometric data. The mesh data is the core element of the appearance of the three-dimensional model, which determines the shape outline and surface details of the model. By parsing the mesh data, the terminal device can obtain the complete geometric structure of the model, providing basic data support for subsequent instantiation processing.

[0092] In an optional embodiment, the mesh parsing process includes reading the vertex buffer and index buffer data in the model file, and verifying the integrity and validity of the data. For example, the terminal device extracts the mesh data of a human model containing 10000 vertices from an FBX or OBJ format model file, each vertex containing position, normal and UV coordinate information, forming a complete geometric description data set.

[0093] In an optional embodiment, the processing of mesh data also includes optimization and reorganization of vertex data to improve rendering efficiency. For example, the terminal device performs vertex deduplication processing on the extracted mesh data, optimizes the original 12000 duplicate vertices to 8000 unique vertices, and reconstructs the index buffer, thereby reducing memory occupancy and improving rendering performance.

[0094] The material reference information is the index relationship of the surface appearance attributes of the model, including texture map path, shader parameter, material attribute and other rendering related configurations. The material reference information determines the visual performance effect of the model during rendering, including color, gloss, transparency and other visual characteristics. By parsing the material reference information, the terminal device can correctly load and configure various resources required for rendering, ensuring that the model instance maintains consistent visual effects during batch rendering.

[0095] In an optional embodiment, the material reference parsing includes reading the association relationship of the material library file and the texture resource, and establishing a resource mapping table. For example, the terminal device parses 5 different material references from the model file, which correspond to the skin, clothing, weapon, accessory and special effect materials of the character, respectively. Each material reference contains the file paths of the corresponding diffuse map, normal map and specular map.

[0096] In an optional embodiment, the processing of material reference also includes preloading and optimization configuration of texture resources. For example, the terminal device preloads the required texture resources into the video memory according to the material reference information parsed, and performs compression and multi-level detail processing on the texture according to the rendering requirements, to balance the rendering quality and performance.

[0097] The skeleton structure data is joint hierarchy information supporting model animation, including animation system data such as skeleton node relationship, initial transformation matrix, weight binding, etc. The skeleton structure is the core framework for realizing character animation, defining the motion constraints and deformation rules between parts of the model. By analyzing the skeleton structure, the terminal device can correctly process the animation data of the model, ensuring that each instance accurately executes the animation sequence during batch rendering.

[0098] In an optional embodiment, the skeleton structure analysis includes constructing a skeleton hierarchy tree and calculating the hierarchical relationship of the skeleton transformation matrix. For example, the terminal device parses a human character skeleton with 25 skeleton nodes from the model file, constructs a complete hierarchy from the root skeleton to the end skeleton, and each skeleton node contains transformation information relative to the parent node and weight data affecting the vertex.

[0099] In an optional embodiment, the processing of the skeleton structure also includes verification and optimization of the animation binding data. For example, the terminal device checks whether the skeleton weight binding of each vertex is correctly normalized, and optimizes the storage format of the weight data, optimizing the original 8 weight values per vertex to 4 main weight values, while ensuring animation quality and improving computing efficiency.

[0100] In a specific application, the terminal device receives a 3D model file containing a warrior character, first parses the mesh data containing 2500 triangles to obtain vertex position and texture coordinate information, then parses the material reference to determine that 5 different materials such as armor texture and weapon texture need to be loaded, and finally parses the skeleton structure containing 22 joints to establish a complete animation framework from the waist root skeleton to the end of the limbs, laying the foundation for subsequent model instantiation and animation playback.

[0101] In step S32, the coordinate position of each model instance is determined according to the preset formation configuration.

[0102] The formation configuration is a parameter set that defines the spatial arrangement of the model instances, including layout control parameters such as row and column number, spacing setting, and arrangement mode. The formation configuration determines the overall distribution pattern of a large number of model instances in three-dimensional space, affecting the visual presentation and computational complexity of the rendering effect. Through the preset formation configuration, the terminal device can systematically organize the spatial relationship of the model instances, realizing the ordered construction of large-scale scenes.

[0103] In an optional embodiment, the formation configuration includes parameter definitions of various arrangement modes such as rectangular grid, circular distribution, and random scattering. For example, the terminal device uses a rectangular grid formation configuration of 10 rows and 12 columns, sets the row spacing to 5 units and the column spacing to 4 units, and can neatly deploy 120 model instances in three-dimensional space to form an ordered square layout.

[0104] In an optional embodiment, the array configuration also supports composite layout and dynamic adjustment functions. For example, the terminal device adopts a multi-layer circular array according to scene requirements, deploys 12 model instances in the inner circle and 24 model instances in the outer circle, and dynamically adjusts the radius and angle distribution of each circle according to the camera view angle to achieve the optimal visual display effect.

[0105] The coordinate position calculation is a mathematical operation process for generating the specific spatial position of each instance based on the array configuration parameters. The coordinate position calculation converts the abstract array configuration into precise three-dimensional coordinate data, ensuring that each model instance can be accurately positioned to the specified spatial position. Through accurate coordinate position calculation, the terminal device can avoid spatial conflicts between model instances and ensure the visual rationality and calculation accuracy of the rendering scene.

[0106] In an optional embodiment, the coordinate position calculation includes mathematical transformation operations based on index values and array parameters. For example, the terminal device calculates the position of the 45th model instance, determines that it is located in the 5th row and 5th column according to the 10-column grid configuration, calculates the X coordinate as 5x4=20, the Z coordinate as 4x5=20, and the Y coordinate remains 0, and finally determines the world coordinate of the instance as (20, 0, 20).

[0107] In an optional embodiment, the coordinate position calculation also includes terrain adaptation and collision detection functions. For example, after the terminal device calculates the basic grid coordinates, it further detects the terrain height information at that position, adjusts the Y coordinate of the model instance to the ground height value, and checks the collision with other objects in the scene to ensure that the model instance can be reasonably placed in the scene environment.

[0108] In a specific application, the terminal device needs to deploy 100 soldier models in a battlefield scene, adopts a 10x10 square array configuration, and sets the row spacing and column spacing to 3 meters. The system calculates the position coordinates of each soldier in turn, the 1st soldier is located at (0, 0, 0), the 2nd soldier is located at (3, 0, 0), the 11th soldier is located at (0, 0, 3), and so on, finally forming a neat and orderly soldier square array, providing accurate spatial positioning data for subsequent batch rendering operations.

[0109] In step S33, the model instance is deployed to the coordinate position to form a model array.

[0110] The model instance deployment is a process of associating and binding the parsed model data and the calculated coordinate positions. The model instance deployment is a final execution step of the instantiation process, which converts the abstract data configuration into a renderable entity object. Through the model instance deployment, the terminal device establishes a corresponding relationship between the complete information of each model, such as geometry, material, and animation, and the specific position of the model in the three-dimensional space, and forms an instance data set that can be batch processed.

[0111] In an optional embodiment, the model instance deployment includes a composite operation of creating an instance transformation matrix and binding a rendering resource. For example, the terminal device creates a 4x4 transformation matrix containing position, rotation, and scaling information for each model instance, and associates the matrix with the mesh buffer, material data, and skeleton information of the model to form a complete renderable instance object.

[0112] In an optional embodiment, the model instance deployment further includes memory optimization and batch processing preparation. For example, the terminal device organizes the transformation data of multiple instances of the same model into a continuous memory block, and uses the instantiation rendering technology to pack 100 transformation matrices of the same character into a unified data buffer, significantly improving the GPU batch processing efficiency and rendering performance.

[0113] In a specific application, the terminal device completes the instance deployment of 150 knight models, and accurately places each knight at a pre-calculated formation position, with all knights facing the same direction and arranged in a wedge-shaped battle formation. The system organizes the 150 knight instances into a unified model array data structure, each instance containing complete information such as position (x, y, z), orientation angle, and animation state, forming a large-scale character array for batch rendering, and providing an efficient data foundation for subsequent animation playback and visual presentation.

[0114] In a specific application of the present embodiment, the terminal device processes a game level containing a large battle scene, which requires rendering of 500 soldier characters simultaneously. First, the soldier model file is parsed to extract mesh data containing 3000 vertices, 5 different equipment material references, and a complete skeleton animation system containing 30 joints; then the accurate coordinate positions of each soldier are calculated according to a 25x20 square configuration, with a row spacing of 2 meters and a column spacing of 1.5 meters; finally, the 500 soldier model instances are deployed one by one to the corresponding positions to form a large-scale army array, each soldier instance containing an independent transformation matrix and animation state, providing complete data support for subsequent batch rendering and animation synchronization.

[0115] In a model rendering method provided in an embodiment of the present application, the plurality of groups of sequence frame images are synthesized according to a preset synthesis rule in multiple levels, including: The multiple groups of sequence frame images are preprocessed, including detecting an effective pixel area of each image and adjusting a position of a target character in the image.

[0116] The method provided by the embodiment optimizes image quality and layout through a preprocessing step before performing multi-level synthesis, ensures the position accuracy of character images in the synthesized texture, and thus improves the visual quality and consistency of the final rendering effect and avoids rendering abnormal problems caused by image position deviation.

[0117] The above scheme is described in detail below.

[0118] The effective pixel area detection is to identify the pixel range containing actual character content by analyzing the transparency channel information of the image, and exclude the pixel area that is purely transparent or invalid. When processing the sequence frame image, the terminal device first traverses each pixel point of the image, checks the Alpha channel value, and considers the pixel as an effective pixel when the Alpha value is greater than a preset threshold. By counting the coordinate range of all effective pixels, the minimum bounding rectangle area containing the character content is determined, and this area is the effective pixel area. This detection method can accurately identify the actual occupied range of the character image, and provide accurate reference for subsequent position adjustment.

[0119] In an optional embodiment, the effective pixel area detection realizes accurate boundary recognition by traversing the Alpha channel value of the image pixels. For example, the terminal device reads a 512x512 pixel character sequence frame image, scans the RGBA value of each pixel row by row, records the coordinates of the pixels with an Alpha value greater than 0 when detecting the pixels, and finally determines that the effective pixels are distributed in the rectangular range of coordinates (128, 256) to (384, 480), thereby accurately positioning the actual boundary of the character content.

[0120] In an optional embodiment, the effective pixel area detection has an adaptive threshold adjustment function and can dynamically optimize the detection accuracy according to different image characteristics. For example, for a character image with a semi-transparent edge effect, the system automatically adjusts the Alpha threshold from the standard 0.1 to 0.05, ensuring that the edge details are not ignored, and for a high-contrast character image, the threshold can be adjusted to 0.2 to improve the detection efficiency.

[0121] In the target role position adjustment, the offset of the role image is calculated based on the detected valid pixel area, and the role content is repositioned to the specified position of the image canvas. The terminal device calculates the center point coordinates and the actual size of the role image based on the boundary information of the valid pixel area, and then determines the target position according to the preset layout rule. Common adjustment strategies include centering the role, aligning the bottom, or positioning according to a specific grid layout. During the adjustment process, the original proportion and details of the role image are maintained, and only the position distribution in the canvas is changed.

[0122] In an optional implementation, the target role position adjustment adopts a bottom alignment strategy to ensure visual consistency of the role in the synthesized texture. For example, when the valid area height of the role is detected to be 200 pixels and the total image height is 256 pixels, the system calculates an offset of 56 pixels downward to accurately position the role content at the bottom of the image, ensuring that the role in different action frames always maintains the same baseline position.

[0123] In an optional implementation, the target role position adjustment supports flexible switching of multiple alignment modes, including center alignment, bottom alignment, and custom position alignment. For example, when processing sequence frames of jumping actions, the system automatically selects the center alignment mode to keep the role in the center of the screen, while when processing walking actions, the bottom alignment is adopted to ensure the consistency of the role's foot position, providing the best visual coherence.

[0124] In a specific application, the terminal device receives a group of role sequence frame images containing 16 frames of walking actions, each frame having a resolution of 512x512 pixels. The system first detects the valid pixel area of each image and finds that the role content is mainly distributed in the upper middle part of each image, with an effective area range of (100, 50) to (412, 450). Then, the actual width of the role is calculated to be 312 pixels and the height to be 400 pixels. According to the bottom alignment adjustment strategy, the system calculates that the role content needs to be moved 62 pixels downward and 100 pixels to the right to achieve the standard layout of the role centered at the bottom of the image. After adjustment, the role in all 16 frames of images is accurately positioned at the same baseline position, providing uniform and standardized image materials for subsequent multi-level synthesis.

[0125] In a specific application of the embodiment, the terminal device processes a set of role sequence frame images containing multiple angles and actions. For 16 sequence frames under each angle, the system sequentially performs the following preprocessing operations: detecting the valid pixel boundary of the role in each image, identifying the actual distribution range of the role content, and then calculating the position adjustment parameter according to the preset alignment specification to uniformly adjust the role image to the standard position. The image set after preprocessing has consistent role positioning and layout, ensuring that there is no role position offset or visual inconsistency problem in the subsequent multi-level synthesis process.

[0126] In an embodiment of the present application, a model rendering method is provided, in which preprocessing of multiple sets of sequence frame images includes: Step S51, calculating the valid pixel boundary box of each image; Step S52, calculating the actual size and position offset of the role image based on the boundary box; Step S53, adjusting the role image to the target position of the image.

[0127] Through the method provided by the embodiment, the actual occupied range of the role image in the original image can be accurately obtained by accurately calculating the valid pixel boundary box of each image, and then the real size of the role image and the offset relative to the target position are calculated based on the boundary box information, and finally the role image is accurately adjusted to the target position, thereby effectively solving the display inconsistency problem caused by position offset of different role models in the rendering process, and improving the quality of the sequence frame image and the accuracy of the subsequent synthesis effect.

[0128] The above scheme will be described in detail below.

[0129] In step S51, the valid pixel boundary box of each image is calculated.

[0130] The valid pixel boundary box is a rectangular area determined by analyzing the distribution range of non-transparent pixels in the image. In the image processing process, the valid pixel boundary box can accurately identify the range of the area in the image that actually contains valid content, excluding the transparent or invalid area around the image, and providing accurate reference for subsequent image processing and position adjustment.

[0131] In an optional embodiment, the terminal device determines the boundary range of the valid pixels by traversing each pixel point of the image and detecting the transparency value of the pixel. For example, the terminal device obtains the RGBA four-channel data of the image, checks the Alpha channel value of each pixel point, and considers the pixel as a valid pixel when the Alpha value is greater than a preset threshold. The minimum and maximum coordinate values of all valid pixels are counted to determine the minimum rectangular area containing all valid pixels, and the coordinates of the top-left corner and the bottom-right corner of the rectangular area constitute the valid pixel boundary box.

[0132] In an optional implementation, the terminal device uses the bounding box detection function of the image processing library to quickly obtain the effective pixel region. For example, the terminal device calls the getbbox() method of the PIL library, which can automatically analyze the distribution of non-transparent pixels in the image and return a tuple containing four coordinate values of left, upper, right, and lower, which define the boundary range of the effective pixels in the image, thereby quickly and accurately obtaining the specific position information of the effective pixel bounding box.

[0133] In step S52, the actual size and position offset of the character image are calculated based on the bounding box.

[0134] wherein the actual size is the real width and height value of the character image in the original image calculated according to the effective pixel bounding box. The calculation of the actual size can accurately reflect the real size of the character image, providing an important size reference for subsequent position adjustment and image synthesis, and ensuring that the character image maintains the correct proportion and size during adjustment.

[0135] In an optional implementation, the terminal device calculates the actual size of the character image through the coordinate difference of the bounding box. For example, when the coordinates of the bounding box are (left, upper, right, lower), the terminal device calculates the actual width as the difference between right and left, and the actual height as the difference between lower and upper. The width and height values obtained in this way accurately reflect the actual space size occupied by the character image in the original image.

[0136] wherein the position offset is the horizontal and vertical movement distance required for the character image to move from the current position to the target position. The accurate calculation of the position offset ensures that the character image can be accurately moved to the expected target position, avoiding inconsistent display effects caused by position deviation, and improving the precision of image processing and the quality of the final synthesis effect.

[0137] In an optional implementation, the terminal device calculates the corresponding offset value according to different position adjustment requirements. For example, when the target is to move the character image to the bottom center position, the terminal device sets the horizontal offset to a value that centers the character image in the horizontal direction, and sets the vertical offset to a value that aligns the bottom of the character image to the bottom of the original image. In this way, the character image can be accurately moved to the expected position.

[0138] In a specific application, the terminal device processes a rendered image containing a character model. First, the terminal device detects the valid pixel bounding box coordinates of the character image through pixel traversal, which are (50, 30, 200, 180). Then, the terminal device calculates the actual width of the character image as 150 pixels and the actual height of the character image as 150 pixels. When the character needs to be adjusted to the bottom center position of the 512x512 original image, the terminal device calculates the horizontal offset as 181 pixels and the vertical offset as 362 pixels. The position adjustment of the character image can be accurately controlled through these parameters.

[0139] In step S53, the character image is adjusted to the target position of the image.

[0140] The target position is a specific position where the character image should be located after adjustment, which is determined in advance according to the image synthesis requirements. The setting of the target position can ensure that all character images have a unified position standard after adjustment, improve the consistency and overall effect of image synthesis, and lay a good foundation for subsequent multi-level synthesis processing.

[0141] In an optional embodiment, the terminal device implements the position adjustment by creating a new blank image and pasting the character image to the specified position. For example, the terminal device creates a transparent background image with the same size as the original image, and then pastes the character valid pixel region cut out from the original image to the target position of the new image according to the calculated offset. In this way, the accurate adjustment of the character image to the target position is completed.

[0142] In a specific application, the terminal device processes a batch of character model sequence frame images. After performing valid pixel bounding box detection on each image, all character images are uniformly adjusted to the position at the bottom center of the image. This ensures that the character images in each grid unit have consistent position distribution in the subsequent 4x4 grid synthesis process, thereby generating sequence frame texture resources with uniform visual effects.

[0143] In a specific application of the embodiment, the terminal device preprocesses a sequence frame group containing 16 character action images. The terminal device obtains the actual occupied area of the character by calculating the valid pixel bounding box of each image. Based on the bounding box information, the terminal device calculates the offset required to adjust the character to the bottom center position. Then, the terminal device creates a new image to adjust the character to the target position according to the calculated offset. Finally, the terminal device obtains 16 preprocessed images with uniform positions, which provides standardized input materials for subsequent grid layout synthesis.

[0144] In a model rendering method provided in an embodiment of the present application, the multi-level synthesis of the multiple groups of sequence frame images according to the preset synthesis rule includes: Step S71, first-level synthesis: multiple sequence frame images of each action and each angle are synthesized into a single-action sequence frame image according to a first preset grid layout; Step S72, second-level synthesis: multiple single-action sequence frame images are synthesized into the total sequence frame texture according to a second preset grid layout.

[0145] The method provided by the embodiment enables the hierarchical synthesis strategy, the images of a single action and a single angle are first integrated in a primary integration, and then the images of multiple actions are integrated in a high-level integration, the progressive processing manner improves the organization and controllability of image synthesis, facilitates accurate UV coordinate positioning of the shader program, and thus improves the rendering efficiency and image quality.

[0146] The above scheme is specifically described below.

[0147] In step S71, first-level synthesis: multiple sequence frame images of each action and each angle are synthesized into a single-action sequence frame image according to a first preset grid layout.

[0148] The first-level synthesis is a process of grid arrangement and integration of all time sequence images under the same action and the same angle. The process has the effect of uniformly organizing the dispersed sequence frame images into a single texture space, facilitating subsequent texture sampling and animation playing, and has the function of realizing spatial storage and fast access of time sequence images.

[0149] In an optional embodiment, the first-level synthesis arranges all image files in each angle folder under each action folder in a grid according to a preset number of rows and columns. For example, for the down angle of the idle action, 16 sequence frame images under the folder are read, and the images are arranged in a grid layout of 4 rows and 4 columns, each image occupies a position in the grid, and finally a single-action sequence frame image containing a complete action sequence is formed. For example, a schematic diagram of a single-action sequence frame image is shown in FIG. Figure 4

[0150] In an optional embodiment, the first-level synthesis further includes a pre-processing and position adjustment function for each input image. For example, the system automatically detects the effective pixel region of each image, calculates the bounding box range of the image, and then adjusts the image content to the bottom center position, so as to ensure that all images have a uniform alignment effect after synthesis, and avoid visual jumping phenomenon caused by inconsistent image positions.

[0151] ​In a specific application, when the terminal device processes the up angle of the walk action, it first reads 16 consecutive frame images in the folder corresponding to the angle, performs effective area detection and position normalization processing on each image, and then arranges these images in a 4x4 grid layout into a large image to form a single-action sequence frame image containing a complete walk action sequence.

[0152] In step S72, the second-level synthesis: synthesizing multiple single-action sequence frame images according to a second preset grid layout into the total sequence frame texture.

[0153] Among them, the second-level synthesis is a high-level processing process for integrating single-action sequence frame images of different actions and angles. The function of this processing process is to organize multiple independent action sequence images into a unified texture resource for unified management and calling by the shader program, and its function is to realize the integrated storage and efficient access of diversified action content.

[0154] In an optional embodiment, the second-level synthesis determines the synthesis layout according to different action types and angle quantities, and organizes the images according to the preset arrangement order. For example, for the case of containing idle action 1 direction and walk action 5 directions, the system arranges 6 single-action sequence frame images according to a 2x3 grid layout, places 3 images in the first row and 3 images in the second row, and forms the final total sequence frame texture.

[0155] In an optional embodiment, a mapping relationship between action type and texture position is established in the second-level synthesis process, providing an index basis for subsequent shader program access. For example, the system records that the idle action corresponds to the first row and first column position in the total texture, and different angles of the walk action correspond to other grid positions. These mapping information will be used for UV coordinate calculation and texture sampling in the shader program.

[0156] In a specific application, after the terminal device completes the generation of all single-action sequence frame images, it creates a blank total texture canvas, and then places 6 single-action sequence frame images of idle_down, walk_up, walk_down, walk_left, walk_left_up, and walk_left_down in the corresponding grid positions according to the preset 2x3 grid layout, to finally generate a total sequence frame texture containing all action and angle information.

[0157] In a specific application of the embodiment, when the terminal device processes the sequence frame image of a certain role model, first, the idle action and the walk action of the role are respectively synthesized in the first level, the 16 images of the down angle of the idle action are synthesized into a single action image with a 4x4 layout, and the 5 angles of the walk action are respectively synthesized into 5 single action images with a 4x4 layout, and then the 6 single action images are organized into a total sequence frame texture according to a 2x3 grid layout through the second level synthesis, to form a complete role animation resource.

[0158] In the model rendering method provided in an embodiment of the application, the first preset grid layout and the second preset grid layout include that the first preset grid layout is a 4-row 4-column layout, and the second preset grid layout is a 2-row 3-column layout.

[0159] Through the method provided in the embodiment, the 4-row 4-column first grid layout can effectively accommodate the sequence frame image of a single action, the internal frame images of the single action are sequentially arranged, the 2-row 3-column second grid layout can reasonably arrange the distribution of multiple action types and angles, and through the accurate grid specification definition, the organization efficiency of the sequence frame image and the accuracy of the texture sampling are improved.

[0160] In the model rendering method provided in an embodiment of the application, the double-layer UV coordinate mapping mechanism includes: The inner-layer UV calculation is to calculate the UV coordinate offset inside a single sequence frame image based on the grid parameter and the time parameter; the outer-layer UV calculation is to determine the position offset in the total sequence frame texture according to the animation type selection parameter and the direction selection parameter; and the inner-layer UV offset and the outer-layer UV offset are added to obtain the final texture sampling coordinate.

[0161] Through the method provided in the embodiment, the double-layer UV coordinate mapping mechanism realizes the accurate positioning of the specific action and angle image frame in the total sequence frame texture through the layered processing of the UV coordinate calculation, and effectively improves the accuracy of the texture sampling and the rendering efficiency.

[0162] The above scheme is specifically described below.

[0163] In the inner-layer UV calculation, the UV coordinate offset inside a single sequence frame image is calculated based on the grid parameter and the time parameter.

[0164] The grid parameter is the row-column configuration information of the sequence frame image in the grid layout. The grid parameter defines the internal organization structure of a single sequence frame image, determines the distribution mode of the image frame through the number of rows and columns, and provides a basic geometric constraint condition for the UV coordinate calculation.

[0165] In an optional implementation, the grid parameter includes row and column information for determining the internal grid layout of the sequence frame image. For example, when the sequence frame image adopts a 4-row and 4-column grid layout, the grid parameter is (4, 4), and the terminal device divides the single sequence frame image into 16 sub-regions according to the parameter, each of which corresponds to an animation frame.

[0166] In an optional implementation, the grid parameter further includes size information of the grid unit for accurately positioning the boundary of each image frame. For example, in a 256x256 pixel sequence frame image, when a 4x4 grid is adopted, the size of each grid unit is 64x64 pixels, and the terminal device calculates the accurate coordinate range of each grid unit according to the size.

[0167] The time parameter is a time variable for controlling the progress of the animation. The time parameter reflects the playing state of the current animation, and drives the switching of the sequence frames through the change of time to realize the continuous playing of the animation effect.

[0168] In an optional implementation, the time parameter is obtained through the time system of the engine and includes current frame time and animation playing speed information. For example, the terminal device obtains that the current game time is 2.5 seconds and the animation playing speed is 16 frames per second, and then calculates that the 8th frame image should be displayed, which corresponds to the position of the 2nd row and the 0th column in the grid.

[0169] In an optional implementation, the time parameter supports a loop playing mode, and automatically returns to the first frame when the last frame is played. For example, after the 15th frame of a 16-frame animation is played, the time parameter is automatically reset to make the animation play in a loop, ensuring the continuity of the character action.

[0170] In a specific application, the terminal device calculates that the grid position corresponding to the 19th frame is the 1st row and the 3rd column according to the 4x4 grid parameter and the current time parameter of 1.2 seconds, and then determines that the UV coordinate offset of the image frame in the sequence frame image is (0.75, 0.25).

[0171] In outer UV calculation, the position offset in the total sequence frame texture is determined according to the animation type selection parameter and the direction selection parameter.

[0172] The animation type selection parameter is an identifier for distinguishing different animation categories. The animation type selection parameter is used to select a specific animation type in the total sequence frame texture containing multiple animations, and realizes the quick switching and accurate positioning of the animation through the numerical identifier.

[0173] In an optional implementation, the animation type selection parameter is encoded in an integer format, and different values correspond to different animation types. For example, 0 represents an idle animation, 1 represents a walk animation, and 2 represents an attack animation. The terminal device selects the type of animation to be played according to the game logic by setting the corresponding parameter value.

[0174] In an optional implementation, the animation type selection parameter supports dynamic switching, which is adjusted in real time according to the change in the state of the character. For example, when the character changes from a stationary state to a moving state, the animation type selection parameter is switched from 0 to 1, realizing a smooth transition from an idle animation to a walk animation.

[0175] The direction selection parameter is a control variable that specifies the orientation or viewing angle direction of the character. The direction selection parameter is used to select the appropriate viewing angle in the total sequence frame texture rendered from multiple angles, ensuring that the character can present the correct visual effect under different observation angles.

[0176] In an optional implementation, the direction selection parameter corresponds to five preset rendering angles, including the top, bottom, left, upper left, and lower left directions. For example, parameter values 0-4 correspond to these five directions, respectively, and the terminal device automatically calculates and sets the corresponding direction parameter according to the position of the camera relative to the character.

[0177] In an optional implementation, the direction selection parameter supports dynamic adjustment according to the relative position of the character and the camera, realizing adaptive switching of the viewing angle. For example, when the camera is located above and to the left of the character, the terminal device automatically sets the direction selection parameter to 3, selecting the corresponding upper left angle sequence frame for rendering.

[0178] In a specific application, the terminal device sets the animation type selection parameter to 1 and the direction selection parameter to 4 according to the current character being in a walk animation state and facing the lower left direction, and calculates the position offset in the 2-row 3-column total sequence frame texture as (0.67, 0.5).

[0179] In the process of adding the inner layer UV offset and the outer layer UV offset to obtain the final texture sampling coordinates, accurate texture positioning is realized through coordinate superposition.

[0180] The coordinate superposition is a calculation process of performing mathematical operations on the two layers of UV offsets. The coordinate superposition combines the UV offsets of the inner layer and the outer layer through vector addition to form the final coordinates that can accurately locate a specific image frame in the total sequence frame texture.

[0181] In an optional embodiment, the coordinate superposition adopts a normalized coordinate system, ensuring that the final coordinate value is within the range of 0-1. For example, the inner layer UV offset is (0.25, 0.25), the outer layer UV offset is (0.33, 0), and the final coordinates (0.58, 0.25) are obtained after superposition, corresponding to a specific position in the total sequence frame texture.

[0182] In an optional embodiment, boundary checks are performed during the coordinate superposition process to prevent sampling errors caused by coordinate overflow. For example, when the calculation result exceeds the range of [0, 1], the terminal device performs a modulo operation or boundary limitation to ensure the correctness of texture sampling.

[0183] In a specific application, the terminal device adds the inner layer UV offset (0.125, 0.375) and the outer layer UV offset (0.333, 0.5) to obtain the final texture sampling coordinates (0.458, 0.875), achieving accurate sampling of the 6th frame image of the lower left corner of the walk animation in the total sequence frame texture.

[0184] In a specific application of the present embodiment, when the terminal device processes the rendering of a character containing both idle and walk animations, it first calculates the inner layer UV offset as (0.75, 0.5) based on the 4x4 grid parameters and the current time of 0.8 seconds, then calculates the outer layer UV offset as (0, 0.5) based on the animation type selection parameter 1 and the direction selection parameter 2, and finally adds the two offsets to obtain the texture sampling coordinates (0.75, 1.0), successfully locating and rendering the 12th frame image of the left corner of the walk animation of the character.

[0185] In an embodiment of the present application, a model rendering method is provided, wherein the shader program includes a shader of a non-illumination calculation type, which contains an animation type selection parameter, a direction selection parameter, and a number of atlas rows and columns parameter as input interfaces.

[0186] The method provided by the present embodiment enables the shader program to adopt a non-illumination calculation type, avoiding complex illumination calculation overheads, and through the configuration of the animation type selection parameter, the direction selection parameter, and the number of atlas rows and columns parameter, accurate positioning and sampling of different action and angle image frames in the total sequence frame texture are achieved, thereby significantly improving rendering performance and running efficiency while ensuring visual effects.

[0187] The above scheme will be described in detail below.

[0188] In an optional implementation, the no-light-computation type of shader has high-efficiency texture sampling capability and simplified pixel processing flow, and can greatly reduce GPU computation load while maintaining visual quality. For example, in a battle scene involving hundreds of enemy troop characters, a traditional lighting shader needs to perform complex lighting computation for each character, while the no-light-computation shader only needs to directly sample color values according to preset texture coordinates, resulting in an overall rendering performance improvement of 70%-76%.

[0189] In an optional implementation, the no-light-computation type of shader has high-efficiency texture sampling capability and simplified pixel processing flow, and can greatly reduce GPU computation load while maintaining visual quality. For example, in a battle scene involving hundreds of enemy troop characters, a traditional lighting shader needs to perform complex lighting computation for each character, while the no-light-computation shader only needs to directly sample color values according to preset texture coordinates, resulting in an overall rendering performance improvement of 70%-76%.

[0190] In an optional implementation, the animation type selection parameter corresponds to different animation states through numerical identification, such as numerical value 0 representing a static animation and numerical value 1 representing a walking animation, thereby achieving accurate positioning of different animation regions in the total sequence frame texture. For example, when the terminal device needs to display the walking state of a character, the shader program can automatically locate the image region corresponding to the walking animation in the total sequence frame texture by setting the animation type selection parameter to 1.

[0191] In an optional implementation, the animation type selection parameter has a dynamic switching function and can adjust the animation performance of a character in real time according to changes in game logic. For example, in a real-time strategy game, when the player issues a movement instruction, the terminal device switches the animation type selection parameter from 0 to 1 by modifying it, causing the originally static character troop to immediately switch to a walking animation. The entire switching process only takes 1-2 frames of time, ensuring the smoothness and responsiveness of the game.

[0192] The direction selection parameter is a direction control parameter for controlling the orientation and perspective of the character. In an optional embodiment, the direction selection parameter is represented by numerical coding to represent different viewing angles, including the five main directions of up, down, left, left-up, and left-down, each corresponding to a specific numerical range. For example, when the direction selection parameter is set to 0, it corresponds to the up perspective, set to 1, it corresponds to the down perspective, and set to 2-4, it corresponds to the left, left-up, and left-down perspectives, respectively. The terminal device determines the sampling position in the total sequence frame texture according to these parameter values.

[0193] In an optional embodiment, the direction selection parameter has the ability of adaptive adjustment, which can automatically select the most suitable display angle according to the camera position and the relative position of the character. For example, when the player observes the battlefield from different angles, the terminal device automatically adjusts the direction selection parameter by analyzing the relative position relationship between the camera and the character, so that each character can be presented to the player with the best visual angle, avoiding visual distortion or unnatural display effect caused by the viewing angle problem.

[0194] The number of rows and columns of the composite picture parameter is a configuration parameter for defining the layout structure of the total sequence frame texture. In an optional embodiment, the number of rows and columns of the composite picture parameter is described in a two-dimensional vector format to describe the grid distribution of the texture, including two components of row and column, which is used to guide the shader program to perform correct coordinate calculation and texture sampling in the total sequence frame texture. For example, when the number of rows and columns of the composite picture parameter is set to (2, 3), it means that the total sequence frame texture is arranged in the form of 2 rows and 3 columns, and the shader program calculates the boundary and sampling coordinates of each sub-texture region accordingly.

[0195] In an optional embodiment, the number of rows and columns of the composite picture parameter provides flexible texture layout configuration capability, supporting the optimization needs of character models of different sizes and different numbers of animations. For example, for complex characters that include more animation types, the terminal device can adjust the number of rows and columns of the composite picture parameter to (3, 4) or other layouts, and increase the fineness of texture segmentation to accommodate more animation frame sequences, while maintaining the universality and scalability of the shader program.

[0196] In a specific application, when the terminal device creates a shader program of the no-light type, it first configures the animation type selection parameter to 0 to display the static state, the direction selection parameter to 1 to display the down perspective, and the number of rows and columns of the composite picture parameter to (2, 3) to match the texture layout of 2 rows and 3 columns. Through the combination of these parameter settings, the shader program can accurately locate the corresponding image region in the total sequence frame texture, achieving efficient character animation playback effect.

[0197] In an embodiment of the model rendering method provided in the present application, the total sequence frame texture and the shader program are applied to the patch model, including: The camera-oriented rendering mode ensures the visual effect of the patch model at any viewing angle. The transformation information is read to place the patch model to the corresponding world coordinate position. The instantiation batching is enabled to combine and process multiple patch models.

[0198] The method provided by the embodiment enables the camera-oriented rendering mode to ensure that the sequence frame patch does not have a perspective distortion effect in a 3D perspective view game, and greatly improves the performance by using the instantiation batching technology, thereby effectively reducing the GPU rendering time consumption.

[0199] The camera-oriented rendering mode is a special 3D rendering technology that adjusts the orientation of the patch model in real time to always face the current camera position. This rendering mode can ensure that the sequence frame patch maintains the best visual effect at various viewing angles, avoiding the perspective distortion problem that may occur in a traditional 2D UI in a 3D environment. The technology calculates the direction vector between the camera and the patch model, dynamically adjusts the rotation matrix of the patch, and makes the normal vector of the patch always point to the camera, thereby achieving the best display effect of the sequence frame patch in a 3D perspective view game.

[0200] In an optional embodiment, the camera-oriented rendering mode calculates the vector difference between the camera position and the center point of the patch model in real time, and uses the vector as the new orientation of the patch. For example, the terminal device obtains the world coordinate position of the current camera and the world coordinate position of the patch model, calculates the direction vector therebetween, and then constructs a corresponding rotation matrix to be applied to the patch model, to ensure that the patch always faces the camera and avoids displaying the side or back of the patch at different viewing angles.

[0201] In an optional embodiment, the camera-oriented rendering mode further includes a constraint processing on the upward direction of the patch model to prevent the patch from rotating improperly in the vertical direction. For example, when calculating the orientation of the patch, the terminal device keeps the upward direction of the patch consistent with the Y-axis direction of the world coordinate system, which ensures that the character always faces the camera in the correct posture and avoids abnormal display effects such as the character being upside down or tilted.

[0202] The transformation information is a collection of data describing the position, rotation, and scaling state of an object in a three-dimensional space. The transformation information contains accurate position data of the patch model in the world coordinate system, which is used to ensure that the sequence frame patch can accurately replace the spatial position of the original 3D model. By reading and applying the transformation information, the terminal device can accurately place the sequence frame patch to the corresponding position of the original character model, maintaining the consistency and accuracy of the layout of the characters in the game scene.

[0203] In an optional embodiment, the transformation information includes three core components: position coordinates, rotation angles, and scaling ratios. For example, the terminal device extracts the world coordinate position (x, y, z), Euler angle rotation (rx, ry, rz), and scaling coefficient (sx, sy, sz) from the original character model, and then applies these parameters to the corresponding patch model, ensuring that each sequence frame patch accurately inherits the spatial transformation properties of the original model.

[0204] In an optional embodiment, the reading process of the transformation information also includes support for dynamic updates to adapt to real-time changes in the position of the character during game operation. For example, the terminal device establishes a listening mechanism for transformation information, and when the position of the original character model changes, the corresponding sequence frame patch is also updated synchronously, maintaining real-time synchronization of the position and ensuring visual continuity of character movement, rotation, and other operations during the game.

[0205] Among them, instance batching is a high-efficiency graphics rendering optimization technology that reduces communication overhead between CPU and GPU by merging multiple similar rendering objects into a single drawing call. Instance batching technology can significantly improve rendering performance, especially when dealing with a large number of similar models, it can combine multiple drawing calls into one call, greatly reducing the burden on the rendering pipeline. This technology balances performance optimization and rendering flexibility by sharing vertex buffers and index buffers while providing independent transformation matrices for each instance.

[0206] In an optional embodiment, instance batching stores the geometry data of the patch model by creating a unified vertex buffer, and provides an independent transformation matrix buffer for each patch instance. For example, the terminal device merges the vertex data of all patch models into a shared buffer, and creates an instance data buffer for each patch instance containing position, rotation, and scaling information, which can render all patch models in the scene with a single drawing call.

[0207] In an optional embodiment, instance batching also incorporates a dynamic batching mechanism that can dynamically adjust the number of instances to be rendered according to the view frustum clipping range of the camera. For example, the terminal device detects which patch models are within the viewable range of the camera before each frame is rendered, and only renders the visible instances. For instances outside the view frustum, rendering is skipped, further improving rendering efficiency.

[0208] In a specific application, the terminal device deploys 100 enemy character troops in a game scene, adopts camera-oriented rendering to ensure that all sequence frame patches always face the player camera, reads the original position information of each character and accurately places the sequence frame patches to the corresponding world coordinate positions, and enables instance batch technology to combine the 100 patch models into one rendering call for rendering, thereby achieving a significant performance improvement of 70%-76% reduction in GPU rendering time.

[0209] In an embodiment of the present application, the model rendering method further comprises: Implementing progressive quality degradation according to the distance between the target character and the camera, and adjusting the sequence frame playback frame rate of the far distance character; Only loading the sequence frame textures required by the current scene and releasing the unused resources in time to achieve dynamic management of texture resources.

[0210] The method provided by the embodiment enables the distance-based progressive optimization strategy to further reduce the rendering burden of far distance characters, and effectively controls the memory occupation through dynamic texture resource management, thereby achieving intelligent balance between performance optimization and visual quality.

[0211] The above scheme will be described in detail below.

[0212] The progressive quality degradation is a distance-based dynamic rendering optimization strategy that automatically adjusts the rendering quality level by detecting the spatial distance between the target character and the camera. The progressive quality degradation technology dynamically allocifies rendering resources according to the display size and importance of the character on the screen, uses lower rendering quality for characters that are far away and occupy fewer pixels on the screen, and maintains high-quality rendering for important characters that are close. The technology establishes a multi-level quality level system to achieve optimal configuration of rendering performance and visual effect.

[0213] In an optional embodiment, the progressive quality degradation divides different quality level intervals by establishing multiple distance thresholds. For example, the terminal device sets the near distance threshold to 50 meters, the middle distance threshold to 100 meters, and the far distance threshold to 200 meters, uses the highest quality rendering when the character is less than 50 meters away from the camera, reduces the sequence frame resolution when the distance is between 50-100 meters, further reduces the animation frame rate when the distance is between 100-200 meters, and uses the simplest rendering method when the distance exceeds 200 meters.

[0214] In an optional embodiment, the progressive quality degradation further includes a dynamic adjustment mechanism of the sequence frame playing frame rate, which adaptively changes the animation playing speed according to the character distance. For example, the terminal device maintains a standard playing frame rate of 16 frames per second for the characters within a distance of 100 meters from the camera, reduces to 8 frames per second for the characters within a distance of 100-150 meters, and further reduces to 4 frames per second for the characters beyond a distance of 150 meters, so that the smooth animation effect of the close-range characters is ensured and the rendering overhead of the long-range characters is significantly reduced through the frame rate gradient adjustment.

[0215] The dynamic management is an intelligent resource allocation and release strategy, which optimizes the loading and unloading of texture resources by real-time monitoring of scene requirements. The dynamic management mechanism can selectively load the necessary texture resources according to the actual needs of the current game scene, and timely release the resources that are no longer used, effectively controlling the memory occupation and improving the loading efficiency. The mechanism realizes accurate control and optimized configuration of texture resources by establishing a tracking system of resource usage state.

[0216] In an optional embodiment, the dynamic management tracks the usage state of each texture by establishing a reference counting system of texture resources. For example, the terminal device maintains a reference counter for each sequence frame texture, and when a character in the scene needs to use a certain texture, the reference count is increased by 1, and when the character leaves or switches the texture, the reference count is decreased by 1, and when the reference count is zero, the texture resource is automatically unloaded from the memory.

[0217] In an optional embodiment, the dynamic management further includes a preloading and caching mechanism, which can predict the texture resources that will be needed and load them into the memory in advance. For example, the terminal device predicts the types of characters that may appear next according to the player's moving direction and game plot progress, and loads the corresponding sequence frame textures into the cache pool in advance, so that they can be used immediately when the characters actually appear, avoiding the lag phenomenon caused by real-time loading.

[0218] In a specific application, the terminal device manages 200 different types of enemy characters in a large battlefield scene, and automatically adjusts the rendering quality according to the distance of each character from the player's camera, maintains a standard frame rate of 16 frames for 30 characters within a distance of 50 meters, reduces to 8 frames for 80 characters within a distance of 50-100 meters, and uses 4 frames for 90 characters beyond a distance of 100 meters, while only loading 15 types of character textures that are actually used in the current scene, and timely releasing the texture resources of the characters that have left the scene, thereby significantly reducing the memory occupation and rendering burden while ensuring the visual effect.

[0219] A model rendering device is also disclosed in the exemplary embodiments of the present disclosure, Figure 5 is a component diagram of a model rendering device in an exemplary embodiment of the present disclosure. As shown in Figure 5The device comprises: an acquisition module configured to acquire a character model file and an animation file; an array module configured to instantiate the character model file to form a character model array; a first generation module configured to perform batch rendering on the character model array according to a plurality of preset rendering angles and the animation file, and generate a plurality of groups of sequence frame images; a second generation module configured to perform multi-level synthesis on the plurality of groups of sequence frame images according to a preset synthesis rule, and generate a total sequence frame texture; a creation module configured to create a shader program, the shader program comprising a double-layer UV coordinate mapping mechanism for locating image frames of specific actions and angles in the total sequence frame texture; a rendering module configured to construct a patch model, and apply the total sequence frame texture and the shader program to the patch model to replace the character model array for rendering.

[0220] Optionally, the acquisition of the character model file and the animation file comprises: acquiring a three-dimensional scene comprising an empty node and a timeline file; and extracting the character model file and the animation file from the three-dimensional scene.

[0221] Optionally, the instantiation of the character model file to form the character model array comprises: parsing a mesh, a material reference, and a skeleton structure of the character model file; determining a coordinate position of each character model instance according to a preset array configuration; and deploying the character model instance to the coordinate position to form the character model array.

[0222] Optionally, before the multi-level synthesis of the plurality of groups of sequence frame images according to the preset synthesis rule, the method further comprises: pre-processing the plurality of groups of sequence frame images, including detecting an effective pixel area of each image and adjusting a position of a target character in the image.

[0223] Optionally, the pre-processing of the plurality of groups of sequence frame images comprises: calculating an effective pixel bounding box of each image; calculating an actual size and a position offset of a character image based on the bounding box; and adjusting the character image to a target position of the image.

[0224] Optionally, the plurality of preset rendering angles include an upper, lower, left, upper-left, and / or lower-left angle, and an orthogonal camera is used for rendering.

[0225] Optionally, the multi-level synthesis comprises: first-level synthesis: synthesizing a plurality of sequence frame images of each action and each angle into a single-action sequence frame image according to a first preset grid layout; and second-level synthesis: synthesizing a plurality of single-action sequence frame images into a total sequence frame texture according to a second preset grid layout.

[0226] Optionally, the first preset grid layout is a 4-row 4-column layout, and the second preset grid layout is a 2-row 3-column layout.

[0227] Optionally, the double-layer UV coordinate mapping mechanism comprises: inner-layer UV calculation: calculating the UV coordinate offset inside a single sequence frame image based on the grid parameters and the time parameters; outer-layer UV calculation: determining the position offset in the total sequence frame texture according to the animation type selection parameter and the direction selection parameter; adding the inner-layer UV offset and the outer-layer UV offset to obtain the final texture sampling coordinates.

[0228] Optionally, the shader program is a shader of a non-lighting calculation type, and the animation type selection parameter, the direction selection parameter, and the atlas row and column number parameter are included as input interfaces.

[0229] Optionally, applying the total sequence frame texture and the shader program to the patch model further comprises: adopting a camera-oriented rendering mode to ensure the visual effect of the patch model under any viewing angle; reading the transformation information of the character model array to place the patch model to the corresponding world coordinate position; and enabling instance merging and batch processing to combine and process multiple patch models.

[0230] Optionally, the method further comprises: implementing progressive quality degradation according to the distance between the target character and the camera, and adjusting the sequence frame playback frame rate of the distant character; and only loading the sequence frame texture required by the current scene and releasing the unused resources in time to realize dynamic management of the texture resources.

[0231] By the method provided by the embodiment, the calculation burden of real-time rendering is significantly reduced while the visual effect is maintained, thereby improving the rendering efficiency of a large-scale character array scene.

[0232] The specific details of each module unit in the above embodiments have been described in detail in the corresponding model rendering method, and in addition, the model rendering device also includes other unit modules corresponding to the display control method, and therefore will not be described here.

[0233] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such a division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into a plurality of modules or units.

[0234] Figure 6 FIG. 1 is a structural schematic diagram of a computer readable storage medium in an example embodiment of the present disclosure. As shown in FIG. 1, the computer readable storage medium comprises a computer readable code for implementing the method of the present disclosure. Figure 6As shown, a program product 1100 according to an embodiment of the present disclosure is described, on which a computer program is stored, which is executed by a processor to implement the method steps of the above model rendering method. Through the method provided by the present embodiment, the computational burden of real-time rendering is significantly reduced while the visual effect is maintained, thereby improving the rendering efficiency of large-scale character array scenes.

[0235] The computer readable storage medium can include a data signal transported, propagated or transmitted, in baseband or as part of a carrier, including a propagated signal, for example a planned transmission, such as a media stream, in a suitable format, for execution by an instruction execution system, apparatus, or device. Although the computer readable storage medium is not transitory signal per se, as the medium holds instructions that implement the steps of a method.

[0236] The program code contained in the computer readable storage medium can be transmitted, propagated or transferred in any suitable medium, including but not limited to wireless, wired, optical, radio frequency (RF), or any suitable combination thereof.

[0237] The following will be described in conjunction with Figure 7 The electronic device 1000 in the present exemplary embodiment is described. The electronic device 1000 is merely an example, and should not impose any limitation on the function and use range of the present embodiment.

[0238] Referring to Figure 7 As shown, the electronic device 1000 is in the form of a general computing device. The components of the electronic device 1000 can include, but are not limited to, at least one processor 1010, at least one memory 1020, a bus 1030 connecting different system components (including the processor 1010 and the memory 1020), and a display unit 1040.

[0239] The memory 1020 stores program code, which can be executed by the processor 1010, so that the processor 1010 executes the specific method steps of the above model rendering method via execution of the executable instructions. Through the method provided by the present embodiment, the computational burden of real-time rendering is significantly reduced while the visual effect is maintained, thereby improving the rendering efficiency of large-scale character array scenes.

[0240] The electronic device can also include a power component configured to perform power management on the electronic device, a wired or wireless network interface configured to connect the electronic device to a network, and an input / output (I / O) interface. The electronic device can operate based on an operating system stored in the memory, such as Android, iOS, Windows, Mac OS X, Unix, Linux, FreeBSD, or the like.

[0241] Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, an electronic device, or a network device, etc.) to execute the method according to the embodiments of the present application.

[0242] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure following the general principles thereof and including such departures from the present disclosure that come within known use or custom in the art. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

[0243] It should be understood that the present disclosure is not limited to the precise structures as herein described and illustrated in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A model rendering method, characterized by, The method comprises the following steps: obtaining a character model file and an animation file; instantiating the character model file to form a character model array; performing batch rendering on the character model array according to a plurality of preset rendering angles and the animation file to generate a plurality of sets of sequence frame images; performing multi-level synthesis on the plurality of sets of sequence frame images according to a preset synthesis rule to generate a total sequence frame texture; creating a shader program, the shader program comprising a double-layer UV coordinate mapping mechanism for locating image frames of specific actions and angles in the total sequence frame texture; constructing a patch model, and applying the total sequence frame texture and the shader program to the patch model to replace the character model array for rendering.

2. The method of claim 1, wherein, The obtaining of the character model file and the animation file comprises the following steps: obtaining a three-dimensional scene comprising an empty node and a timeline file; extracting the character model file and the animation file from the three-dimensional scene.

3. The method of claim 1, wherein, The instantiation of the character model file to form a character model array comprises the following steps: parsing the mesh, material reference and skeletal structure of the character model file; determining the coordinate positions of each character model instance according to a preset formation configuration; deploying the character model instances to the coordinate positions to form the character model array.

4. The method of claim 1, wherein, Before the multi-level synthesis of the plurality of sets of sequence frame images according to the preset synthesis rule, the method further comprises the following steps: preprocessing the plurality of sets of sequence frame images, including detecting the effective pixel area of each image and adjusting the position of the target character in the image.

5. The method of claim 4, wherein, The preprocessing of the plurality of sets of sequence frame images comprises the following steps: calculating the effective pixel bounding box of each image; calculating the actual size and position offset of the character image based on the bounding box; adjusting the character image to the target position of the image.

6. The method of claim 1, wherein, The plurality of preset rendering angles include the top, bottom, left, top-left and / or bottom-left angles, and an orthogonal camera is used for rendering.

7. The method of claim 1, wherein, The multi-level synthesis comprises the following steps: first-level synthesis: synthesizing a plurality of sequence frame images of each action and each angle into a single-action sequence frame image according to a first preset grid layout; second-level synthesis: synthesizing a plurality of single-action sequence frame images into the total sequence frame texture according to a second preset grid layout.

8. The method of claim 7, wherein, The first preset grid layout is a 4x4 layout, and the second preset grid layout is a 2x3 layout.

9. The method of claim 1, wherein, The double-layer UV coordinate mapping mechanism comprises the following steps: inner-layer UV calculation: calculating the UV coordinate offset inside a single sequence frame image based on mesh parameters and time parameters; outer-layer UV calculation: determining the position offset in the total sequence frame texture according to animation type selection parameters and direction selection parameters; adding the inner-layer UV offset and the outer-layer UV offset to obtain the final texture sampling coordinates.

10. The method of claim 1, wherein, The shader program is a shader of a non-lighting calculation type, and comprises animation type selection parameters, direction selection parameters and atlas row and column number parameters as input interfaces.

11. The method of claim 1, wherein, The application of the total sequence frame texture and the shader program to the patch model further comprises the following steps: using a camera-oriented rendering mode to ensure the visual effect of the patch model under any viewing angle; reading the transformation information of the character model array to place the patch model to the corresponding world coordinate position; The instantiation enabled batch combines and processes multiple patch models.

12. The method of claim 1, wherein, The method further comprises: Implementing progressive quality degradation according to the distance between the target role and the camera, and adjusting the sequence frame playing frame rate of the role at a long distance; Only loading the sequence frame textures required by the current scene and releasing the unused resources in time to realize dynamic management of texture resources.

13. A model rendering apparatus, characterized by comprising: Comprise: An acquisition module is configured to acquire a role model file and an animation file; An array module is configured to instantiate the role model file to form a role model array; A first generation module is configured to perform batch rendering on the role model array according to a plurality of preset rendering angles and the animation file, and generate a plurality of groups of sequence frame images; A second generation module is configured to perform multi-level synthesis on the plurality of groups of sequence frame images according to a preset synthesis rule, and generate a total sequence frame texture; A creation module is configured to create a shader program, the shader program comprising a double-layer UV coordinate mapping mechanism for locating image frames of specific actions and angles in the total sequence frame texture; A rendering module is configured to construct a patch model, apply the total sequence frame texture and the shader program to the patch model, and replace the role model array for rendering.

14. A computer readable storage medium storing a computer program, wherein the computer program comprises instructions that, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 13. The computer program, when executed by a processor, implements the steps of the model rendering method of any one of claims 1 to 12.

15. An electronic device comprising a processor and a memory, characterized in that The memory stores a computer program, and the processor executes the computer program to implement the steps of the model rendering method of any one of claims 1 to 12.