A method and apparatus for texture processing and game material generation

By using a method of filtering and UV unwrapping to merge models, the problems of reduced texture accuracy and fixed position after merging were solved, thus achieving the preservation of model accuracy and material properties, and improving game performance and storage efficiency.

CN114359460BActive Publication Date: 2026-03-17NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In existing technologies, when merging models using Merge Actor, the accuracy of the merged texture model is reduced, and the relative positions of the merged models are fixed and cannot be moved, thus failing to retain the original PBR material used by the model.

Method used

Obtain the models and textures of the objects to be merged, filter the target models that meet the preset accuracy conditions, synthesize them into the first model group, and perform UV unwrapping and baking to generate merged textures and new UV data, retain the model accuracy, allow the model position to change, and associate PBR materials.

Benefits of technology

Maintain the accuracy of the merged model, allow for changes in model position, and retain the original PBR materials, thereby reducing game storage space and improving game performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114359460B_ABST
    Figure CN114359460B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for texture processing and game material generation. The method for texture processing comprises the following steps: obtaining a model of each object object in the object objects to be merged and a texture corresponding to the model; obtaining a target model satisfying a preset accuracy condition from the model, and merging the target model into a first model group; performing UV unfolding on the first model group to obtain first model group UV data; baking the texture according to the first model group UV data to obtain a merged texture and second model group UV data corresponding to the merged texture; wherein the merged texture contains the texture of each object object, and the second model group UV data is new UV data. The method for game material generation generates game material by using the merged texture and the corresponding model. By using the method, the problem of reduced accuracy of each model after texture merging is solved, and the rendering efficiency of game material in a game is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer processing technology, specifically to a texture processing method and apparatus. This application also relates to a game asset generation method and apparatus. Background Technology

[0002] Game scenes often include a large number of models such as terrain, vegetation, buildings, and objects, and each model often uses different textures. Therefore, the texture complexity in game scenes is high, which poses a challenge to the rendering of game scenes. Currently, merging the textures of adjacent objects in a game scene so that they are drawn in the same Drawcall is an important method to optimize game performance and reduce the storage space occupied by the game package.

[0003] In existing technologies, the Merge Actor tool built into UE4 (Unreal Engine 4) is generally used to merge textures. One approach uses Merge Actor to combine multiple selected models in the scene into a single Actor, merging their textures and materials. Another approach uses Merge Actor to generate a component containing many material slots without merging materials. However, merging models using Merge Actor has the following problems: the accuracy of the merged texture model is reduced, resulting in a loss of visual appeal; furthermore, the relative positions of the merged models are fixed and cannot be moved, and the original PBR materials used by the models cannot be preserved.

[0004] Therefore, how to provide an effective texture processing solution to maintain the accuracy of each merged model is a problem that needs to be solved. Summary of the Invention

[0005] The image processing method provided in this application provides a more reasonable texture processing scheme and solves the problem of reduced accuracy of each model after texture merging.

[0006] This application provides a texture processing method, including: obtaining the model of each object in a set of objects to be merged and the texture corresponding to the model; obtaining a target model that meets a preset accuracy condition from the model, and merging the target models into a first model group; performing UV unwrapping on the first model group to obtain UV data of the first model group; baking the texture according to the UV data of the first model group to obtain a merged texture and UV data of a second model group corresponding to the merged texture; wherein, the merged texture includes the texture of each object, and the UV data of the second model group is new UV data.

[0007] Optionally, it also includes: obtaining a new model for each object based on the UV data of the second model group, wherein the new model for each object corresponds to the texture of each object in the merged texture map; and saving the new models to the corresponding locations.

[0008] Optionally, it also includes: sending an import command and preset parameters using a preset port, wherein the import command and preset parameters are used by the command receiving end to import the merged texture and the new model of each object to generate game assets.

[0009] Optionally, the method is applied to the first tool; the step of sending the import command and preset parameters using the preset port further includes: the first tool obtaining the preset port of the second tool, determining that the preset port of the second tool is available, and sending the import command and preset parameters to the preset port of the second tool; wherein, the second tool opens the preset port, receives the import command and the preset parameters through the preset port, and imports the merged texture and the new model from the location where the new model is stored according to the preset parameters.

[0010] Optionally, it also includes: identifying at least a portion of object objects within a preset range in the game scene as the object objects to be merged.

[0011] Optionally, obtaining the target model that meets the preset accuracy condition from the model includes: obtaining the high-precision model with the most faces from the model of each object, and using the high-precision model of each object as the target model.

[0012] Optionally, the step of performing UV unwrapping on the first model group to obtain UV data of the first model group includes: determining the base map size for performing UV unwrapping on the first model group; performing UV unwrapping on the first model group according to the base map size to obtain UV data of the first model group.

[0013] Optionally, determining the base map size for UV unwrapping the first model group includes: determining the texture size corresponding to at least some models in the first model group, and determining the base map size based on the texture size; and / or, determining the importance of each object corresponding to at least some models in the first model group in the game scene, and determining the base map size based on the importance.

