Data processing method, device, electronic device and storage medium

By integrating and baking multiple baking objects, generating integrated light maps and splitting them, the problem of low baking lighting information in the prior art is solved, and a more efficient baking process is achieved.

CN112734898BActive Publication Date: 2025-02-28TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110078123.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-20
Publication Date
2025-02-28
Estimated Expiration
2041-02-28

AI Technical Summary

Technical Problem

In the prior art, the efficiency of baking lighting information is low, and it is necessary to improve the efficiency of baking.

Method used

By obtaining multiple baking objects, performing integration processing to generate integrated baking objects, generating baking instructions, baking the integrated baking objects into integrated light maps, and splitting the integrated light maps to obtain the corresponding lighting maps for each baking object.

Benefits of technology

Improve the baking efficiency and make full use of the computing unit of the graphics processor to avoid waste caused by the computing unit being in an idle state.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112734898B_ABST
    Figure CN112734898B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a data processing method, device, electronic device and storage medium; the embodiment of the present invention can obtain multiple baking objects, where the baking object is an object used to store lighting information in a three-dimensional space; integrate the multiple baking objects to obtain an integrated baking object; generate baking instructions for the integrated baking object; bake the integrated baking object into an integrated lighting map based on the baking instructions for the integrated baking object; split the integrated lighting map to obtain a lighting map corresponding to each baking object. In the embodiment of the present invention, after integrating the multiple baking objects into one baking object, the graphics processor bakes the integrated baking object. Since more computing units are required when processing the integrated baking object, the computing units of the graphics processor can be fully utilized to avoid the computing units being wasted in an idle state. Therefore, this solution can improve the efficiency of baking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Simulating the basic properties of light in real life (such as reflection, refraction, diffraction, etc.) is an important research direction in computer graphics. For example, the lighting effect can be achieved by baking the scene's lighting information onto the model map. The lighting information can include not only the lighting color information of the model surface, but also the light penetration relationship information between models.

[0003] However, the efficiency of baking lighting information is currently low, so improving the efficiency of baking is an urgent problem to be solved. Summary of the invention

[0004] Embodiments of the present invention provide a data processing method, device, electronic device, and storage medium, which can improve baking efficiency.

[0005] An embodiment of the present invention provides a data processing method, including:

[0006] Obtain multiple baking objects, where the baking objects are objects used to store lighting information in a three-dimensional space;

[0007] Integrate multiple baking objects to obtain an integrated baking object;

[0008] generating baking instructions for the integrated baking object;

[0009] Baking the integrated baking object into an integrated light map based on a baking instruction for the integrated baking object;

[0010] The integrated light map is split to obtain the light map corresponding to each baked object.

[0011] An embodiment of the present invention further provides a data processing device, including:

[0012] An acquisition unit, used to acquire a plurality of baking objects, where the baking objects are objects used to store lighting information in a three-dimensional space;

[0013] An integration unit, used for integrating a plurality of baking objects to obtain an integrated baking object;

[0014] A generating unit, used for generating a baking instruction for an integrated baking object;

[0015] A baking unit, based on a baking instruction for the integrated baking object, bakes the integrated baking object into an integrated light map;

[0016] The splitting unit splits the integrated light map to obtain the light map corresponding to each baked object.

[0017] In some embodiments, the object storing the illumination information is a texture map of the model, and the integrated baking object is an integrated texture map; the integration unit is specifically used for:

[0018] Get the preset image size, and get the image size of the texture image;

[0019] Sorting the texture maps according to their image sizes to obtain a sorted texture map group;

[0020] The texture maps in the sorted texture map group are integrated according to a preset image size to obtain an integrated texture map.

[0021] In some embodiments, the texture images in the sorted texture image group are integrated according to a preset image size to obtain an integrated texture image, and the integration unit is specifically used to:

[0022] When there is a texture map in the sorted texture map group, a blank map of a preset image size is generated;

[0023] Insert the texture maps in the sorted texture map group into the blank map to obtain an integrated texture map.

[0024] In some embodiments, the integration unit is specifically used to:

[0025] Get the current texture map, which is the texture map that is being prepared to insert a blank map;

[0026] Insert the current texture map into the blank map;

[0027] When the current texture map is successfully inserted into the blank map, the insertion success process is executed;

[0028] When the current texture fails to be inserted into the blank map, the insertion failure processing is performed.

[0029] In some embodiments, the integration unit is specifically used to:

[0030] Delete the current texture map from the sorted texture map group;

[0031] Determines the next texture map in the sorted texture map group as the current texture map.

[0032] In some embodiments, the integration unit is specifically used to:

[0033] Determine the next texture map in the sorted texture map group;

[0034] When there is a next texture map in the sorted texture map group, determining that the next texture map in the sorted texture map group is the current texture map, and returning to execute the step of obtaining the current texture map;

[0035] When the next texture map does not exist in the sorted texture map group, return to execute the step of generating a blank map of a preset image size when the texture map exists in the sorted texture map group.

[0036] In some embodiments, the integration unit is specifically used to:

[0037] Determine the texture space utilization rate according to the preset image size and the image size of the texture image in the blank texture;

[0038] When the texture space utilization is greater than the utilization threshold, the process returns to the step of generating a blank texture of a preset image size when there is a texture in the sorted texture group.

[0039] In some embodiments, the integration unit is specifically used to:

[0040] Return to the step of generating a blank map of a preset image size when a texture map exists in the sorted texture map group.

[0041] In some embodiments, the data processing apparatus is further configured to:

[0042] The preset image size is determined based on the number of threads of a graphics processor that is used to bake the integrated texture map.

[0043] In some embodiments, the object storing the illumination information is an illumination sample, which is the spatial position of multiple illumination information sampling points in a three-dimensional space, and the integrated baking object is an integrated illumination sample; the integration unit is specifically used for:

[0044] Arrange multiple illumination samples linearly into a group to obtain integrated illumination samples.

[0045] In some embodiments, the data processing apparatus is further configured to:

[0046] Determine the position of the baked object in the integrated baked object;

[0047] storing a mapping relationship between a baking object and a position of the baking object in the integrated baking object;

[0048] The split unit is specifically used for:

