Data processing method and device, electronic equipment and storage medium

By performing fine batch processing of virtual scene resources, including merging mesh data and texture maps, and generating texture maps, the problems of small batching intensity and poor quality in the existing technology are solved, and efficient virtual scene rendering is achieved Performance improvement.

CN119444885APending Publication Date: 2025-02-14HANGZHOU BULLET FINGER UNIVERSE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411399269.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In the prior art, the combination of virtual scene resources is small and the combination quality is poor, resulting in limited improvement in virtual scene rendering performance.

Method used

By responding to the batch command of the target virtual scene, based on the object type and shader type of the virtual object, determine the set of objects to be merged and the group of objects to be merged, traverse these object groups, merge mesh data and texture maps, and generate a texture picture set based on the object type and shader type of the virtual object. , and adjust the texture coordinates to reconstruct the virtual object data.

Benefits of technology

High-quality batch optimization has been achieved, the batching efforts have been improved, the number of texture switching has been reduced, and the rendering performance of virtual scenes has been significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444885A_ABST
    Figure CN119444885A_ABST
Patent Text Reader

Abstract

The invention relates to a data processing method and apparatus, an electronic device and a storage medium. The method comprises the steps of determining a to-be-blended object set based on object types of virtual objects in a target virtual scene; determining at least one to-be-blended object group based on the shader type corresponding to each virtual object in the to-be-blended object set; for each to-be-merged object group, traversing the virtual objects in the to-be-merged object group, and when the traversed virtual objects meet a preset merging condition, merging the grid volume data of the traversed virtual objects into first merged grid volume data; and generating a texture image set based on the traversed texture maps of the virtual objects, adjusting texture coordinates of the first combined grid body data based on regions corresponding to the texture maps in the texture image set to obtain adjusted combined grid body data, and reconstructing the adjusted combined grid body data into first reconstructed virtual object data. According to the method and the device, the optimization with greater blending strength is realized, the texture switching frequency is reduced, and the rendering performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In the implementation of graphics rendering, DrawCall is a rendering instruction submitted by the CPU (Central Processing Unit) to the GPU (Graphics Processing Unit), also known as a rendering batch. Each time a rendering instruction is submitted, the CPU needs to send a lot of content to the GPU, including data, status, and instructions. After the CPU completes the preparation work, the GPU can start this rendering. The CPU often takes a lot of time to prepare resources. If the number of Drawcalls is too many, the CPU performance will decline. Therefore, it is very important to reduce the number of Drawcalls. Among them, the batching of virtual scene resources is crucial to optimizing rendering performance. It can reduce the load on the CPU and GPU, reduce the number of DrawCalls, save memory and computing resources, etc.

[0003] However, the batching method for virtual scene resources in the related art has the problems of weak batching strength and poor batching quality, which is not conducive to improving the virtual scene rendering performance. Summary of the invention

[0004] The present disclosure provides a data processing method, device, electronic device and storage medium to at least solve the problem that the batching method of virtual scene resources in the related art has low batching strength and poor batching quality, which is not conducive to improving the virtual scene rendering performance. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a data processing method, including:

[0006] In response to a batching instruction for a target virtual scene, a set of objects to be batched is determined based on the object type of each virtual object in the target virtual scene; the set of objects to be batched includes a plurality of virtual objects corresponding to the same object type;

[0007] Based on the shader type corresponding to each virtual object in the set of objects to be batched, determining at least one group of objects to be batched; each group of objects to be batched includes multiple virtual objects corresponding to the same shader type in the set of objects to be batched;

[0008] For each of the groups of objects to be combined, traverse the virtual objects in the group of objects to be combined, and when the traversed virtual objects in the group of objects to be combined meet the preset merging condition, merge the mesh data of the traversed virtual objects in the group of objects to be combined to obtain first merged mesh data; generate a texture atlas based on the texture maps of the traversed virtual objects in the group of objects to be combined, and adjust the texture coordinates of the first merged mesh data based on the areas respectively corresponding to the texture maps in the texture atlas to obtain adjusted merged mesh data; reconstruct the virtual object based on the adjusted merged mesh data to obtain first reconstructed virtual object data;

[0009] When the untraversed virtual objects in the group of objects to be combined meet the preset traversal conditions, the untraversed virtual objects are taken as the group of objects to be combined, and the step of traversing the virtual objects in the group of objects to be combined is performed until the untraversed virtual objects in the group of objects to be combined do not meet the preset traversal conditions.

[0010] In some exemplary embodiments, traversing the virtual objects in the group of objects to be combined, and when the traversed virtual objects in the group of objects to be combined meet a preset merging condition, merging the mesh data of each traversed virtual object in the group of objects to be combined to obtain the first merged mesh data includes:

[0011] Traversing the virtual objects in the group of objects to be batched, and for the traversed current virtual object, determining new texture size information corresponding to the current virtual object based on texture atlas layout information and size information of the texture map corresponding to the current virtual object;

[0012] Based on the new texture size information corresponding to the current virtual object, the current accumulated texture size information is updated; the current accumulated texture size information is the sum of the new texture size information corresponding to each virtual object traversed in the group of objects to be batched;

[0013] In the case where the current virtual object is not the last virtual object in the group of objects to be merged, if the current accumulated texture size information exceeds the preset texture atlas size, merging the mesh data of each virtual object traversed in the group of objects to be merged to obtain the first merged mesh data;

[0014] The batching instruction of the target virtual scene carries texture atlas configuration information, and the texture atlas configuration information includes the texture atlas layout information and the preset texture atlas size.

[0015] In some exemplary embodiments, the method further comprises:

[0016] In the case that the current virtual object is the last virtual object in the group of objects to be batched, the mesh data of the traversed virtual objects in the group of objects to be batched are merged to obtain the first merged mesh data.

[0017] In some exemplary embodiments, merging the mesh data of each virtual object that has been traversed in the group of objects to be batched to obtain first merged mesh data includes:

[0018] Determining a first total number of mesh vertices based on mesh data of each virtual object that has been traversed in the group of objects to be batched;

[0019] Based on the index buffer precision that matches the first total number of mesh vertices, the mesh volume data of each virtual object that has been traversed in the group of objects to be batched are merged to obtain the first merged mesh volume data.

[0020] In some exemplary embodiments, determining the set of objects to be batched based on the object type of each virtual object in the target virtual scene includes:

[0021] Based on a first object type of each virtual object in the target virtual scene, the virtual objects in the target virtual scene are divided into at least one first virtual object set; the first object type represents the layer to which the virtual object belongs;

[0022] For each of the first virtual object sets, based on the second object type of each virtual object in the first virtual object set, a target virtual object is selected from the first virtual object set to form a second virtual object set; the second object type representation of the target virtual object is baked;

[0023] Based on the texture mapping properties of each virtual object in the second virtual object set, the second virtual object set is divided into a third virtual object set and a fourth virtual object set; wherein the texture mapping properties of each virtual object in the third virtual object set represent that the texture mapping is a non-tiled texture, and the texture mapping properties of each virtual object in the fourth virtual object set represent that the texture mapping is a tiled texture;

