Material conversion method, device, computer equipment and medium
By obtaining and correcting the baking data of the three-dimensional model file, and using the baking template to generate PBR map files, the problem of low efficiency of material systems in different renderers is solved, and efficient material conversion and standardization is achieved.
Patent Information
- Application Number
- CN202210224208.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-03-09
AI Technical Summary
In the prior art, the material systems of different renderers cannot achieve high-fidelity interchange, resulting in commercial three-dimensional engines being unable to directly reuse the materials produced by the renderer, which requires manual adjustment, which is inefficient and difficult.
By obtaining baking data, including three-dimensional model files and baking templates carrying rendered materials, the three-dimensional model files are corrected, and baked conversion is performed to generate PBR map files. The baking template is adaptively adjusted to achieve high-quality PBR material conversion.
It improves the material conversion efficiency, achieves high-quality and highly targeted PBR material conversion effect, and is suitable for material standardization work in the field of high complexity CG and gaming.
Smart Images

Figure CN114663568B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer graphics technology, and in particular to a material conversion method, apparatus, computer equipment, and medium thereof. Background Art
[0002] The CG (Computer Graphics) industry has mainstream renderers such as V-Ray, Conora, Redshift, Arnold, and Octance, which provide high-quality image and animation rendering for 3D modeling software in various fields. However, each renderer has its own material system, each containing specific material properties and parameters. These renderers lack universality and cannot achieve high-fidelity conversion. As a result, commercial 3D engines (such as Unity and UE4) or self-developed 3D engines cannot directly reuse materials produced by these renderers. Even after basic material mapping is completed, the material effects in the 3D engine still differ significantly from those of the original renderer, making it impossible to restore the original material performance of the model. Reconversion or manual readjustment is extremely time-consuming and labor-intensive.
[0003] Although the PBR (Physically Based Rendering) material production process was developed to standardize materials, there's currently no mature material tool in the graphics field that can convert general renderer materials into universal PBR material files and data. Traditionally, engine engineers or technical artists (TAs) use their experience to perform simple parameter conversions (texture maps, color values). However, if a material contains unique textures or complex nested structures, these effects will be lost. The 3D engine then uses custom parameters to visually align these effects. This approach is difficult, inefficient, and requires high precision, making it a difficult technical challenge for material processing in the graphics field. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a material conversion method, apparatus, computer equipment and medium thereof to solve the problem of low efficiency of three-dimensional rendering material conversion.
[0005] In order to solve the above technical problems, the present invention provides a material conversion method, including:
[0006] Obtain baking data, wherein the baking data includes a 3D model file carrying rendering materials and a baking template;
[0007] Modify the 3D model file according to the baking template;
[0008] The corrected 3D model file is baked and converted to generate a PBR map file.
[0009] In order to solve the above technical problems, the present invention further provides a material conversion device, comprising:
[0010] An acquisition module is used to acquire baking data, wherein the baking data includes a three-dimensional model file carrying a rendering material and a baking template;
[0011] The correction module is used to correct the 3D model file according to the baking template;
[0012] The baking conversion module is used to bake the modified 3D model file to generate a PBR map file.
[0013] In order to solve the above technical problems, an embodiment of the present application further provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the above material conversion method are implemented.
[0014] In order to solve the above technical problems, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned material conversion method are implemented.
[0015] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0016] By obtaining baking data, wherein the baking data includes a three-dimensional model file carrying rendering materials and a baking template, the three-dimensional model file is corrected according to the baking template, and the corrected three-dimensional model file is baked and converted to generate a PBR map file. On the one hand, by correcting the three-dimensional model file carrying rendering materials, the parameters of the three-dimensional model file are adaptively adjusted, so that the baking conversion is performed under the conditions that meet the PBR conversion, thereby showing a high-quality and highly targeted PBR material conversion effect, and improving the material conversion baking efficiency. On the other hand, the technical solution of the present application makes the material conversion process more universal and convenient by correcting the three-dimensional model file, and is suitable for material standardization work in CG and game fields with large quantity and high complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the solutions in this application, a brief introduction will be given below to the drawings required for use in the description of the embodiments of this application. Obviously, the drawings described below are some embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0019] Figure 2 is a flow chart of an embodiment of the material conversion method of the present application;
[0020] Figure 3 This is an overall diagram of the file upload and background task processing service process of this application;
[0021] Figure 4 This is a flowchart of an embodiment of the background service processing of the present application;
[0022] Figure 5 It is a schematic diagram of the overall structure of the material conversion method of the present application;
[0023] Figure 6 This is a schematic diagram of an embodiment of the material conversion device of the present application;
[0024] Figure 7 This is the basic structural block diagram of the computer device of this application. DETAILED DESCRIPTION
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of the application are for the purpose of describing specific embodiments only and are not intended to limit this application. The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0026] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0028] Based on this, the present application provides a material conversion method to solve the above technical problems.
[0029] like Figure 1As shown, system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. Network 104 is a medium for providing communication links between terminal devices 101, 102, 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0030] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0031] Terminal devices 101, 102, and 103 can be various electronic devices with display screens and support web browsing, including but not limited to smartphones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV), laptop computers, desktop computers, etc.
[0032] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0033] It should be noted that the material conversion method provided in the embodiment of the present application is executed by a server / terminal device, and accordingly, the material conversion device is generally set in the server / terminal device.
[0034] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0035] Continue to refer Figure 2 , Figure 2 The flowchart of an embodiment of a material conversion method includes:
[0036] S201: Obtain baking data, where the baking data includes a 3D model file carrying rendering materials and a baking template.
[0037] The baking data includes the original files that need to be converted into PBR and the baking templates corresponding to the conversion into PBR. The original files include 3D model files corresponding to various renderer types. The 3D model files include the rendering materials provided by the renderer type. The renderer types can be, but are not limited to, Vray (renderer research), CORONA (an interior rendering renderer), Redshift (Redshift renderer), Arnold (Arnold renderer), and Octane (an unbiased renderer based on GPU technology) and other rendering software. Vray's rendering material is VrayMtl. Using this material in the scene can obtain more accurate physical lighting (light energy distribution), faster rendering, and more convenient adjustment of reflection and refraction parameters; Arnold's rendering material can be plastic, glass, metal, etc. The baking template includes various rendering parameters for converting the materials of each renderer type into PBR maps.
[0038] The acquisition method can be the baking data directly input by the user, or obtained from the task queue cached in the server.
[0039] In the embodiment of the present application, before obtaining the baking data, the material conversion method further includes:
[0040] Get the 3D model file with rendering material;
[0041] Generate baking tasks based on 3D model files;
[0042] Store baking tasks in the task queue.
[0043] Specifically, the 3D model files carrying rendering materials are the 3D model files corresponding to the various renderer types to be converted and baked. The rendering materials are as described in the examples above and will not be described in detail here. These can be obtained directly from the rendering materials corresponding to the renderer type selected by the user in the 3D modeling software, or by obtaining rendering materials pre-stored in a database for that renderer type. The acquisition method is not limited here.
[0044] In addition to obtaining the original file, it also includes the map file and the corresponding baking parameters. That is, the baking task corresponding to the original file is generated through the map file and the corresponding baking parameters. The baking task is used to describe and provide the conditions, materials, and baking templates for converting into PBR map files. Map files contain a lot of other information besides textures, such as UV coordinates (referring to texture mapping coordinates), input and output controls for maps, etc. The function of the map file is to map the texture to the surface of a three-dimensional object through UV coordinates.
[0045] Furthermore, baking tasks can be generated in batches and stored in the background server in the form of a task queue. The task queue provides the functions required to execute tasks, so that tasks can be retried, results can be returned, and task status can be recorded when baking conversion is performed later.
[0046] Continue to refer Figure 3 and Figure 4 , Figure 3 This is the overall diagram of the application file upload and background task processing service process. Figure 4 This is a flowchart of an embodiment of the background service processing of this application, specifically including:
[0047] The user uploads the PBR original file through the terminal device entrance, that is, uploads the 3D model files corresponding to various renderer types to be converted and baked, or obtains the PBR original file through a database such as MySQL, and detects the PBR original file through the task manager. When the PBR original file fails the detection, for example, when the upload fails due to the missing or incorrect type of the obtained PBR original file, an upload error report is returned to the user's terminal device.
[0048] Furthermore, after passing the test, the user needs to fill in the baking parameter settings for the material conversion on the terminal device to manage the expected output effect. Alternatively, the default baking template provided can be used. After completing all the above baking data input, the original file and the baking parameters required for the conversion are sent to the task management server (such as a web server) for task management and information persistence storage. The corresponding baking task is generated and inserted into the Redis (Remote Dictionary Server) queue.
[0049] Furthermore, obtaining baking data specifically includes the following steps:
[0050] Parse and obtain 3D model files, 3D model types, and rendering attribute information from the task queue;
[0051] Determine a rendering parameter template based on the 3D model type and rendering attribute information;
[0052] Get the baking template based on the rendering parameter template.
[0053] Specifically, when a user-initiated request for material conversion of an original file is detected, the server generates at least one material conversion task; the task is parsed from the task queue, and the parsing process includes obtaining the task's json data from redis, and obtaining the corresponding task's 3D model file, 3D model type, renderer type, material type, texture type, map type, and rendering attribute information by parsing the task's json data. The rendering attribute information includes the file's global setting information and the corresponding parameter values. The file's global setting information can be the image output size, quality level, etc.; based on the above information, a baking template is obtained, wherein the baking template includes pre-made PBR material baking template parameters and the PBR material properties that need to be converted. The baking template parameters may include but are not limited to GI presets, light map presets, and ambient light presets. Material properties may include but are not limited to diffuse reflection, reflection, reflection glossiness, Fresnel parameters, etc., which are not limited here.
[0054] Among them, 3D model types include .max / .fbx / .mb / .gltf / .skp, etc.; renderer types include standard renderer, VRay renderer, Arnold renderer, redshift renderer, etc.; texture types include general textures and renderer custom textures; map types include jpg / png, etc.
[0055] 3D model types such as .max and .mb are read through the parser of DCC (Digital Content Creation) modeling software. Other common formats are read through format conversion tools. Textures and maps are read and parsed by selecting the corresponding renderer SDK (Software Development Kit).
[0056] Furthermore, based on the rendering attribute information corresponding to the above-mentioned various types, the corresponding rendering tool is matched; based on the material of the rendering tool and the 3D model type, the corresponding rendering parameter template is matched; based on the rendering parameter template, the pre-made PBR material baking template parameters and the PBR material properties that need to be converted are obtained; based on the baking parameters, the baking elements that need to be added to convert to PRB materials are set, and specified properties are added to the set baking elements, such as the uploaded .max 3D model file and the vray material it carries, opening 3dmax for model parsing, calling the vray renderer to read the vray material and texture, and using the pre-made vray parameter rendering parameter template and baking elements to achieve conversion to PBR materials. In this way, general materials can be converted with high fidelity to the files and data required for the real physical rendering (PBR) process material based on the matched baking template, maximizing the conversion accuracy and efficiency, and solving the problem that the materials of commonly used renderers are not universal.
[0057] S202: Modify the 3D model file according to the baking template.
[0058] Specifically, the correction process is implemented through scripting language and needs to be continuously optimized and adjusted according to the baking situation. On the one hand, the 3D model file is corrected to avoid errors and crashes in the baking process. On the other hand, due to the inevitable distortion of the effect in the baking process, it can only be close to the original effect and cannot be completely consistent. Therefore, the baked PBR map effect and the original effect need to be repeatedly corrected to make the output effect as close as possible to the input effect.
[0059] Specifically, the modification of the 3D model file according to the baking template includes:
[0060] The rendering attribute information of the 3D model file is modified according to the baking template to update the 3D model file.
[0061] Specifically, before baking, unsupported material properties, namely rendering attribute information, need to be corrected and made compatible. After baking, the color difference of the image in the 3D model file needs to be corrected so that the updated 3D model file is closer to and more realistic than the original effect.
[0062] Based on the rendering property information and baking template obtained by task queue analysis, the renderer settings, material data, texture data, map data, files and global parameters contained in the 3D model file are corrected to obtain rendering material information that meets the rendering material conditions.
[0063] S203: Perform baking conversion on the corrected 3D model file to generate a PBR map file.
[0064] In the embodiment of the present application, the modified 3D model file is baked and converted to generate a PBR map file. The specific steps include:
[0065] Based on the baking template, determine the baking elements of the revised 3D model file;
[0066] Get the properties corresponding to the baking elements;
[0067] Convert 3D files into PBR map files based on their attributes.
[0068] Based on the baking parameters in the baking template, set the baking elements that need to be added to convert the corrected 3D model file to the PRB material, and add specified attributes to the set baking elements. Based on the corrected 3D model file, use the material baking tool to bake the material of the 3D model file to obtain the PRB map file produced by the PBR-like process. Among them, the baking elements include diffuse reflection, reflection, normal, transparency, etc., and the attributes include image output size, file type, output channel, etc. The material baking tool includes material baking scripts, external software or SDKs, such as Substance, vraySDK, etc. The process production can be Metallic / Roughness (metal value / roughness) or Specular / Glossiness (specular reflection / glossiness), which is not limited here.
[0069] PBR map files are baked maps. Baked maps convert the light and shadow relationships between 3D model files into realistic images. Baked maps include normal maps, conversion maps, specular maps, solid color maps, etc.
[0070] Furthermore, by building a multi-process / multi-thread service environment and a distributed rendering server, when there are too many tasks, multi-process / thread concurrent services and distributed rendering can be used to realize the conversion and generation of multiple PBR map files, thereby improving rendering efficiency.
[0071] By obtaining baking data, wherein the baking data includes a 3D model file carrying rendering materials and a baking template,
[0072] The 3D model file is corrected according to the baking template, and the corrected 3D model file is baked and converted to generate a PBR map file. On the one hand, by correcting the 3D model file carrying the rendering material, the parameters of the 3D model file are adaptively adjusted, so that the baking conversion is performed under the conditions that meet the PBR conversion, thereby showing a high-quality and highly targeted PBR material conversion effect, and improving the material conversion baking efficiency. On the other hand, the technical solution of the present application makes the material conversion process more universal and convenient by correcting the 3D model file, and is suitable for material standardization work in CG and game fields with large quantity and high complexity.
[0073] Furthermore, when a crash or stop is detected during the baking conversion process, the 3D model file that is not currently performing baking conversion is recorded; when a new baking conversion operation instruction is received, baking conversion is started from the 3D model file that is not currently performing baking conversion.
[0074] Specifically, the PBR baking conversion process is monitored in real time by launching a daemon tool. If the PBR baking conversion service process crashes or stops, the daemon tool will start a new conversion process and continue the unfinished material baking conversion task in the new conversion process. The daemon tool includes but is not limited to process daemonization, single-task time limit, and exception pop-up window processing.
[0075] If the material conversion service is covered by a prompt pop-up window during execution, the rendering daemon process processes the prompt pop-up window to allow the current PBR baking conversion to continue execution.
[0076] Furthermore, if it is detected that the baking conversion process exceeds the preset time due to a fault, the current baking conversion is terminated, and the baking conversion is started from the 3D model file that has not currently performed the baking conversion. That is, the guardian tool terminates the baking conversion timeout process and starts a new baking conversion to continue executing the baking conversion task that has not been completed normally.
[0077] In the examples of this application, please refer to Figure 5 , Figure 5This is a schematic diagram of the overall structure of the material conversion method of the present application. The user initiates a task information request for generating MV (Model View) to the modelview-service (model view server); the modelview-service stores the task information and submits the task information to the pbrqueue, i.e., the pbr task queue; the pbr queue extracts the task information to obtain the baking task information, which may include the finished model task and the material task; the pbr queue submits the identified baking task information to redis (cache); the pbr-service, i.e., the PBR material conversion service, manages the baking task information in a regular manner through polling when idle, and stores the task status and task result information in the monitored baking task information to redis, and the pbr-service is used to update the task status and assign task execution; the pbr-service saves the converted material files, data, etc. to the MySQL database, and the pbr-service callback notifies the modelview-service of the task status so that the modelview-service updates the task status. All data communication with pbr-service will be conducted through Redis, and no direct communication with other external services will occur. Except for logic such as file downloads implemented within pbr-service, which must be downloaded directly from the relevant storage center, a daemon on the server ensures the stable operation of conversion scripts and programs. All other task-related information and data will be passed to pbrqueue via Redis. After this, the main process of the task will be tracked and controlled in pbrqueue, which will safeguard the task processing flow and handle exceptions. Tracking and control include exception and error reporting, progress updates, and other aspects to ensure the efficient and error-free execution of the entire material conversion process, reducing data loss during the material conversion process caused by abnormal situations such as task crashes or shutdowns, thereby improving material conversion efficiency and quality.
[0078] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0079] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0080] Further references Figure 6 , as a response to the above Figure 2 The present application provides a schematic diagram of an embodiment of a material conversion device, which is similar to the embodiment of the material conversion method shown in FIG. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0081] like Figure 6 As shown, the material conversion device of this embodiment includes: an acquisition module 61, a correction module 62 and a baking conversion module 63.
[0082] An acquisition module 61 is configured to acquire baking data, wherein the baking data includes a 3D model file carrying rendering materials and a baking template;
[0083] A correction module 62 is used to correct the 3D model file according to the baking template;
[0084] The baking conversion module 63 is used to perform baking conversion on the corrected 3D model file to generate a PBR map file.
[0085] In an embodiment of the present application, the material conversion device further includes:
[0086] A file acquisition module 64 is used to acquire a 3D model file carrying a rendering material;
[0087] A generation module 65 is used to generate a baking task based on the 3D model file;
[0088] The storage module 66 is configured to store the baking task in the task queue.
[0089] In the embodiment of the present application, the acquisition module 61 includes:
[0090] The parsing unit 611 is used to parse the task queue to obtain the 3D model file, 3D model type and rendering attribute information;
[0091] A determining unit 612 is configured to determine a rendering parameter template based on the 3D model type and rendering attribute information;
[0092] The acquiring unit 613 is configured to acquire a baking template based on the rendering parameter template.
[0093] In the embodiment of the present application, the correction module 62 includes:
[0094] The updating unit 621 is configured to modify the rendering attribute information of the 3D model file according to the baking template to update the 3D model file.
[0095] In the embodiment of the present application, the baking conversion module 63 includes:
[0096] A baking unit 631 is used to determine baking elements of the modified 3D model file based on the baking template;
[0097] The attribute unit 632 is used to obtain the attribute corresponding to the baking element;
[0098] The conversion unit 633 is used to convert the 3D file into a PBR map file according to the attributes.
[0099] In an embodiment of the present application, the material conversion device further includes:
[0100] The recording module 67 is used to record the 3D model files that are not currently being baked when a crash or stop in the baking conversion process is detected;
[0101] The execution module 68 is configured to start executing the baking conversion from the 3D model file that has not been currently subjected to the baking conversion when receiving a new baking conversion operation instruction.
[0102] In an embodiment of the present application, the material conversion device further includes:
[0103] The fault execution module 69 is configured to terminate the current baking conversion if it is detected that the preset time has been exceeded during the baking conversion process, and start baking conversion from the 3D model file that has not been currently baked converted.
[0104] Regarding the material conversion device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0105] To solve the above technical problems, the present application also provides a computer device. Figure 7 , Figure 7 This is a basic structural block diagram of the computer device in this embodiment.
[0106] The computer device 7 includes a memory 71, a processor 72, and a network interface 73 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 7 with components 71-73, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0107] The computer device may be a desktop computer, notebook computer, PDA, cloud server, etc. The computer device may interact with the user via a keyboard, mouse, remote control, touchpad, or voice control device.
[0108] The memory 71 includes at least one type of readable storage medium, including flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or D-interface display memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, a magnetic disk, an optical disk, etc. In some embodiments, the memory 71 may be an internal storage unit of the computer device 7, such as the hard disk or memory of the computer device 7. In other embodiments, the memory 71 may also be an external storage device of the computer device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 7. Of course, the memory 71 may also include both the internal storage unit of the computer device 7 and its external storage device. In this embodiment, the memory 71 is generally used to store the operating system and various application software installed on the computer device 7, such as the program code of the material conversion method. In addition, the memory 71 can also be used to temporarily store various types of data that have been output or are to be output.
[0109] In some embodiments, the processor 72 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 72 is generally used to control the overall operation of the computer device 7. In this embodiment, the processor 72 is used to execute program code stored in the memory 71 or process data, such as executing the program code for the material conversion method.
[0110] The network interface 73 may include a wireless network interface or a wired network interface. The network interface 73 is generally used to establish a communication connection between the computer device 7 and other electronic devices.
[0111] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores a material conversion program, and the material conversion program can be executed by at least one processor to enable the at least one processor to perform the steps of the material conversion method as described above.
[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0113] Obviously, the embodiments described above are only some of the embodiments of the present application, rather than all of the embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned specific embodiments, or to make equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present application.
Claims
1. A material conversion method, characterized in that: include: Obtaining baking data, wherein the baking data includes a three-dimensional model file carrying rendering materials and a baking template; Modifying the three-dimensional model file according to the baking template; Bake and convert the corrected 3D model file to generate a PBR map file; Before obtaining the baking data, the method further includes: Obtaining a 3D model file carrying a rendering material; the 3D model file carrying a rendering material is a 3D model file corresponding to various renderer types to be converted and baked; generating a baking task based on the three-dimensional model file; Storing the baking task in a task queue; The obtaining of baking data includes: Parsing and obtaining the 3D model file, 3D model type and rendering attribute information from the task queue; Determining a rendering parameter template according to the three-dimensional model type and the rendering attribute information; Based on the rendering parameter template, obtaining a baking template; The method further comprises: When a crash or stop is detected during the baking conversion process, a 3D model file that is not currently undergoing baking conversion is recorded; When a new baking conversion operation instruction is received, starting to perform baking conversion from the three-dimensional model file that is not currently subjected to baking conversion; If it is detected that the baking conversion process exceeds a preset time, the current baking conversion is terminated, and the baking conversion is started from the three-dimensional model file that is not currently subjected to baking conversion.
2. The material conversion method according to claim 1, characterized in that: The modifying of the three-dimensional model file according to the baking template includes: The rendering attribute information of the three-dimensional model file is modified according to the baking template to update the three-dimensional model file.
3. The material conversion method according to claim 1, characterized in that: The baking conversion of the modified 3D model file to generate a PBR map file includes: Determining baking elements of the modified three-dimensional model file based on the baking template; Get the attributes corresponding to the baking element; The three-dimensional file is converted according to the attributes to generate the PBR map file.
4. A material conversion device, characterized in that: include: An acquisition module is configured to acquire baking data and a 3D model file carrying rendering materials; the 3D model file carrying rendering materials is a 3D model file corresponding to various renderer types to be converted and baked; and a baking task is generated based on the 3D model file. The baking task is stored in a task queue; wherein the baking data includes a 3D model file carrying rendering materials and a baking template; and obtaining the baking data includes: parsing the 3D model file, the 3D model type, and rendering attribute information from the task queue; determining a rendering parameter template according to the 3D model type and the rendering attribute information; and obtaining the baking template based on the rendering parameter template. A correction module, configured to correct the three-dimensional model file according to the baking template; The baking conversion module is used to bake the modified three-dimensional model file to generate a PBR map file; when a crash or stop is detected in the baking conversion process, the three-dimensional model file that is not currently performing the baking conversion is recorded; when a new baking conversion operation instruction is received, the baking conversion is started from the three-dimensional model file that is not currently performing the baking conversion; if it is detected that the baking conversion process exceeds a preset time, the current baking conversion is terminated, and the baking conversion is started from the three-dimensional model file that is not currently performing the baking conversion.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the material conversion method according to any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the material conversion method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Three-dimension model processing method and device
CN106067185A
PBR material rendering method and system based on VRAY
CN111275802A