[0049] According to the mapping relationship between the baking object and the position of the baking object in the integrated baking object, the integrated lighting map is split to obtain the lighting map corresponding to the baking object.

[0050] In some embodiments, the baking unit is specifically used for:

[0051] Sending the baking instruction and the integrated baking object to a server equipped with a graphics processor, so that the server uses the graphics processor to bake the integrated baking object into an integrated light map based on the baking instruction;

[0052] Receives the integrated lightmap from the server.

[0053] An embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute steps in any one of the data processing methods provided in the embodiments of the present invention.

[0054] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for a processor to load to execute the steps in any one of the data processing methods provided by the embodiments of the present invention.

[0055] The embodiment of the present invention can obtain multiple baking objects, which are objects used to store lighting information; integrate the multiple baking objects to obtain an integrated baking object; generate baking instructions for the integrated baking object; based on the baking instructions for the integrated baking object, bake the integrated baking object into an integrated lighting map; split the integrated lighting map to obtain a lighting map corresponding to each baking object.

[0056] In the present invention, since the texture maps of multiple models can be integrated into a large texture map, and then the integrated texture map is baked to obtain a lighting map storing the lighting information of multiple models; then the lighting map is split to obtain the lighting map corresponding to each model; therefore, the graphics processor can bake the texture maps of multiple models at one time; similarly, the lighting samples in the three-dimensional space can be linearly arranged and the arranged lighting samples can be baked, so the graphics processor can bake multiple lighting samples at one time; from the above, when the graphics processor bakes multiple texture maps or multiple lighting samples at one time, more computing units are required for processing, so the computing units of the graphics processor can be fully utilized to avoid the waste caused by the computing units being in an idle state, so that this solution can improve the baking efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0058] Figure 1ais a schematic diagram of a scenario of a data processing method provided by an embodiment of the present invention;

[0059] Figure 1b It is a flowchart of a data processing method provided by an embodiment of the present invention;

[0060] Figure 1c is a schematic diagram of a texture map of a model provided by an embodiment of the present invention;

[0061] Figure 1d is a schematic diagram of the distribution of illumination information sampling points provided by an embodiment of the present invention;

[0062] Figure 1e is a schematic diagram of a texture image in a blank map provided by an embodiment of the present invention;

[0063] Figure 2a is a flowchart of another data processing method provided by an embodiment of the present invention;

[0064] Figure 2b is a schematic diagram of a user interface of a terminal device provided by an embodiment of the present invention;

[0065] Figure 2c It is a schematic diagram of an integration process provided by an embodiment of the present invention;

[0066] Figure 2d is a schematic diagram of another integration process provided by an embodiment of the present invention;

[0067] Figure 3 is a flowchart of another data processing method provided by an embodiment of the present invention;

[0068] Figure 4 is a structural schematic diagram of a data processing device provided by an embodiment of the present invention;

[0069] Figure 5 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0070] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0071] Embodiments of the present invention provide a data processing method, device, electronic device and storage medium.

[0072] The data processing device may be integrated in an electronic device, which may be a terminal, a server, etc. The terminal may be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, or a personal computer (PC).

[0073] In some embodiments, the data processing device may also be integrated into multiple electronic devices, for example, the data processing device may be integrated into a terminal device and a server, and the terminal device and the server jointly implement the data processing method of the present invention. The server may be a single server or a server cluster composed of multiple servers.

[0074] For example, refer to Figure 1a , Figure 1a Schematic diagram of a scenario of a data processing method provided by an embodiment of the present invention. The scenario of the data processing method may include a terminal device and a server. Figure 1a In the embodiment, the terminal device can obtain multiple baking objects, which are objects used to store lighting information in a three-dimensional space. The terminal device integrates the multiple baking objects to obtain an integrated baking object. The terminal device generates a baking instruction for the integrated baking object. The terminal device sends the baking instruction and the integrated baking object to a server, which is equipped with a graphics processor, so that the server uses the graphics processor to bake the integrated baking object into an integrated lighting map based on the baking instruction; the terminal device receives the integrated lighting map from the server. The terminal device splits the integrated lighting map to obtain a lighting map corresponding to each baking object.

[0075] In the embodiment of the present invention, the terminal device integrates multiple baking objects into one baking object, and the graphics processor then bakes the integrated baking object; baking the integrated baking object requires more computing units to process, which can make full use of the computing units of the graphics processor, and try to make the graphics processor run at full capacity, avoiding the computing units being idle and wasted. Therefore, this solution can improve the efficiency of baking.

[0076] It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.

[0077] In this embodiment, a data processing method based on data processing is provided, such as Figure 1b As shown, the specific process of the data processing method can be as follows:

[0078] 101. Get multiple baking objects.

[0079] Among them, the baking object is an object used to store lighting information in a three-dimensional space. The object may include but is not limited to the texture map and lighting samples of the model; the basic models such as characters, scenes and buildings in the three-dimensional space are all implemented based on the three-dimensional stereo model; the lighting information may include information about the light irradiating the model surface, information about the light penetration between models, and information about the light passing through the blank space in the scene. It should be noted that in the embodiment of the present invention, multiple refers to two or more, that is, multiple baking objects refer to two or more baking objects.

[0080] In some embodiments, the object storing the illumination information is a texture map of a model. The model may be a basic model such as a person, scene, or building in a three-dimensional space. Figure 1c , which is a schematic diagram of a texture map of a model provided by an embodiment of the present invention, Figure 1c (I) in the figure is used to represent the texture map of a cone when the model is a cone; Figure 1c (ii) is used to represent the texture map of a ball when the model is a ball. The implementation method of the terminal device obtaining the texture map of the model is not limited; optionally, the texture map of the role model can be customized according to the actual application situation, for example, the texture map of the role model can be customized according to the role requirements of the established role model.

