A method and device for model rendering

By combining and indexing the data of the animation model, the combined batch rendering of the animation model is solved, and the excessive processor burden caused by the increase of multiple characters and devices in the animation is improved, and the operation efficiency and user experience of the animation are improved.

CN112669418BActive Publication Date: 2025-05-09BEIJING PIXEL SOFTWARE TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011532448.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-22
Publication Date
2025-05-09
Estimated Expiration
2040-12-22

AI Technical Summary

Technical Problem

The increase in multiple characters and accompanying devices in the animation causes excessive processor burden, resulting in reduced game frame rates and poor user experience.

Method used

By obtaining data sets of different types of models to be rendered, combining data and creating index data, and sending rendering instructions to the image processor to realize batch rendering, reducing the number of renderings.

Benefits of technology

Improve the running efficiency of animations, reduce the running burden of the processor, and improve the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112669418B_ABST
    Figure CN112669418B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a method and device for model rendering, the method comprising: the method of the embodiment of the present application obtains model data sets of at least two different types of models to be rendered respectively, wherein the data sets include at least: vertex data, index data and bone matrix data, and the data sets are used to characterize the target state of each type of the at least two different types of models to be rendered; merges the data sets of the models to obtain merged data, wherein the merged data includes the data sets of the models and the index data corresponding to the data sets of the models; sends rendering instructions and merged data to an image processor, wherein the rendering instructions include at least the vertex data and the index data in the merged data, which can reduce the running burden of the processor and improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of rendering, and specifically to a method and device for model rendering. Background Art

[0002] In the related technology, the characters in the animation are indispensable modules. Each character will be equipped with equipment through the hanging points, and each equipment needs to be submitted for rendering to make the animation enter the next frame. However, there will be many characters in the animation, and the number of attached equipment will increase. However, as the number of submissions for rendering increases, the frame rate of the game will be reduced, which will increase the burden on the processor and cause problems such as lag.

[0003] Therefore, how to reduce the operating burden of the processor and improve the user experience has become an urgent problem to be solved. Summary of the invention

[0004] Embodiments of the present application provide a method and device for model rendering. Through some embodiments of the present application, at least batch rendering of different types of skeletal animation models can be achieved, reducing the number of rendering submissions, thereby improving the running efficiency of the animation, reducing the running burden of the processor, and improving the user experience.

[0005] In a first aspect, an embodiment of the present application provides a method for model rendering, the method comprising: respectively obtaining model data sets of at least two different types of models to be rendered, wherein the data sets include at least vertex data, index data and bone matrix data, and the data sets are used to characterize the target state of each type of the at least two different types of models to be rendered; merging the data sets of the models to obtain merged data, wherein the merged data includes the data sets of the models and the index data corresponding to the data sets of the models; and sending a rendering instruction to an image processor, wherein the rendering instruction includes at least the vertex data and the index data in the merged data.

[0006] Therefore, the embodiment of the present application can realize batch rendering of different types of skeletal animation models through a model rendering method, reduce the number of rendering submissions, thereby improving the running efficiency of the animation, reducing the running burden of the processor, and improving the user experience.

[0007] In combination with the first aspect, in one implementation, the index data is used to index the vertex data corresponding to the models.

[0008] Therefore, the embodiment of the present application can make the vertex data correspond to each model during the rendering process by establishing index data.

[0009] In combination with the first aspect, in one implementation, the vertex data is obtained by copying each vertex data of each model.

[0010] Therefore, the embodiment of the present application copies the vertex data of each model and puts each vertex data into the merged data.

[0011] In combination with the first aspect, in one embodiment, the merged data also includes an index number corresponding to each vertex data; the index number is obtained in the following manner: the order of the vertices of the first model is directly used as the index number of the first model in the vertex data; starting from the second model, the sum of the number of vertices of all models before the current model is recorded as N, and the index number of the current model is the order of the vertices of the current model plus N, where N is an integer greater than or equal to 1.

[0012] Therefore, the embodiment of the present application can quickly find the vertex data corresponding to each model in the merged data by establishing corresponding index numbers for the vertex data, thereby reducing the number of searches by the processor, thereby reducing the operating burden and speeding up the operating speed.

[0013] In combination with the first aspect, in one embodiment, the merged data includes: the vertex data and the index data corresponding to the vertex data; after merging the data sets of the models to obtain the merged data, the method also includes: recording the model serial number of the models in the merged data; creating a texture array, storing the texture of the models in the texture array, and recording the texture serial number corresponding to the models; creating a bone matrix array, calculating the bone matrix data corresponding to the models according to the coordinates, orientation and scaling in the local space to obtain new bone matrix data, storing the new bone matrix data in the bone matrix array, and recording the bone serial number corresponding to the models; creating a parameter array, storing the material parameters corresponding to the models in the parameter array, and recording the parameter serial number corresponding to the models.