[0024] Any of the third virtual object sets is used as the set of objects to be batched.

[0025] In some exemplary embodiments, the method further comprises:

[0026] Dividing virtual objects corresponding to the same material in the fourth virtual object set into a group to obtain at least one virtual object group to be processed;

[0027] For each of the virtual object groups to be processed, when the number of virtual objects in the virtual object group to be processed exceeds a preset number threshold, determining a second total number of mesh vertices based on mesh data of each virtual object in the virtual object group to be processed;

[0028] Based on the index buffer precision matching the second total number of mesh vertices, merging the mesh volume data of each virtual object in the to-be-processed virtual object group to obtain second merged mesh volume data;

[0029] A virtual object is reconstructed based on the second merged mesh data to obtain second reconstructed virtual object data.

[0030] In some exemplary embodiments, before determining the set of objects to be batched based on the object type of each virtual object in the target virtual scene in response to the batching instruction for the target virtual scene, the method further includes:

[0031] In response to a batch configuration instruction triggered by a static scene resource of the target virtual scene, a target batch editing interface is displayed; the target batch editing interface includes a texture atlas layout configuration area and a texture atlas size configuration area;

[0032] Based on the texture atlas layout information input in the texture atlas layout configuration area and the preset texture atlas size input in the texture atlas size configuration area, a batching instruction for the target virtual scene is generated.

[0033] In some exemplary embodiments, the target batch editing interface also includes an optimization information display area, and the optimization information display area is used to display optimization evaluation index data before and after batching.

[0034] In some exemplary embodiments, after obtaining the first reconstructed virtual object data, the method further includes:

[0035] The original mesh data of the traversed virtual objects in the group of objects to be batched are deleted.

[0036] In some exemplary embodiments, after obtaining the first reconstructed virtual object data, the method further includes:

[0037] In response to a batch cancel instruction for the target virtual scene, the batch operation on the target virtual scene is canceled.

[0038] According to a second aspect of an embodiment of the present disclosure, there is provided a data processing device, including:

[0039] The object set determining unit is configured to execute a batching instruction for a target virtual scene, and determine a set of objects to be batched based on the object type of each virtual object in the target virtual scene; the set of objects to be batched includes a plurality of virtual objects corresponding to the same object type;

[0040] The object grouping unit is configured to determine at least one group of objects to be batched based on the shader type corresponding to each virtual object in the set of objects to be batched; each of the groups of objects to be batched includes multiple virtual objects corresponding to the same shader type in the set of objects to be batched;

[0041] The batch operation unit is configured to execute, for each of the object groups to be batched, traverse the virtual objects in the object group to be batched, and when the traversed virtual objects in the object group to be batched meet a preset merging condition, merge the mesh data of each traversed virtual object in the object group to be batched to obtain first merged mesh data; generate a texture atlas based on the texture maps of each virtual object traversed in the object group to be batched, and adjust the texture coordinates of the first merged mesh data based on the areas corresponding to each texture map in the texture atlas to obtain adjusted merged mesh data; reconstruct the virtual object based on the adjusted merged mesh data to obtain first reconstructed virtual object data;

[0042] a loop unit, configured to execute, when the virtual objects that have not been traversed in the group of objects to be combined meet the preset traversal condition, taking the virtual objects that have not been traversed as the group of objects to be combined, and executing the step of traversing the virtual objects in the group of objects to be combined, until the virtual objects that have not been traversed in the group of objects to be combined do not meet the preset traversal condition

[0043] In some exemplary embodiments, the batch operation unit includes:

[0044] A new map size determination unit is configured to perform traversal of the virtual objects in the group of objects to be batched, and for a current virtual object traversed, determine new map size information corresponding to the current virtual object based on texture atlas layout information and size information of the texture map corresponding to the current virtual object;

[0045] A texture size accumulation unit is configured to update the current accumulated texture size information based on the new texture size information corresponding to the current virtual object; the current accumulated texture size information is the sum of the new texture size information corresponding to each virtual object traversed in the group of objects to be batched;

[0046] A first mesh data merging unit is configured to execute, when the current virtual object is not the last virtual object in the group of objects to be merged, if the current accumulated texture size information exceeds a preset texture atlas size, merging the mesh data of each virtual object that has been traversed in the group of objects to be merged to obtain the first merged mesh data;

[0047] The batching instruction of the target virtual scene carries texture atlas configuration information, and the texture atlas configuration information includes the texture atlas layout information and the preset texture atlas size.

[0048] In some exemplary embodiments, the batch operation unit further comprises:

[0049] The second grid data merging unit is configured to merge the grid data of each virtual object that has been traversed in the group of objects to be merged to obtain the first merged grid data when the current virtual object is the last virtual object in the group of objects to be merged.

[0050] In some exemplary embodiments, when the batching operation unit merges the mesh data of each virtual object that has been traversed in the group of objects to be batched to obtain first merged mesh data, the batching operation unit is specifically configured to determine a first total number of mesh vertices based on the mesh data of each virtual object that has been traversed in the group of objects to be batched; and merge the mesh data of each virtual object that has been traversed in the group of objects to be batched based on an index buffer precision that matches the first total number of mesh vertices to obtain the first merged mesh data.

[0051] In some exemplary embodiments, the object set determining unit includes:

[0052] A first object division unit is configured to divide the virtual objects in the target virtual scene into at least one first virtual object set based on a first object type of each virtual object in the target virtual scene; the first object type represents a layer to which the virtual object belongs;

[0053] A selection unit is configured to select a target virtual object from the first virtual object set to form a second virtual object set for each of the first virtual object sets based on the second object type of each virtual object in the first virtual object set; the second object type representation of the target virtual object is baked;

[0054] A second division unit is configured to divide the second virtual object set into a third virtual object set and a fourth virtual object set based on a texture mapping attribute of each virtual object in the second virtual object set; wherein the texture mapping attribute of each virtual object in the third virtual object set indicates that the texture mapping is a non-tiled texture, and the texture mapping attribute of each virtual object in the fourth virtual object set indicates that the texture mapping is a tiled texture;

[0055] The first determining unit is configured to execute taking any of the third virtual object sets as the set of objects to be batched.

[0056] In some exemplary embodiments, the apparatus further comprises:

[0057] A third division unit is configured to divide the virtual objects corresponding to the same material in the fourth virtual object set into a group to obtain at least one virtual object group to be processed;

[0058] A second determining unit is configured to determine, for each of the virtual object groups to be processed, a second total number of mesh vertices based on mesh data of each virtual object in the virtual object group to be processed when the number of virtual objects in the virtual object group to be processed exceeds a preset number threshold;

[0059] A third mesh data merging unit is configured to merge the mesh data of each virtual object in the to-be-processed virtual object group based on the index buffer precision matching the second total number of mesh vertices to obtain second merged mesh data;

[0060] The reconstruction unit is configured to perform virtual object reconstruction based on the second merged grid data to obtain second reconstructed virtual object data.

[0061] In some exemplary embodiments, the apparatus further comprises:

[0062] A batch editing interface display unit is configured to execute a batch configuration instruction triggered in response to a static scene resource based on the target virtual scene, and display a target batch editing interface; the target batch editing interface includes a texture atlas layout configuration area and a texture atlas size configuration area;

[0063] The batch instruction generation unit is configured to generate a batch instruction for the target virtual scene based on the texture atlas layout information input in the texture atlas layout configuration area and the preset texture atlas size input in the texture atlas size configuration area.

[0064] In some exemplary embodiments, the target batch editing interface also includes an optimization information display area, and the optimization information display area is used to display optimization evaluation index data before and after batching.

[0065] In some exemplary embodiments, the batch operation unit further comprises:

[0066] The deleting unit is configured to delete the original mesh data of the traversed virtual objects in the group of objects to be batched after obtaining the first reconstructed virtual object data.

[0067] In some exemplary embodiments, the batch operation unit further comprises:

[0068] The undoing unit is configured to execute, after obtaining the first reconstructed virtual object data, in response to a batch undo instruction for the target virtual scene, undoing the batch operation on the target virtual scene.

[0069] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0070] processor;

[0071] a memory for storing instructions executable by the processor;

[0072] Wherein, the processor is configured to execute the instructions to implement the data processing method of the first aspect mentioned above.

[0073] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data processing method of the first aspect described above.

[0074] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the data processing method of the first aspect described above is implemented.

[0075] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0076] In response to a batching instruction for a target virtual scene, a set of objects to be batched is determined based on the object type of each virtual object in the target virtual scene, and at least one group of objects to be batched is determined based on the shader type corresponding to each virtual object in the set of objects to be batched, wherein each virtual object in each group of objects to be batched corresponds to the same shader type, and then for each group of objects to be batched, the virtual objects in the group of objects to be batched are traversed, and when the traversed virtual objects in the group of objects to be batched meet a preset merging condition, the mesh data of each traversed virtual object in the group of objects to be batched are merged to obtain first batched mesh data, and a texture atlas is generated based on the texture maps of each virtual object traversed in the group of objects to be batched, and the first merged mesh data is merged based on the area data corresponding to each of the texture maps in the texture atlas. The texture coordinates are adjusted to obtain adjusted merged mesh data, and virtual objects are reconstructed based on the adjusted merged mesh data to obtain first reconstructed virtual object data. When the virtual objects that have not been traversed in the object group to be merged meet the preset traversal conditions, the virtual objects that have not been traversed are used as the aforementioned object group to be merged, and the aforementioned steps of traversing the virtual objects in the object group to be merged are performed until the virtual objects that have not been traversed in the object group to be merged do not meet the preset traversal conditions. Therefore, the above technical solution not only finely controls the merged mesh data, but also merges texture maps to form a texture atlas, and accurately controls data alignment, thereby ensuring that various attribute data of the batch can be efficiently used in the texture atlas, achieving high-quality optimization with greater batching strength, effectively reducing the number of texture switching times, and being conducive to greatly improving the rendering performance of the virtual scene.

[0077] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0079] Figure 1 is a flowchart of a data processing method according to an exemplary embodiment;

[0080] Figure 2 is a flowchart of another data processing method according to an exemplary embodiment;

[0081] Figure 3 is a flowchart of another data processing method according to an exemplary embodiment;

[0082] Figure 4is a schematic diagram of a target batch editing interface according to an exemplary embodiment;

[0083] Figure 5 is a schematic diagram of a batch cancellation interface according to an exemplary embodiment;

[0084] Figure 6 is a flowchart of another data processing method according to an exemplary embodiment;

[0085] Figure 7 is a structural block diagram of a data processing device according to an exemplary embodiment;

[0086] Figure 8 It is a structural block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0087] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0088] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0089] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0090] See also Figure 1 , which is a flow chart of a data processing method according to an exemplary embodiment. Figure 1 As shown, the following steps are included:

[0091] In step S101 , in response to a batching instruction for a target virtual scene, a set of objects to be batched is determined based on the object type of each virtual object in the target virtual scene.

[0092] The set of objects to be batched includes a plurality of virtual objects corresponding to the same object type.

[0093] Among them, the virtual scene is a scene in a virtual game displayed or provided when the application is running on the terminal, which can also be called a virtual world, and can include multiple virtual objects. The virtual scene is a simulation environment of the real world, or a semi-simulated and semi-fictional virtual environment, or a purely fictional virtual environment. Optionally, the virtual scene is any one of a two-dimensional virtual space, a 2.5-dimensional virtual space, or a three-dimensional virtual space. The embodiment of the present disclosure does not limit the dimension of the virtual scene. The target virtual scene refers to the virtual scene to be batched.

[0094] A virtual object is a virtual image used to represent an object in a virtual scene. Each virtual object has its own shape and volume in the virtual scene and occupies a part of the space in the virtual scene. For example, a virtual object may include vegetation, mountains, sky, rivers, etc. in the virtual scene.

[0095] The batching instruction is used to instruct to batch the static virtual objects in the target virtual scene, so the virtual objects mentioned in the embodiments of the present disclosure may be static virtual objects. In a specific implementation, the batching instruction for the target virtual scene may be triggered and generated based on an editing tool with a batching function in the terminal.

[0096] In some exemplary embodiments, Figure 2 As shown, the above step S101 may include, when determining the set of objects to be batched based on the object type of each virtual object in the target virtual scene:

[0097] In step S201, virtual objects in the target virtual scene are divided into at least one first virtual object set based on a first object type of each virtual object in the target virtual scene.

[0098] The first object type represents the layer to which the virtual object belongs, and the first object type of each virtual object in each of the first virtual object sets is the same.

[0099] Specifically, virtual objects of the same first object type, ie, virtual objects belonging to the same layer, are grouped into the same set, thereby obtaining a first virtual object set corresponding to each layer.

[0100] In step S203, for each of the first virtual object sets, based on the second object type of each virtual object in the first virtual object set, a target virtual object is selected from the first virtual object set to form a second virtual object set; the second object type representation of the target virtual object is baked.

[0101] In step S205, based on the texture map attribute of each virtual object in the second virtual object set, the second virtual object set is divided into a third virtual object set and a fourth virtual object set.

[0102] The texture map attribute of each virtual object in the third virtual object set indicates that the texture map is a non-tiled texture, and the texture map attribute of each virtual object in the fourth virtual object set indicates that the texture map is a tiled texture (TileTexture).

[0103] In a specific implementation, the deviation range of the texture coordinate UV can be used in the texture map properties to indicate whether it is a tiled texture. For example, if the deviation range of the texture coordinate UV is not in the range of 0-1, it indicates a tiled texture, and vice versa, if it is in the range of 0-1, it indicates a non-tiled texture. The texture map properties can be configured through the target batch configuration interface.

[0104] In step S207, any one of the third virtual object sets is used as the set of objects to be batched.

[0105] Specifically, considering that the batch processing of the embodiment of the present disclosure needs to be implemented based on the texture atlas, and tiled textures are not suitable for using texture atlases, which will result in erroneous effects, any third virtual object set is used as the aforementioned set of objects to be batched, so that a higher batch quality can be ensured when batch processing is subsequently performed on the set of objects to be batched based on the texture atlas.