[0081] In some embodiments, the object storing the illumination information is an illumination sample, which is the spatial position of a plurality of illumination information sampling points in a three-dimensional space. Figure 1d FIG. 1 is a schematic diagram showing the distribution of illumination information sampling points provided by an embodiment of the present invention. Figure 1d Each sphere 100 represents a lighting information sampling point, and the lighting conditions on the spherical surface of the sphere can be used to represent the changes in lighting information. The lighting samples can be the spatial positions corresponding to 4×4×4 lighting information sampling points. The specific implementation method for the terminal device to obtain the lighting samples is not limited; for example, the terminal device can obtain a bounding box specified by the user, divide the bounding box into multiple blocks according to the user configuration, and subdivide each block into one to thousands of units (Bricks) formed by 4×4×4 lighting information sampling points according to the different scene complexities of the position of each block in the three-dimensional space, thereby obtaining lighting samples.

[0082] 102. Integrate multiple baking objects to obtain an integrated baking object.

[0083] Among them, the integrated baking object may include but is not limited to integrated texture maps and integrated lighting samples; the integrated baking object is a representation form after multiple baking objects are integrated, for example, the integrated texture map is a representation form after the texture maps of multiple models are integrated, and the integrated lighting sample is a representation form after multiple lighting samples are integrated.

[0084] In some embodiments, the object storing the illumination information is a texture map of a model, and the integrated baking object is an integrated texture map; the terminal device integrates the texture maps of multiple models to obtain a specific implementation of the integrated texture map, which may include but is not limited to the following steps:

[0085] (i) Obtaining a preset image size and an image size of a texture map.

[0086] The preset image size is the image size of the integrated texture map. Optionally, the image size can be customized according to actual application conditions, for example, according to a graphics processing unit (GPU) used to bake the integrated texture map.

[0087] The terminal device obtains the image size of the texture map, which can be determined by the corresponding model. It should be noted that texture maps are generally square, and most of them use several specific image sizes. Different image sizes are usually in multiples. For example, the image sizes of common texture maps are 8×8, 16×16, 32×32, 64×64, 128×128 pixels, etc.

[0088] Optionally, before obtaining the preset image size, the terminal device determines the preset image size according to the number of threads of the graphics processor. Taking a graphics processor with 72 computing units (Streaming Multiprocessor, SM) as an example, each computing unit can be resident (Resident) at most 2048 threads at the same time, so the number of fully loaded threads that the graphics processor can support is 72×2048=147456. Since texture images are generally square, and generally one thread can process one pixel, 147456=384×384, that is, images with a size of 384×384 pixels or more can make the graphics processor run at full load; therefore, the preset image size can be 256×256, 512×512 and 1024×1024.

[0089] (ii) sorting the texture maps according to their image sizes to obtain a sorted texture map group.

[0090] The sorted texture map group includes a plurality of ordered texture maps. Optionally, the texture maps are sorted from large to small according to their image size to obtain the sorted texture map group; the texture maps can also be sorted from small to large according to their image size to obtain the sorted texture map group; this is not limited in the embodiment of the present invention.

[0091] (iii) Integrating the texture images in the sorted texture image group according to a preset image size to obtain an integrated texture image.

[0092] There is no limitation on the specific implementation method of integrating the texture images in the sorted texture image group according to the preset image size, and may include but is not limited to the following implementation methods.

[0093] In one implementation, when there is a texture map in the sorted texture map group, the terminal device generates a blank map of a preset image size; the terminal device inserts the texture map in the sorted texture map group into the blank map to obtain an integrated texture map. When there is no texture map in the sorted texture map group, the integration process of the texture maps in the sorted texture map group ends.

[0094] The blank map can be a blank image, i.e., an image with image size but empty pixel values, where the pixel values ​​include the position and color value of each pixel. The blank map is used to make the integrated texture map a regular image when integrating multiple texture maps, for example, a square image.

[0095] It should be noted that, since there are multiple texture maps in the sorted texture map group, and the image size of the blank map is fixed; therefore, when there are texture maps in the sorted texture map group, the texture map integration process is an iterative process, and multiple integrated texture maps will be obtained in the end. Here, only the texture map integration process is used as an example to illustrate.

[0096] ⑴The terminal device generates a blank map of a preset image size.

[0097] It should be noted that each time a blank map is generated, the terminal device may determine the first texture map in the sorted texture map group as the current texture map.

[0098] (2) The terminal device obtains the current texture map. The current texture map is used to indicate the texture map in the sorted texture map group that is about to be inserted with a blank map; for example, the current texture map and other texture maps to be inserted can be distinguished by marking the texture map. Generally, there is only one current texture map in the sorted texture map group.

[0099] ⑶ The terminal device inserts the current texture image into the blank map. The terminal device inserts the current texture image into the blank map according to the preset image size and the rule that the texture images are closely connected; for example, see Figure 1e , is a schematic diagram of a texture image in a blank map provided by an embodiment of the present invention. Figure 1eAs shown in the figure, when inserting the first texture image S1 into the blank map, S1 can be inserted into the upper left corner of the blank map, and its boundary coincides with the boundary of the blank map; when inserting the second texture image S2, the left boundary of S2 coincides with the right boundary of S1, and so on. When inserting a texture image in the first row will exceed the boundary of the blank map, a new row is started to continue inserting the texture image.

[0100] (4) When the current texture image is successfully inserted into the blank map, the insertion success processing is executed.

[0101] When the current texture map is successfully inserted into the blank map, the terminal device deletes the current texture map from the sorted texture map group; then determines that the texture map of the next texture map in the sorted texture map group is the current texture map; and obtains the next texture map, inserts the texture map into the blank map, and returns to execute step (2), thereby forming a loop. It should be noted that when the terminal device cannot obtain the next texture map, it determines whether there are still texture maps in the sorted texture map group. When there are texture maps in the sorted texture map group, the terminal device generates a blank map of a preset image size and enters the next integration process. When there are no texture maps in the sorted texture map group, the integration process ends.

[0102] ⑸ When the current texture image fails to be inserted into the blank map, execute the insertion failure processing.

[0103] Among them, failure to insert the current texture map into the blank map is used to indicate that inserting the current texture map into the blank map will exceed the boundary of the blank map, so the current map is not inserted into the blank map; the current map is still in the sorted texture map group and can wait for the next integration process to be inserted into the blank map generated by the next integration process.

[0104] The specific implementation methods of insert failure processing are not limited, and include but are not limited to the following methods.