[0014] Therefore, the embodiment of the present application establishes an array to store the data of each model and establishes a serial number, so that the bone matrix data, texture, material parameters, etc. corresponding to each model can be quickly found in the merged data, thereby reducing the number of searches of the processor, thereby reducing the operating burden and speeding up the operating speed.

[0015] In combination with the first aspect, in one embodiment, the vertex data includes a batch number corresponding to each vertex data, and the batch number is obtained in the following manner: the batch number composed of the model number, the texture number, the starting number in the bone number and the parameter number is stored in each vertex data; sending a rendering instruction to the image processor includes: sending the rendering instruction, the merged data and the batch number to the image processor.

[0016] Therefore, the embodiment of the present application establishes a batch number for each vertex in the vertex data. After submitting the rendering, it can use the batch number of each vertex to quickly find the rendering data from each array and render multiple types of models at a time, thereby improving the running efficiency of the animation, reducing the running burden of the processor, and improving the user experience.

[0017] In combination with the first aspect, in one implementation, before obtaining the data sets of each of at least two different types of models to be rendered, the method further includes: creating rendering material parameters for the at least two different types of models to be rendered.

[0018] Therefore, the embodiment of the present application can unify the rendering material standards by unifying the rendering material parameters of each model to be rendered, thereby speeding up the rendering process.

[0019] In a second aspect, an embodiment of the present application provides a model rendering method, the method comprising: receiving a rendering instruction, wherein the rendering instruction includes at least vertex data and index data in the merged data; obtaining rendering data in a data set of each model according to the vertex data and a batch sequence number corresponding to the vertex data, wherein the rendering data includes at least bone matrix data; using the rendering data to perform a batch rendering on at least two different types of models to be rendered to obtain a rendering model.

[0020] In a third aspect, an embodiment of the present application provides a model rendering device, comprising: an acquisition module, a merging module and a sending module; the acquisition module is configured to respectively acquire each model data set of at least two different types of models to be rendered, wherein the data set includes at least: vertex data, index data and bone matrix data, and the data set is used to characterize the target state of each type of the at least two different types of models to be rendered; the merging module is configured to merge the data sets of the models to obtain merged data, wherein the merged data includes the data sets of the models and the index data corresponding to the data sets of the models; the sending module is configured to send rendering instructions and merged data to an image processor, wherein the rendering instructions include at least the vertex data and the index data in the merged data.

[0021] In combination with the third aspect, in one implementation, the index data is used to index the vertex data corresponding to each model.

[0022] In combination with the third aspect, in one implementation, the vertex data is obtained by copying each vertex data of each model.

[0023] In combination with the third aspect, in one embodiment, the merged data also includes an index number corresponding to each vertex data; the index number is obtained in the following manner: the order of the vertices of the first model is directly used as the index number of the first model in the vertex data; starting from the second model, the sum of the number of vertices of all models before the current model is recorded as N, and the index number of the current model is the order of the vertices of the current model plus N, where N is an integer greater than or equal to 1.

[0024] In combination with the third aspect, in one embodiment, the merged data includes: the vertex data and the index data corresponding to the vertex data; the merging module is specifically configured to: record the model serial number of each model in the merged data; create a texture array, store the texture of each model in the texture array, and record the texture serial number corresponding to each model; create a bone matrix array, calculate the bone matrix data corresponding to each model according to the coordinates, orientation and scaling in the local space to obtain new bone matrix data, store the new bone matrix data in the bone matrix array, and record the bone serial number corresponding to each model; create a parameter array, store the material parameters corresponding to each model in the parameter array, and record the parameter serial number corresponding to each model.

[0025] In combination with the third aspect, in one embodiment, the vertex data includes a batch number corresponding to each vertex data, and the batch number is obtained in the following manner: the batch number composed of the model number, the texture number, the starting number in the bone number and the parameter number is stored in each vertex data; sending a rendering instruction to the image processor includes: sending the rendering instruction, the merged data and the batch number to the image processor.

[0026] In combination with the third aspect, in one implementation, the acquisition module is configured to: create rendering material parameters for the at least two different types of models to be rendered.