[0106] In the above implementation, necessary batching condition restrictions are set according to different layers, whether to bake, and whether it is a tiled texture, so as to ensure the effectiveness of the subsequent batching process and the guarantee of the final rendering quality. It can also support different layers and different baking conditions, thereby improving the reasonable versatility of data processing in the disclosed embodiment.

[0107] In step S103, at least one group of objects to be batched is determined based on the shader type corresponding to each virtual object in the set of objects to be batched.

[0108] Each of the groups of objects to be batched includes multiple virtual objects of the same shader type in the set of objects to be batched. The shader type corresponding to each virtual object is the type of the shader Shader used by the virtual object. The shader Shader is used to implement image rendering, and the shader type may include a vertex shader and a pixel shader, etc.

[0109] Specifically, each virtual object in the set of objects to be batched corresponds to material information, and the material information can indicate the type of shader and texture map used by the virtual object. In the embodiment of the present disclosure, the shader type corresponding to each virtual object is determined based on the material information of each virtual object in the set of objects to be batched, and then the virtual objects corresponding to the same shader type in the set of objects to be batched are divided into a group, thereby obtaining at least one group of objects to be batched. It can be understood that the shader type corresponding to each virtual object in each group of objects to be batched is the same, but the texture maps of each virtual object can be the same or different, that is, there is no limitation on whether the texture maps of each virtual object in the same group of objects to be batched are the same.

[0110] In step S105, for each of the object groups to be batched, the virtual objects in the object group to be batched are traversed, and when the traversed virtual objects in the object group to be batched meet the preset merging condition, the following batching operations (1) to (4) are performed:

[0111] (1) merging the mesh data of each virtual object that has been traversed in the group of objects to be merged into a batch to obtain first merged mesh data;

[0112] The mesh data of the virtual object is mesh data. By merging the mesh data of each virtual object that has been traversed in the group of objects to be merged, a merged larger mesh data, namely the first mesh data, can be obtained.

[0113] (2) generating a texture atlas based on the texture maps of each virtual object that has been traversed in the group of objects to be batched;

[0114] Among them, the texture atlas is usually a large rectangular texture, which contains multiple small texture maps. These small texture maps are merged together according to certain rules and layout methods to form an overall image.

[0115] Specifically, the texture atlas generated above may include texture atlases corresponding to different map types, for example, it may include Mask texture atlas, Base texture atlas and Normal texture atlas. In a specific implementation, the texture atlases of the same map type in the texture maps corresponding to the traversed virtual objects in the object group to be batched can be combined into a texture atlas corresponding to the map type through a texture packer. Among them, the texture packer can specifically use Texture Packer; further, Texture Packer is a general tool that can pack multiple scattered texture maps into a complete texture atlas, that is, store multiple small texture maps as a large texture atlas; of course, the texture packer can also use other static map packers, and the embodiments of the present disclosure do not make specific limitations on this.

[0116] (3) adjusting the texture coordinates of the first merged mesh volume data based on the regions respectively corresponding to the texture maps in the texture atlas to obtain adjusted merged mesh volume data;

[0117] Specifically, for each texture map of each virtual object that has been traversed in the group of objects to be batched, the area corresponding to the texture map in the corresponding texture atlas is determined, and then the texture coordinates of the first merged mesh data are mapped to the corresponding area in the corresponding texture atlas to obtain new texture coordinates. The first merged mesh data containing the new texture coordinates is the adjusted merged mesh data.

[0118] (4) Reconstructing the virtual object based on the adjusted merged grid data to obtain first reconstructed virtual object data.

[0119] The first reconstructed virtual object data is the reconstructed Game Object data obtained by reconstructing the virtual object based on the adjusted merged mesh data.

[0120] In step S107, when the untraversed virtual objects in the group of objects to be combined in batch meet the preset traversal conditions, the untraversed virtual objects are taken as the group of objects to be combined in batch, and the step of traversing the virtual objects in the group of objects to be combined in batch is performed until the untraversed virtual objects in the group of objects to be combined in batch do not meet the preset traversal conditions.

[0121] The preset traversal condition may be that the number of untraversed virtual objects in the group of objects to be batched is zero.

[0122] In some exemplary embodiments, the batching instruction of the target virtual scene carries texture atlas configuration information, and the texture atlas configuration information includes the texture atlas layout information and the preset texture atlas size, and then Figure 3 As shown, in the above step S105, when the virtual objects in the group of objects to be combined are traversed, when the traversed virtual objects in the group of objects to be combined meet the preset merging condition, the mesh data of each virtual object in the group of objects to be combined are merged to obtain the first merged mesh data, which may include:

[0123] In step S301, the virtual objects in the object group to be batched are traversed, and for the current virtual object traversed, the new map size information corresponding to the current virtual object is determined based on the texture atlas layout information and the size information of the texture map corresponding to the current virtual object.

[0124] Specifically, the texture atlas layout information may include the spacing size between different block maps in the texture atlas, and then the new map size information is calculated based on the spacing size and the size information of the texture map corresponding to the current virtual object. It can be understood that if the current virtual object corresponds to several texture maps, several corresponding new map size information will be calculated.

[0125] In step S303, the current accumulated texture size information is updated based on the new texture size information corresponding to the current virtual object.

[0126] The current accumulated texture size information is the sum of the new texture size information corresponding to each virtual object that has been traversed in the group of objects to be batched.

[0127] In step S305, it is determined whether the current virtual object is the last virtual object in the group of objects to be batched.

[0128] Specifically, when the judgment result indicates that the current virtual object is not the last virtual object in the group of objects to be batched, the following step S307 can be executed; otherwise, when the judgment result indicates that the current virtual object is the last virtual object in the group of objects to be batched, the following step S309 can be directly executed.

[0129] In step S307, it is determined whether the current accumulated texture size information exceeds the preset texture atlas size.

[0130] The preset texture atlas size indicates the size of the texture atlas to be generated. In a specific implementation, the preset texture atlas size may be the maximum resolution of the texture atlas.

[0131] Specifically, when the judgment result indicates that the current cumulative map size information exceeds the preset texture atlas size, the following step S309 can be executed; conversely, when the judgment result indicates that the current cumulative map size information does not exceed the preset texture atlas size, the execution of steps S301 to S307 can be returned.

[0132] In step S309, the mesh data of each virtual object that has been traversed in the group of objects to be merged are merged to obtain the first merged mesh data.

[0133] The above-mentioned implementation method combines the texture atlas configuration information carried in the batch instruction when traversing the virtual objects in the object group to be merged, and includes texture atlas layout information and preset texture atlas size, wherein the texture atlas layout information is used to determine the new map size information corresponding to the current virtual object, and then update the current cumulative map size information based on the new map size information of the current virtual object, and when the current virtual object is not the last virtual object in the object group to be merged, and the current cumulative map size information exceeds the preset texture atlas size, the mesh data of the traversed virtual objects in the object group to be merged are merged, thereby ensuring that the first merged network data obtained by the merger is consistent with the texture atlas configuration information, that is, improving the flexibility of the batch operation and ensuring the effectiveness of the batch operation; and when the current virtual object is the last virtual object in the object group to be merged, the mesh data of the traversed virtual objects in the object group to be merged are directly merged, thereby improving the efficiency of the batch operation.