[0105] Method 1: When the current texture fails to be inserted into the blank map, the next texture in the sorted texture group is determined.

[0106] When there is a next texture map in the sorted texture map group, the next texture map in the sorted texture map group is determined to be the current texture map, and the step of obtaining the current texture map is returned to be executed. For example, the next texture map is marked as the current texture map, and the terminal device obtains the next texture map and inserts the texture map into the blank map, that is, returns to execute step (2), thereby forming a loop.

[0107] When there is no next texture map in the sorted texture map group, the process returns to the step of generating a blank map of a preset image size when there is a texture map in the sorted texture map group, that is, entering the next integration process.

[0108] In summary, when the current texture fails to be inserted into the blank map, the terminal device can obtain textures with a smaller image size than the current texture from the sorted textures in descending order of image size, and determine whether they can be inserted into the blank map until there is no texture with a smaller image size in the sorted texture group. Therefore, the number of textures inserted into the blank map can be as large as possible, that is, the same number of textures can generate the least integrated textures.

[0109] Method 2: Before determining the next texture map in the sorted texture map group, the texture space utilization rate can also be determined according to the preset image size and the image size of the texture map in the blank map. The texture map in the blank map is used to indicate the texture map that is successfully inserted into the blank map, and the texture space utilization rate is used to indicate the ratio of the image size of the texture map in the blank map to the preset image size.

[0110] For example, suppose there are n texture images S1, S2, ... Sn in the blank map, and their image sizes are D1×D1, D2×D2, ..., D n ×D n , the texture space utilization can be obtained by the following formula:

[0111]

[0112] Among them, E p Indicates the texture space utilization rate; D i represents the image size of the i-th texture image; D p ×D p Image size representing a blank texture.

[0113] When the texture space utilization is greater than the utilization threshold, the process returns to the step of generating a blank texture of a preset image size when there is a texture in the sorted texture group; when the texture space utilization is not greater than the utilization threshold, the insertion failure processing described in method 1 is performed. The utilization threshold can be customized according to the actual application, for example, it is set to 0.9; that is, when the texture space utilization is greater than 0.9, the next integration process is performed, and when the texture space utilization is not greater than 0.9, the insertion failure processing described in method 1 is performed.

[0114] In summary, when the current texture fails to be inserted into the blank texture, the terminal device first determines the texture space utilization. When the texture space utilization is greater than the utilization threshold, it enters the next integration process. Otherwise, it obtains the texture from the sorted texture map in descending order according to the image size, and determines whether it can be inserted into the blank texture. Therefore, the integration process can be performed without taking too long while ensuring a good texture space utilization.

[0115] Method 3: when the current texture fails to be inserted into the blank map, the process returns to the step of generating a blank map of a preset image size when there is a texture in the sorted texture group; that is, when the current texture fails to be inserted into the blank map, the process directly proceeds to the next integration process. Therefore, the time consumed by the integration process can be minimized.

[0116] In one implementation, the terminal device may also splice the texture maps in the sorted texture map group, and limit the image size of the spliced ​​texture map to be no larger than the preset image size. The spliced ​​texture map is inserted into the blank map to form a regular integrated texture map. Therefore, multiple texture maps can be spliced ​​into a large integrated texture map, which is convenient for subsequent baking of the integrated texture map.

[0117] Optionally, during the integration process, the texture space utilization rate when each integrated texture map is obtained may be recorded, and the texture space utilization rate may be used as one of the evaluation criteria for the integration process.

[0118] In some embodiments, the object storing illumination information is an illumination sample, and the illumination sample is the spatial position of multiple illumination information sampling points in three-dimensional space, and the integrated baking object is an integrated illumination sample; the multiple illumination samples are integrated and processed to obtain the specific implementation method of the integrated illumination sample, and the terminal device linearly arranges the multiple illumination samples into a group to obtain an integrated illumination sample. Among them, multiple illumination samples refer to two or more illumination samples, and the number of illumination samples is obtained according to the number of illumination information sampling points in the bounding box specified by the user. For example, the distribution of illumination information sampling points in three-dimensional space can be regarded as a tree-like distribution. In this embodiment, according to the common illumination information sampling points between illumination samples, the distribution of the tree-like illumination information sampling points is arranged into a linear distribution to obtain an integrated illumination sample.

[0119] 103. Generate baking instructions for the integrated baking object.

[0120] The baking instruction is used to call the graphics processor to bake the integrated baking object. The integrated baking object can refer to the integrated baking object described in step 102 above, and can include but is not limited to integrated texture maps and integrated lighting samples, which will not be repeated here.

[0121] 104. Based on the baking instructions for the integrated baking object, bake the integrated baking object into an integrated light map.

[0122] Among them, baking is the pre-calculation process of global illumination (GI), which shows the combined effect of direct and indirect lighting.

[0123] The integrated light map may include but is not limited to an integrated two-dimensional light map and an integrated volumetric light map. The integrated two-dimensional light map is a two-dimensional light map obtained by baking an integrated texture map, and the integrated two-dimensional light map stores the lighting information of multiple models; the integrated volumetric light map is a volumetric light map obtained by baking an integrated lighting sample, and the integrated volumetric light map stores the lighting information of multiple lighting samples.

[0124] In some embodiments, the terminal device sends a baking instruction and an integrated baking object to a server, and the server is equipped with a graphics processor, so that the server uses the graphics processor to bake the integrated baking object into an integrated lighting map based on the baking instruction; the terminal device receives the integrated lighting map from the server. For example, the terminal device sends an integrated texture map and a baking instruction for the integrated texture map to the server, and the server uses the graphics processor to bake the integrated texture map into an integrated two-dimensional lighting map based on the baking instruction; or the terminal device sends an integrated lighting sample and a baking instruction for the integrated lighting sample to the server, and the server uses the graphics processor to bake the integrated lighting sample into an integrated volumetric lighting map based on the baking instruction.

[0125] In some embodiments, if the terminal device is equipped with a graphics processor, the graphics processor of the terminal device may also be used to bake the integrated baking object into an integrated lighting map, which is not limited in the embodiments of the present invention. For example, the terminal device uses the graphics processor to bake the integrated texture map into an integrated two-dimensional lighting map based on the baking instruction; or the terminal device uses the graphics processor to bake the integrated lighting sample into an integrated volumetric lighting map based on the baking instruction.