[0014] Optionally, it also includes: if the distance between the display position of the object corresponding to the at least part of the model and the current player character in the game space is less than a preset distance threshold, then the importance of the object is determined to be high, and the base map size is set to the first base map size or the base map size is set according to the original texture size corresponding to each of the at least part of the model.

[0015] Optionally, it further includes: determining the UV tile interval distance between UV tiles used for UV unwrapping the first model group; the step of UV unwrapping the first model group according to the base map size to obtain the UV data of the first model group includes: UV unwrapping the first model group according to the base map size and the UV tile interval distance to obtain the UV data of the first model group.

[0016] Optionally, obtaining the model of each object in the object objects to be merged and the texture corresponding to the model includes: for each object object, obtaining the model of the object object and at least one file identifier of the texture corresponding to it; and obtaining the model corresponding to the object object and all textures of the model object according to a preset naming rule and the at least one file identifier.

[0017] Optionally, it also includes: for each object, associating the new model of the object with the PBR material used to create the object before merging the model.

[0018] This application embodiment also provides a method for generating game assets, including: receiving an import instruction and preset parameters; wherein, the import instruction and preset parameters are used to import a merged texture provided by the instruction sending end and a new model corresponding to the texture of each object in the merged texture; the merged texture and the new model are generated using the texture processing method; importing the merged texture and the new model according to the import instruction and preset parameters, and importing the PBR material used to create the model of the object before merging; according to a preset naming rule, assigning each texture in the merged texture as a corresponding PBR material as a texture parameter to obtain a game asset model associated with the PBR material.

[0019] This application embodiment also provides a texture processing apparatus, including: a model acquisition unit, used to acquire the model of each object in the object objects to be merged and the texture corresponding to the model; a model filtering unit, used to acquire target models that meet preset accuracy conditions from the models and synthesize the target models into a first model group; a UV unwrapping unit, used to perform UV unwrapping on the first model group to obtain UV data of the first model group; and a rebaking unit, used to bake the texture according to the UV data of the first model group to obtain a merged texture and UV data of a second model group corresponding to the merged texture; wherein, the merged texture includes the texture of each object, and the UV data of the second model group is new UV data.

[0020] This application embodiment also provides a game asset generation device, including: an instruction receiving unit, used to receive an import instruction and preset parameters; wherein, the import instruction and preset parameters are used to import a merged texture provided by an instruction sending end and a new model corresponding to the texture of each object in the merged texture; the merged texture and the new model are generated using the texture processing method; a model import unit, used to import the merged texture and the new model according to the import instruction and the preset parameters, and import the PBR material used to create the model of the object before merging; and a material association unit, used to assign corresponding PBR materials to each texture in the merged texture as texture parameters according to a preset naming rule, thereby obtaining a game asset model associated with the PBR materials.

[0021] This application also provides an electronic device, including: a memory and a processor; the memory is used to store a computer program, which, when run by the processor, executes the method provided in this application.

[0022] This application also provides a storage device storing a computer program, which, when run by a processor, executes the method provided in this application.

[0023] Compared with the prior art, this application has the following advantages:

[0024] This application provides a texture processing method, apparatus, and device. The method involves acquiring the model of each object in a set of objects to be merged, along with the texture corresponding to that model; obtaining target models that meet preset accuracy conditions from the models; merging the target models into a first model group; performing UV unwrapping on the first model group to obtain UV data for the first model group; and baking the textures based on the UV data of the first model group to obtain a merged texture and UV data for a second model group corresponding to the merged texture. The merged texture includes the texture of each object, and the UV data of the second model group is new UV data. Because the textures are merged based on target models that meet preset accuracy conditions within the models of each object, the accuracy of each merged model can be maintained to the greatest extent, solving the problem of reduced texture model accuracy in the prior art. Furthermore, by obtaining a new model for each object based on the UV data of the second model group, the relative positions between the models of the merged objects can be changed, solving the problem in the prior art where the fixed relative positions between the merged model groups prevent further movement of the models. Furthermore, the new model of each object is associated with the PBR material used in the model before merging that object was created, thus preserving the original PBR material used by the model and solving the problem in the prior art that the original material of the model cannot be preserved when the materials are not merged.

[0025] This application provides a method, apparatus, and device for generating game assets. The method involves receiving an import command and preset parameters. The import command and preset parameters are used to import a merged texture map provided by the command sending end and a new model corresponding to the texture of each object in the merged texture map. The merged texture map and the new model are generated using the texture processing method provided in this application. The merged texture map and the new model are imported according to the import command and the preset parameters, and the PBR materials used to create the pre-merged models of the object objects are imported. According to preset naming rules, each texture in the merged texture map is assigned a corresponding PBR material as a texture parameter, resulting in a game asset model associated with the PBR materials. The generated game assets maintain the accuracy of the pre-merged texture model and retain the original PBR materials used in the model. Furthermore, the relative positions between the models of each object can be changed. Moreover, the game asset package obtained from the merged texture map is small and can be drawn in the same rendering command (Drawcall) during game runtime, thus reducing game storage space and improving game running efficiency. Attached Figure Description

[0026] Figure 1 This is a schematic diagram of the system environment of the method provided in the embodiments of this application;

