CN-115888117-B - LOD file asset generation method and device, electronic equipment and storage medium
Abstract
The application provides a method, a device, electronic equipment and a storage medium for generating LOD file assets, and relates to the technical field of scene rendering, wherein the method comprises the steps of loading a model file corresponding to a target object model in a game, obtaining material path information of the target object model, and determining a plurality of model areas corresponding to the target object model based on the material path information; the method comprises the steps of carrying out material combination on a plurality of model areas to obtain combined material areas, carrying out mapping baking treatment on the combined material areas to obtain a target mapping, carrying out wiring reconstruction on a target object model to obtain a grid model after face reduction, and generating LOD file assets corresponding to the target object model based on the target mapping and the grid model. The application can reduce the times of drawing calls (Draw calls) during rendering, further reduce the time consumption and the occupancy rate of the GPU during rendering, and simultaneously improve the efficiency of model rendering.
Inventors
- LI SHUO
Assignees
- 网易(杭州)网络有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20221115
Claims (11)
- 1. A method of generating LOD file assets, the method comprising: Loading a model file corresponding to a target object model in a game, acquiring material path information of the target object model, and determining a plurality of model areas corresponding to the target object model based on the material path information; Combining the materials of the plurality of model areas to obtain a combined material area; Performing mapping baking treatment on the combined material areas to obtain a target mapping; Extracting spline curves of a background grid of the target object model to obtain a target contour line of the target object model; Performing wiring reconstruction based on the target contour line to obtain a grid model after face reduction; and generating LOD file assets corresponding to the target object model based on the target map and the grid model.
- 2. The method of claim 1, wherein determining a plurality of model regions corresponding to the target object model based on the material path information comprises: And determining a plurality of model areas corresponding to the target object model in response to a selection operation aiming at the naming attribute of the target material in the material path information, wherein the target object model comprises a game role model, and the model areas at least comprise one or more of a skin area, a head area, a hair area, an eye area, a body area and a clothing area.
- 3. The method of claim 1 or 2, wherein merging the materials of the plurality of model areas to obtain a merged material area, comprising: classifying the model areas, and determining the type of the area to be merged of the target object model; And merging the material information of the corresponding model region based on the type of the region to be merged to obtain at least one merged material region.
- 4. The method of generating LOD file assets of claim 3, further comprising: And responding to stacking operation of the same model area subjected to stacking, and carrying out UV layout on the model area with overlapping coverage after material merging.
- 5. The method of claim 3, wherein the model file includes original map information of the target object model, wherein the performing a map baking process on the merged material region to obtain a target map comprises: Responding to a request for creating materials, and generating material number information corresponding to the type of the region to be combined; And carrying out mapping baking treatment on the baking area corresponding to the material number information based on the original mapping information to obtain a target mapping.
- 6. The method of generating LOD file assets of claim 5, further comprising: and switching the baking area in response to a selection control operation of the identification information of the type of the area to be combined.
- 7. The method of generating LOD file assets of claim 5, further comprising: determining a COP2NetWork synthetic network in response to a creation operation of the map network; Responding to the creation operation of a form control module in the COP2NetWork synthesis network, and importing color texture information in the model file; and carrying out gray level processing and contrast enhancement processing on the color texture information to generate Ahpha maps corresponding to the color maps.
- 8. The method for generating LOD file assets according to claim 1, wherein extracting spline curves of a background grid of the target object model to obtain a target contour of the target object model includes: Determining a first contour of the target object model in response to a first selection operation of non-shared spline curves in spline curves for a background mesh of the target object model; determining a second contour of the target object model in response to a second selection operation for a specified spline curve of the target object model; and obtaining a target contour line of the target object model based on the first contour line and the second contour line.
- 9. A device for generating LOD file assets, the device comprising: The model loading module is used for loading a model file corresponding to a target object model in a game, acquiring material path information of the target object model, and determining a plurality of model areas corresponding to the target object model based on the material path information; the material merging module is used for merging materials of the plurality of model areas to obtain a merged material area; the baking processing module is used for carrying out mapping baking processing on the combined material areas to obtain a target mapping; The surface reduction processing module is used for extracting spline curves of a background grid of the target object model to obtain a target contour line of the target object model; And the LOD file asset generation module is used for generating LOD file assets corresponding to the target object model based on the target map and the grid model.
- 10. An electronic device comprising a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium in communication over the bus when the electronic device is in operation, the processor executing the machine-readable instructions to perform the steps of a method of generating an LOD file asset as claimed in any one of claims 1 to 8.
- 11. A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, performs the steps of a method of generating LOD file assets according to any one of claims 1 to 8.
Description
LOD file asset generation method and device, electronic equipment and storage medium Technical Field The invention relates to the technical field of scene rendering, in particular to a method and a device for generating LOD file assets, electronic equipment and a storage medium. Background When the game model is displayed in the game scene, the display of the model at a position farther from the view angle range of the player is more blurred, so that the overall rendering efficiency of the game model can be improved by reasonably subtracting the number of the model surfaces of the model at a position farther from the view angle range of the player. In the related art, the DCC software is manually adjusted by an artist, so that the manufacturing process is time-consuming and labor-consuming, and the workload of modification is large, resulting in lower manufacturing efficiency. Disclosure of Invention The invention aims to provide a LOD file asset generation method, a LOD file asset generation device, an LOD file asset generation electronic device and a LOD file asset generation storage medium, which can reduce the number of drawing calls (Draw calls) during rendering, further reduce the time consumption and the occupancy rate of a GPU during rendering, and improve the model rendering efficiency. In a first aspect, the present invention provides a method for generating an LOD file asset, the method comprising: Loading a model file corresponding to a target object model in a game, acquiring material path information of the target object model, and determining a plurality of model areas corresponding to the target object model based on the material path information; combining materials of the plurality of model areas to obtain a combined material area; Performing mapping baking treatment on the combined material area to obtain a target mapping; carrying out wiring reconstruction on the target object model to obtain a grid model after face reduction; And generating LOD file assets corresponding to the target object model based on the target map and the grid model. In a second aspect, the present invention provides an apparatus for generating an LOD file asset, the apparatus comprising: The model loading module is used for loading a model file corresponding to a target object model in the game, acquiring material path information of the target object model, and determining a plurality of model areas corresponding to the target object model based on the material path information; The material merging module is used for merging materials of the plurality of model areas to obtain merged material areas; the baking processing module is used for carrying out mapping baking processing on the combined material area to obtain a target mapping; the surface reduction processing module is used for carrying out wiring reconstruction on the model line of the target object to obtain a grid model after surface reduction; And the LOD file asset generation module is used for generating LOD file assets corresponding to the target object model based on the target map and the grid model. In a third aspect, the invention provides an electronic device comprising a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium in communication over the bus when the electronic device is in operation, the processor executing the machine-readable instructions to perform the steps of a method of generating an LOD file asset as in the previous embodiments. In a fourth aspect, the present invention provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor performs the steps of a method of generating an LOD file asset as in the previous embodiments. The method has the advantages that the multiple model areas are determined through the material path information of the target object model in the game, the materials of the multiple model areas are combined to obtain the combined material areas, the number of drawing calls (Draw calls) can be reduced when the model is rendered, so that the time consumption and the occupancy rate of the GPU in rendering are reduced, the grid model with the reduced surface is obtained through wiring reconstruction of the target object model, the number of surfaces rendered by the current frame can be reduced, the rendering times are further reduced, and the rendering efficiency of LOD file assets corresponding to the target object model is further improved. Drawings In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present application, and other drawings can be obtained according to the