[0126] Therefore, in the process of the graphics processor baking the integrated texture map or the integrated lighting samples, the number of times the graphics processor is called can be reduced because multiple texture maps are integrated into a large texture map, and multiple lighting samples are integrated into a large lighting sample before baking; and each baking process of the graphics processor requires more computing cores to process the integrated texture maps and lighting samples, so that the graphics processor makes full use of the computing units of the graphics processor, to a certain extent avoids the situation where some computing units are wasted due to being in an idle state, and improves the baking efficiency.

[0127] 105. Split the integrated illumination map to obtain the illumination map corresponding to each baked object.

[0128] Among them, the light map may include but is not limited to a two-dimensional light map (Light Map) and a volumetric light map (Volumetric Light Map). The two-dimensional light map may be a texture map that stores lighting information and can be applied to the surface of the model; the texture map is a map represented by the arrangement of texels, and the texel is a texture element; the lighting information is information about the light irradiating the surface of the model in the scene and the information about the light penetration between models, that is, the lighting information baked at each position on the surface of the model is stored in the corresponding texel in the two-dimensional light map. The volumetric light map may be a light probe (Light Probe) distributed in a three-dimensional space. A light probe represents a lighting sample at a spatial position in a three-dimensional space, and the lighting information baked by the light sample is stored in the light probe. The light probe can store information about the blank space in the three-dimensional scene where light passes.

[0129] When integrating multiple baking objects, the terminal device can determine the position of the baking object in the integrated baking object, and then store the mapping relationship between the baking object and the position of the baking object in the integrated baking object. After the terminal device obtains the illumination map, it can split the integrated illumination map according to the mapping relationship between the baking object and the position of the baking object in the integrated baking object to obtain the illumination map corresponding to the baking object.

[0130] For example, each model's texture map has a corresponding identifier. After determining the position of the texture map in the integrated texture map, a mapping relationship between the texture map identifier and the texture map's position in the integrated texture map is established, and the mapping relationship is stored in a table. For example, the mapping relationship can be stored in a storage medium such as a cache or memory of a terminal device. When the terminal device obtains the illumination map, since the baking process does not change the position of the texture map, the terminal device can obtain the mapping relationship, and according to the position of the texture map in the integrated texture map and the texture map identifier in the mapping relationship, the illumination map corresponding to each texture map is split from the integrated illumination map to obtain the illumination map corresponding to each texture map.

[0131] The embodiment of the present invention can obtain multiple baking objects, which are objects used to store lighting information; integrate the multiple baking objects to obtain an integrated baking object; generate baking instructions for the integrated baking object; based on the baking instructions for the integrated baking object, bake the integrated baking object into an integrated lighting map; split the integrated lighting map to obtain a lighting map corresponding to each baking object.

[0132] From the above, it can be seen that since the texture maps of multiple models can be integrated into a large texture map, and then the integrated texture map is baked to obtain a lighting map that stores the lighting information of multiple models; then the lighting map is split to obtain the lighting map corresponding to each model; therefore, the graphics processor can bake the texture maps of multiple models at one time; similarly, the lighting samples in the three-dimensional space can be linearly arranged and the arranged lighting samples can be baked, so the graphics processor can bake multiple lighting samples at one time; from the above, when the graphics processor bakes multiple texture maps or multiple lighting samples at one time, more computing units are required for processing, so the computing units of the graphics processor can be fully utilized to avoid the waste caused by the computing units being in an idle state, so that this solution can improve the baking efficiency.

[0133] The data processing solution provided by the embodiment of the present invention can be applied to various lighting baking scenes in three-dimensional space. For example, take the lighting baking scene of a three-dimensional game as an example; in this scene, the baking object can be the texture map of the three-dimensional model in the game, such as the texture map of the game character, props, building and other models; the baking object can also be the lighting sample in the game scene, such as the spatial position of multiple lighting information sampling points in the three-dimensional space of the game scene.

[0134] According to the above Figure 1b The method described in the embodiment will be further described in detail below with respect to the lighting baking scene of a three-dimensional game.

[0135] In this embodiment, the terminal device is installed with a game engine, and the graphics processor has 72 computing units.

[0136] like Figure 2a As shown, when the baking object is a texture map of a three-dimensional model in a game, a specific process of a data processing method is as follows:

[0137] 201. Obtain texture maps of multiple three-dimensional models.

[0138] The texture maps of multiple three-dimensional models refer to texture maps of two or more three-dimensional models. For example, the texture maps of the multiple three-dimensional models may be texture maps of n game characters, where n is a positive integer greater than 2.

[0139] 202. Integrate the texture maps of multiple three-dimensional models to obtain an integrated texture map.

[0140] The terminal device obtains the preset image size. For example, Figure 2bis a schematic diagram of a user interface of a terminal device provided by an embodiment of the present invention. As shown in the figure, a user can select whether to integrate the texture map in the user interface provided by the game engine of the terminal device. If the user selects to integrate, the preset image size can be set. The selectable image sizes are 256, 512 and 1024. The terminal device responds to the user's operation and obtains the preset image size.

[0141] The terminal device starts the integration process. The terminal device sorts multiple texture maps according to the image size from large to small to obtain a sorted texture map group. The terminal device determines whether there is a texture map in the sorted texture map group. If there is no texture map, the integration process is terminated; if there is a texture map, a blank map of a preset image size is generated. The terminal device obtains the current texture map and inserts the current texture map into the blank map. If the insertion is successful, the current texture map is deleted from the sorted texture map group, the next texture map is determined to be the current texture map, and the step of returning to obtain the current texture map is returned. Furthermore, if the insertion fails, the following implementation method can be referred to.

[0142] In some embodiments, Figure 2c As shown, if the insertion fails, the current texture map is not processed; then it is determined whether there is a next texture map in the current texture map. If there is a next texture map, the next texture map is determined as the current texture map, and the step of inserting the current texture map into the blank map is returned to execute; if there is no next texture map, the step of generating a blank map of a preset image size is returned to execute. During the integration process of the terminal device, when the current texture map fails to be inserted into the blank map, a texture map with a smaller image size than the current texture map is obtained to determine whether it can be inserted into the blank map, thereby improving the utilization rate of the map space.