[0027] Figure 2 This is a flowchart of the texture processing method provided in the first embodiment of this application;

[0028] Figure 3 This is a schematic diagram of a texture merging effect provided in the first embodiment of this application;

[0029] Figure 4 This is a flowchart of the game asset generation method provided in the second embodiment of this application;

[0030] Figure 5 This is a schematic diagram of the texture processing device provided in the third embodiment of this application;

[0031] Figure 6 This is a schematic diagram of the game asset generation device provided in the fourth embodiment of this application;

[0032] Figure 7 This is a schematic diagram of the electronic device provided in this application. Detailed Implementation

[0033] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.

[0034] This application provides a texture processing method, apparatus, electronic device, and storage device. This application also provides a game asset generation method, apparatus, electronic device, and storage device. These will be described in detail in the following embodiments.

[0035] For ease of understanding, the system environment provided in the embodiments of this application is first given. Please refer to... Figure 1The system environment shown in the figure includes: texture merging terminal 101 and game asset creation terminal 102. Among them, texture merging terminal 101 includes: model file and texture file reading module 101-1, model file merging and UV redistribution module 101-2, rebaking and new model export module 101-3, and first data transmission module 101-4. The texture merging end 101 reads the original files of the objects to be merged through the model file and texture file reading module 101-1. For example, for each object to be merged, it reads the model file containing model data of at least one precision for that object and the texture file containing the corresponding texture data. Through the model file merging and UV redistribution module 101-2, it selects a model of appropriate precision for each object to be merged, performs compositing, and redistributes the UVs. Through the rebaking and new model export module 101-3, it rebakes the original texture files of the objects to be merged according to the redistributed UVs, obtaining the merged textures and new merged model data. From the new merged model data, it exports the new model of each merged object. Through the first data transmission module 101-4, it sends instructions to the game asset production end 102, instructing it to obtain the merged textures and the new models of the merged objects. In practice, the texture merging end can be implemented based on Houdini or other similar tools. The game asset creation module 102 includes: a texture merging and new model import module 102-1, a material association and asset generation module 102-2, and a second data transmission module 102-3. The game asset creation module receives instructions from the texture merging module via the second data transmission module, parses parameters from the instructions, and imports the merged textures and corresponding new models for each merged object according to the instructions and parameters in the texture merging and new model import module 102-1. The material association and asset generation module 102-2 then associates the merged textures with the corresponding PBR materials of each model to generate the merged game assets. In implementation, the game asset creation module can be based on Unreal Engine 4 (UE4). During implementation, after processing the textures to obtain the merged textures and the new models of each merged object, the texture merging end temporarily stores them in a local temporary folder. The first data transmission module 101-4 transmits Python-based instructions to the game asset production end. After the game asset production end reads the merged textures and the new models of each merged object temporarily stored by the texture merging end according to the address parameters in the instructions, the texture merging end deletes the corresponding files temporarily stored locally. The first data transmission module 101-4 and the second data transmission module 102-3 establish a data channel between the texture merging end and the game asset production end, thereby facilitating the process of merging textures into game asset production and simplifying the operation of creating game assets.

[0036] It is understood that the above system environment is exemplary and is not intended to limit the methods provided in the embodiments of this application.

[0037] The following combination Figure 2 and Figure 3 The texture processing method provided in the first embodiment of this application will be described. Figure 2 The texture processing method shown includes steps S201 to S204.

[0038] Step S201: Obtain the model of each object in the object objects to be merged and the texture corresponding to the model.

[0039] The texture processing method provided in this application can merge the textures of multiple objects into a single merged texture, preserving the original texture accuracy of the merged objects to the greatest extent possible. Furthermore, it can also obtain a model of the merged objects with new UVs, allowing the positional relationships between the models of the merged objects corresponding to the merged texture to be altered.

[0040] UV refers to the UV coordinate data in the UV coordinate system. The UV coordinate system is a coordinate system corresponding to a two-dimensional plane defined by the horizontal and vertical directions of the display. It is used to locate pixels on an image, enabling the overlay of a two-dimensional image onto the surface of a three-dimensional object, thus rendering a 3D effect. The values ​​of UV coordinate data range from 0 to 1. For example, the U-th pixel in the horizontal direction represents the horizontal position of that pixel, and the V-th pixel in the vertical direction represents the vertical position of that pixel. Using UV, each point on the texture map corresponding to the object's model can be mapped to the surface of the model. The gaps between points can be smoothly interpolated, resulting in a more three-dimensional and realistic rendering of the object on the display.

[0041] An object refers to an object component that can be rendered on a display to closely resemble a realistic object. Examples include terrain, vegetation, and buildings in a game scene, as well as items and props. In this embodiment, an object can be represented by one model file and at least three texture files. The model file can contain model data for multiple models of the object with different model precisions. The texture file contains at least: a base color map, a normal map, and a blend map. The base color map represents the color of the object's surface, the normal map represents the surface texture obtained by drawing normals to the object's uneven surface, and the blend map represents the roughness of the object's surface. In this embodiment, the textures of multiple object objects are merged to reduce the object's size and improve rendering quality. For example, if each of the three object objects before merging corresponds to three texture files and one model file, the merged texture will contain three texture files and three model files corresponding to the three merged objects.