[0027] In a fourth aspect, an embodiment of the present application provides a device for model rendering, comprising: a receiving module, a reading module and a rendering module; the receiving module is configured to receive rendering instructions, wherein the rendering instructions include at least vertex data and index data in the merged data; the reading module is configured to read the rendering data in the data set of each model according to the vertex data and the batch sequence number corresponding to the vertex data, wherein the rendering data includes at least bone matrix data; the rendering module is configured to use the rendering data to perform a batch rendering on at least two different types of models to be rendered to obtain a rendering model.

[0028] In the fifth aspect, an embodiment of the present application provides a central processing unit, comprising: a processing module, a storage module and a bus, wherein the processing module is connected to the storage module via the bus, and the storage module stores computer-readable instructions. When the computer-readable instructions are executed by the processing module, they are used to implement the method described in the first aspect and all its embodiments.

[0029] In the sixth aspect, an embodiment of the present application provides an image processor, comprising: a processing module, a storage module and a bus, wherein the processing module is connected to the storage module via the bus, and the storage module stores computer-readable instructions. When the computer-readable instructions are executed by the processing module, they are used to implement the method described in the second aspect.

[0030] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a server, any of the above-described methods is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 is a system diagram of model rendering shown in an embodiment of the present application;

[0032] Figure 2 is a flow chart of a model rendering method shown in an embodiment of the present application;

[0033] Figure 3 is a flow chart of another model rendering method shown in an embodiment of the present application;

[0034] Figure 4 It is an internal module of a model rendering device shown in an embodiment of the present application;

[0035] Figure 5 It is another internal module of a model rendering device shown in an embodiment of the present application;

[0036] Figure 6 It is an internal module of the central processing unit shown in the embodiment of the present application;

[0037] Figure 7 It is an internal module of the image processor shown in the embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0039] The method steps in the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0040] The implementation of this application can be applied to scenes of multiple model renderings. For example, these scenes include scenes in which each sports character is accompanied by multiple weapons in the model rendering of three-dimensional games, and each weapon requires a weapon model to render. In the case where there are too many three-dimensional game characters and the number of weapons to be rendered is increasing, the processor uses different types of weapon models to render weapons (i.e., obtains data sets of each model of at least two different types of models to be rendered respectively). In the process of each weapon rendering, at least one rendering must be submitted. If there are too many characters, the game frame rate will be reduced and the user experience will be poor. Therefore, the inventor of this application has found that the model rendering method provided by some embodiments of this application can realize the batch rendering of different types of skeletal animation models, reduce the number of submission renderings, thereby improving the running efficiency of the animation, reducing the running burden of the processor, and improving the user experience. For example, in the scene of rendering weapons, the method in the embodiment of this application can be used to use the merged data to perform a batch rendering of at least two different types of models to be rendered to obtain a rendered animation. It is understandable that the application scenario of the embodiment of this application is not limited to this.

[0041] In the related technology, the characters in the animation are essential modules. Each character will have equipment attached through the hanging point, and each equipment needs to be submitted for rendering to make the animation enter the next frame. However, there will be many characters in the animation, and the number of attached equipment will increase. However, as the number of submissions for rendering increases, the frame rate of the game will be reduced, the burden on the processor will be increased, and problems such as freezes will occur. Therefore, how to reduce the operating burden of the processor and improve the user experience has become an urgent problem to be solved.

[0042] In view of the above problems, an embodiment of the present application provides a method and device for model rendering, the method comprising: The method of the embodiment of the present application obtains model data sets of at least two different types of models to be rendered respectively, wherein the data sets at least include: vertex data, index data and bone matrix data, and the data sets are used to characterize the target state of each type of the at least two different types of models to be rendered; merges the data sets of the models to obtain merged data, wherein the merged data includes the data sets of the models and the index data corresponding to the data sets of the models; sends rendering instructions and merged data to an image processor, wherein the rendering instructions at least include the vertex data and the index data in the merged data.

[0043] The following will be combined Figure 1 Describe a system for model rendering, such as Figure 1 As shown, Figure 1 It is a model rendering system in an embodiment of the present application, including: a data acquisition server 110 and a rendering server 140, wherein the data acquisition server 110 uses a central processing unit 120 to execute a program to obtain merged data, and the rendering server 140 can use an image processor 130 to merge and render the merged data obtained from the data acquisition server 110. The central processing unit is used to execute the data sets of each model of at least two different types of models to be rendered respectively; merge the data sets of each model to obtain merged data; and send rendering instructions to the image processor. The image processor is used to execute the rendering instructions sent by the central processing unit; according to the vertex data and the batch sequence number corresponding to the vertex data, the rendering data in the data set of each model is obtained; and the rendering data is used to perform a batch rendering on at least two different types of models to be rendered to obtain a rendering model.