[0143] In some embodiments, Figure 2d As shown, if the insertion fails, the step of generating a blank texture of a preset image size is returned. When the terminal device fails to insert a blank texture into the current texture image during the integration process, the next integration process is entered, that is, a new blank texture is generated, which can shorten the integration process time.

[0144] A more specific implementation of step 202 may refer to the method described in step 102, which is only briefly explained here.

[0145] 203. Generate a first baking instruction for the integrated texture map, wherein the first baking instruction is not an instruction for invoking a graphics processor to bake the integrated texture map.

[0146] 204. Based on the first baking instruction for the integrated texture map, bake the integrated texture map into an integrated two-dimensional light map. The terminal device sends the first baking instruction and the integrated texture map to the server, and the server is equipped with a graphics processor, so that the server uses the graphics processor to bake the integrated texture map into the integrated two-dimensional light map based on the first baking instruction; the terminal device receives the integrated two-dimensional light map from the server.

[0147] 205. Split the integrated two-dimensional illumination map to obtain a two-dimensional illumination map corresponding to the texture map of each model.

[0148] The two-dimensional illumination map may store illumination information in the form of a texture map, and when rendering a three-dimensional model in a game, the texture map may be applied to the surface of the three-dimensional model.

[0149] like Figure 3 As shown, when the baking object is a lighting sample in a game scene, the specific process of a data processing method is as follows:

[0150] 301. Obtain multiple illumination samples.

[0151] The multiple illumination samples refer to two or more illumination samples. The number of illumination samples is obtained according to the number of illumination information sampling points in the bounding box specified by the user, so the user does not need to configure the size of the integrated illumination samples.

[0152] 302. Integrate the multiple illumination samples to obtain an integrated illumination sample. The terminal device linearly arranges the multiple illumination samples into a group to obtain an integrated illumination sample.

[0153] 303. Generate a second baking instruction for the integrated illumination sample, wherein the second baking instruction is not used to call an instruction for a graphics processor to bake the integrated illumination sample.

[0154] 304. Based on the second baking instruction for the integrated illumination sample, bake the integrated illumination sample into an integrated volumetric illumination map. The terminal device sends the second baking instruction and the integrated illumination sample to the server, and the server is equipped with a graphics processor, so that the server uses the graphics processor to bake the integrated illumination sample into the integrated volumetric illumination map based on the second baking instruction; the terminal device receives the integrated volumetric illumination map from the server.

[0155] 305. Split the integrated volumetric illumination map to obtain a volumetric illumination map corresponding to each illumination sample.

[0156] The volumetric light map may be stored in the form of a light probe. For example, when a game character moves to an area corresponding to a light sample, the surface of the character may display the light information in the volumetric light map corresponding to the light sample.

[0157] The embodiment of the present invention can obtain multiple baking objects, which are objects used to store lighting information; integrate the multiple baking objects to obtain an integrated baking object; generate baking instructions for the integrated baking object; based on the baking instructions for the integrated baking object, bake the integrated baking object into an integrated lighting map; split the integrated lighting map to obtain a lighting map corresponding to each baking object.

[0158] From the above, it can be seen that since the texture maps of multiple models can be integrated into a large texture map, and then the integrated texture map is baked to obtain a lighting map that stores the lighting information of multiple models; then the lighting map is split to obtain the lighting map corresponding to each model; therefore, the graphics processor can bake the texture maps of multiple models at one time; similarly, the lighting samples in the three-dimensional space can be linearly arranged and the arranged lighting samples can be baked, so the graphics processor can bake multiple lighting samples at one time; from the above, when the graphics processor bakes multiple texture maps or multiple lighting samples at one time, more computing units are required for processing, so the computing units of the graphics processor can be fully utilized to avoid the waste caused by the computing units being in an idle state, so that this solution can improve the baking efficiency.

[0159] In order to better implement the above method, an embodiment of the present invention further provides a data processing device, which can be integrated in an electronic device, and the electronic device can be a terminal, a server, etc. Among them, the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a personal computer, etc.; the server can be a single server or a server cluster composed of multiple servers.

[0160] For example, in this embodiment, a data processing device specifically integrated in a personal computer is taken as an example, and the personal computer may be equipped with a graphics processor to describe the method of the embodiment of the present invention in detail.

[0161] For example, Figure 4 As shown, the data processing device may include an acquisition unit 401, an integration unit 402, a generation unit 403, a baking unit 404, and a splitting unit 405, as follows:

[0162] (I) Acquisition Unit 401

[0163] The acquisition unit 401 is used to acquire a plurality of baking objects, where the baking objects are objects used to store lighting information in a three-dimensional space.

[0164] (II) Integration Unit 402

[0165] The integration unit 402 is used to integrate multiple baking objects to obtain an integrated baking object.

[0166] In some embodiments, the object storing the illumination information is a texture map of the model, and the integrated baking object is an integrated texture map; the integration unit 402 is specifically used for:

[0167] Get the preset image size, and get the image size of the texture image;

[0168] Sorting the texture maps according to their image sizes to obtain a sorted texture map group;

[0169] The texture maps in the sorted texture map group are integrated according to a preset image size to obtain an integrated texture map.

[0170] In some embodiments, the texture images in the sorted texture image group are integrated according to a preset image size to obtain an integrated texture image. The integration unit 402 is specifically used to:

[0171] When there is a texture map in the sorted texture map group, a blank map of a preset image size is generated;

[0172] Insert the texture maps in the sorted texture map group into the blank map to obtain an integrated texture map.

[0173] In some embodiments, the integration unit 402 is specifically configured to:

[0174] Get the current texture map, which is the texture map in the sorted texture map group where a blank map is being inserted;

[0175] Insert the current texture map into the blank map;

[0176] When the current texture map is successfully inserted into the blank map, the insertion success process is executed;

[0177] When the current texture fails to be inserted into the blank map, the insertion failure processing is performed.

[0178] In some embodiments, the integration unit 402 is specifically configured to:

[0179] Delete the current texture map from the sorted texture map group;

[0180] Determine that the next texture map in the sorted texture map group is the current texture map, and return to execute the step of obtaining the current texture map.

[0181] In some embodiments, the integration unit 402 is specifically configured to:

[0182] Determine the next texture map in the sorted texture map group;

[0183] When there is a next texture map in the sorted texture map group, determining the next texture map in the sorted texture map group as the current texture map;

[0184] When there is no next texture map in the sorted texture map group, return to execute the step of generating a blank map of a preset image size when there is a texture map in the sorted texture map group.

[0185] In some embodiments, the integration unit 402 is specifically configured to:

[0186] Determine the texture space utilization rate according to the preset image size and the image size of the texture image in the blank texture;

[0187] When the texture space utilization is greater than the utilization threshold, the process returns to the step of generating a blank texture of a preset image size when there is a texture in the sorted texture group.

[0188] In some embodiments, the integration unit 402 is specifically configured to:

[0189] Returns the step that is executed when a texture exists in the sorted texture group to generate a blank map of the preset image size.

[0190] In some embodiments, the object storing the illumination information is an illumination sample, which is the spatial position of multiple illumination information sampling points in the three-dimensional space, and the integrated baking object is the integrated illumination sample; the integration unit 402 is specifically used for:

[0191] Arrange multiple illumination samples linearly into a group to obtain integrated illumination samples.

[0192] (III) Integration Unit 402

[0193] The generating unit 403 is configured to generate a baking instruction for the integrated baking object.

[0194] (IV) Baking unit 404

[0195] The baking unit 404 bakes the integrated baking object into an integrated light map based on the baking instruction for the integrated baking object.

[0196] In some embodiments, the baking unit 404 is specifically used for:

[0197] Sending the baking instruction and the integrated baking object to a server equipped with a graphics processor, so that the server uses the graphics processor to bake the integrated baking object into an integrated light map based on the baking instruction;

[0198] Receives the integrated lightmap from the server.

[0199] (V) Split Unit 405

[0200] The splitting unit 405 splits the integrated illumination map to obtain an illumination map corresponding to each baking object.

[0201] In some embodiments, the data processing apparatus is further configured to:

[0202] The preset image size is determined based on the number of threads of a graphics processor that is used to bake the integrated texture map.

[0203] In some embodiments, the data processing apparatus is further configured to:

[0204] Determine the position of the baked object in the integrated baked object;

[0205] storing a mapping relationship between a baking object and a position of the baking object in the integrated baking object;

[0206] The splitting unit 405 is specifically used for:

[0207] According to the mapping relationship between the baking object and the position of the baking object in the integrated baking object, the integrated lighting map is split to obtain the lighting map corresponding to the baking object.

[0208] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0209] As can be seen from the above, the data processing device of this embodiment obtains multiple baking objects by the acquisition unit, and the baking object is an object used to store lighting information; the integration unit integrates the multiple baking objects to obtain an integrated baking object; the generation unit generates a baking instruction for the integrated baking object; the baking unit bakes the integrated baking object into an integrated lighting map based on the baking instruction for the integrated baking object; the splitting unit splits the integrated lighting map to obtain a lighting map corresponding to each baking object.

[0210] After integrating multiple baking objects into one baking object, the GPU bakes the integrated baking object. Since more computing units are needed to process the integrated baking object, the computing units of the GPU can be fully utilized to avoid the computing units being wasted in an idle state. Therefore, this solution can improve the baking efficiency.

[0211] The embodiment of the present invention further provides an electronic device, which may be a terminal, a server, or the like. The terminal may be a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, a personal computer, or the like; the server may be a single server or a server cluster composed of multiple servers, or the like.

[0212] In some embodiments, the data processing device may also be integrated into multiple electronic devices. For example, the data processing device may be integrated into multiple servers, and the data processing method of the present invention may be implemented by multiple servers.

[0213] In this embodiment, the terminal device of this embodiment is described in detail by taking the terminal device as an example. The terminal device is equipped with a graphics processor, such as Figure 5 As shown, it shows a schematic diagram of the structure of the terminal device involved in the embodiment of the present invention, specifically:

[0214] The terminal device may include one or more processors 501 of processing and computing units, one or more computer-readable storage media memories 502, a power supply 503, an input module 504, and a communication module 505. Those skilled in the art will appreciate that Figure 5 The terminal device structure shown in the figure does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0215] The processor 501 is the control center of the terminal device. It uses various interfaces and lines to connect various parts of the entire terminal device. By running or executing software programs and / or modules stored in the memory 502 and calling data stored in the memory 502, it executes various functions of the terminal device and processes data, thereby performing overall detection of the terminal device. In some embodiments, the processor 501 may include one or more processing and computing units; in some embodiments, the processor 501 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 501.

[0216] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 502 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 502 may also include a memory controller to provide the processor 501 with access to the memory 502.

[0217] The terminal device also includes a power supply 503 for supplying power to various components. In some embodiments, the power supply 503 can be logically connected to the processor 501 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 503 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.

[0218] The terminal device may further include an input module 504, which may 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.

[0219] The terminal device may also include a communication module 505. In some embodiments, the communication module 505 may include a wireless module. The terminal device may perform short-range wireless transmission through the wireless module of the communication module 505, thereby providing the user with wireless broadband Internet access. For example, the communication module 505 may be used to help the user send and receive emails, browse web pages, and access streaming media.

[0220] Although not shown, the terminal device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 501 in the terminal device will load the executable files corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 501 will run the application programs stored in the memory 502, thereby realizing various functions, as follows:

[0221] Obtain multiple baking objects, where the baking objects are objects used to store lighting information in a three-dimensional space;

[0222] Integrate multiple baking objects to obtain an integrated baking object;

[0223] generating baking instructions for the integrated baking object;

[0224] Baking the integrated baking object into an integrated light map based on a baking instruction for the integrated baking object;

[0225] The integrated light map is split to obtain the light map corresponding to each baked object.

[0226] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0227] Since the terminal device can integrate multiple baking objects into one baking object, and the graphics processor then bakes the integrated baking object, more computing units are required when processing the integrated baking object, so the computing units of the graphics processor can be fully utilized to avoid the computing units being idle and wasted. Therefore, this solution can improve the efficiency of baking.