[0042] This step involves obtaining the model and corresponding textures for each of the multiple objects to be merged. Specifically, it includes the following processing: identifying at least a portion of the objects within a preset range in the game scene as the objects to be merged; and obtaining the model and corresponding textures for each object to be merged. For example, objects within a 1-meter range can be merged. When obtaining these files to be merged, files associated with filenames can be queried according to preset naming rules. Specifically, obtaining the model and corresponding textures for each object in the objects to be merged includes: for each object, obtaining at least one file identifier for the object's model and its corresponding textures; and, according to the preset naming rules and the at least one file identifier, obtaining the model corresponding to the object and all textures associated with that model object. The preset naming rules need to specify the components of the filename and the connectors between them. Each component includes the texture's main name, such as the object identifier information, and the meaning of each component. For example, if the preset naming rules specify that the filename must include at least the object identifier, then the associated files for that object can be searched using the object identifier. For example, a preset naming convention includes the following parts: object type, object name, number, texture type, and file extension. The object name and number can be used to search for associated files of that object. For instance, filenames "T_Vases_01_BC.TGA" and "T_Vases_01_N.TGA" represent the base color map and normal map of object Vases_01, respectively; "T_Vases_02_BC.TGA" and "T_Vases_01_N.TGA" represent the base color map and normal map of object Vases_02, respectively; and "Vases" is the object name, with the code following the connector representing the object's number. This facilitates the retrieval of multiple textures and models for each object.

[0043] In this embodiment, one object corresponds to one model, and one model corresponds to multiple textures, such as a base color texture, a normal texture, and a blend texture. The method further includes: receiving the number of object objects to be merged and the number of models that need to be merged into a merge texture; receiving the model identifier of each object object to be merged and the single texture identifier corresponding to the model, and querying other associated textures according to a preset naming rule.

[0044] Step S202: Obtain a target model that meets the preset accuracy conditions from the model, and synthesize the target model into a first model group.

[0045] In this embodiment, the models of the objects to be merged before merging generally contain model data of multiple models of that object with different model precisions. This step involves selecting the target model that meets the preset precision conditions from the models of the objects to be merged before merging, for use in texture merging processing.

[0046] Preferably, the model is a Level of Detail (LOD) model. LOD is a resource allocation technique for object rendering in a rendering environment. It refers to determining the resource allocation for object rendering based on the position and importance of the object model's nodes in the display environment, reducing the face count and detail of less important objects, thereby achieving high-efficiency rendering computation. The model file corresponding to the model can be in FBX format or other formats; this embodiment does not limit the format. Preferably, the high-precision model with the most faces is obtained from the model of each object, and this high-precision model is used as the target model. That is, the original high-precision models of the objects to be merged are retained, thus preserving the original texture accuracy to the greatest extent possible during merging. In implementation, each physical object model file (such as an FBX file) may contain multiple hierarchical models, with different levels representing different levels of precision. For each physical object, the primitive data (i.e., surface data) of each level of model data is obtained from its model file. The level model data with the largest surface data, i.e., LOD0, is used as the target model. LOD0 represents the model with the highest precision for that object. Since different levels of model precision differ, the unwrapped UVs also differ. To preserve the original high precision of the object, the LOD0 model of each object is extracted for UV unwrapping. Using this model to unwrap the UVs yields good texture effects. Further, the target models of each object are synthesized to obtain the first model group. In implementation, after reading the textures of each object, all textures associated with each object can be found according to preset naming rules. The models of each object can be read, and the Houdini MergeGeo node can be called to perform model merging processing, resulting in the first model group containing models of each physical object that meet the preset precision conditions.

[0047] Step S203: Perform UV unwrapping on the first model group to obtain UV data of the first model group.

[0048] This step involves UV unwrapping of the first model group. Unwrapping the first model group to obtain its UV data includes: determining the base map size for UV unwrapping; and unwrapping the first model group according to the base map size to obtain its UV data. Determining the base map size includes: determining the texture size corresponding to at least some models in the first model group, and determining the base map size based on the texture size; and / or, determining the importance of each object corresponding to at least some models in the first model group in the game scene, and determining the base map size based on the importance. The texture size corresponding to at least some models in the first model group can be understood as the original image size corresponding to each model in the at least some models. The game scene specifically refers to the display environment in the game. Preferably, the map size for UV unwrapping of the first model group is determined based on the original image size of the objects to be merged and their importance in the display environment.

[0049] In this embodiment, objects are considered highly important if they need to be displayed at close range in the display environment. Specifically, the process includes the following: if the distance between the object corresponding to at least some of the models and the current player character in the game space is less than a preset distance threshold, then the object is determined to be highly important, and the base map size is set to a first base map size or the base map size is set according to the original texture size corresponding to each of the at least some models. In practice, the base map size can be set by setting the texture resolution. For example, if the original texture of the model is 2k (resolution), then the base map resolution is set to 2k. If it is determined that the model will not be observed at close range in the game, the resolution can be set to 1k or 512. Furthermore, the base map size can also be determined based on the number of objects to be merged (i.e., the number of textures included in the merged texture). If the textures of 6 or 7 or more models are merged at once, then to ensure the texture accuracy of each model, the UV unwrapping base map size is set to a larger value. For example, when merging textures for four or more models, the texture resolution can be set to 2k for models with high importance and 1k for models with low importance.