[0134] Based on this, in some exemplary implementations, before step S101, the method may further include:

[0135] In response to a batch configuration instruction triggered by a static scene resource of the target virtual scene, a target batch editing interface is displayed, the target batch editing interface including a texture atlas layout configuration area and a texture atlas size configuration area;

[0136] Based on the texture atlas layout information input in the texture atlas layout configuration area and the preset texture atlas size input in the texture atlas size configuration area, a batching instruction for the target virtual scene is generated.

[0137] The static scene resource of the target virtual scene can be any static virtual object resource in the resource file corresponding to the target virtual scene. In a specific implementation, you can select any static virtual object resource of the target virtual scene, right-click and select the batch tool to trigger the batch configuration instruction. The terminal responds to the batch configuration instruction and pops up the target batch editing interface. The target batch editing interface includes a texture atlas layout configuration area and a texture atlas size configuration area. Figure 4The diagram shows a target batch editing interface provided by an embodiment of the present disclosure, wherein area 401 is a texture atlas layout configuration area, and area 402 is a texture atlas size configuration area. Area 401 can be used to configure the layout of the texture atlas to be generated, for example, the atlas interval (the interval size between different block maps in the atlas), the MipMap edge size, and the type of texture maps participating in the texture atlas batch (such as BaseMap, NormalMap, MaskMap); area 402 can be used to configure the size of the texture atlas to be generated, for example, the maximum resolution of the texture atlas and / or the maximum number of texture atlas maps can be configured. The terminal can then generate a batch instruction for the target virtual scene based on the texture atlas layout information entered in the texture atlas layout configuration area and the preset texture atlas size entered in the texture atlas size configuration area.

[0138] The above-mentioned implementation method displays a target batch editing interface in response to a batch configuration instruction triggered by static scene resources based on the target virtual scene, and then generates a batch instruction for the target virtual scene based on the texture atlas layout information and preset texture atlas size input in the corresponding area of ​​the target batch editing interface, so that subsequent batch operations can match actual needs, thereby improving the flexibility, batch effect and efficiency of the batch operation.

[0139] It is understandable that the target batch editing interface may also include input areas for other related content based on actual needs, such as an optimization information display area, which is used to display optimization evaluation index data before and after batching, and the optimization evaluation index data may include index data before and after batching, index data after batching, and optimization rate. Figure 4 As shown in area 403 in the figure, the pre-batching index data may include the number of vertices, meshes, materials and DrawCalls before batching; the post-batching index data may include the number of vertices, meshes, materials and DrawCalls after batching. Thus, the optimization information display area of ​​the target batch editing interface can intuitively display the changes in relevant index data before and after batching before batching data processing, which facilitates intuitive understanding of the batching strength and improves the flexibility and efficiency of batching.

[0140] In some exemplary implementations, the above step S309 may include:

[0141] Determining a first total number of mesh vertices based on mesh data of each virtual object that has been traversed in the group of objects to be batched;

[0142] Based on the index buffer precision that matches the first total number of mesh vertices, the mesh volume data of each virtual object that has been traversed in the group of objects to be batched are merged to obtain the first merged mesh volume data.

[0143] Specifically, the number of mesh vertices corresponding to each traversed virtual object can be determined based on the mesh data of each traversed virtual object in the object group to be batched, and then the sum of the number of mesh vertices corresponding to each traversed virtual object is calculated to obtain the first total number of mesh vertices.

[0144] The index buffer precision involved in the embodiments of the present disclosure may include Uint32 index buffer precision and Uint16 index buffer precision, wherein the value range stored in the Uint16 index buffer precision is 0 to 65535 (2^16-1), wherein Uint means unsigned, i.e., does not contain negative numbers, and 16 means that the data type occupies 16 bits; the value range stored in the Uint32 index buffer precision is 0 to 4294967295 (2^32-1), and 32 means that the data type occupies 32 bits. Based on this, when the mesh data of each virtual object that has been traversed in the object group to be merged is merged based on the index buffer precision matching the first total number of mesh vertices to obtain the first merged mesh data, it can be determined whether the first total number of mesh vertices exceeds the maximum value corresponding to the Uint16 index buffer precision, that is, 65535. If it exceeds the maximum value corresponding to the Uint16 index buffer precision, the Uint32 index buffer precision is determined as the index buffer precision matching the first total number of mesh vertices, and the mesh data of each virtual object that has been traversed in the object group to be merged is merged based on the Uint32 index buffer precision to obtain the first merged mesh data; conversely, if it does not exceed the maximum value corresponding to the Uint16 index buffer precision, the Uint16 index buffer precision is determined as the index buffer precision matching the first total number of mesh vertices, and the mesh data of each virtual object that has been traversed in the object group to be merged is merged based on the Uint16 index buffer precision to obtain the first merged mesh data.

[0145] In the above implementation, the first total number of mesh vertices is determined based on the mesh data of each virtual object that has been traversed in the object group to be batched, and then based on the index buffer accuracy that matches the first total number of mesh vertices, the mesh data of each virtual object that has been traversed in the object group to be batched are merged to obtain the first merged mesh data, thereby ensuring the effectiveness of the merging process and improving the efficiency of the batching operation.

[0146] In some exemplary embodiments, after obtaining the first reconstructed virtual object data in the aforementioned step S105, the method may further include: deleting the original data of the traversed virtual objects in the group of objects to be batched.

[0147] In a specific implementation, whether to delete the corresponding original data after batching can be configured through the target batch editing interface. When it is configured to delete the corresponding original data after batching, the original mesh data of the virtual objects that have been traversed in the object group to be batched can be deleted after obtaining the first reconstructed virtual object data.

[0148] By deleting the original mesh data of the traversed virtual objects in the object group to be batched after generating the first reconstructed virtual object data, the memory occupation by this part of the data can be avoided, thereby improving the rendering performance while avoiding the waste of memory resources and improving the utilization rate of memory resources.

[0149] In some exemplary embodiments, in order to further improve the flexibility and accuracy of data processing, after obtaining the first reconstructed virtual object data in the aforementioned step S105, the method may further include: in response to a batch undo instruction for the target virtual scene, undoing the batch operation on the target virtual scene.

[0150] Specifically, the batch cancellation command can be triggered based on any reconstructed virtual object data of the target virtual scene. For example, select any reconstructed virtual object data of the target virtual scene, right-click to display the batch cancellation interface, and the batch cancellation interface displays controls for canceling this batch, such as Figure 5 Shown is a schematic diagram of a batch cancellation interface provided in an embodiment of the present disclosure, wherein control 501 is used to indicate the cancellation of the current batch. When control 501 is clicked, a batch cancellation instruction for the target virtual scene is issued, so that the terminal can respond to the batch cancellation instruction to cancel the batch operation on the target virtual scene.

