Methods, apparatus, electronic devices and storage media for generating LOD file assets
By merging the materials of game models and reconstructing the wiring, LOD file assets are generated, solving the problem of time-consuming and labor-intensive generation processes in existing technologies and achieving more efficient rendering effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2022-11-15
- Publication Date
- 2026-05-05
AI Technical Summary
In existing technologies, the process of generating LOD file assets for game models is time-consuming and labor-intensive, and the amount of modification work is large, resulting in low rendering efficiency.
By loading the material path information of the game model, merging the materials of the model area, performing texture baking and topology reconstruction, and generating LOD file assets.
It reduces the number of drawing calls during rendering, reduces GPU time consumption and utilization, and improves model rendering efficiency.
Smart Images

Figure CN115888117B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of scene rendering technology, and more specifically, to a method, apparatus, electronic device, and storage medium for generating LOD file assets. Background Technology
[0002] When displaying game models in a game scene, models farther away from the player's viewpoint appear more blurry. Therefore, the overall rendering efficiency of game models can be improved by reasonably reducing the polygon count of models at greater distances. Currently, this is typically done manually by artists in DCC software, a time-consuming and labor-intensive process with significant modifications, resulting in low production efficiency. Summary of the Invention
[0003] The purpose of this invention is to provide a method, apparatus, electronic device, and storage medium for generating LOD file assets, which can reduce the number of draw calls during rendering, thereby reducing GPU time consumption and utilization during rendering, while improving the efficiency of model rendering.
[0004] In a first aspect, the present invention provides a method for generating LOD (Level of Detail) file assets, the method comprising:
[0005] Load the model file corresponding to the target object model in the game, obtain the material path information of the target object model, and determine multiple model areas corresponding to the target object model based on the material path information;
[0006] Merge the materials of multiple model regions to obtain a merged material region;
[0007] The merged material area is subjected to texture baking to obtain the target texture.
[0008] The target object model is rewired to obtain a mesh model with reduced surface area.
[0009] Generate LOD file assets corresponding to the target object model based on the target texture and mesh model.
[0010] Secondly, the present invention provides an apparatus for generating LOD (Level of Detail) file assets, the apparatus comprising:
[0011] The model loading module is used to load the model file corresponding to the target object model in the game, obtain the material path information of the target object model, and determine multiple model areas corresponding to the target object model based on the material path information.
[0012] The material merging module is used to merge the materials of multiple model regions to obtain a merged material region;
[0013] The baking module is used to bake textures on merged material areas to obtain the target texture.
[0014] The polygon reduction module is used to reconstruct the wiring of the target object model to obtain a mesh model with reduced polygons.
[0015] The LOD file asset generation module is used to generate LOD file assets corresponding to the target object model based on the target texture and mesh model.
[0016] Thirdly, the present invention provides an electronic device, comprising: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of a method for generating LOD file assets as described in the foregoing embodiments.
[0017] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of a method for generating LOD file assets as described in the foregoing embodiments.
[0018] The beneficial effects of this invention are as follows: by determining multiple model regions through the material path information of the target object model in the game, and merging the materials of multiple model regions to obtain a merged material region, the number of draw calls can be reduced when rendering the model, thereby reducing the GPU time consumption and utilization rate during rendering; by reconstructing the wiring of the target object model to obtain a mesh model with reduced faces, the number of faces rendered in the current frame can be reduced, thereby reducing the number of rendering times and further improving the rendering efficiency of the LOD file assets corresponding to the target object model. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating a method for generating LOD file assets according to an embodiment of this application is shown;
[0021] Figure 2 This illustration shows a schematic diagram of material path information provided in an embodiment of this application;
[0022] Figure 3This illustration shows a schematic diagram of a UV layout adjustment provided in an embodiment of this application;
[0023] Figure 4 This illustration shows a schematic diagram of the effect of an Alpha texture provided in an embodiment of this application;
[0024] Figure 5 This illustration shows a schematic diagram of a baking area selection method provided in an embodiment of this application;
[0025] Figure 6 A schematic diagram of a surface reduction method provided in an embodiment of this application is shown;
[0026] Figure 7 This illustration shows a structural diagram of an apparatus for generating LOD file assets according to an embodiment of this application;
[0027] Figure 8 A structural diagram of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0029] LOD (Level of Detail) can determine the resource allocation for object rendering based on the position (screen size) and importance of the model's nodes in the display environment. This reduces the number of faces and details of unimportant objects, thereby achieving high-efficiency rendering computation.
[0030] In related technologies, when developing scenes on mobile devices, a large number of art character assets in the project need to have Level of Depth (LOD) created to meet performance requirements. The LOD tools built into traditional engines cannot meet these requirements, and artists usually need to manually perform topology cuts, UV mapping, and texture reassembly in DCC software. The creation process is time-consuming and labor-intensive, and the amount of work required for secondary modifications is still significant.
[0031] Considering that the space occupied by a model on the screen decreases as the model moves further away from the player, meaning that the number of pixels used to draw the model decreases, this application provides a method, apparatus, electronic device, and storage medium for generating LOD file assets. This can reduce the number of draw calls, thereby reducing the GPU's rendering time and usage, while also improving the efficiency of model rendering.
[0032] This application provides a method for generating LOD file assets, which can be applied to Houdini. This method enables the construction of a rapid LOD model generation tool to improve the rendering efficiency of models that are far apart in the scene. Figure 1 The flowchart illustrates the method for generating this LOD file asset, which mainly includes the following steps:
[0033] Step S102: Load the model file corresponding to the target object model in the game, obtain the material path information of the target object model, and determine multiple model areas corresponding to the target object model based on the material path information.
[0034] The target object model in the game can include models contained in the game scene, such as game character models, scene building models, plant models, road models, river models, prop models, etc. Each of these target object models corresponds to the original art asset data of the artists during the design process. This original art asset data can be a 3D model file in FBX format, which includes object texture maps.
[0035] For the original art asset data of the target object model, after loading the target object model, several important attributes are retained on the vertices and faces of the model, such as normal, UV information, and material path information (Shop_materialpath). These attributes are created by artists in DCC software when creating the target object model according to production specifications. In one implementation, when the target object model is a game character model, the material path information (Shop_materialpath) can correspond to the materials of each part contained in the game character model.
[0036] For target object models that are far from the player, areas of the same type can use the same material. For example, when the target object model is a plant model in a game scene, the leaf areas can use the same material, the branch areas can use the same material, and so on; similarly, when the target object is a game character model in a game scene, the skin areas can use the same material, the hair areas can use the same material, and so on. Therefore, in an optional implementation, when the material path information corresponding to the target object model is obtained, the model area of the target object model can be determined based on the material path information.
[0037] Step S104: Merge the materials of multiple model regions to obtain a merged material region.
[0038] This embodiment mainly addresses the situation where the distance is relatively far and fewer pixels can be used for the target object model. Based on this, the display of material information of the target object model can merge multiple materials that originally belonged to different areas, thereby improving rendering efficiency without affecting the overall effect of the model.
[0039] Optionally, when merging materials for multiple model regions, the materials of multiple regions can be merged according to the distance between them, or the materials of adjacent model regions can be merged. Alternatively, regions that can be merged can be selected according to actual needs to obtain merged material regions.
[0040] For example, for game character models, the hair area and head area can be merged in terms of material, and the hair area, head area, hair accessory area, and face area can also be merged. For building models, the wall area and roof area can be merged, and the mountain area and the nearby road area can be merged in terms of material. In this way, when two or more draw calls were originally required, they can be performed sequentially after merging, thus reducing the number of draw calls.
[0041] Step S106: Perform texture baking on the merged material area to obtain the target texture.
[0042] When baking textures on merged material regions, at least the baking of Diffuse (color), Normal (normal), and ARM (metal / roughness) textures should be included. Since the original art asset data contains texture mapping information, the model after merging material regions can be baked using this texture mapping information.
[0043] Step S108: Perform wiring reconstruction on the target object model to obtain a mesh model with reduced surface area.
[0044] In one implementation, the target object model includes multiple triangular faces, meaning the target object model includes several spline curves that constitute the background mesh of the triangular facets. The more triangular facets there are, the more detail the target object model can display. When the target object model is viewed from a distance in the graphical user interface, unnecessary curves in the spline curves of the target object model can be removed, thereby reducing the number of triangular facets corresponding to the target object model and obtaining a mesh model after facet construction.
[0045] Step S110: Generate LOD file assets corresponding to the target object model based on the target texture and mesh model.
[0046] In one implementation, when generating the target texture and mesh model, a model storage path can be selected for the target texture and mesh model. When the target texture and mesh model are stored in the same storage path, the LOD file asset after material merging and polygon reduction can be determined. Thus, for some scenarios with low rendering polygon requirements, the LOD file asset can be directly imported, thereby reducing the production difficulty and model production time, and the workload will also be reduced accordingly during subsequent secondary modifications.
[0047] The method for generating LOD file assets provided in this application determines multiple model regions by using the material path information of the target object model in the game, and merges the materials of the multiple model regions to obtain a merged material region. This can reduce the number of draw calls when rendering the model, thereby reducing the GPU time consumption and utilization during rendering. By reconstructing the wiring of the target object model to obtain a mesh model with reduced faces, the number of faces rendered in the current frame can be reduced, thereby reducing the number of rendering times and further improving the rendering efficiency of the LOD file assets corresponding to the target object model.
[0048] To facilitate understanding, the method for generating this LOD file asset is explained in detail below.
[0049] In an optional implementation, the above-mentioned determination of multiple model regions corresponding to the target object model based on material path information may, in specific implementation, include:
[0050] In response to a selection operation on the target material naming attribute in the material path information, multiple model regions corresponding to the target object model are determined. The aforementioned target object model includes a game character model, and the model regions include at least one or more of the following model regions: skin region, head region, hair region, eye region, body region, and clothing region.
[0051] When a target object model is created, its material attributes are categorized according to naming conventions. In Houdini, the Shop_material path is the material ID, such as Skin, Head, Hair, Eye, Body, Cloth, etc. The selection operation for the target material naming attribute in the material path information described above can be performed by selecting the aforementioned material ID via the material path. For easier understanding, see [link to relevant documentation]. Figure 2 The diagram shows the material path information for a Skin. In one implementation, a Group can be created and the parameter expression @Shop_material path = "Name" can be written to peel off each region in the target object model according to the material path information to obtain multiple model regions corresponding to the target object model.
[0052] In one implementation, materials from multiple model regions are merged to obtain a merged material region. In specific implementation, this may include the following steps 1.1) and 1.2):
[0053] Step 1.1) Classify multiple model regions to determine the type of region to be merged in the target object model;
[0054] Step 1.2) Based on the type of the region to be merged, merge the material information of the corresponding model regions to obtain at least one merged material region.
[0055] When classifying multiple model regions, adjacent regions can be identified as belonging to the same type of region to be merged based on their distance from each other. For example, for a game character model, considering the need for costume changes, the extracted model regions can be divided into two parts using Blast nodes: the upper part includes the hair region, head region, eye region, and hair accessory region; the lower part includes the body region, clothing region, and decoration region. Thus, the hair region, head region, eye region, and hair accessory region can be identified as belonging to the same type of region to be merged, as can the body region, clothing region, and decoration region. This material merging method can simultaneously meet the needs of game character costume changes while merging materials.
[0056] This method identifies multiple regions in the original game character model, including the hair area, head area, eye area, hair accessory area, body area, and clothing area, as two merged material areas. This reduces the Draw Call (the process of preparing data and notifying the GPU for rendering), improving rendering efficiency while reducing the consumption of rendering resources.
[0057] Optionally, when determining the areas to be merged, the type of areas to be merged can also be determined according to the actual situation. For example, when there are other requirements for the game character model, such as changing hairstyles or headwear, the areas that need to have their textures changed can be separated, and the fixed areas can be merged into the same material area.
[0058] After the target object model is stripped of its regions using the above method, the model regions may stack, resulting in overlapping UV (texture coordinate attribute) layouts. Therefore, the above method also includes: responding to the stacking operation for the same model regions that are stacked, performing UV layout on the model regions that overlap after material merging.
[0059] Optionally, in one implementation, a UV Layout node can be created in Houdini, and Stack Identical Islands Match Mirrored Islands can be enabled to discover and stack identical UVs, causing the UV layout to fill the UV grid. In another implementation, it can also be manually adjusted by artists. For easier understanding, see [link to relevant documentation]. Figure 3 The diagram illustrates UV layout adjustments. The left side shows the result of manual UV planning, with important areas (such as the body) occupying a larger portion. The right side shows the default UV grid filling controlled by nodes. In practical applications, you can choose one of these methods to adjust the UV layout, or you can first adjust it automatically and then fine-tune it manually according to your needs.
[0060] In an optional implementation, the model file corresponding to the target object model includes the original texture information of the target object model. Since the material information of the original art assets of the target object model changes after material merging, to facilitate texture baking, the merged material area is subjected to texture baking processing to obtain the target texture. In specific implementation, this may include steps 2.1) and 2.2):
[0061] Step 2.1): In response to the material creation request, generate material number information corresponding to the type of the region to be merged;
[0062] Step 2.2) Based on the original texture information, perform texture baking processing on the baking area corresponding to the material number information to obtain the target texture.
[0063] Regarding step 2.1 above, the material creation request can increase the number of IDs for creating Quick Materials and number the created materials according to the degree of material merging, thus obtaining material number information. This allows the assignment of corresponding texture maps to each area, preparing for subsequent Baker work and facilitating art preview. For example, for the game character model mentioned above, when dividing the model area into upper and lower parts for merging, the material number information for the upper and lower parts can be determined separately. For instance, material number information 1 indicates the body part, and 2 indicates the head part.
[0064] Regarding step 2.2 above, the loaded model file includes original texture information. To improve processing efficiency, the original texture information can be sequentially baked to complete the baking process of the model after material merging, obtaining the target texture. This texture baking process can at least include bakers for the Diffuse (color), Normal (normals), and ARM (metal / roughness) textures.
[0065] Furthermore, considering that the Diffuse A channel of the game character model contains an alpha texture, and that baking cannot solve the problem of alpha channel generation, in an optional implementation, the above method can also process the generation of the alpha texture. In specific implementation, this can include the following steps:
[0066] Step 3.1): In response to the creation operation of the texture network, determine the COP2NetWork composition network;
[0067] Step 3.2) In response to the creation operation of the shape control module in the COP2NetWork synthesis network, import the color texture information from the model file;
[0068] Step 3.3) Perform grayscale processing and contrast enhancement processing on the color texture information to generate the Ahpha map corresponding to the color map.
[0069] In practice, after the Baker's Diffuse map is stored in a custom path, a COP2Network compositing network is created. Within the COP2Network, a shape control module (SOP Import) is created to import the color and texture information from the model file. After converting it to grayscale, Contrast enhancement is performed, and an Alpha map is output. The Alpha map only contains the A channel of the Diffuse map; the Alpha channel is a semi-transparent channel. See [link to documentation]. Figure 4As shown, the effect of the alpha mapping can be seen in the skirt hem. The skirt hem without the alpha channel has a black and white texture effect (left image), while the skirt hem with the alpha channel has a semi-transparent effect (right image).
[0070] After obtaining the target texture, to facilitate subsequent processing by artists, the Input path / Output path of the Maps Baker node can be exposed as tool parameters, allowing for custom storage and output paths.
[0071] Furthermore, for the merged material regions obtained from the above division, in order to improve the selectivity of baking, the above method also includes: switching the baking region in response to the selection control operation of the identification information of the region type to be merged.
[0072] In one example, the baking region can be switched via a Switch node. During operation, the Render button can be exposed as a parameter, and other Render parameter expressions can be added under the channel link: maps_baker1 / execute maps_baker2 / execute maps_baker3 / execute, to generate options for the corresponding baking regions. Taking a game character model as an example, after dividing the game character model into a head and body, the selection of the baking region can be set to 0 for whole-body baking, 1 for the body, and 2 for the head. See [link to relevant documentation]. Figure 5 As shown, when the baking area is switched to 0, the entire area (including the body and head) can be baked.
[0073] The above method allows for the merging of multiple material IDs from the target object model. For game character models, the hair, skin, eyes, and clothing of the original game character model can be merged into a single material map. This allows for the simultaneous use of the hair, skin, eyes, and clothing in a single rendering process, reducing draw calls and improving GPU rendering and addressing the time-consuming issues of switching materials. Regarding polygon reduction, the above-mentioned topology reconstruction of the target object model yields a reduced-polygon mesh model. In practice, this can include the following steps:
[0074] Step 4.1) Extract the spline curves of the background mesh of the target object model to obtain the target outline of the target object model;
[0075] Step 4.2) Reconstruct the wiring based on the target contour line to obtain the mesh model after reducing the number of faces.
[0076] Regarding step 4.1) above, the spline curves of the background mesh of the target object model are extracted to obtain the target contour line of the target object model. In specific implementation, this may include the following steps:
[0077] Step 4.1.1): In response to the first selection operation of non-shared spline curves in the spline curves of the background mesh of the target object model, the first contour line of the target object model is determined. In one implementation, a first Group node can be created, the Type can be changed to Edges, Include by Edges can be enabled, Unshared Edges can be checked to extract non-shared edges as the first layer of edge protection, and a group can be created to automatically select non-shared spline curves in the spline curves of the background mesh of the target object model to obtain the first contour line.
[0078] Step 4.1.2) responds to the second selection operation for the specified spline curve in the target object model, determining the second contour line of the target object model. A second Group node is created, guard lines are manually selected, and an Edges type group is created as the second layer of guard line protection. The guard line protection group is passed in using Poly Reduce's Preserve Features. The second layer of guard line protection can use Preserve Features as a parameter expression; more refined guard lines can be manually added in the tool's parameter panel.
[0079] Step 4.1.3) Obtain the target contour line of the target object model based on the first contour line and the second contour line.
[0080] Regarding step 4.2 above, after obtaining the target outline, the game character model can be redefined based on this target outline. See [link / reference]. Figure 6 As shown, the left image is a schematic diagram of the original game character model, and the right image is a schematic diagram of the mesh model after the polygon reduction. It can be seen that the number of triangles in the right image is much less than that in the left image, but the overall outline structure of the right image is still relatively complete. There are no issues of UV stretching and silhouette changes caused by polygon reduction.
[0081] In summary, the method for generating LOD file assets provided in this application embodiment can reduce the number of draw calls during rendering, thereby reducing GPU time consumption and utilization during rendering, while improving the efficiency of model rendering.
[0082] Figure 7 The diagram shows a structural schematic of an apparatus for generating LOD (Level of Detail) file assets according to an embodiment of this application. The apparatus mainly includes the following parts:
[0083] The model loading module 702 is used to load the model file corresponding to the target object model in the game, obtain the material path information of the target object model, and determine multiple model areas corresponding to the target object model based on the material path information.
[0084] Material merging module 704 is used to merge materials from multiple model regions to obtain merged material regions;
[0085] Baking module 706 is used to perform texture baking on the merged material area to obtain the target texture.
[0086] The polygon reduction processing module 708 is used to reconstruct the wiring of the target object model to obtain a mesh model after polygon reduction.
[0087] The LOD file asset generation module 710 is used to generate LOD file assets corresponding to the target object model based on the target texture and mesh model.
[0088] The LOD file asset generation apparatus provided in this application embodiment determines multiple model regions by using the material path information of the target object model in the game, and merges the materials of the multiple model regions to obtain a merged material region. This can reduce the number of draw calls when rendering the model, thereby reducing the GPU time consumption and utilization during rendering. By reconstructing the spline curves of the background mesh of the target object model through wiring, a mesh model with reduced faces is obtained, which can reduce the number of faces rendered in the current frame, thereby reducing the number of rendering times and further improving the rendering efficiency of the LOD file asset corresponding to the target object model.
[0089] In some implementations, the material merging module 704 is further configured to: respond to a selection operation on the target material naming attribute in the material path information, and determine multiple model regions corresponding to the target object model; the target object model includes a game character model, and the model regions include at least one or more of the following model regions: skin region, head region, hair region, eye region, body region, and clothing region.
[0090] In some implementations, the material merging module 704 is further configured to: classify multiple model regions, determine the type of region to be merged in the target object model; and merge the material information of the corresponding model regions based on the type of region to be merged to obtain at least one merged material region.
[0091] In some embodiments, the above apparatus further includes a UV adjustment module for: performing UV layout on model areas that overlap after material merging in response to a stacking operation for the same model areas where stacking occurs.
[0092] In some implementations, the baking processing module 706 is further configured to: generate material number information corresponding to the type of region to be merged in response to a material creation request; and perform texture baking processing on the baking region corresponding to the material number information based on the original texture information to obtain the target texture.
[0093] In some embodiments, the above-described apparatus further includes a baking area switching module, configured to switch the baking area in response to a selection control operation for identification information of the type of area to be merged.
[0094] In some embodiments, the above apparatus further includes an Alpha map determination module: in response to the creation operation of the map network, determining the COP2NetWork compositing network; in response to the creation operation of the shape control module in the COP2NetWork compositing network, importing color texture information from the model file; performing grayscale processing and contrast enhancement processing on the color texture information to generate an Alpha map corresponding to the color map.
[0095] In some embodiments, the above-mentioned polygon reduction processing module 708 is further used to: extract the spline curve of the background mesh of the target object to obtain the target contour line of the target object model; and reconstruct the wiring based on the target contour line to obtain the mesh model after polygon reduction.
[0096] In some embodiments, the above-described surface reduction processing module 708 is further configured to: determine a first contour line of the target object model in response to a first selection operation of a non-shared spline curve in the spline curve of the background mesh of the target object model; determine a second contour line of the target object model in response to a second selection operation of a specified spline curve in the target object model; and obtain a target contour line of the target object model based on the first contour line and the second contour line.
[0097] Figure 8 This illustration shows a schematic diagram of an electronic device provided in an embodiment of this application, including: a processor 801, a storage medium 802, and a bus 803. The storage medium 802 stores machine-readable instructions executable by the processor 801. When the electronic device runs a method for generating LOD file assets as described in the embodiment, the processor 801 communicates with the storage medium 802 via the bus 803. The processor 801 executes the machine-readable instructions, and the preamble of the method item of the processor 801 performs the following steps:
[0098] Load the model file corresponding to the target object model in the game, obtain the material path information of the target object model, and determine multiple model areas corresponding to the target object model based on the material path information;
[0099] Merge the materials of multiple model regions to obtain a merged material region;
[0100] The merged material area is subjected to texture baking to obtain the target texture.
[0101] The spline curves of the background mesh of the target object model are reconstructed by wiring to obtain the mesh model after surface reduction;
[0102] Generate LOD file assets corresponding to the target object model based on the target texture and mesh model.
[0103] In a feasible implementation, when the processor 801 performs the operation of selecting the target material naming attribute in the material path information to determine the multiple model regions corresponding to the target object model, it is specifically used to: determine the multiple model regions corresponding to the target object model; the target object model includes a game character model, and the model regions include at least one or more of the following model regions: skin region, head region, hair region, eye region, body region, and clothing region.
[0104] In a feasible implementation, when the processor 801 performs material merging on multiple model regions to obtain merged material regions, it specifically performs the following: classifies the multiple model regions to determine the type of the target object model to be merged; and merges the material information of the corresponding model regions based on the type of the regions to be merged to obtain at least one merged material region.
[0105] In one feasible implementation, the processor 801 is also configured to: perform UV layout on model areas that have overlapping coverage after material merging in response to a stacking operation for the same model areas where stacking occurs.
[0106] In one feasible implementation, the model file includes the original texture information of the target object model; when the processor 801 performs texture baking processing on the merged material region to obtain the target texture, it specifically performs the following: in response to the material creation request, it generates material number information corresponding to the type of the region to be merged; and performs texture baking processing on the baking region corresponding to the material number information based on the original texture information to obtain the target texture.
[0107] In one feasible implementation, the processor 801 is further configured to: switch the baking region in response to a selection control operation for identification information of the region type to be merged.
[0108] In one feasible implementation, the processor 801 is further configured to: determine the COP2NetWork compositing network in response to the creation operation of the texture network; import color texture information from the model file in response to the creation operation of the shape control module in the COP2NetWork compositing network; and perform grayscale processing and contrast enhancement processing on the color texture information to generate an Ahpha map corresponding to the color texture.
[0109] In a feasible implementation, when the processor 801 performs wiring reconstruction on the spline curve of the background mesh of the target object model to obtain a mesh model with reduced surface area, it specifically performs the following: in response to a node creation operation, it creates a spline curve of the background mesh of the target object model and determines that the type of the spline curve of the background mesh of the target object model is a spline curve type; it extracts the spline curve of the background mesh of the target object to obtain the target contour line of the target object model; and it performs wiring reconstruction based on the target contour line to obtain a mesh model with reduced surface area.
[0110] In one feasible implementation, when the processor 801 performs spline curve extraction processing on the background mesh of the target object to obtain the target contour line of the target object model, it specifically performs the following actions: in response to a first selection operation for a non-shared spline curve in the spline curve of the background mesh of the target object model, it determines a first contour line of the target object model; in response to a second selection operation for a specified spline curve in the target object model, it determines a second contour line of the target object model; and obtains the target contour line of the target object model based on the first contour line and the second contour line.
[0111] By merging materials from multiple model regions using the above method, a merged material region can be obtained. This reduces the number of draw calls during model rendering, thereby reducing GPU time consumption and usage. By reconstructing the spline curves of the background mesh of the target object model through wiring, a mesh model with reduced faces can be obtained, which can reduce the number of faces rendered in the current frame, thereby reducing the number of rendering times and further improving the rendering efficiency of the LOD file assets corresponding to the target object model.
[0112] This application embodiment also provides a computer-readable storage medium storing a computer program, which is executed by a processor, and the processor performs the following steps:
[0113] Load the model file corresponding to the target object model in the game, obtain the material path information of the target object model, and determine multiple model areas corresponding to the target object model based on the material path information;
[0114] Merge the materials of multiple model regions to obtain a merged material region;
[0115] The merged material area is subjected to texture baking to obtain the target texture.
[0116] The spline curves of the background mesh of the target object model are reconstructed by wiring to obtain the mesh model after surface reduction;
[0117] Generate LOD file assets corresponding to the target object model based on the target texture and mesh model.
[0118] In a feasible implementation, when the processor performs the operation of determining multiple model regions corresponding to the target object model based on material path information, it is specifically used for: selecting the target material naming attribute in the material path information, and determining multiple model regions corresponding to the target object model; the target object model includes a game character model, and the model regions include at least one or more of the following model regions: skin region, head region, hair region, eye region, body region, and clothing region.
[0119] In one feasible implementation, when the processor performs material merging on multiple model regions to obtain merged material regions, it specifically performs the following: classifies the multiple model regions to determine the type of the target object model to be merged; and merges the material information of the corresponding model regions based on the type of the regions to be merged to obtain at least one merged material region.
[0120] In one feasible implementation, the processor is also configured to: perform UV layout on model areas that overlap after material merging in response to stacking operations for the same model areas where stacking occurs.
[0121] In one feasible implementation, the model file includes the original texture information of the target object model; when the processor performs texture baking on the merged material region to obtain the target texture, it specifically performs the following: in response to the material creation request, it generates material number information corresponding to the type of the region to be merged; and performs texture baking on the baking region corresponding to the material number information based on the original texture information to obtain the target texture.
[0122] In one feasible implementation, the processor is also configured to: switch the baking region in response to a selection control operation for identification information of the region type to be merged.
[0123] In one feasible implementation, the processor is further configured to: determine the COP2NetWork compositing network in response to the creation operation of the texture network; import color texture information from the model file in response to the creation operation of the shape control module in the COP2NetWork compositing network; and perform grayscale processing and contrast enhancement processing on the color texture information to generate an Ahpha map corresponding to the color texture.
[0124] In one feasible implementation, when the processor performs wiring reconstruction on the spline curve of the background mesh of the target object model to obtain a mesh model with reduced surface area, it specifically performs the following: in response to a node creation operation, it creates a spline curve of the background mesh of the target object model and determines that the type of the spline curve of the background mesh of the target object model is a spline curve type; it extracts the spline curve of the background mesh of the target object to obtain the target contour line of the target object model; and it performs wiring reconstruction based on the target contour line to obtain a mesh model with reduced surface area.
[0125] In one feasible implementation, when the processor performs spline curve extraction processing on the background mesh of the target object to obtain the target contour line of the target object model, it specifically performs the following steps: in response to a first selection operation for a non-shared spline curve in the spline curve of the background mesh of the target object model, it determines a first contour line of the target object model; in response to a second selection operation for a specified spline curve in the target object model, it determines a second contour line of the target object model; and obtains the target contour line of the target object model based on the first contour line and the second contour line.
[0126] By merging materials from multiple model regions using the above method, a merged material region can be obtained. This reduces the number of draw calls during model rendering, thereby reducing GPU time consumption and usage. By reconstructing the spline curves of the background mesh of the target object model through wiring, a mesh model with reduced faces can be obtained, which can reduce the number of faces rendered in the current frame, thereby reducing the number of rendering times and further improving the rendering efficiency of the LOD file assets corresponding to the target object model.
[0127] In this embodiment, the computer program, when run by the processor, can also execute other machine-readable instructions to perform other methods as described in the embodiments. For details on the specific execution steps and principles, please refer to the description of the embodiments, which will not be repeated here.
[0128] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0130] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0131] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0132] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0133] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A method for generating LOD (Level of Detail) file assets, characterized in that, The method includes: Load the model file corresponding to the target object model in the game, obtain the material path information of the target object model, and determine multiple model regions corresponding to the target object model based on the material path information; The materials of multiple model regions are merged to obtain a merged material region; The merged material area is subjected to texture baking to obtain the target texture; The spline curves of the background mesh of the target object model are extracted to obtain the target contour line of the target object model; Based on the target contour line, wiring reconstruction is performed to obtain a mesh model with reduced surface area; Based on the target texture and the mesh model, generate the LOD file asset corresponding to the target object model.
2. The method for generating LOD file assets according to claim 1, characterized in that, Based on the material path information, multiple model regions corresponding to the target object model are determined, including: In response to a selection operation on the target material naming attribute in the material path information, multiple model regions corresponding to the target object model are determined; the target object model includes a game character model, and the model regions include at least one or more of the following model regions: skin region, head region, hair region, eye region, body region, and clothing region.
3. The method for generating LOD file assets according to claim 1 or 2, characterized in that, The materials of multiple model regions are merged to obtain a merged material region, including: The multiple model regions are classified to determine the type of region to be merged in the target object model; Based on the type of the region to be merged, the material information of the corresponding model region is merged to obtain at least one merged material region.
4. The method for generating LOD file assets according to claim 3, characterized in that, The method further includes: In response to stacking operations on identical model regions that are stacked, perform UV layout on model regions that overlap after material merging.
5. The method for generating LOD file assets according to claim 3, characterized in that, The model file includes the original texture information of the target object model; The merged material region is subjected to texture baking to obtain the target texture, including: In response to the request to create a material, generate material number information corresponding to the type of the region to be merged; Based on the original texture information, the baking area corresponding to the material number information is subjected to texture baking processing to obtain the target texture.
6. The method for generating LOD file assets according to claim 5, characterized in that, The method further includes: In response to a selection control operation based on the identification information of the region type to be merged, the baking region is switched.
7. The method for generating LOD file assets according to claim 5, characterized in that, The method further includes: In response to the creation operation of the texture network, determine the COP2NetWork composition network; In response to the creation operation of the shape control module in the COP2NetWork synthesis network, the color texture information in the model file is imported; The color texture information is subjected to grayscale processing and contrast enhancement processing to generate an Ahpha map corresponding to the color map.
8. The method for generating LOD file assets according to claim 1, characterized in that, Extracting the spline curves of the background mesh of the target object model to obtain the target contour line of the target object model includes: In response to a first selection operation of a non-shared spline curve in the spline curve of the background mesh of the target object model, a first contour line of the target object model is determined. In response to a second selection operation for a specified spline curve in the target object model, a second contour line of the target object model is determined; The target contour line of the target object model is obtained based on the first contour line and the second contour line.
9. An apparatus for generating LOD (Level of Detail) file assets, characterized in that, The device includes: The model loading module is used to load the model file corresponding to the target object model in the game, obtain the material path information of the target object model, and determine multiple model regions corresponding to the target object model based on the material path information. The material merging module is used to merge the materials of multiple model regions to obtain a merged material region. The baking module is used to perform texture baking on the merged material area to obtain the target texture. The polygon reduction module is used to extract the spline curves of the background mesh of the target object model to obtain the target contour line of the target object model; and to reconstruct the wiring based on the target contour line to obtain the mesh model after polygon reduction. The LOD file asset generation module is used to generate LOD file assets corresponding to the target object model based on the target texture and the mesh model.
10. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of a method for generating LOD file assets as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of a method for generating LOD file assets as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Grid processing method for LOD model generation and grid processing system thereof and 3D reconstruction method and system
CN106384386A
Image rendering method and device, equipment, storage medium and program product
CN114359458A