[0050] In this embodiment, when unfolding the UV of the first model group, the unfolding can also be performed according to the interval between each UV patch, specifically including: determining the UV patch interval distance between the UV patches used for UV unfolding of the first model group; then, the step of unfolding the UV of the first model group according to the base map size to obtain the UV data of the first model group includes: unfolding the UV of the first model group according to the base map size and the UV patch interval distance to obtain the UV data of the first model group.

[0051] During implementation, the UVlayout node of the Houdini tool can be used to expand the first model group and tile it onto the base map. Alternatively, other nodes can be used to expand the UVs and obtain the UV data for the first model group.

[0052] Step S204: Bake the texture according to the UV data of the first model group to obtain a merged texture and UV data of the second model group corresponding to the merged texture; wherein, the merged texture includes the texture of each object, and the UV data of the second model group is new UV data.

[0053] This step involves rebaking the corresponding texture based on the UV data of the first model group, thereby obtaining the merged texture and its corresponding UV data of the second model group.

[0054] In this embodiment, UDIM (U-Dimension Multi-Quadrant Mapping) technology is used to recalculate the UV unwrapping obtained in step S203. The complete model UV data of each model in the first model group is divided into independent partial UVs, represented by patches, and the overall UV is presented in a tiling manner. A patch can be a 1x1 square grid. The original UV data is converted into UDIM integer coordinates in units of patches. If starting from the lower left corner coordinate in the UV coordinate system, a single channel can contain up to ten patches. Each patch can have a U index between 0 and 9, and the V index can be zero or any positive integer. Then, the UDIM data can be calculated using the following formula:

[0055] udim = 1001 + u + (10 * v);

[0056] Where u is the original U-coordinate value of the model; v is the original V-coordinate value of the model.

[0057] Parsing the UV index allows you to find the corresponding pixel values. Baking is then performed based on the UDIM data and the corresponding pixel values ​​to obtain the merged texture and the UV data of the second model group containing the new UV data. Alternatively, a re-baking can be implemented using the Houdini tool.

[0058] Furthermore, a new model for each object is obtained based on the UV data of the second model group. Each object refers to the object being merged in the generated merged texture map. The new model of each object corresponds to the texture of each object in the merged texture map. The new models are then saved to their respective locations. In other words, the model of each merged object corresponding to the textures included in the merged texture map is exported based on the UV data of the merged second model group and stored in a specified location. This allows the model of each merged object corresponding to the merged texture map to be moved independently, enabling it to be moved according to the art requirements and facilitating modifications to game assets created based on the merged texture map.

[0059] In this embodiment, the method further includes: for each object, associating the new model of the object with the PBR material used to create the object's model before merging, so that the merged texture and the corresponding new model obtained after merging can maintain the same material as the model before merging; or, associating the new model of the object with a specified PBR material, so that the merged texture and the corresponding new model obtained after merging use the same material, which can improve rendering efficiency.

[0060] In this embodiment, the merged texture and the corresponding new models of each merged object can be used to create game assets. The method further includes establishing a data channel between the texture merging end executing the texture processing method and the game asset creation end, thereby simplifying the operation process of creating game assets based on models of multiple object objects and their corresponding textures. Specifically, the method further includes: sending an import command and preset parameters using a preset port. The import command and preset parameters are used by the command receiving end to import the merged texture and the new models of each object to generate game assets. The method provided in this embodiment can be applied to a first tool. The generated merged texture and the new models of each object can be imported into a second tool, which further processes and generates game assets. Specifically, the first tool obtains the preset port of the second tool, determines that the preset port of the second tool is available, and sends an import command and preset parameters to the preset port of the second tool. The second tool opens the preset port, receives the import command and the preset parameters through the preset port, and imports the merged texture and the new models from the location where the new models are stored according to the preset parameters. During implementation, the protocol for data transmission between the first and second tools is not limited. For example, UDP can be used, and the default port opened by the second tool is the UDP port. The first tool can send specific Python commands to this port. If a response indicating successful execution of the command is received, the default port of the second tool is confirmed to be available. Alternatively, a data connection can be established between the default ports of the first and second tools, and import commands and default parameters can be sent to the second tool through this data connection. Preferably, a data connection is established between the game asset production end and the default port opened by the game asset production end. Python-based commands and parameters are sent to the game asset production end through this data connection. The commands are import commands, and the parameters include at least those indicating the following operations: importing textures, importing models, and importing normals, but not importing materials. The merged textures and corresponding new models are imported into the game asset production end. Preferably, a specified PBR material, such as a standard PBR material, can be loaded on the game asset production end. Textures are assigned to the texture parameters corresponding to the material according to a default naming rule, thereby associating each new model with the corresponding specified PBR material, so that the merged new models share the specified PBR material. Merged model resources use the same material, which can reduce draw calls and improve rendering efficiency.