[0151] By providing batch undo in the above implementation, it can be ensured that when errors occur or adjustments are needed during the batching process, it can be easily traced back and modified, thereby improving data processing efficiency and flexibility, as well as the quality of the final batching results.

[0152] In some exemplary implementations, in order to improve the versatility of the technical solutions of the embodiments of the present disclosure, as Figure 6 As shown, the method may also include:

[0153] In step S601, virtual objects corresponding to the same material in the fourth virtual object set are divided into a group to obtain at least one virtual object group to be processed.

[0154] In step S603, for each of the virtual object groups to be processed, when the number of virtual objects in the virtual object group to be processed exceeds a preset number threshold, a second total number of mesh vertices is determined based on mesh data of each virtual object in the virtual object group to be processed.

[0155] The preset number threshold may be set based on actual needs, for example, may be set to 1, that is, when the number of virtual objects in the to-be-processed virtual object group exceeds 1, subsequent processing will be performed on the to-be-processed virtual object group.

[0156] Specifically, when the number of virtual objects in the virtual object group to be processed exceeds a preset number threshold, the number of mesh vertices corresponding to each virtual object can be determined based on the mesh data of each virtual object in the virtual object group to be processed, and then the sum of the number of mesh vertices corresponding to each virtual object in the virtual object group to be processed is calculated to obtain the second total number of mesh vertices.

[0157] In step S605, based on the index buffer precision matching the second total number of mesh vertices, the mesh volume data of each virtual object in the to-be-processed virtual object group are merged to obtain second merged mesh volume data.

[0158] Specifically, it can be determined whether the second total number of mesh vertices exceeds the maximum value corresponding to the Uint16 index buffer precision, that is, 65535. If it exceeds the maximum value corresponding to the Uint16 index buffer precision, the Uint32 index buffer precision is determined as the index buffer precision that matches the second total number of mesh vertices, and the mesh data of each virtual object in the virtual object group to be processed is merged based on the Uint32 index buffer precision to obtain the second merged mesh data; conversely, if it does not exceed the maximum value corresponding to the Uint16 index buffer precision, the Uint16 index buffer precision is determined as the index buffer precision that matches the second total number of mesh vertices, and the mesh data of each virtual object in the virtual object group to be processed is merged based on the Uint16 index buffer precision to obtain the second merged mesh data.

[0159] In step S607, a virtual object is reconstructed based on the second merged mesh data to obtain second reconstructed virtual object data.

[0160] The second reconstructed virtual object data is reconstructed Game Object data obtained by reconstructing the virtual object based on the second merged mesh data.

[0161] It can be understood that after the second reconstructed virtual object data is obtained, the original mesh data of each virtual object in the virtual object group to be processed may be deleted to save memory resources.

[0162] In the above-mentioned implementation mode, for each virtual object in the target virtual scene that is not suitable for batch operation using a texture atlas, i.e., the fourth virtual object set, the virtual objects of the same material are divided into a group of virtual objects to be processed, and then each group of virtual objects to be processed is batch processed based on the material. This effectively reduces the number of rendering calls and improves rendering efficiency, while greatly improving the flexibility and versatility of data processing in the disclosed embodiment.

[0163] The technical solution of the disclosed embodiment, in the Unity engine, through the static virtual scene batching operation based on the texture atlas, not only finely controls the merging of mesh data, but also merges multiple different texture maps of multiple virtual objects into a large texture atlas, and accurately controls data alignment, ensuring that various batched attribute data can be efficiently used in the texture atlas, achieving high-quality optimization with greater batching strength, effectively reducing the number of texture switching times, and facilitating a significant improvement in the rendering performance of virtual scenes.

[0164] Figure 7 is a structural block diagram of a data processing device according to an exemplary embodiment. Figure 7 , the data processing device 700 comprises:

[0165] The object set determining unit 710 is configured to execute, in response to a batching instruction for a target virtual scene, determine a set of objects to be batched based on the object type of each virtual object in the target virtual scene; the set of objects to be batched includes a plurality of virtual objects corresponding to the same object type;

[0166] The object grouping unit 720 is configured to determine at least one group of objects to be batched based on the shader type corresponding to each virtual object in the set of objects to be batched; each of the groups of objects to be batched includes multiple virtual objects corresponding to the same shader type in the set of objects to be batched;

[0167] The batch operation unit 730 is configured to execute, for each of the object groups to be batched, traversing the virtual objects in the object group to be batched, and when the traversed virtual objects in the object group to be batched meet the preset merging condition, merging the mesh data of each traversed virtual object in the object group to be batched to obtain first merged mesh data; generating a texture atlas based on the texture maps of each virtual object traversed in the object group to be batched, and adjusting the texture coordinates of the first merged mesh data based on the areas corresponding to each texture map in the texture atlas to obtain adjusted merged mesh data; reconstructing the virtual object based on the adjusted merged mesh data to obtain first reconstructed virtual object data;

[0168] The loop unit 740 is configured to execute, when the virtual objects that have not been traversed in the group of objects to be combined meet the preset traversal condition, taking the virtual objects that have not been traversed as the group of objects to be combined, and executing the step of traversing the virtual objects in the group of objects to be combined, until the virtual objects that have not been traversed in the group of objects to be combined do not meet the preset traversal condition.

[0169] In some exemplary embodiments, the batch operation unit 730 includes:

[0170] A new map size determination unit is configured to perform traversal of the virtual objects in the group of objects to be batched, and for a current virtual object traversed, determine new map size information corresponding to the current virtual object based on texture atlas layout information and size information of the texture map corresponding to the current virtual object;

[0171] A texture size accumulation unit is configured to update the current accumulated texture size information based on the new texture size information corresponding to the current virtual object; the current accumulated texture size information is the sum of the new texture size information corresponding to each virtual object traversed in the group of objects to be batched;

[0172] A first mesh data merging unit is configured to execute, when the current virtual object is not the last virtual object in the group of objects to be merged, if the current accumulated texture size information exceeds a preset texture atlas size, merging the mesh data of each virtual object that has been traversed in the group of objects to be merged to obtain the first merged mesh data;

[0173] The batching instruction of the target virtual scene carries texture atlas configuration information, and the texture atlas configuration information includes the texture atlas layout information and the preset texture atlas size.

[0174] In some exemplary embodiments, the batch operation unit 730 further includes:

[0175] The second grid data merging unit is configured to merge the grid data of each virtual object that has been traversed in the group of objects to be merged to obtain the first merged grid data when the current virtual object is the last virtual object in the group of objects to be merged.

[0176] In some exemplary embodiments, when the batching operation unit 730 merges the mesh data of each virtual object that has been traversed in the group of objects to be batched to obtain first merged mesh data, it is specifically configured to determine a first total number of mesh vertices based on the mesh data of each virtual object that has been traversed in the group of objects to be batched; and merge the mesh data of each virtual object that has been traversed in the group of objects to be batched based on an index buffer precision that matches the first total number of mesh vertices to obtain the first merged mesh data.

[0177] In some exemplary embodiments, the object set determining unit 710 includes:

[0178] A first object division unit is configured to divide the virtual objects in the target virtual scene into at least one first virtual object set based on a first object type of each virtual object in the target virtual scene; the first object type represents a layer to which the virtual object belongs;

[0179] A selection unit is configured to select a target virtual object from the first virtual object set to form a second virtual object set for each of the first virtual object sets based on the second object type of each virtual object in the first virtual object set; the second object type representation of the target virtual object is baked;

[0180] A second division unit is configured to divide the second virtual object set into a third virtual object set and a fourth virtual object set based on a texture mapping attribute of each virtual object in the second virtual object set; wherein the texture mapping attribute of each virtual object in the third virtual object set indicates that the texture mapping is a non-tiled texture, and the texture mapping attribute of each virtual object in the fourth virtual object set indicates that the texture mapping is a tiled texture;

[0181] The first determining unit is configured to execute taking any of the third virtual object sets as the set of objects to be batched.

[0182] In some exemplary embodiments, the apparatus 700 further includes:

[0183] A third division unit is configured to divide the virtual objects corresponding to the same material in the fourth virtual object set into a group to obtain at least one virtual object group to be processed;

[0184] A second determining unit is configured to determine, for each of the virtual object groups to be processed, a second total number of mesh vertices based on mesh data of each virtual object in the virtual object group to be processed when the number of virtual objects in the virtual object group to be processed exceeds a preset number threshold;

[0185] A third mesh data merging unit is configured to merge the mesh data of each virtual object in the to-be-processed virtual object group based on the index buffer precision matching the second total number of mesh vertices to obtain second merged mesh data;

[0186] The reconstruction unit is configured to perform virtual object reconstruction based on the second merged grid data to obtain second reconstructed virtual object data.

[0187] In some exemplary embodiments, the apparatus 700 further includes:

[0188] A batch editing interface display unit is configured to execute a batch configuration instruction triggered in response to a static scene resource based on the target virtual scene, and display a target batch editing interface; the target batch editing interface includes a texture atlas layout configuration area and a texture atlas size configuration area;

[0189] The batch instruction generation unit is configured to generate a batch instruction for the target virtual scene based on the texture atlas layout information input in the texture atlas layout configuration area and the preset texture atlas size input in the texture atlas size configuration area.

[0190] In some exemplary embodiments, the target batch editing interface also includes an optimization information display area, and the optimization information display area is used to display optimization evaluation index data before and after batching.

[0191] In some exemplary embodiments, the batch operation unit 730 further includes:

[0192] The deleting unit is configured to delete the original mesh data of the traversed virtual objects in the group of objects to be batched after obtaining the first reconstructed virtual object data.

[0193] In some exemplary embodiments, the batch operation unit 730 further includes:

[0194] The undoing unit is configured to execute, after obtaining the first reconstructed virtual object data, in response to a batch undo instruction for the target virtual scene, undoing the batch operation on the target virtual scene.

[0195] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0196] In some exemplary embodiments, an electronic device is also provided, including a processor; a memory for storing processor-executable instructions; wherein, when the processor is configured to execute the instructions stored in the memory, it implements any one of the data object processing methods provided in the embodiments of the present disclosure.

[0197] The electronic device may be a terminal, a server or a similar computing device. For example, the electronic device is a terminal. Figure 8 is a block diagram of an electronic device for data processing according to an exemplary embodiment, specifically:

[0198] The terminal may include components such as an RF (Radio Frequency) circuit 810, a memory 820 including one or more computer-readable storage media, an input unit 830, a display unit 840, a sensor 850, an audio circuit 860, a WiFi (wireless fidelity) module 870, a processor 880 including one or more processing cores, and a power supply 890. Those skilled in the art will appreciate that Figure 8 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0199] The RF circuit 810 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 880 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 810 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. In addition, the RF circuit 810 can also communicate with the network and other terminals through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.

[0200] The memory 820 can be used to store software programs and modules. The processor 880 executes various functional applications and data processing by running the software programs and modules stored in the memory 820. The memory 820 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, etc.; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 820 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 820 may also include a memory controller to provide the processor 880 and the input unit 830 with access to the memory 820.

[0201] The input unit 830 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 830 may include a touch-sensitive surface 831 and other input devices 832. The touch-sensitive surface 831, also known as a touch display screen or touchpad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 831), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 831 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 880, and can receive and execute commands sent by the processor 880. In addition, the touch-sensitive surface 831 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 831, the input unit 830 may further include other input devices 832. Specifically, the other input devices 832 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0202] The display unit 840 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the terminal, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 840 may include a display panel 841, and optionally, the display panel 841 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 831 may cover the display panel 841, and when the touch-sensitive surface 831 detects a touch operation on or near it, it is transmitted to the processor 880 to determine the type of the touch event, and then the processor 880 provides corresponding visual output on the display panel 841 according to the type of the touch event. Among them, the touch-sensitive surface 831 and the display panel 841 can be two independent components to realize the input and output functions, but in some embodiments, the touch-sensitive surface 831 and the display panel 841 can also be integrated to realize the input and output functions.

[0203] The terminal may also include at least one sensor 850, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 841 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 841 and / or the backlight when the terminal is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the terminal posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can be configured in the terminal, they will not be repeated here.

[0204] The audio circuit 860, the speaker 861, and the microphone 862 can provide an audio interface between the user and the terminal. The audio circuit 860 can transmit the received audio data to the speaker 861 after converting the received audio data into an electrical signal, which is converted into a sound signal for output by the speaker 861; on the other hand, the microphone 862 converts the collected sound signal into an electrical signal, which is received by the audio circuit 860 and converted into audio data, and then the audio data is output to the processor 880 for processing, and then sent to another terminal through the RF circuit 810, or the audio data is output to the memory 820 for further processing. The audio circuit 860 may also include an earplug jack to provide communication between an external headset and the terminal.

[0205] WiFi is a short-range wireless transmission technology. The terminal can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 870, which provides users with wireless broadband Internet access. Figure 8 A WiFi module 870 is shown, but it is understandable that it is not an essential component of the terminal and can be omitted as needed without changing the essence of the invention.

[0206] The processor 880 is the control center of the terminal, and uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the terminal and processes data by running or executing software programs and / or modules stored in the memory 820, and calling data stored in the memory 820. Optionally, the processor 880 may include one or more processing cores; preferably, the processor 880 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 880.

[0207] The terminal also includes a power supply 80 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 880 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 890 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0208] In some exemplary embodiments, a computer-readable storage medium including instructions is also provided, such as a memory 820 including instructions, and the instructions can be executed by a processor 880 of the device 800 to complete the data processing method provided in any of the above embodiments. Alternatively, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0209] In some exemplary embodiments, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the data processing method provided in any of the above embodiments is implemented.