[0044] Combine the following Figure 2 The steps of implementing a method for model rendering performed by the processing data acquisition server 110 are described in detail, such as Figure 2 The steps shown include:

[0045] S210: Obtain model data sets of at least two different types of models to be rendered respectively.

[0046] In one implementation, rendering material parameters are created for the at least two different types of models to be rendered.

[0047] Before obtaining data sets of at least two different types of models to be rendered, the central processing unit unifies the rendering material parameters required for rendering the weapon. The number of textures and the number of parameters in the rendering material are fixed. The rendering material used in each animation has the same texture and parameters, and the textures are of the same size. For example, all types of base textures are 512*512 in size, and normal maps are 256*256 in size. The total number of all base textures does not exceed 256.

[0048] It should be noted that the base map represents the color, pattern or design of the model to be rendered; the normal map represents the bump information, flatness and light intensity with the rendered animation.

[0049] It should be noted that the rendering material parameters may include multiple materials, including base maps and normal maps, and may also include highlight maps, etc., but the embodiments of the present application are not limited to this.

[0050] Therefore, the embodiment of the present application can unify the rendering material standards by unifying the rendering material parameters of each model to be rendered, thereby speeding up the rendering process.

[0051] In one embodiment, model data sets of at least two different types of models to be rendered are respectively obtained, wherein the data sets include at least: vertex data, index data and bone matrix data, and the data sets are used to characterize the target state of each type of the at least two different types of models to be rendered.

[0052] When the game is running, the CPU creates a base map array, a normal map array, and a rendering material array to store the corresponding data in the subsequent data merging step.

[0053] After the above array is created, vertex data, bone matrix data and index data of at least two different types of models to be rendered are obtained, wherein the data set obtained for each model may also include the above-mentioned base map, normal map, etc. The obtained data set may be changed according to actual conditions, but the embodiments of the present application are not limited to this.

[0054] The above describes the process of the central processor obtaining the data sets of each model of at least two different types of models to be rendered respectively. The following describes the process of merging the data sets of the models to obtain merged data.

[0055] S220, merging the data sets of the models to obtain merged data.

[0056] In one embodiment, the data sets of the models are merged to obtain merged data, wherein the merged data includes the data sets of the models and the index data corresponding to the data sets of the models;

[0057] After the data sets of each model are acquired, the data sets of each model are merged. During the merging process, the index data is used to index the vertex data corresponding to each model.

[0058] Therefore, the embodiment of the present application can make the vertex data correspond to each model during the rendering process by establishing index data.

[0059] In one embodiment, the vertex data in the data set of each model is obtained by copying the vertex data of each model.

[0060] In one embodiment, the merged data also includes an index number corresponding to each vertex data; the index number is obtained in the following manner: the order of the vertices of the first model is directly used as the index number of the first model in the vertex data; starting from the second model, the sum of the number of vertices of all models before the current model is recorded as N, and the index number of the current model is the order of the vertices of the current model plus N, where N is an integer greater than or equal to 1.

[0061] The central processing unit creates a new overall rendering model in the process of merging data, and directly copies the vertex data of each model in the data set of each model into the overall rendering model. For the index number corresponding to the vertex data, the sorting of the vertex data of the first model is firstly used as the index number of the first model in the vertex data, and then starting from the second model, the sum of the number of vertices of all the models before the current model is recorded as N, and the index number of the current model is the sorting of the vertices of the current model plus N.

[0062] For example, there are two models, A and B. The vertex data of model A are 1, 2 and 3, and the vertex data of model B are P, D and F. A new overall rendering model C is created. The vertex data of A and B are first put into C. Then the vertex data in C are 1, 2, 3, P, D and F. Then the vertex data in C are arranged with index numbers. Since there are 3 vertex data in A, the order of the vertex data in B is added with 3, and the corresponding order of the vertex data in C is 1, 2, 3, 4, 5, 6. Therefore, through the index number, you can find that the vertices at positions 1, 2 and 3 belong to model A, and the vertices at positions 4, 5 and 6 belong to model B.

[0063] It should be noted that, in the process of merging data, a new overall rendering model can be submitted for batch rendering, or the merged data can be directly submitted for batch rendering.

[0064] Therefore, the embodiment of the present application can quickly find the vertex data corresponding to each model in the merged data by establishing corresponding index numbers for the vertex data, thereby reducing the number of searches by the processor, thereby reducing the operating burden and speeding up the operating speed.