[0061] Please refer to Figure 3The diagram illustrates the effect of merging textures, including: the new model 301 of the merged object, the merged texture and corresponding material 302, and the merged rendering effect 303. The example shown is three merged object objects, i.e., three new models: input_mesh1, input_mesh2, and input_mesh3. The merged texture and corresponding material 302 include the merged textures obtained after merging: T_Vase_01_BC_Atlas (merged base color map), T_Vase_01_N_Atlas (merged normal map), T_Vase_01_RMA_Atlas (merged blend map), and Atlas_mesh1 (the material shared by the new models of the merged object objects). The rendering effect is shown in the merged rendering effect 303, which can be rendered in a single Drawcall. Furthermore, Atlas_mesh1 can be used to export the individual models of these three object objects, allowing the distance between them to be altered. It is understood that the unfolded size, shape, appearance, etc. of the objects shown in the figures are all illustrative examples and are not intended to limit the methods provided in the embodiments of this application.

[0062] It should be noted that, unless otherwise specified, the features given in this embodiment and other embodiments of this application can be combined with each other, and steps S201 and S202 or similar terms do not limit the steps to be performed in a specific order.

[0063] This concludes the description of the method provided in this embodiment. Because the method merges textures based on target models that meet preset accuracy conditions within the model of each object, it can maximize the accuracy of the merged models, solving the problem of reduced accuracy of merged texture models in existing technologies. Furthermore, by obtaining a new model for each object based on the UV data of the second model group, the relative positions between the models of the merged objects can be changed, solving the problem in existing technologies where the fixed relative positions between merged model groups prevent model movement. Furthermore, by associating the new model of each object with the PBR material used to create the object before merging, the original PBR material used by the model can be retained, solving the problem in existing technologies where the original material cannot be retained without merging materials.

[0064] Based on the above embodiments, the second embodiment of this application provides a method for generating game assets. The following is combined with... Figure 4 The method will be described below. For relevant parts, please refer to the corresponding descriptions in the above embodiments. Figure 4 The game asset generation method shown includes steps S401 to S403.

[0065] Step S401: Receive import instructions and preset parameters; wherein, the import instructions and preset parameters are used to import the merged texture provided by the instruction sending end and the new model corresponding to the texture of each object in the merged texture; the merged texture and the new model are generated using the texture processing method.

[0066] Step S402: Import the merged texture and the new model according to the import command and the preset parameters, and import the PBR material used to create the object before merging;

[0067] Step S403: According to the preset naming rules, each texture in the merged texture is assigned a corresponding PBR material as a texture parameter to obtain a game material model associated with the PBR material.

[0068] The game asset generation method described above can be applied to game asset creation. In this embodiment, the merged texture generated by the texture processing method and the corresponding new models of each merged object can be used to create game assets.

[0069] The game asset creation terminal listens to a preset port and establishes a data channel with the texture merging terminal that executes the texture processing method, thereby simplifying the operation process of creating game assets based on models of multiple objects and their corresponding textures. The import command is a Python-based command. The preset parameters include the storage location of the merged textures and their corresponding new models. The preset parameters also include at least the parameters used to represent the following operations: import textures, import models, import normals, and do not import materials.

[0070] In one embodiment of this example, the corresponding PBR material can be the PBR material used by the object's model before merging. Then, assigning the corresponding PBR material as a texture parameter to each texture in the merged texture image includes: associating the new model of the object with the PBR material used to create the object's model before merging, thereby ensuring that the merged texture and the corresponding new model after merging maintain the same material as the model before merging. In another embodiment, the corresponding PBR material is a specified PBR material. Then, assigning the corresponding PBR material as a texture parameter to each texture in the merged texture image includes: associating the new model of the object with the specified PBR material, ensuring that the merged texture and the corresponding new model after merging use the same specified PBR material, improving rendering efficiency.

[0071] Preferably, the game asset creation client imports the merged textures and corresponding new models according to the import command. Further, the game asset creation client can load a specified PBR material, such as a standard PBR material, and assign textures to the corresponding texture parameters of the material according to a preset naming rule, thereby associating each new model with the specified PBR material. This allows the merged new models to share the specified PBR material. Using the same material for the merged model resources when generating game assets reduces draw calls and improves rendering efficiency. After the import execution is complete, an import completion command is sent to the texture merging client, which can be used to delete the temporarily stored merged texture files and corresponding model files. This method can be implemented based on UE4.

[0072] This concludes the description of the method provided in this embodiment. The merged textures used in this method are derived from merging target models that meet preset precision conditions within the model of each object. Therefore, it can maintain the precision of each merged model to the greatest extent possible, solving the problem of reduced precision in the merged texture model, and preserving the original PBR material used by the model. Furthermore, the relative positions between the models of each object can be changed. The game asset package obtained based on the merged textures is smaller, reducing the storage space occupied, and is drawn in the same rendering instruction (Drawcall) during game runtime, thus reducing the game's storage space and improving game running efficiency.