[0210] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0211] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A data processing method, characterized in that: include: In response to a batching instruction for a target virtual scene, determining a set of objects to be batched based on an object type of each virtual object in the target virtual scene; The set of objects to be batched includes a plurality of virtual objects corresponding to the same object type; Based on the shader type corresponding to each virtual object in the set of objects to be batched, determining at least one group of objects to be batched; each group of objects to be batched includes multiple virtual objects corresponding to the same shader type in the set of objects to be batched; For each of the groups of objects to be combined, traverse the virtual objects in the group of objects to be combined, and when the traversed virtual objects in the group of objects to be combined meet a preset merging condition, merge the mesh data of the traversed virtual objects in the group of objects to be combined to obtain first merged mesh data; Generate a texture atlas based on the texture maps of each virtual object traversed in the group of objects to be batched, and adjust the texture coordinates of the first merged mesh data based on the areas respectively corresponding to each texture map in the texture atlas to obtain adjusted merged mesh data; Reconstructing the virtual object based on the adjusted merged grid data to obtain first reconstructed virtual object data; When the untraversed virtual objects in the group of objects to be combined meet the preset traversal conditions, the untraversed virtual objects are taken as the group of objects to be combined, and the step of traversing the virtual objects in the group of objects to be combined is performed until the untraversed virtual objects in the group of objects to be combined do not meet the preset traversal conditions.

2. The method according to claim 1, characterized in that The traversing of the virtual objects in the group of objects to be combined into a batch, and when the traversed virtual objects in the group of objects to be combined into a batch meet a preset merging condition, merging the mesh data of each traversed virtual object in the group of objects to be combined into a batch to obtain first merged mesh data includes: Traversing the virtual objects in the group of objects to be batched, and for the traversed current virtual object, determining new texture size information corresponding to the current virtual object based on texture atlas layout information and size information of the texture map corresponding to the current virtual object; Based on the new texture size information corresponding to the current virtual object, the current accumulated texture size information is updated; the current accumulated texture size information is the sum of the new texture size information corresponding to each virtual object traversed in the group of objects to be batched; In the case where the current virtual object is not the last virtual object in the group of objects to be merged, if the current accumulated texture size information exceeds the preset texture atlas size, merging the mesh data of each virtual object traversed in the group of objects to be merged to obtain the first merged mesh data; The batching instruction of the target virtual scene carries texture atlas configuration information, and the texture atlas configuration information includes the texture atlas layout information and the preset texture atlas size.

3. The method according to claim 2, characterized in that The method further comprises: In the case that the current virtual object is the last virtual object in the group of objects to be batched, the mesh data of the traversed virtual objects in the group of objects to be batched are merged to obtain the first merged mesh data.

4. The method according to claim 1, characterized in that The step of merging the mesh data of each virtual object that has been traversed in the group of objects to be batched to obtain first merged mesh data includes: Determining a first total number of mesh vertices based on mesh data of each virtual object that has been traversed in the group of objects to be batched; Based on the index buffer precision that matches the first total number of mesh vertices, the mesh volume data of each virtual object that has been traversed in the group of objects to be batched are merged to obtain the first merged mesh volume data.

5. The method according to any one of claims 1 to 4, characterized in that: The determining of the set of objects to be batched based on the object type of each virtual object in the target virtual scene comprises: Based on a first object type of each virtual object in the target virtual scene, the virtual objects in the target virtual scene are divided into at least one first virtual object set; the first object type represents the layer to which the virtual object belongs; For each of the first virtual object sets, based on the second object type of each virtual object in the first virtual object set, a target virtual object is selected from the first virtual object set to form a second virtual object set; the second object type representation of the target virtual object is baked; Based on the texture mapping properties of each virtual object in the second virtual object set, the second virtual object set is divided into a third virtual object set and a fourth virtual object set; wherein the texture mapping properties of each virtual object in the third virtual object set represent that the texture mapping is a non-tiled texture, and the texture mapping properties of each virtual object in the fourth virtual object set represent that the texture mapping is a tiled texture; Any of the third virtual object sets is used as the set of objects to be batched.

6. The method according to claim 5, characterized in that The method further comprises: Dividing virtual objects corresponding to the same material in the fourth virtual object set into a group to obtain at least one virtual object group to be processed; For each of the virtual object groups to be processed, when the number of virtual objects in the virtual object group to be processed exceeds a preset number threshold, determining a second total number of mesh vertices based on mesh data of each virtual object in the virtual object group to be processed; Based on the index buffer precision matching the second total number of mesh vertices, merging the mesh volume data of each virtual object in the to-be-processed virtual object group to obtain second merged mesh volume data; A virtual object is reconstructed based on the second merged mesh data to obtain second reconstructed virtual object data.

7. The method according to claim 2, characterized in that Before determining the set of objects to be batched based on the object type of each virtual object in the target virtual scene in response to the batching instruction for the target virtual scene, the method further includes: In response to a batch configuration instruction triggered by a static scene resource of the target virtual scene, a target batch editing interface is displayed; the target batch editing interface includes a texture atlas layout configuration area and a texture atlas size configuration area; Based on the texture atlas layout information input in the texture atlas layout configuration area and the preset texture atlas size input in the texture atlas size configuration area, a batching instruction for the target virtual scene is generated.

8. The method according to claim 7, characterized in that The target batch editing interface also includes an optimization information display area, and the optimization information display area is used to display optimization evaluation index data before and after batching.

9. The method according to claim 1, characterized in that: After obtaining the first reconstructed virtual object data, the method further includes: The original mesh data of the traversed virtual objects in the group of objects to be batched are deleted.

10. The method according to claim 1, characterized in that After obtaining the first reconstructed virtual object data, the method further includes: In response to a batch cancel instruction for the target virtual scene, the batch operation on the target virtual scene is canceled.

11. A data processing device, characterized in that: include: The object set determining unit is configured to execute a batching instruction for a target virtual scene, and determine a set of objects to be batched based on the object type of each virtual object in the target virtual scene; the set of objects to be batched includes a plurality of virtual objects corresponding to the same object type; The object grouping unit is configured to determine at least one group of objects to be batched based on the shader type corresponding to each virtual object in the set of objects to be batched; each of the groups of objects to be batched includes multiple virtual objects corresponding to the same shader type in the set of objects to be batched; a batching operation unit configured to perform, for each of the to-be-batch-combined object groups, traversing the virtual objects in the to-be-batch-combined object group, and merging the mesh data of the traversed virtual objects in the to-be-batch-combined object group when the traversed virtual objects in the to-be-batch-combined object group meet a preset merging condition, to obtain first merged mesh data; Generate a texture atlas based on the texture maps of each virtual object traversed in the group of objects to be batched, and adjust the texture coordinates of the first merged mesh data based on the areas respectively corresponding to each texture map in the texture atlas to obtain adjusted merged mesh data; Reconstructing the virtual object based on the adjusted merged grid data to obtain first reconstructed virtual object data; The loop unit is configured to execute, when the virtual objects that have not been traversed in the group of objects to be batched meet the preset traversal condition, take the untraversed virtual objects as the group of objects to be batched, and execute the step of traversing the virtual objects in the group of objects to be batched until the untraversed virtual objects in the group of objects to be batched do not meet the preset traversal condition.

12. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the data processing method according to any one of claims 1 to 10.

13. A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data processing method according to any one of claims 1 to 10.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 10 is implemented.