[0065] In one embodiment, the merged data includes: the vertex data and the index data corresponding to the vertex data; after merging the data sets of the models to obtain the merged data, the method also includes: recording the model serial number of the models in the merged data; creating a texture array, storing the textures of the models in the texture array, and recording the texture serial numbers corresponding to the models; creating a bone matrix array, calculating the bone matrix data corresponding to the models according to the coordinates, orientation and scaling in the local space to obtain new bone matrix data, storing the new bone matrix data in the bone matrix array, and recording the bone serial numbers corresponding to the models; creating a parameter array, storing the material parameters corresponding to the models in the parameter array, and recording the parameter serial numbers corresponding to the models.

[0066] Create a texture array, including a base texture array and a normal texture array, put the texture of each model into the created texture array, record the texture sequence number of the texture array, and map the texture elements in the texture array to the corresponding models according to the texture sequence number.

[0067] For example: Model A contains stickers Figure 1 Hetie Figure 2 , Model B contains stickers Figure 3 Hetie Figure 4 , paste Figure 1 ,stick Figure 2 , added to the texture array, all marked as 1, indicating that the texture Figure 1 Hetie Figure 2 For the texture of model A, Figure 3 Hetie Figure 4 Marked as 2, indicating paste Figure 3 Hetie Figure 4 This is the texture of model B.

[0068] Create a bone matrix array, the size of the array is the sum of the number of bones of each model, calculate according to the coordinates, orientation and scaling in the local space, obtain new bone matrix data, store the new bone matrix data in the bone matrix array, record the bone serial numbers corresponding to the models, mark the index numbers of the n bone matrices of the first model as 0, and starting from the second model, the index numbers of the bone matrices are marked as the sum of the number of bones of the previous model.

[0069] For example: Model A is affected by 5 bones, and there are 5 elements in the bone matrix. The vertex values ​​of model A are marked as 0, and the vertex values ​​of model B are marked as 5. The starting serial number of each model's bone matrix is ​​used as the bone serial number between each bone matrix and the model, and so on. If there are more models, the starting serial number of each item is the sum of the number of bones of all previous models.

[0070] Create a parameter array, where the parameter array stores the base color, normal strength, etc. in the rendering material. It can also store other parameters such as highlight intensity. The embodiments of the present application are not limited to this. The parameters of the base color and normal strength of each model are merged in the parameter array, and the parameter serial number is recorded.

[0071] Therefore, the embodiment of the present application establishes an array to store the data of each model and establishes a serial number, so that the bone matrix data, texture, material parameters, etc. corresponding to each model can be quickly found in the merged data, thereby reducing the number of searches of the processor, thereby reducing the operating burden and speeding up the operating speed.

[0072] In one embodiment, the vertex data includes a batch number corresponding to each vertex data, and the batch number is obtained in the following manner: the batch number composed of the model number, the texture number, the starting number in the bone number and the parameter number is stored in each vertex data; sending a rendering instruction to the image processor includes: sending the rendering instruction, the merged data and the batch number to the image processor.

[0073] In the overall rendering model, a batch number is established for each vertex. The batch number can contain 4 values. The first value is the model number corresponding to each model, the second is the starting number of the bone matrix corresponding to each model, the third value is the texture number corresponding to each model, and the fourth value is the parameter number corresponding to each model.

[0074] It should be noted that the batch serial number may include serial numbers corresponding to each model, serial numbers corresponding to the bone matrix array and serial numbers corresponding to the texture array, and may also include serial numbers corresponding to the parameter array, etc., which can be determined based on the actual rendering situation, and the embodiments of the present application are not limited to this.

[0075] For example: there are two models, A and B, that need to be batch rendered. In the total rendering model, the index numbers of the vertices of A are 1, 2, and 3, and the index numbers of the vertices of B are 4, 5, and 6. Now, the batch numbers of the six vertices are established respectively. Taking vertex 1 as an example, vertex 1 has 4 batch numbers. Since vertex 1 belongs to model A, the first value is "A"; the second value is the starting number of the bone matrix of model A. Since model A is the first of all models, the bone matrix is ​​marked as 0, so the starting number is also 0, so the second value is "0"; the third value is the corresponding texture, so in accordance with the above method of creating a texture array, the third value is the texture of A, so the third value is "1"; the fourth value corresponds to the parameter. So in the same way, the fourth value is "1", so the batch number of vertex 1 in model A is (A, 0, 1, 1).

[0076] Therefore, the embodiment of the present application establishes a batch number for each vertex in the vertex data. After submitting the rendering, it can use the batch number of each vertex to quickly find the rendering data from each array and render multiple types of models at a time, thereby improving the running efficiency of the animation, reducing the running burden of the processor, and improving the user experience.