[0073] Corresponding to the first embodiment, the third embodiment of this application provides a texture processing apparatus. Please refer to... Figure 5 The texture processing device shown in the figure includes:

[0074] The model acquisition unit 501 is used to acquire the model of each object in the object objects to be merged and the texture corresponding to the model;

[0075] The model filtering unit 502 is used to obtain target models that meet preset accuracy conditions from the models and synthesize the target models into a first model group;

[0076] UV unwrapping unit 503 is used to unwrap the first model group to obtain UV data of the first model group;

[0077] The rebaking unit 504 is used to bake the texture according to the UV data of the first model group to obtain a merged texture and UV data of the second model group corresponding to the merged texture; wherein, the merged texture includes the texture of each object, and the UV data of the second model group is new UV data.

[0078] Optionally, the device further includes a model export unit, which is used to obtain a new model for each object based on the UV data of the second model group, wherein the new model of each object corresponds to the texture of each object in the merged texture map; and saves the new models to the corresponding locations.

[0079] Optionally, the device further includes a data transmission unit, which is used to: send an import command and preset parameters using a preset port, wherein the import command and preset parameters are used by the instruction receiving end to import the merged texture and the new model of each object to generate game assets.

[0080] Optionally, the device is implemented as a first tool; the data transmission unit is specifically used for: obtaining a preset port of the second tool, determining that the preset port of the second tool is available, and sending an import command and preset parameters to the preset port of the second tool; wherein, the second tool opens the preset port, receives the import command and the preset parameters through the preset port, and imports the merged texture and the new model from the location where the new model is stored according to the preset parameters.

[0081] Optionally, the model acquisition unit 501 is specifically used to: determine at least a portion of the object objects within a preset range in the game scene as the object objects to be merged.

[0082] Optionally, the model filtering unit 502 is specifically used to: obtain the high-precision model with the most faces from the model of each object, and use the high-precision model of each object as the target model.

[0083] Optionally, the UV unwrapping unit 503 is specifically used to: determine the base map size for UV unwrapping the first model group; and perform UV unwrapping on the first model group according to the base map size to obtain UV data of the first model group.

[0084] Optionally, the UV unwrapping unit 503 is specifically used to: determine the texture size corresponding to at least some models in the first model group, and determine the base map size based on the texture size; and / or, determine the importance of each object corresponding to at least some models in the first model group in the game scene, and determine the base map size based on the importance.

[0085] Optionally, the UV unrolling unit 503 is specifically used to: if the distance between the display position of the object corresponding to the at least part of the model and the current player character in the game space is less than a preset distance threshold, then determine that the object is of high importance, and set the base map size to the first base map size or set the base map size according to the original texture size corresponding to each of the at least part of the model.

[0086] Optionally, the UV unwrapping unit 503 is specifically used to: determine the UV tile interval distance between UV tiles used for UV unwrapping the first model group; and perform UV unwrapping on the first model group according to the base map size and the UV tile interval distance to obtain the UV data of the first model group.

[0087] Optionally, the model acquisition unit 501 is specifically used for: acquiring the model of the object and at least one file identifier in the texture map corresponding to each object; and acquiring the model corresponding to the object and all texture maps of the model object according to a preset naming rule and the at least one file identifier.

[0088] Optionally, the model acquisition unit 501 is specifically used to: for each object, associate the new model of the object with the PBR material used to create the object before merging the model.

[0089] Corresponding to the second embodiment, the fourth embodiment of this application provides a game asset generation device. Please refer to... Figure 6 The game asset generation device shown in the figure includes:

[0090] The instruction receiving unit 601 is used to receive an import instruction and preset parameters; wherein, the import instruction and preset parameters are used to import a merged texture map provided by the instruction sending end and a new model corresponding to the texture map of each object in the merged texture map; the merged texture map and the new model are generated using the texture processing method.

[0091] The model import unit 602 is used to import the merged texture and the new model according to the import instruction and the preset parameters, and to import the PBR material used to create the object before merging the model.

[0092] The material association unit 603 is used to assign each texture in the merged texture as a corresponding PBR material according to a preset naming rule, so as to obtain a game material model associated with the PBR material.

[0093] Based on the above embodiments, the fifth embodiment of this application provides an electronic device. For relevant parts, please refer to the corresponding descriptions in the above embodiments. Figure 7The electronic device shown in the figure includes a memory 701 and a processor 702; the memory is used to store a computer program, which, after being run by the processor, executes the method provided in the embodiments of this application.

[0094] Based on the above embodiments, the sixth embodiment of this application provides a storage device. For relevant parts, please refer to the corresponding descriptions in the above embodiments. The schematic diagram of the storage device is similar. Figure 7 The storage device stores a computer program, which, when executed by a processor, performs the method described in the embodiments of this application.

[0095] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0096] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0097] 1. Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.

[0098] 2. Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0099] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.

Claims