[0228] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0229] To this end, an embodiment of the present invention provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any data processing method provided in the embodiment of the present invention. For example, the instructions can execute the following steps:

[0230] Obtain multiple baking objects, where the baking objects are objects used to store lighting information in a three-dimensional space;

[0231] Integrate multiple baking objects to obtain an integrated baking object;

[0232] generating baking instructions for the integrated baking object;

[0233] Baking the integrated baking object into an integrated light map based on a baking instruction for the integrated baking object;

[0234] The integrated light map is split to obtain the light map corresponding to each baked object.

[0235] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0236] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0237] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the lighting baking aspect of the three-dimensional space or the lighting baking aspect of the three-dimensional game provided in the above embodiments.

[0238] Since the instructions stored in the storage medium can execute the steps in any data processing method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any data processing method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0239] The above is a detailed introduction to a data processing method, device, electronic device and computer-readable storage medium provided in an embodiment of the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its computing unit concept. At the same time, for those skilled in the art, according to the concept of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A data processing method, characterized in that: include: Acquire multiple baking objects, where the baking objects are objects used to store lighting information in a three-dimensional space; Performing integration processing on the multiple baking objects to obtain an integrated baking object; generating a baking instruction for the integrated baking object; Baking the integrated baking object into an integrated light map based on the baking instruction for the integrated baking object; The integrated light map is split to obtain a light map corresponding to each of the baked objects.

2. The data processing method according to claim 1, characterized in that: The object storing the illumination information is a texture map of the model, and the integrated baking object is an integrated texture map; The integrating the plurality of baking objects to obtain an integrated baking object includes: Obtaining a preset image size, and obtaining an image size of the texture map, wherein the preset image size is set based on a graphics processor, and the graphics processor is a graphics processor used to bake the integrated texture map; Sorting the texture images according to their image sizes to obtain a sorted texture image group; The texture maps in the sorted texture map group are integrated according to the preset image size to obtain an integrated texture map.

3. The data processing method according to claim 2, characterized in that: The step of integrating the texture maps in the sorted texture map group according to the preset image size to obtain an integrated texture map includes: When the texture map exists in the sorted texture map group, generating a blank map of the preset image size; The texture map in the sorted texture map group is inserted into the blank map to obtain an integrated texture map.

4. The data processing method according to claim 3, characterized in that: The inserting the texture map in the sorted texture map group into the blank map comprises: Obtaining a current texture map, wherein the current texture map is a texture map in the sorted texture map group into which the blank map is to be inserted; Inserting the current texture map into the blank map; When the current texture map is successfully inserted into the blank map, performing successful insertion processing; When the insertion of the current texture map into the blank map fails, insertion failure processing is performed.

5. The data processing method according to claim 4, characterized in that: The execution of successful insertion processing includes: Deleting the current texture map from the sorted texture map group; Determine that the next texture map in the sorted texture map group is the current texture map, and return to execute the step of obtaining the current texture map.

6. The data processing method according to claim 4, characterized in that: The execution of the insertion failure process includes: Determining a next texture map in the sorted texture map group; When the next texture map exists in the sorted texture map group, determining that the next texture map in the sorted texture map group is the current texture map, and returning to execute the step of obtaining the current texture map; When the next texture map does not exist in the sorted texture map group, the step of generating a blank map of the preset image size when the texture map exists in the sorted texture map group is returned to.

7. The data processing method according to claim 6, characterized in that: Before obtaining the next texture map in the sorted texture map group, the method further includes: Determine the texture space utilization rate according to the preset image size and the image size of the texture image in the blank texture; When the texture space utilization is greater than the utilization threshold, the step of generating a blank texture of the preset image size when the texture image exists in the sorted texture image group is returned to.

8. The data processing method according to claim 4, characterized in that: The execution of the insertion failure process includes: Return to the step of generating a blank map of the preset image size when the texture map exists in the sorted texture map group.

9. The data processing method according to claim 2, characterized in that: Before obtaining the preset image size, the method further includes: The preset image size is determined according to the number of threads of a graphics processor, and the graphics processor is used to bake the integrated texture map.

10. The data processing method according to claim 1, characterized in that: The object storing the illumination information is an illumination sample, the illumination sample is the spatial position of a plurality of illumination information sampling points in the three-dimensional space, and the integrated baking object is an integrated illumination sample; The integrating the plurality of baking objects to obtain an integrated baking object includes: A plurality of the illumination samples are linearly arranged into a group to obtain the integrated illumination sample.

11. The data processing method according to claim 1, characterized in that: After the integration processing is performed on the plurality of baking objects to obtain the integrated baking object, the method further includes: determining a position of the baking object in the integrated baking object; storing a mapping relationship between the baking object and a position of the baking object in the integrated baking object; The step of splitting the integrated illumination map to obtain an illumination map corresponding to each of the baked objects includes: According to the mapping relationship between the baking object and the position of the baking object in the integrated baking object, the integrated light map is split to obtain the light map corresponding to the baking object.

12. The data processing method according to claim 1, characterized in that: The step of baking the integrated baking object into an integrated light map based on the baking instruction for the integrated baking object includes: Sending the baking instruction and the integrated baking object to a server, the server being equipped with a graphics processor, so that the server uses the graphics processor to bake the integrated baking object into an integrated light map based on the baking instruction; The integrated light map is received from the server.

13. A data processing device, characterized in that: include: An acquisition unit, used to acquire a plurality of baking objects, where the baking objects are objects used to store lighting information in a three-dimensional space; an integration unit, configured to integrate the plurality of baking objects to obtain an integrated baking object; A generating unit, configured to generate a baking instruction for the integrated baking object; a baking unit, which bakes the integrated baking object into an integrated light map based on the baking instruction for the integrated baking object; The splitting unit splits the integrated light map to obtain a light map corresponding to each of the baked objects.

14. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps in the data processing method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the data processing method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Three-dimensional model rendering method and device, processor and terminal

    CN109903385A

  • Method of synthesizing a multitexture and recordingmedium thereof

    KR1020050080334A