[0077] S230, sending a rendering instruction to the image processor.

[0078] In one embodiment, a rendering instruction is sent to a graphics processor, wherein the rendering instruction includes at least the vertex data and the index data in the merged data.

[0079] After executing S210 and S220, the central processing unit submits and sends rendering instructions to the image processor. The submitted rendering instructions include vertex data, index data, batch number, texture array, bone matrix array, and parameter array in the merged data; the rendering instructions may also only include vertex data and batch number in the merged data, and the remaining arrays are stored in registers in the central processing unit.

[0080] Therefore, the embodiment of the present application can realize batch rendering of different types of skeletal animation models through a model rendering method, reduce the number of rendering submissions, thereby improving the running efficiency of the animation, reducing the running burden of the processor, and improving the user experience. The above describes a model rendering method in detail, and the following describes another model rendering method.

[0081] S310, receiving a rendering instruction sent by a central processing unit.

[0082] In one implementation, a rendering instruction sent by a central processing unit is received, wherein the rendering instruction at least includes vertex data and index data in the merged data.

[0083] The image processor receives rendering instructions sent by the central processing unit, wherein the rendering instructions received by the image processor may include vertex data, index data, batch number, texture array, bone matrix array, and parameter array in the merged data included in the submitted rendering instructions; the rendering instructions may also only include vertex data and batch number in the merged data, and the remaining arrays are stored in registers in the central processing unit.

[0084] S320, obtaining rendering data in a data set of each model according to the vertex data and a batch sequence number corresponding to the vertex data.

[0085] In one embodiment, rendering data in a data set of each model is obtained based on the vertex data and a batch sequence number corresponding to the vertex data, wherein the rendering data at least includes bone matrix data.

[0086] After receiving the rendering instruction sent by the central processing unit, the image processor obtains the rendering data corresponding to the vertex from the rendering material array, map array, bone matrix array, and parameter array according to the batch number corresponding to each vertex in the vertex data.

[0087] S330: Use the rendering data to perform batch rendering on at least two different types of models to be rendered to obtain a rendering model.

[0088] After acquiring rendering data of different types of models to be rendered, the image processor batch renders the different types of models to be rendered to obtain a rendering model.

[0089] Therefore, the embodiment of the present application can realize batch rendering of different types of skeletal animation models through a model rendering method, reduce the number of rendering submissions, thereby improving the running efficiency of the animation, reducing the running burden of the processor, and improving the user experience.

[0090] The above describes a method of model rendering in detail. Figure 4 and Figure 5 Describes a device for model rendering.

[0091] like Figure 4 As shown, a model rendering device includes: an acquisition module 410, a merging module 420 and a sending module 430.

[0092] In one embodiment, the embodiment of the present application provides a model rendering device, comprising: an acquisition module, a merging module and a sending module; the acquisition module is configured to respectively acquire each model data set of at least two different types of models to be rendered, wherein the data set includes at least: vertex data, index data and bone matrix data, and the data set is used to characterize the target state of each type of the at least two different types of models to be rendered; the merging module is configured to merge the data sets of the models to obtain merged data, wherein the merged data includes the data sets of the models and the index data corresponding to the data sets of the models; the sending module is configured to send rendering instructions and merged data to an image processor, wherein the rendering instructions include at least the vertex data and the index data in the merged data.

[0093] In one embodiment, the index data is used to index the vertex data corresponding to the models.

[0094] In one implementation, the vertex data is obtained by copying each vertex data of each model.

[0095] In one embodiment, the merged data also includes an index number corresponding to each vertex data; the index number is obtained in the following manner: the order of the vertices of the first model is directly used as the index number of the first model in the vertex data; starting from the second model, the sum of the number of vertices of all models before the current model is recorded as N, and the index number of the current model is the order of the vertices of the current model plus N, where N is an integer greater than or equal to 1.

[0096] In one embodiment, the merged data includes: the vertex data and the index data corresponding to the vertex data; the merging module is specifically configured to: record the model serial number of each model in the merged data; create a texture array, store the texture of each model in the texture array, and record the texture serial number corresponding to each model; create a bone matrix array, calculate the bone matrix data corresponding to each model according to the coordinates, orientation and scaling in the local space to obtain new bone matrix data, store the new bone matrix data in the bone matrix array, and record the bone serial number corresponding to each model; create a parameter array, store the material parameters corresponding to each model in the parameter array, and record the parameter serial number corresponding to each model.