1. A method of texture mapping, characterized by, The method comprises: acquiring a model of each object object in the object objects to be merged and a map corresponding to the model; acquiring a target model meeting a preset accuracy condition from the model, and integrating the target model into a first model group; performing UV unfolding on the first model group to obtain first model group UV data; baking the map according to the first model group UV data to obtain a merged map and second model group UV data corresponding to the merged map; wherein the merged map contains the map of each object object, and the second model group UV data is new UV data; The method further comprises: deriving a new model of each object object according to the second model group UV data, wherein the new model of each object object corresponds to the map of each object object in the merged map respectively; and saving the new model to a corresponding position respectively, so that the new model of each merged object object corresponding to the merged map can be moved individually.

2. The method of claim 1, wherein, Further comprising: sending an import instruction and a preset parameter using a preset port, the import instruction and the preset parameter being used to instruct a receiving end to import the merged map and the new model of each object object to generate game materials.

3. The method of claim 2, wherein, The method is applied to a first tool; The method further comprises: The first tool acquires a preset port of a second tool, determines that the preset port of the second tool is available, and sends an import instruction and a preset parameter to the preset port of the second tool; wherein the second tool opens the preset port, receives the import instruction and the preset parameter through the preset port, and imports the merged map and the new model from a position where the new model is saved according to the preset parameter.

4. The method of claim 1, wherein, Further comprising: determining at least part of the object objects in a preset range in a game scene as the object objects to be merged.

5. The method of claim 1, wherein, The method further comprises: acquiring a high-precision model with the largest number of surfaces from the model of each object object as the target model.

6. The method of claim 1, wherein, The method further comprises: determining a base map size for UV unfolding of the first model group; performing UV unfolding on the first model group according to the base map size to obtain the first model group UV data.

7. The method of claim 6, wherein, The method further comprises: determining a map size corresponding to each of at least part of the models in the first model group, and determining the base map size according to the map size; and / or determining an importance of each object object corresponding to at least part of the models in the first model group in a game scene, and determining the base map size according to the importance.

8. The method of claim 7, wherein, Further comprising: If a distance between a display position of an object corresponding to the at least partial model in a game space and a current player character is less than a preset distance threshold, it is determined that the object is important, the texture size is set to a first texture size or the texture size is set according to a corresponding original texture size of each of the at least partial model.

9. The method of claim 6, wherein, Further comprising: determining a UV patch interval distance between UV patches used for UV unwrapping of the first model group; the UV unwrapping of the first model group according to the texture size comprises: unwrapping the first model group according to the texture size and the UV patch interval distance to obtain the first model group UV data.

10. The method of claim 1, wherein, the obtaining of the model of each object and the texture corresponding to the model in the object to be merged comprises: for each object, obtaining at least one file identifier in the model of the object and the texture corresponding thereto; according to a preset naming rule and the at least one file identifier, obtaining the model corresponding to the object and all textures of the model object.

11. The method of claim 1, wherein, Further comprising: for each object, associating the new model of the object to the PBR material used by the pre-merging model for making the object.

12. A game material generation method characterized by comprising: Comprising: receiving an import instruction and a preset parameter; wherein the import instruction and the preset parameter are used to import a merged texture and a new model corresponding to the texture of each object in the merged texture provided by an import instruction sending end; the merged texture and the new model are generated by the method of any one of claims 1-11; according to the import instruction and the preset parameter, importing the merged texture and the new model, and importing a PBR material used by a pre-merging model for making the object; wherein the new model corresponding to the texture of each object in the merged texture can be moved individually; according to a preset naming rule, assigning a corresponding PBR material to each texture in the merged texture as a texture parameter to obtain a game material model associated with the PBR material.

13. A texture mapping processing apparatus characterized by comprising: Comprising: a model obtaining unit, configured to obtain a model of each object and a texture corresponding to the model in the object to be merged; a model screening unit, configured to obtain a target model satisfying a preset accuracy condition from the model, and to combine the target model into a first model group; a UV unwrapping unit, configured to unwrap the first model group to obtain first model group UV data; a re-baking unit, configured to bake the texture according to the first model group UV data to obtain a merged texture and second model group UV data corresponding to the merged texture; wherein the merged texture contains the texture of each object, and the second model group UV data is new UV data; The method further comprises: deriving a new model of each object object according to the second model group UV data, wherein the new model of each object object corresponds to the map of each object object in the merged map respectively; and saving the new model to a corresponding position respectively, so that the new model of each merged object object corresponding to the merged map can be moved individually.

14. A game material generation device, characterized by comprising: The method further comprises: An instruction receiving unit is configured to receive an import instruction and preset parameters, wherein the import instruction and the preset parameters are used to import a merged map and a new model corresponding to a map of each object object in the merged map provided by an import instruction sending end, and the merged map and the new model are generated by using any one of the methods in claims 1-11; A model importing unit is configured to import the merged map and the new model according to the import instruction and the preset parameters, and import a PBR material used to make a pre-merging model of the object object, wherein the new model corresponding to the map of each object object in the merged map can be moved individually; A material association unit is configured to assign a corresponding PBR material to each map in the merged map as a map parameter according to a preset naming rule, and obtain a game material model associated with the PBR material.

Citation Information

Patent Citations

  • Three-dimensional model and material merging method and device, terminal, storage medium and rendering method

    CN111028361A

  • Scene rendering method and device, computer readable storage medium and computer equipment

    CN111105491A