[0097] In one embodiment, the vertex data includes a batch number corresponding to each vertex data, and the batch number is obtained in the following manner: the batch number composed of the model number, the texture number, the starting number in the bone number and the parameter number is stored in each vertex data; sending a rendering instruction to the image processor includes: sending the rendering instruction, the merged data and the batch number to the image processor.

[0098] In one embodiment, the acquisition module is configured to: create rendering material parameters for the at least two different types of models to be rendered.

[0099] In the embodiments of the present application, Figure 4 The modules shown can achieve Figure 1 , Figure 2 The process in the method embodiment. Figure 4 The operations and / or functions of each module in Figure 1 , Figure 2 For details, please refer to the description in the above method embodiment. To avoid repetition, detailed description is appropriately omitted here.

[0100] like Figure 5 As shown, a model rendering device includes: a receiving module 510, a reading module 520 and a rendering module 530.

[0101] In one implementation, the present application provides a model rendering device, comprising: a receiving module, a reading module and a rendering module; the receiving module is configured to receive a rendering instruction, wherein the rendering instruction includes at least vertex data and index data in the merged data; the reading module is configured to read the rendering data in the data set of each model according to the vertex data and the batch sequence number corresponding to the vertex data, wherein the rendering data includes at least bone matrix data; the rendering module is configured to use the rendering data to perform a batch rendering on at least two different types of models to be rendered to obtain a rendering model. In the present application embodiment, Figure 5 The modules shown can achieve Figure 1 , Figure 3 The process in the method embodiment. Figure 5 The operations and / or functions of each module in Figure 1 , Figure 3 For details, please refer to the description in the above method embodiment. To avoid repetition, detailed description is appropriately omitted here.

[0102] The above describes a model rendering device. Figure 6 and Figure 7A central processing unit and an image processing unit are described.

[0103] like Figure 6 As shown, a central processing unit includes a processing module 610 , a storage module 620 and a bus 630 .

[0104] In one embodiment, an embodiment of the present application provides a central processing unit, including: a processing module, a storage module and a bus, the processing module is connected to the storage module via the bus, the storage module stores computer-readable instructions, and when the computer-readable instructions are executed by the processing module, they are used to implement any one of the methods applied to all embodiments of the central processing unit. For details, please refer to the description in the above method embodiments. To avoid repetition, the detailed description is appropriately omitted here.

[0105] like Figure 7 As shown, an image processor includes a processing module 710 , a storage module 720 and a bus 730 .

[0106] In one embodiment, the embodiment of the present application provides an image processor, including: a processing module, a storage module and a bus, the processing module is connected to the storage module via the bus, the storage module stores computer-readable instructions, and when the computer-readable instructions are executed by the processing module, they are used to implement any one of the methods applied to all embodiments of the image processor. For details, please refer to the description in the above method embodiments. To avoid repetition, the detailed description is appropriately omitted here.

[0107] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a server, any of the above-mentioned methods is implemented. For details, please refer to the description in the above-mentioned method embodiments. To avoid repetition, the detailed description is appropriately omitted here.

[0108] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0109] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for model rendering, characterized in that: The method comprises: Respectively obtaining each model data set of at least two different types of models to be rendered, wherein the data set at least includes: vertex data, index data and bone matrix data, and the data set is used to characterize the target state of each type of the at least two different types of models to be rendered; Merging the data sets of the models to obtain merged data, wherein the merged data includes the data sets of the models and the index data corresponding to the data sets of the models; Sending a rendering instruction to an image processor, wherein the rendering instruction at least includes the vertex data and the index data in the merged data; After merging the data sets of the models to obtain merged data, the method further includes: Recording the model sequence number of each model in the merged data; Create a texture array, store the textures of each model in the texture array, and record the texture serial number corresponding to each model; Create a bone matrix array, calculate the bone matrix data corresponding to each model according to the coordinates, orientation and scaling in the local space to obtain new bone matrix data, store the new bone matrix data in the bone matrix array, and record the bone serial numbers corresponding to each model; A parameter array is created, the material parameters corresponding to the models are stored in the parameter array, and the parameter serial numbers corresponding to the models are recorded.

2. The method according to claim 1, characterized in that The index data is used to index the vertex data corresponding to the models.

3. The method according to claim 2, characterized in that The vertex data is obtained by copying the vertex data of each model.

4. The method according to claim 3, characterized in that The merged data also includes index numbers corresponding to the vertex data; The index number is obtained in the following manner: The order of the vertices of the first model is directly used as the index number of the first model in the vertex data; Starting from the second model, the sum of the numbers of vertices of all models before the current model is recorded as N, and the index number of the current model is the order of the vertices of the current model plus N, where N is an integer greater than or equal to 1.

5. The method according to claim 4, characterized in that The merged data includes: the vertex data and the index data corresponding to the vertex data.

6. The method according to claim 5, characterized in that The vertex data includes a batch sequence number corresponding to each vertex data, and the batch sequence number is obtained in the following manner: The batch number composed of the model number, the texture number, the starting number in the bone number and the parameter number is stored in each vertex data; The sending of the rendering instruction to the image processor comprises: The rendering instruction, the merged data and the batch sequence number are sent to an image processor.

7. The method according to claim 1, characterized in that Before obtaining the data sets of at least two different types of models to be rendered, the method further includes: Creating rendering material parameters for the at least two different types of models to be rendered.

8. A method for model rendering, characterized in that: The method comprises: Receive a rendering instruction, wherein the rendering instruction includes at least vertex data and index data in the merged data, and the merged data includes a data set of each model and the index data corresponding to the data set of each model; According to the vertex data and the batch sequence number corresponding to the vertex data, rendering data in the data set of each model is obtained, wherein the rendering data at least includes bone matrix data; wherein the data set at least includes: vertex data, index data and bone matrix data, and the data set is used to characterize the target state of each type of model to be rendered in the at least two different types; Using the rendering data, batch rendering is performed on at least two different types of models to be rendered to obtain a rendering model; After receiving the rendering instruction, the method further includes: Recording the model sequence number of each model in the merged data; Create a texture array, store the textures of each model in the texture array, and record the texture serial number corresponding to each model; Create a bone matrix array, calculate the bone matrix data corresponding to each model according to the coordinates, orientation and scaling in the local space to obtain new bone matrix data, store the new bone matrix data in the bone matrix array, and record the bone serial numbers corresponding to each model; A parameter array is created, the material parameters corresponding to the models are stored in the parameter array, and the parameter serial numbers corresponding to the models are recorded.

9. A device for model rendering, characterized in that: include: Get module, merge module and send module; The acquisition module is configured to respectively acquire model data sets of at least two different types of models to be rendered, wherein the data sets at least include: vertex data, index data and bone matrix data, and the data sets are used to characterize the target state of each type of the at least two different types of models to be rendered; The merging module is configured to merge the data sets of the models to obtain merged data, wherein the merged data includes the data sets of the models and the index data corresponding to the data sets of the models; The sending module is configured to send a rendering instruction and merged data to the image processor, wherein the rendering instruction at least includes the vertex data and the index data in the merged data; After merging the data sets of the models to obtain the merged data, the method further includes: Recording the model sequence number of each model in the merged data; Create a texture array, store the textures of each model in the texture array, and record the texture serial number corresponding to each model; Create a bone matrix array, calculate the bone matrix data corresponding to each model according to the coordinates, orientation and scaling in the local space to obtain new bone matrix data, store the new bone matrix data in the bone matrix array, and record the bone serial numbers corresponding to each model; A parameter array is created, the material parameters corresponding to the models are stored in the parameter array, and the parameter serial numbers corresponding to the models are recorded.

10. A device for model rendering, characterized in that: include: Receiving module, reading module and rendering module; The receiving module is configured to receive a rendering instruction, wherein the rendering instruction at least includes vertex data and index data in the merged data, and the merged data includes a data set of each model and the index data corresponding to the data set of each model; The reading module is configured to read rendering data in a data set of each model according to the vertex data and a batch sequence number corresponding to the vertex data, wherein the rendering data at least includes bone matrix data; wherein the data set at least includes: vertex data, index data and bone matrix data, and the data set is used to characterize the target state of each type of model to be rendered in the at least two different types; The rendering module is configured to use the rendering data to perform batch rendering on at least two different types of models to be rendered to obtain a rendering model; After receiving the rendering instruction, the method further includes: Recording the model sequence number of each model in the merged data; Create a texture array, store the textures of each model in the texture array, and record the texture serial number corresponding to each model; Create a bone matrix array, calculate the bone matrix data corresponding to each model according to the coordinates, orientation and scaling in the local space to obtain new bone matrix data, store the new bone matrix data in the bone matrix array, and record the bone serial numbers corresponding to each model; A parameter array is created, the material parameters corresponding to the models are stored in the parameter array, and the parameter serial numbers corresponding to the models are recorded.

Citation Information

Patent Citations

  • Batch rendering method, device and system for skeletal animations and storage medium

    CN109840931A