Three-dimensional model generation method and device, storage medium and electronic equipment
By converting and mapping textures to generate target three-dimensional models, the method addresses inefficiencies in manual processing, improving generation efficiency and accuracy of animation previews while reducing costs.
Patent Information
- Application Number
- CN202411157715.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-12-20
AI Technical Summary
The inefficiency in generating preview-level three-dimensional models for animation previews due to manual processing of textures and materials, especially in large animation scenes, leads to inaccurate previews and high labor costs.
A method involving obtaining an original texture based on an original material, performing resolution conversion to generate a target texture, mapping it onto a preset lighting model to create a target material, and generating a target three-dimensional model for preview, which can be batch processed to improve efficiency.
This method enhances the generation efficiency of preview-level models, reduces labor costs, ensures data consistency, and improves the accuracy of animation previews while facilitating smoother data transfer between production stages.
Smart Images

Figure CN119169156A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computers, and in particular to a method, device, storage medium and electronic device for generating a three-dimensional model. Background Art
[0002] At present, in the animation production process, if a high-precision model without textures is used for animation preview, it will lead to inaccurate preview and data lag. In order to improve the accuracy of the preview, after the Lookdev (Look Development, Chinese name for visual development) renderable model file is produced, the production staff can manually process the textures and materials to generate a preview-level texture material model file. However, the efficiency of manually processing to generate preview-level models is low, and it is difficult to apply to large animation scenes with many textures and materials.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] At least some embodiments of the present disclosure provide a method, device, storage medium and electronic device for generating a three-dimensional model, so as to at least solve the technical problem of low generation efficiency of a preview-level model.
[0005] According to one embodiment of the present disclosure, a method for generating a three-dimensional model is provided, comprising: obtaining an original texture corresponding to the original three-dimensional model based on an original material corresponding to the original three-dimensional model; performing resolution conversion on the original texture to obtain a target texture, wherein the resolution of the target texture is smaller than the resolution of the original texture; mapping the target texture onto a surface of a preset lighting model to generate a target material; generating a target three-dimensional model based on the original three-dimensional model and the target material, wherein the target three-dimensional model is used for previewing.
[0006] According to one embodiment of the present disclosure, a three-dimensional model generation device is also provided, including: an acquisition module, used to acquire an original map corresponding to the original three-dimensional model based on the original material corresponding to the original three-dimensional model; a conversion module, used to perform resolution conversion on the original map to obtain a target map, wherein the resolution of the target map is smaller than the resolution of the original map; a mapping module, used to map the target map onto the surface of a preset lighting model to generate a target material; a generation module, used to generate a target three-dimensional model based on the original three-dimensional model and the target material, wherein the target three-dimensional model is used for previewing.
[0007] According to one embodiment of the present disclosure, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned three-dimensional model generation method in each embodiment of the present application when running.
[0008] According to one embodiment of the present disclosure, an electronic device is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the above-mentioned three-dimensional model generation method in each embodiment of the present application.
[0009] According to another aspect of the embodiments of the present application, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the three-dimensional model generating method described above in each embodiment of the present application is implemented.
[0010] According to another aspect of an embodiment of the present application, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned three-dimensional model generation method in each embodiment of the present application is implemented.
[0011] According to another aspect of the embodiments of the present application, a computer program is also provided. When the computer program is executed by a processor, the above-mentioned three-dimensional model generating method in each embodiment of the present application is implemented.
[0012] In at least some embodiments of the present disclosure, the original texture corresponding to the original stereo model is obtained based on the original material corresponding to the original stereo model; the original texture is converted to obtain the target texture; the target texture is mapped to the surface of the preset illumination model to generate the target material; based on the original stereo model and the target material, the target stereo model is generated to achieve the purpose of generating a preview-level stereo model. It is easy to notice that, based on the original material, the original texture corresponding to the original stereo model is obtained through the material, which can improve the speed of obtaining the original texture when the original stereo model is batch processed; the original texture is converted to obtain the target texture with lower resolution and mapped to the surface of the preset illumination model to generate the target material, which can make the target material meet the requirements of the preview-level target stereo model; the target material is used to replace the original material, and the target stereo model is generated based on the original stereo model and the target material, which can realize the batch processing of the original stereo model, obtain the target stereo model that can be used for preview, and avoid the tediousness of manually processing the original stereo model one by one. Compared with manually processing and generating preview-level models, this method can reduce labor costs in the process, improve the accuracy of animation previews, ensure data consistency, and help achieve smoother data transfer between different production stages, thereby reducing production costs and improving the efficiency of preview-level model generation. While ensuring that the generated target three-dimensional model meets the preview requirements, it achieves the technical effect of improving the efficiency of preview-level model generation, thereby solving the technical problem of low preview-level model generation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present application. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0014] Figure 1 It is a hardware structure block diagram of a mobile terminal of a three-dimensional model generation method according to an embodiment of the present disclosure;
[0015] Figure 2 is a flow chart of a method for generating a three-dimensional model according to one embodiment of the present disclosure;
[0016] Figure 3 is a schematic diagram of a quadrant of a three-dimensional model according to one embodiment of the present disclosure;
[0017] Figure 4 is a structural block diagram of a three-dimensional model generating device according to one embodiment of the present disclosure;
[0018] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the scheme of the present disclosure, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present disclosure.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0021] In a possible implementation, the inventor has practiced and carefully studied the preview-level model generation method commonly used in the context of model generation. The inventor still has the technical problem of low preview-level model generation efficiency. Based on this, the game scene applied by the embodiment of the present disclosure can be a scene in which users can perform animation previews. A three-dimensional model generation method is proposed. The technical concept adopted is to obtain the original texture corresponding to the original three-dimensional model based on the original material corresponding to the original three-dimensional model; perform resolution conversion on the original texture to obtain the target texture; map the target texture onto the surface of the preset lighting model to generate the target material; and generate the target three-dimensional model based on the original three-dimensional model and the target material. The target three-dimensional models that can be used for preview can be generated in batches, avoiding the tediousness of manual processing one by one, achieving the purpose of improving the preview-level model generation efficiency, thereby solving the technical problem of low preview-level model generation efficiency, and further achieving the technical effect of improving the preview-level model generation efficiency.
[0022] The above method embodiments involved in the present disclosure can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, the mobile terminal can be a smart phone, a tablet computer, a handheld computer, a mobile Internet device, a PAD, a game console and other terminal devices. Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for generating a three-dimensional model according to an embodiment of the present disclosure. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 The processor 102 (only one is shown) may include, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a field-programmable logic device (FPGA), a neural network processor (NPU), a tensor processing unit (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. In one embodiment of the present disclosure, it may also include: an input / output device 108 and a display device 110.
[0023] In some optional embodiments mainly based on game scenarios, the above-mentioned device can also provide a human-computer interaction interface with a touch-sensitive surface, which can sense finger contact and / or gestures to perform human-computer interaction with a graphical user interface (GUI). The human-computer interaction function may include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interface, playing digital videos, playing digital music and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or readable storage medium executable by one or more processors.
[0024] Those skilled in the art will understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0025] According to one embodiment of the present disclosure, an embodiment of a method for generating a three-dimensional model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0026] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0027] Maya: It is the world's top 3D animation software produced by Autodesk, an American company. It is used for professional film and television advertisements, character animation, movie special effects, etc. It is a high-end production software at the movie level.
[0028] Lookdev: The full name is Look Development. The "look development" process in the film, television and game industry mainly involves setting materials, lighting and camera settings for 3D (Three-dimensional) models in the scene so as to preview the appearance of the model before rendering. The output of the Lookdev stage is usually preview images, models, high-precision maps, complex rendering materials, etc., which are used as references in the subsequent rendering or animation production stages.
[0029] Dictionary data structure: A dictionary data structure contains a series of data stored in the form of key-value pairs. In many programming languages, dictionaries are used to quickly find and retrieve data. Each key must be unique, and the value can be any type of data, including numbers, strings, lists, and even other dictionaries. Dictionaries provide a very efficient way to organize and access data and are often used to represent mapping relationships.
[0030] FFmpeg: FFmpeg is a cross-platform solution for processing multimedia data (audio, video, etc.). It consists of multiple libraries and tools, including tools for recording, converting, and streaming audio and video content. FFmpeg can handle almost all audio and video formats and can run on a wide range of platforms. Its functions include video encoding and decoding, audio encoding and decoding, streaming media processing, etc., so it is widely used in video processing, transcoding, streaming media transmission and other fields.
[0031] Lambert lighting model: is a simple model for calculating diffuse illumination of a surface. The model assumes that light shines on the surface in all directions with the same intensity and does not consider the angle of incidence of the light. According to the model, the brightness of the surface depends only on the angle between the incident light and the surface normal, and has nothing to do with the position of the observer. This simple model is suitable for describing the lighting effects of rough surfaces.
[0032] UV coordinate space: It is the two-dimensional coordinate space of the surface of a three-dimensional model, which is used to map the texture to the surface of the model. UV mapping determines how the texture is attached to the model, and determines the distribution of the texture on the surface of the model by specifying the corresponding position of each vertex on the texture image.
[0033] UDIM: is a standard for texture mapping management that allows multiple texture tiles to be used in a single UV coordinate space. This technology is often used in digital content production (such as animation, games, and film and television production) to accommodate more texture information in one UV layout and improve the details and realism of the model.
[0034] Rendering-level model: A 3D model that is optimized and prepared to meet specific rendering requirements. Rendering-level models are usually optimized for the rendering process, including data such as high-detail models, specific geometric subdivisions, high-precision textures, and complex material structures.
[0035] Preview-level models: usually refer to 3D models that have been simplified for real-time preview. In the process of film and television production, preview-level models usually include high-detail models, specific geometric subdivisions, low-precision textures, and simple material structures.
[0036] In a possible implementation, the present disclosure provides a method for generating a three-dimensional model. Figure 2 is a flow chart of a method for generating a three-dimensional model according to one embodiment of the present disclosure. Figure 2 As shown, the method comprises the following steps:
[0037] Step S202: acquiring an original texture corresponding to the original three-dimensional model based on the original material corresponding to the original three-dimensional model.
[0038] The original stereo model in the above steps is a rendering-level model, which is a 3D model that has been optimized and prepared to meet specific rendering requirements. Rendering-level models are usually optimized for the rendering process, including data such as high-detail models, specific geometric subdivisions, high-precision maps, and complex material structures.
[0039] The original material in the above steps is a material with a relatively complex material structure corresponding to the rendering-level model, and the original material can be represented by a material model. Exemplarily, the material model can be Arnold aIstandard. Arnold is a software for computer graphics rendering. aiStandard is the standard material used by Arnold. Arnold aIstandard material is widely used in the Arnold renderer and is usually used to render various types of objects, including but not limited to characters, skin, metal, props, and scenes. Arnold aIstandard material can perform fine control over lighting, reflection, refraction, and shadow, and is suitable for a variety of scenes. The material model used by the original material may not be limited to this.
[0040] The original texture in the above steps is the texture corresponding to the original three-dimensional model. A texture is an image pasted on the surface of an object. It can add texture, color, pattern and other details to the surface of the object to make the object look more realistic. Since different materials use different material properties to connect textures, the original texture can be determined by the properties of the original material, that is, the original texture can be obtained based on the original material.
[0041] In an optional embodiment, a rendering file of Maya Lookdev is opened, and the original three-dimensional model therein is queried in an iterative manner to obtain a dictionary DictA containing the correspondence between the original material and the original three-dimensional model, wherein the dictionary DictA has a dictionary data structure. The key values in the dictionary DictA, that is, the values of all the original materials, are polled to obtain the original material corresponding to the original three-dimensional model.
[0042] Since the original map is affected by the properties of the original material, after obtaining the original material corresponding to the original three-dimensional model, the properties of the original material can be looked up, and the properties of the original map can be determined based on whether there is a map connection in the properties of the original material and the weight value of the original material properties. The original map corresponding to the original three-dimensional model is determined based on the properties that determine the original map.
[0043] When converting the rendering-level model to the preview-level model, that is, converting the original stereo model to the target stereo model, the precision of the texture used is different, so it is necessary to obtain the original texture and process the original texture to obtain the preview-level model. On this basis, the original material connected to the original stereo model is automatically found, and the attributes used to connect the texture in the original material are automatically found through the original material logic to determine the original texture, which can increase the speed of obtaining the original texture during batch processing, thereby improving the generation efficiency of the preview-level model.
[0044] Step S204, performing resolution conversion on the original texture to obtain a target texture, wherein the resolution of the target texture is smaller than the resolution of the original texture.
[0045] The target map in the above steps is a low-resolution map suitable for preview-level models. It is a low-precision map and also the map corresponding to the target three-dimensional model.
[0046] In an optional embodiment, ffmpeg can be used to convert the resolution of the original texture to obtain a target texture. Specifically, the original texture and the target resolution can be input into ffmpeg, and a conversion command can be issued to ffmpeg, and then ffmpeg can output a target texture that meets the target resolution based on the original texture and the target resolution. The target resolution is the resolution of the target texture, which can be determined according to the specific application situation, and the specific value of the target resolution is not limited here.
[0047] Step S206, mapping the target map onto the surface of the preset lighting model to generate a target material.
[0048] The preset illumination model in the above steps may represent the basic material of the target stereoscopic model, for example, may be a Lambert illumination model, but is not limited thereto.
[0049] The target material in the above steps is the material of the target three-dimensional model, which can be obtained by connecting the target map and the preset lighting model, that is, the target material contains both the target map corresponding to the target three-dimensional model and the basic material of the target three-dimensional model.
[0050] In an optional embodiment, since the preview-level model, that is, the target three-dimensional model, does not have complex requirements on the material, it only needs to restore the texture and transparency of the object surface, and does not need properties such as highlights, so the basic Lambert lighting model can be used as the basic material, that is, the preset lighting model. Then, the target texture can be connected to the basic material to obtain the target material.
[0051] In another optional embodiment, when there are multiple target maps, the Lambert lighting model serving as the base material can be copied multiple times so that the number of base materials is equal to the number of target maps, and then the target maps and base materials are connected one by one to obtain the target material.
[0052] Step S208: generating a target 3D model based on the original 3D model and the target material, wherein the target 3D model is used for previewing.
[0053] The target stereo model in the above steps is a preview-level model used for preview. The preview-level model usually refers to a 3D model that is simplified for real-time preview, including a low-precision texture and a simple material structure.
[0054] In an optional embodiment, the dictionary DictA contains the correspondence between the original material and the original three-dimensional model, obtains the original three-dimensional model list ModelList corresponding to the original material from the dictionary DictA, and replaces the original material with the target material, and connects the target material to the surface of the corresponding original three-dimensional model according to the correspondence between the original material and the original three-dimensional model in the dictionary DictA, so as to obtain the target three-dimensional model for preview. The target three-dimensional model is a preview-level model connected with a simple basic material and a low-precision texture.
[0055] In another optional embodiment, the target material may also be mapped to the surface of the original three-dimensional model to obtain the target three-dimensional model.
[0056] In another optional embodiment, the correspondence between the target material and each quadrant on the surface of the original three-dimensional model can be determined according to the properties of the target material, and then the target material can be connected to each quadrant on the surface of the original three-dimensional model according to the correspondence to obtain the target three-dimensional model.
[0057] In at least some embodiments of the present disclosure, the original texture corresponding to the original stereo model is obtained based on the original material corresponding to the original stereo model; the original texture is converted to obtain a target texture; the target texture is mapped to the surface of a preset illumination model to generate a target material; and a target stereo model is generated based on the original stereo model and the target material. It is easy to notice that, based on the original material, the original texture corresponding to the original stereo model is obtained through material logic search, which can improve the speed of obtaining the original texture when batch processing the original stereo model; the original texture is converted to obtain a target texture with a lower resolution and mapped to the surface of a preset illumination model to generate a target material, which can make the target material meet the requirements of the preview-level target stereo model; the target material is used to replace the original material, and the target stereo model is generated based on the original stereo model and the target material, which can realize batch processing of the original stereo model, obtain the target stereo model that can be used for preview, and avoid the tediousness of manually processing the original stereo model one by one. Compared with manually processing and generating preview-level models, this method can reduce labor costs in the process, improve the accuracy of animation previews, ensure data consistency, and help achieve smoother data transfer between different production stages, thereby reducing production costs and improving the efficiency of preview-level model generation. While ensuring that the generated target three-dimensional model meets the preview requirements, it achieves the technical effect of improving the efficiency of preview-level model generation, thereby solving the technical problem of low preview-level model generation efficiency.
[0058] Optionally, the original map includes an original color map and an original transparency map; based on the original material corresponding to the original three-dimensional model, the original map corresponding to the original three-dimensional model is obtained, including: based on the type of the original material, determining a first attribute and a second attribute of the original map, wherein the first attribute is used to determine the map color of the original map, and the second attribute is used to determine the map transparency of the original map; based on the first attribute, the original color map is obtained; based on the second attribute, the original transparency map is obtained.
[0059] The original color map in the above step is the color map in the original map. The color map contains the color information of the surface of the object, which can make the object present different colors and textures.
[0060] The original transparency map in the above steps is the transparency map in the original map. The transparency map contains the transparency information of the object surface. It can control the transparency of the object during rendering to make it appear semi-transparent or completely transparent.
[0061] The type of the original material in the above steps can be aiStandard, a multifunctional material for simulating metal, plastic, wood, etc., aiHair, a material for rendering hair and fur, aiSkin, a material for rendering skin, or aiShadowMatte, a material for creating shadow channels, but not limited to these. Different types of original materials have different corresponding properties, and the properties of the original map can be determined by the properties corresponding to the original material.
[0062] The first attribute of the original texture in the above steps is the attribute of the original material, which is used to determine the texture color of the original texture; the second attribute of the original texture is the attribute of the original material, which is used to determine the texture transparency of the original texture.
[0063] In an optional embodiment, the first attribute and the second attribute of the original map can be determined according to the type of the original material. Exemplarily, if the type of the original material is aiStandard, the map color of the original map will be affected by the four attributes of Base (base color), Subsurface (subsurface scattering), Coat (coating), and Emission (self-luminescence) in the original material, and the first attribute can be determined according to the influence of each attribute on the map color. Specifically, the attribute connected to the original color map can be the first attribute of the original map; if all attributes are not connected to the original color map, the weight (weight value) of each attribute is obtained, and the attribute with the largest weight is used as the first attribute.
[0064] When the original color map is obtained based on the first attribute, the original color map may be determined according to the color map path or attribute value corresponding to the first attribute.
[0065] For example, if the type of the original material is aiStandard, the texture transparency of the original texture will be affected by the transmission attribute of the original material that controls the surface transparency and refraction effect of the material, and the second attribute of the original texture can be determined to be the transmission attribute.
[0066] When the original transparency map is obtained based on the second attribute, the original transparency map may be determined according to the transparency map path or attribute value corresponding to the second attribute.
[0067] Optionally, acquiring the original color map based on the first attribute includes: in response to the first attribute indicating that the map color of the original map is determined by the original color map, determining a color map path of the original color map, and acquiring the original color map based on the color map path; in response to the first attribute indicating that the map color of the original map is determined by the attribute value of the first attribute, determining the attribute value of the first attribute to be the original color map;
[0068] The color map path in the above steps is obtained according to the first attribute, and the value of the original color map position can be used to find and obtain the original color map.
[0069] In an optional embodiment, taking the type of the original material as aiStandard as an example, if the first attribute is connected to the original color map, the color map path in the first attribute can be obtained, and the original color map can be found according to the color map path.
[0070] If the first attribute has no attribute connected to the original color map, the attribute value of the first attribute is directly obtained. The attribute value of the first attribute is a fixed color value. The surface color of the original material can be determined based on the attribute value of the first attribute. Therefore, the attribute value of the first attribute at this time is the original color map.
[0071] Optionally, obtaining the original transparency map based on the second attribute includes: in response to the second attribute indicating that the texture transparency of the original map is cut off by the original transparency map, determining the transparency map path of the original transparency map, and obtaining the original transparency map based on the transparency map path; in response to the second attribute indicating that the texture transparency of the original map is determined by the attribute value of the second attribute, determining the attribute value of the second attribute to be the original transparency map.
[0072] The transparency map path in the above steps is obtained according to the first attribute, and the value of the original transparency map position can be used to find and obtain the original transparency map.
[0073] In an optional embodiment, taking the original material type of aiStandard as an example, if the attribute value of the second attribute is 0, the original transparency map is the inverse value of the opacity attribute, that is, 1 minus the attribute value of opacity. If the attribute value of the second attribute is greater than 0.01, and the second attribute is connected to the original transparency map, the transparency map path in the second attribute can be obtained, and the original transparency map can be found according to the transparency map path. If the attribute value of the second attribute is greater than 0.01, and the second attribute is not connected to the original transparency map, the attribute value of the second attribute is directly obtained, and the attribute value of the second attribute is a fixed transparency value. The surface transparency of the original material can be determined based on the attribute value of the second attribute. Therefore, the attribute value of the second attribute at this time is the original transparency map.
[0074] It should be noted that the numerical values in the above description are only examples, and the specific numerical values used in actual applications may not be limited to these.
[0075] Optionally, mapping the target map onto the surface of a preset lighting model to generate a target material, including: determining a target number of target materials based on the type of the target map, wherein the type of the target map is used to characterize whether the target map is a multi-quadrant map; replicating the preset lighting model based on the target number to obtain a target number of replicated three-dimensional models; mapping the target map onto the surfaces of a target number of replicated three-dimensional models, respectively, to generate a target number of materials, wherein the target material includes a target number of materials.
[0076] The type of the target map in the above step can be determined according to the number of udimID, which is a unique identifier used to identify each texture tile in the UDIM texture layout.
[0077] The target number in the above steps is the number of target materials, which can be determined by the type of target map.
[0078] The multi-quadrant map in the above steps is a map having multiple texture tiles in the UDIM texture layout, and the number of the multi-quadrant map is the number of texture tiles in the UDIM texture layout.
[0079] In an optional embodiment, the color map path or transparency map path of the original map corresponding to the target map can be obtained, and the udimID of the target map can be determined according to the map list in the color map path or transparency map path. If there is only one udimID, it is determined that the target map is not a multi-quadrant map, and the target number is 1; if there are multiple udimIDs, it is determined that the target map is a multi-quadrant map, and the target number is the number of udimIDs.
[0080] If the original texture corresponding to the target texture has no color texture path and transparency texture path, and only has a fixed color value and a fixed transparency value, it is determined that the target texture is not a multi-quadrant texture, and the target quantity is 1.
[0081] If the target map is a multi-quadrant map, the preset lighting model is copied so that a target number of copied three-dimensional models are obtained after the copying. Then, each texture tile of the target map in the UDIM texture layout is mapped to the surface of a copied three-dimensional model to obtain a target number of materials, and the target number of materials constitute the target material.
[0082] Optionally, based on the type of the target map, determining the target quantity of the target material includes: in response to the type of the target map characterizing that the target map is a multi-quadrant map, determining the target quantity based on the number of multi-quadrant maps; in response to the type of the target map characterizing that the target map is not a multi-quadrant map, determining the target quantity to be a preset quantity.
[0083] The preset number in the above steps is a pre-set number. A preferred value of the preset number is 1, but it is not limited to this. Other values can be set as the preset number according to actual application conditions. The specific value of the preset number is not limited here.
[0084] In an optional embodiment, if the type of the target map indicates that the target map is a multi-quadrant map, it means that the target map has multiple texture tiles in the UDIM texture layout. Since the target map needs to be mapped to a target material, in order to ensure that each texture tile of the target map in the UDIM texture layout can be mapped to a target material, there also needs to be multiple target materials, that is, the number of targets should be the number of multi-quadrant maps.
[0085] If the type of the target map indicates that the target map is not a multi-quadrant map, the preset number may be determined according to actual application conditions so that the target number is the preset number.
[0086] Optionally, based on the original three-dimensional model and the target material, a target three-dimensional model is generated, including: based on the type of the target map, determining the material texture coordinates of the target material, wherein the type of the target map is used to characterize whether the target map is a multi-quadrant map; based on the material texture coordinates of the target material, mapping the target material onto the surface of the original three-dimensional model to generate the target three-dimensional model.
[0087] The material texture coordinates in the above steps may be UV coordinates, and the UV coordinates may be used to determine the quadrant of the original three-dimensional model corresponding to the target material.
[0088] In an optional embodiment, a target material list MatList is obtained from a dictionary DictE storing the correspondence between the original material and the target material, and it is determined whether the target material in the target material list MatList is a multi-quadrant map. For a target material that is a multi-quadrant map, the original material corresponding to the target material is found, and the material texture coordinates of the target material are determined according to the UV coordinates of the original material, that is, the material texture coordinates. Then, according to the quadrant of the original three-dimensional model to which the UV coordinates belong, the target material is connected to the corresponding surface of the original three-dimensional model to generate the target three-dimensional model.
[0089] In another optional embodiment, the material texture coordinates of the target material can be determined from the path of the target map according to the type of the target map, and then the quadrant of the original three-dimensional model surface corresponding to the material texture coordinates is determined, and the target material is mapped to the quadrant of the original three-dimensional model surface corresponding to the material texture coordinates to obtain the target three-dimensional model.
[0090] For the target material of non-multi-quadrant mapping, the original solid model has only one quadrant. Connecting the target material to the surface of the original solid model can generate the target solid model.
[0091] Optionally, based on the type of the target map, the material texture coordinates of the target material are determined, including: in response to the type of the target map characterizing that the target map is a multi-quadrant map, obtaining the map multi-quadrant identifier corresponding to the multi-quadrant map, obtaining the material multi-quadrant identifier of the target material, and converting the material multi-quadrant identifier to obtain the material texture coordinates of the target material; in response to the type of the target map characterizing that the target map is not a multi-quadrant map, obtaining the map texture coordinates of the target map to obtain the material texture coordinates of the target material.
[0092] The texture multi-quadrant identifier in the above step may be a udimID, which is a unique identifier used to identify each texture tile in a UDIM texture layout.
[0093] The texture coordinates of the map in the above steps are values that can represent the position of the target map.
[0094] In an optional embodiment, when the type of the target texture indicates that the target texture is a multi-quadrant texture, the udimID of the target texture, i.e., the multi-quadrant identifier of the texture, can be determined according to the texture list in the color texture path or the transparency texture path. Then, the dictionary DictD storing the correspondence between the udimID and the target material is accessed to obtain the udimID corresponding to the target material.
[0095] There is a corresponding relationship between udimID and UV coordinates. udimID is a four-digit value, usually starting from 1001 to 9999. The method for calculating UV coordinates based on udimID is:
[0096] U = udimID%1000-1;
[0097] V = udimID / 10-100;
[0098] Where U is the U coordinate of the UV coordinate, and V is the V coordinate of the UV coordinate.
[0099] For example, if the udimID is 1001, then U is calculated to be 0, that is, the U coordinate is between 0 and 1; for another example, if the udimID is 1021, then V is calculated to be 2, that is, the V coordinate is between 2 and 3. However, the above examples are only examples, and the values that can be used in actual applications are not limited to these.
[0100] Therefore, according to the corresponding relationship between udimID and UV coordinates, udimID can be converted to obtain the UV coordinates of the target material, that is, the material texture coordinates.
[0101] When the type of the target map represents that the target map is not a multi-quadrant map, the original material corresponding to the target map is found according to the target map, the original three-dimensional model corresponding to the target map is determined according to the dictionary DictA containing the correspondence between the original material and the original three-dimensional model, the map texture coordinates of the target map are determined according to the position of the original three-dimensional model, and the map texture coordinates of the target map are used as the material texture coordinates of the target material.
[0102] Optionally, in response to the original three-dimensional model containing multiple three-dimensional models, determining the original material corresponding to the original three-dimensional model, and obtaining the original map corresponding to the original material, includes: obtaining a first mapping relationship corresponding to the multiple three-dimensional models, wherein the first mapping relationship is used to characterize the mapping relationship between the multiple three-dimensional models and at least one original material; traversing any original material in the first mapping relationship, and obtaining an original map corresponding to any original material; and constructing a second mapping relationship based on any original material and the original map corresponding to any original material.
[0103] The first mapping relationship in the above step has a dictionary data structure, which is used to represent the mapping relationship between multiple three-dimensional models and at least one original material, and can be used to determine the original material used by the three-dimensional model or the three-dimensional model to which the original material is applied. The key in the first mapping relationship is the name of the original material.
[0104] The second mapping relationship in the above step has a dictionary data structure, which is used to represent the mapping relationship between any original material and any original map, and the key is the name of the original material.
[0105] In an optional embodiment, DictA stored in the database, that is, the first mapping relationship, can be obtained by accessing the database, and the original materials in the first mapping relationship can be traversed. Then, the original texture corresponding to any original material can be obtained. Specifically, the properties of the original texture can be determined according to the type of the original material. If there is a linked texture in the properties of the original texture, the texture path is queried to obtain the texture position as the original texture; if there is no linked texture in the properties of the original texture, the property value is obtained as the original texture.
[0106] The original map may include an original color map and an original transparency map, and the map position may be the position of the original color map or the position of the original transparency map. The attribute value may be a color attribute value or a transparency attribute value.
[0107] Then, DictB having a dictionary data structure, that is, a second mapping relationship, is constructed, in which a mapping relationship between any original material and any original map is stored.
[0108] Optionally, after performing resolution conversion on the original texture to obtain the target texture, the method further includes: traversing any original texture in the second mapping relationship; and constructing a third mapping relationship based on any original texture and a target texture corresponding to any original texture.
[0109] The third mapping relationship in the above step has a dictionary data structure, which is used to represent the mapping relationship between any original map and any target map.
[0110] In an optional embodiment, the original texture is converted in resolution to obtain a target texture with a resolution smaller than that of the original texture. A third mapping relationship is then constructed based on the path of the original texture and the path of the target texture corresponding to the original texture, and the mapping relationship between any original material and any original texture is represented by the third mapping relationship.
[0111] Optionally, mapping the target map onto the surface of a preset lighting model to generate a target material includes: traversing any original material in the first mapping relationship, and obtaining an original map corresponding to any original material from the second mapping relationship; based on the original map corresponding to any original material, obtaining a target map corresponding to any original material from a third mapping relationship; mapping the target map corresponding to any original material onto the surface of the preset lighting model to generate a target material corresponding to any original material; and constructing a fourth mapping relationship based on any original material and the target material corresponding to any original material.
[0112] The fourth mapping relationship in the above step has a dictionary data structure, which is used to represent the mapping relationship between the original material, the texture multi-quadrant identifier and the target material.
[0113] In an optional embodiment, any original material in the first mapping relationship is traversed, and the original texture corresponding to the original material is obtained from the second mapping relationship according to the name of the original material. The file name of the original texture is parsed to obtain the udimID, that is, the texture multi-quadrant identifier, and the path of the target texture is obtained from the third mapping relationship according to the path of the original texture, thereby obtaining the target texture and the texture multi-quadrant identifier corresponding to any original material. The target texture of the original material is mapped to the Lambert lighting model as the base material, that is, the surface of the preset lighting model, to obtain the target material including the color map, the transparency map, and the lighting model. The target material and the texture multi-quadrant identifier corresponding to any original material are obtained.
[0114] A fourth mapping relationship, namely DictE, is constructed according to any original material, any target material corresponding to the original material, and the texture multi-quadrant identifier coordinates, so that the fourth mapping relationship can represent the mapping relationship between the original material, the texture multi-quadrant identifier, and the target material. For example, one item in the fourth mapping relationship can be expressed as:
[0115] {matA:{1001:easyMat1,1002:easyMat2,1003:easyMat3}};
[0116] Among them, matA is the original material, 1001, 1002, 1003 are the quadrants of the three-dimensional model, Figure 3 is a schematic diagram of a quadrant of a three-dimensional model according to one embodiment of the present disclosure, such as Figure 3 As shown, Figure 3The model on the right is a three-dimensional model, and 1001, 1002, and 1003 on the left are three quadrants corresponding to the three-dimensional model. The quadrant of the three-dimensional model can be determined according to the multi-quadrant identifier of the texture. easyMat1, easyMat2, and easyMat3 are target materials. One of the fourth mapping relationships can be interpreted as follows: the target material of the original material matA in the quadrant of udimID 1001 is easyMat1, the target material in the quadrant of udimID 1002 is easyMat2, and the target material in the quadrant of udimID 1003 is easyMat3.
[0117] Optionally, based on the original three-dimensional model and the target material, a target three-dimensional model is generated, including: traversing any three-dimensional model among multiple three-dimensional models; based on any three-dimensional model, determining the original material corresponding to any three-dimensional model from a first mapping relationship; based on the original material corresponding to any three-dimensional model, determining the target material corresponding to any three-dimensional model from a fourth mapping relationship; based on the material texture coordinates of the target material corresponding to any three-dimensional model, mapping the target material corresponding to any three-dimensional model onto the surface of any three-dimensional model to obtain a new three-dimensional model corresponding to any three-dimensional model, wherein the target three-dimensional model includes new three-dimensional models corresponding to multiple three-dimensional models.
[0118] The new stereo model in the above steps may be a preview-level model used for previewing, and the stereo model used to obtain the new stereo model is a rendering-level model.
[0119] In an optional embodiment, any one of the multiple three-dimensional models is traversed and the original material corresponding to the three-dimensional model is extracted from the first mapping relationship, and then the original material is replaced, and the original material containing the high-precision original map and the complex material is replaced with the target material containing the low-precision map and the simple material, so as to realize the generation of a new three-dimensional model at the preview level.
[0120] In the process of replacing the original material with the target material, the target material corresponding to the original material and the texture multi-quadrant identifier corresponding to the target material are determined from the fourth mapping relationship according to the original material corresponding to any three-dimensional model. The texture multi-quadrant identifier is converted to obtain the texture coordinates, so the target material corresponding to the original material and the texture coordinates corresponding to the target material can be determined. Subsequently, the surface of the corresponding three-dimensional model can be determined according to the texture coordinates corresponding to the target material, and the target material corresponding to any three-dimensional model can be mapped to the surface of the corresponding three-dimensional model to achieve the replacement of the original material and the target material, and obtain a new three-dimensional model.
[0121] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a 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 such an understanding, the technical solution of the present disclosure, 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, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present disclosure.
[0122] In the present embodiment, a device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the terms "unit" and "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0123] Figure 4 : is a structural block diagram of a three-dimensional model generating device according to one embodiment of the present disclosure, wherein a graphical user interface is provided through a terminal device, and the content displayed by the graphical user interface includes a touch area. As shown in the figure, the device includes:
[0124] The acquisition module 40 is used to acquire the original texture corresponding to the original three-dimensional model based on the original material corresponding to the original three-dimensional model.
[0125] The conversion module 42 is used to perform resolution conversion on the original texture to obtain a target texture, wherein the resolution of the target texture is smaller than the resolution of the original texture.
[0126] The mapping module 44 is used to map the target map onto the surface of the preset lighting model to generate the target material.
[0127] The generating module 46 is used to generate a target 3D model based on the original 3D model and the target material, wherein the target 3D model is used for previewing.
[0128] The acquisition module includes: a first determination unit, used to acquire the original map corresponding to the original three-dimensional model based on the original material corresponding to the original three-dimensional model, including: determining the first attribute and the second attribute of the original map based on the type of the original material, wherein the first attribute is used to determine the map color of the original map, and the second attribute is used to determine the map transparency of the original map; a first acquisition unit, used to acquire the original color map based on the first attribute; a second acquisition unit, used to acquire the original transparency map based on the second attribute.
[0129] The first acquisition unit is further configured to determine a color map path of the original color map in response to the first attribute being connected to the original color map, and acquire the original color map based on the color map path; and to determine that the attribute value of the first attribute is the original color map in response to the first attribute not being connected to the original color map.
[0130] The second acquisition unit is also used to determine the transparency map path of the original transparency map in response to the second attribute being connected to the original transparency map, and acquire the original transparency map based on the transparency map path; in response to the second attribute not being connected to the original transparency map, determine that the attribute value of the second attribute is the original transparency map.
[0131] The mapping module includes: a second determination unit, used to determine the target quantity of target materials based on the type of target map, wherein the type of target map is used to characterize whether the target map is a multi-quadrant map; a copying unit, used to copy the preset lighting model based on the target quantity to obtain the target number of copied three-dimensional models; a first generation unit, used to map the target map onto the surfaces of the target number of copied three-dimensional models respectively to generate the target number of materials, wherein the target material includes the target number of materials.
[0132] The second determination unit is further configured to determine the target quantity based on the number of multi-quadrant textures in response to the target texture type characterizing that the target texture is a multi-quadrant texture; and determine the target quantity to be a preset quantity in response to the target texture type characterizing that the target texture is not a multi-quadrant texture.
[0133] The generation module includes: a third determination unit, used to determine the material texture coordinates of the target material based on the type of the target map, wherein the type of the target map is used to characterize whether the target map is a multi-quadrant map; a second generation unit, used to map the target material onto the surface of the original three-dimensional model based on the material texture coordinates of the target material to generate a target three-dimensional model.
[0134] The third determination unit is also used to, in response to the target map type characterization that the target map is a multi-quadrant map, obtain the map multi-quadrant identifier corresponding to the multi-quadrant map, obtain the material multi-quadrant identifier of the target material, and convert the material multi-quadrant identifier to obtain the material texture coordinates of the target material; in response to the target map type characterization that the target map is not a multi-quadrant map, obtain the map texture coordinates of the target map to obtain the material texture coordinates of the target material.
[0135] The acquisition module is also used to obtain a first mapping relationship corresponding to multiple three-dimensional models, wherein the first mapping relationship is used to characterize the mapping relationship between multiple three-dimensional models and at least one original material; traverse any original material in the first mapping relationship, and obtain the original map corresponding to any original material; based on any original material and the original map corresponding to any original material, construct a second mapping relationship.
[0136] The conversion module is also used to traverse any original texture in the second mapping relationship; and construct a third mapping relationship based on any original texture and a target texture corresponding to any original texture.
[0137] The mapping module is also used to traverse any original material in the first mapping relationship, obtain the original map corresponding to any original material from the second mapping relationship; based on the original map corresponding to any original material, obtain the target map corresponding to any original material from the third mapping relationship; map the target map corresponding to any original material onto the surface of a preset lighting model to generate a target material corresponding to any original material; and construct a fourth mapping relationship based on any original material and the target material corresponding to any original material.
[0138] The generation module is also used to traverse any one of the multiple three-dimensional models; based on any one of the three-dimensional models, determine the original material corresponding to any one of the three-dimensional models from the first mapping relationship; based on the original material corresponding to any one of the three-dimensional models, determine the target material corresponding to any one of the three-dimensional models from the fourth mapping relationship; based on the material texture coordinates of the target material corresponding to any one of the three-dimensional models, map the target material corresponding to any one of the three-dimensional models onto the surface of any one of the three-dimensional models to obtain a new three-dimensional model corresponding to any one of the three-dimensional models, wherein the target three-dimensional model includes new three-dimensional models corresponding to multiple three-dimensional models.
[0139] It should be noted that the above-mentioned units and modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned units and modules are all located in the same processor; or, the above-mentioned units and modules are located in different processors in any combination.
[0140] An embodiment of the present disclosure further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0141] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0142] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.
[0143] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0144] Based on the original material corresponding to the original three-dimensional model, obtaining the original texture corresponding to the original three-dimensional model;
[0145] Performing resolution conversion on the original texture to obtain a target texture, wherein the resolution of the target texture is smaller than the resolution of the original texture;
[0146] Map the target map onto the surface of the preset lighting model to generate the target material;
[0147] A target stereo model is generated based on the original stereo model and the target material, wherein the target stereo model is used for previewing.
[0148] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: based on the type of the original material, determining a first attribute and a second attribute of the original map, wherein the first attribute is used to determine the map color of the original map, and the second attribute is used to determine the map transparency of the original map; obtaining the original color map based on the first attribute; and obtaining the original transparency map based on the second attribute.
[0149] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: in response to the first attribute being connected to the original color map, determining a color map path of the original color map, and acquiring the original color map based on the color map path; in response to the first attribute not being connected to the original color map, determining that the attribute value of the first attribute is the original color map.
[0150] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: in response to the second attribute being connected to the original transparency map, determining the transparency map path of the original transparency map, and obtaining the original transparency map based on the transparency map path; in response to the second attribute not being connected to the original transparency map, determining that the attribute value of the second attribute is the original transparency map.
[0151] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: determining a target quantity of target materials based on a target map type, wherein the target map type is used to characterize whether the target map is a multi-quadrant map; replicating a preset lighting model based on the target quantity to obtain a target number of replicated three-dimensional models; and mapping the target maps onto surfaces of a target number of replicated three-dimensional models, respectively, to generate a target number of materials, wherein the target material contains a target number of materials.
[0152] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: in response to the target map type characterizing that the target map is a multi-quadrant map, determining the target quantity based on the number of multi-quadrant maps; in response to the target map type characterizing that the target map is not a multi-quadrant map, determining the target quantity to be a preset quantity.
[0153] Optionally, the above-mentioned computer-readable storage medium is also configured to store program code for executing the following steps: based on the type of target map, determining the material texture coordinates of the target material, wherein the type of target map is used to characterize whether the target map is a multi-quadrant map; based on the material texture coordinates of the target material, mapping the target material onto the surface of the original three-dimensional model to generate a target three-dimensional model.
[0154] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: in response to the target map type characterization that the target map is a multi-quadrant map, obtaining the map multi-quadrant identifier corresponding to the multi-quadrant map, obtaining the material multi-quadrant identifier of the target material, and converting the material multi-quadrant identifier to obtain the material texture coordinates of the target material; in response to the target map type characterization that the target map is not a multi-quadrant map, obtaining the map texture coordinates of the target map to obtain the material texture coordinates of the target material.
[0155] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: obtaining a first mapping relationship corresponding to multiple three-dimensional models, wherein the first mapping relationship is used to characterize the mapping relationship between multiple three-dimensional models and at least one original material; traversing any original material in the first mapping relationship, and obtaining an original map corresponding to any original material; and constructing a second mapping relationship based on any original material and the original map corresponding to any original material.
[0156] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: traversing any original map in the second mapping relationship; and constructing a third mapping relationship based on any original map and a target map corresponding to any original map.
[0157] Optionally, the above-mentioned computer-readable storage medium is also configured to store program code for executing the following steps: traversing any original material in the first mapping relationship, and obtaining the original map corresponding to any original material from the second mapping relationship; based on the original map corresponding to any original material, obtaining the target map corresponding to any original material from the third mapping relationship; mapping the target map corresponding to any original material onto the surface of a preset lighting model to generate a target material corresponding to any original material; and constructing a fourth mapping relationship based on any original material and the target material corresponding to any original material.
[0158] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: traversing any one of a plurality of three-dimensional models; based on any one of the three-dimensional models, determining the original material corresponding to any one of the three-dimensional models from a first mapping relationship; based on the original material corresponding to any one of the three-dimensional models, determining the target material corresponding to any one of the three-dimensional models from a fourth mapping relationship; based on the material texture coordinates of the target material corresponding to any one of the three-dimensional models, mapping the target material corresponding to any one of the three-dimensional models onto the surface of any one of the three-dimensional models to obtain a new three-dimensional model corresponding to any one of the three-dimensional models, wherein the target three-dimensional model includes new three-dimensional models corresponding to multiple three-dimensional models.
[0159] In the computer-readable storage medium of this embodiment, the original texture corresponding to the original stereo model is obtained based on the original material corresponding to the original stereo model; the original texture is converted to obtain the target texture; the target texture is mapped to the surface of the preset illumination model to generate the target material; and the target stereo model is generated based on the original stereo model and the target material. It is easy to notice that the original texture corresponding to the original stereo model is obtained by material logic search based on the original material, which can improve the speed of obtaining the original texture when the original stereo model is processed in batches; the original texture is converted to obtain the target texture with lower resolution and mapped to the surface of the preset illumination model to generate the target material, which can make the target material meet the requirements of the preview-level target stereo model; the original material is replaced by the target material, and the target stereo model is generated based on the original stereo model and the target material, which can realize the batch processing of the original stereo model, obtain the target stereo model that can be used for preview, avoid the tediousness of manually processing the original stereo model one by one, and ensure that the generated target stereo model meets the preview requirements. At the same time, the purpose of improving the generation efficiency of the preview-level model is achieved, thereby solving the technical problem of low generation efficiency of the preview-level model.
[0160] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0161] In an exemplary embodiment of the present application, a program product capable of implementing the above method of the present embodiment is stored on a computer-readable storage medium. In some possible implementations, various aspects of the embodiments of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps described in the above "Exemplary Method" section of the present embodiment according to various exemplary implementations of the present disclosure.
[0162] According to the program product for implementing the above method in the embodiment of the present disclosure, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the embodiment of the present disclosure is not limited to this. In the embodiment of the present disclosure, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0163] The program product may be in any combination of one or more computer-readable media. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive) of computer-readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0164] It should be noted that the program code contained in the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0165] An embodiment of the present disclosure further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0166] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0167] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0168] Based on the original material corresponding to the original three-dimensional model, obtaining the original texture corresponding to the original three-dimensional model;
[0169] Performing resolution conversion on the original texture to obtain a target texture, wherein the resolution of the target texture is smaller than the resolution of the original texture;
[0170] Map the target map onto the surface of the preset lighting model to generate the target material;
[0171] A target stereo model is generated based on the original stereo model and the target material, wherein the target stereo model is used for previewing.
[0172] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: based on the type of original material, determine the first attribute and the second attribute of the original map, wherein the first attribute is used to determine the map color of the original map, and the second attribute is used to determine the map transparency of the original map; obtain the original color map based on the first attribute; obtain the original transparency map based on the second attribute.
[0173] Optionally, the processor may also be configured to perform the following steps through a computer program: in response to the first attribute being connected to the original color map, determining a color map path of the original color map, and acquiring the original color map based on the color map path; in response to the first attribute not being connected to the original color map, determining that the attribute value of the first attribute is the original color map.
[0174] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: in response to the second attribute being connected to the original transparency map, determining the transparency map path of the original transparency map, and obtaining the original transparency map based on the transparency map path; in response to the second attribute not being connected to the original transparency map, determining that the attribute value of the second attribute is the original transparency map.
[0175] Optionally, the processor may also be configured to perform the following steps through a computer program: determining a target quantity of target materials based on a target map type, wherein the target map type is used to characterize whether the target map is a multi-quadrant map; replicating a preset lighting model based on the target quantity to obtain a target number of replicated three-dimensional models; and mapping the target maps onto surfaces of a target number of replicated three-dimensional models to generate a target number of materials, wherein the target material includes a target number of materials.
[0176] Optionally, the processor may also be configured to perform the following steps through a computer program: in response to the target map type characterizing that the target map is a multi-quadrant map, determining the target quantity based on the number of multi-quadrant maps; and in response to the target map type characterizing that the target map is not a multi-quadrant map, determining the target quantity to be a preset quantity.
[0177] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: based on the type of the target map, determine the material texture coordinates of the target material, wherein the type of the target map is used to characterize whether the target map is a multi-quadrant map; based on the material texture coordinates of the target material, map the target material onto the surface of the original three-dimensional model to generate a target three-dimensional model.
[0178] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: in response to the type characterization of the target map that the target map is a multi-quadrant map, obtaining the map multi-quadrant identifier corresponding to the multi-quadrant map, obtaining the material multi-quadrant identifier of the target material, and converting the material multi-quadrant identifier to obtain the material texture coordinates of the target material; in response to the type characterization of the target map that the target map is not a multi-quadrant map, obtaining the map texture coordinates of the target map to obtain the material texture coordinates of the target material.
[0179] Optionally, the processor can also be configured to perform the following steps through a computer program: obtaining a first mapping relationship corresponding to multiple three-dimensional models, wherein the first mapping relationship is used to characterize the mapping relationship between multiple three-dimensional models and at least one original material; traversing any original material in the first mapping relationship, and obtaining an original map corresponding to any original material; and constructing a second mapping relationship based on any original material and the original map corresponding to any original material.
[0180] Optionally, the processor may be configured to execute the following steps through a computer program: traverse any original map in the second mapping relationship; and construct a third mapping relationship based on any original map and a target map corresponding to any original map.
[0181] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: traverse any original material in the first mapping relationship, and obtain the original map corresponding to any original material from the second mapping relationship; based on the original map corresponding to any original material, obtain the target map corresponding to any original material from the third mapping relationship; map the target map corresponding to any original material onto the surface of a preset lighting model to generate a target material corresponding to any original material; and construct a fourth mapping relationship based on any original material and the target material corresponding to any original material.
[0182] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: traverse any one of the multiple three-dimensional models; based on any one of the three-dimensional models, determine the original material corresponding to any one of the three-dimensional models from the first mapping relationship; based on the original material corresponding to any one of the three-dimensional models, determine the target material corresponding to any one of the three-dimensional models from the fourth mapping relationship; based on the material texture coordinates of the target material corresponding to any one of the three-dimensional models, map the target material corresponding to any one of the three-dimensional models onto the surface of any one of the three-dimensional models to obtain a new three-dimensional model corresponding to any one of the three-dimensional models, wherein the target three-dimensional model includes new three-dimensional models corresponding to multiple three-dimensional models.
[0183] In the electronic device of this embodiment, a technical solution is provided. The original texture corresponding to the original stereo model is obtained based on the original material corresponding to the original stereo model; the original texture is converted to obtain the target texture; the target texture is mapped to the surface of the preset illumination model to generate the target material; and the target stereo model is generated based on the original stereo model and the target material. It is easy to notice that the speed of obtaining the original texture can be improved when the original stereo model is processed in batches by using the original material as the basis and obtaining the original texture corresponding to the original stereo model through material logic search; the original texture is converted to obtain the target texture with lower resolution and mapped to the surface of the preset illumination model to generate the target material, so that the target material can meet the requirements of the preview-level target stereo model; the original material is replaced by the target material, and the target stereo model is generated based on the original stereo model and the target material, so that the batch processing of the original stereo model can be realized, and the target stereo model that can be used for preview can be obtained, so as to avoid the tediousness of manually processing the original stereo model one by one, and the purpose of improving the generation efficiency of the preview-level model is achieved while ensuring that the generated target stereo model meets the preview requirements, thereby solving the technical problem of low generation efficiency of the preview-level model.
[0184] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. Figure 5 As shown, the electronic device 500 is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0185] like Figure 5 As shown, the electronic device 500 is in the form of a general computing device. The components of the electronic device 500 may include but are not limited to: at least one processor 510, at least one memory 520, a bus 530 connecting different system components (including the memory 520 and the processor 510), and a display 540.
[0186] The memory 520 stores program codes, which can be executed by the processor 510, so that the processor 510 executes the steps described in the method part of the embodiment of the present application according to various exemplary embodiments of the present disclosure.
[0187] The memory 520 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 5201 and / or a cache memory unit 5202, and may further include a read-only memory unit (ROM) 5203, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
[0188] In some examples, the memory 520 may also include a program / utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. The memory 520 may further include a memory remotely disposed relative to the processor 510, and these remote memories may be connected to the electronic device 500 via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0189] Bus 530 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a local bus of processor 510, or a bus using any of a variety of bus architectures.
[0190] The display 540 may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the electronic device 500 .
[0191] Optionally, the electronic device 500 may also communicate with one or more external devices 600 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 500, and / or any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 550. Furthermore, the electronic device 500 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 560. Figure 5 As shown, the network adapter 560 communicates with other modules of the electronic device 500 via the bus 530. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0192] The electronic device 500 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply and / or a camera.
[0193] It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only and does not limit the structure of the above electronic device. Figure 5 More or fewer components as shown, or with Figure 1 The memory 520 may be used to store computer programs and corresponding data, such as the computer programs and corresponding data corresponding to the three-dimensional model generation method in the embodiment of the present disclosure. The processor 510 executes various functional applications and data processing by running the computer programs stored in the memory 520, that is, implementing the above-mentioned three-dimensional model generation method.
[0194] The embodiment of the present application further provides a computer program product. Optionally, in this embodiment, the computer program product may include a computer program, and the computer program implements the method provided in the embodiment when executed by a processor.
[0195] Optionally, the computer program included in the above-mentioned computer program product is executed by a processor to perform the following steps:
[0196] Based on the original material corresponding to the original three-dimensional model, obtaining the original texture corresponding to the original three-dimensional model;
[0197] Performing resolution conversion on the original texture to obtain a target texture, wherein the resolution of the target texture is smaller than the resolution of the original texture;
[0198] Map the target map onto the surface of the preset lighting model to generate the target material;
[0199] A target stereo model is generated based on the original stereo model and the target material, wherein the target stereo model is used for previewing.
[0200] The embodiments of the present application also provide a computer program product. Optionally, the computer program product may include a non-volatile computer-readable storage medium, which may be used to store a computer program, and when the computer program is executed by a processor, the method provided in the embodiments is implemented.
[0201] Optionally, the computer program stored in the non-volatile computer-readable storage medium is used by the processor to execute the following steps:
[0202] Based on the original material corresponding to the original three-dimensional model, obtaining the original texture corresponding to the original three-dimensional model;
[0203] Performing resolution conversion on the original texture to obtain a target texture, wherein the resolution of the target texture is smaller than the resolution of the original texture;
[0204] Map the target map onto the surface of the preset lighting model to generate the target material;
[0205] A target stereo model is generated based on the original stereo model and the target material, wherein the target stereo model is used for previewing.
[0206] The embodiment of the present application further provides a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, the method provided in the above embodiment is implemented.
[0207] Optionally, the computer program is executed by a processor to perform the following steps:
[0208] Based on the original material corresponding to the original three-dimensional model, obtaining the original texture corresponding to the original three-dimensional model;
[0209] Performing resolution conversion on the original texture to obtain a target texture, wherein the resolution of the target texture is smaller than the resolution of the original texture;
[0210] Map the target map onto the surface of the preset lighting model to generate the target material;
[0211] A target stereo model is generated based on the original stereo model and the target material, wherein the target stereo model is used for previewing.
[0212] The serial numbers of the above-mentioned embodiments of the present disclosure are only for description and do not represent the advantages or disadvantages of the embodiments.
[0213] In the above embodiments of the present disclosure, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0214] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0215] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0216] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0217] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0218] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present disclosure. These improvements and modifications should also be regarded as the scope of protection of the present disclosure.
Claims
1. A three-dimensional model generation method, characterized in that: include: Based on the original material corresponding to the original three-dimensional model, obtaining the original texture corresponding to the original three-dimensional model; Performing resolution conversion on the original map to obtain a target map, wherein the resolution of the target map is smaller than the resolution of the original map; Mapping the target map onto the surface of a preset lighting model to generate a target material; A target three-dimensional model is generated based on the original three-dimensional model and the target material, wherein the target three-dimensional model is used for previewing.
2. The three-dimensional model generation method according to claim 1, characterized in that: The original texture includes an original color texture and an original transparency texture; based on the original material corresponding to the original three-dimensional model, obtaining the original texture corresponding to the original three-dimensional model includes: Determine a first attribute and a second attribute of the original texture based on the type of the original material, wherein the first attribute is used to determine a texture color of the original texture, and the second attribute is used to determine a texture transparency of the original texture; Obtaining the original color map based on the first attribute; The original transparency map is obtained based on the second attribute.
3. The three-dimensional model generation method according to claim 2, characterized in that: Acquiring the original color map based on the first attribute includes: In response to the first attribute indicating that the texture color of the original texture is determined by the original color map, determining a color map path of the original color map, and obtaining the original color map based on the color map path; In response to the first attribute indicating that the texture color of the original texture is determined by the attribute value of the first attribute, the attribute value of the first attribute is determined to be the original color texture.
4. The three-dimensional model generation method according to claim 2, characterized in that: Acquiring the original transparency map based on the second attribute includes: In response to the second attribute indicating that the texture transparency of the original texture is cut off by the original transparency texture, determining a transparency texture path of the original transparency texture, and obtaining the original transparency texture based on the transparency texture path; In response to the second attribute indicating that the texture transparency of the original texture is determined by the attribute value of the second attribute, the attribute value of the second attribute is determined to be the original transparency texture.
5. The three-dimensional model generation method according to claim 1, characterized in that: Mapping the target map onto the surface of the preset illumination model to generate the target material includes: Determining a target quantity of the target material based on a type of the target map, wherein the type of the target map is used to characterize whether the target map is a multi-quadrant map; Based on the target number, the preset illumination model is copied to obtain the target number of copied three-dimensional models; The target map is respectively mapped onto surfaces of the target number of replicated solid models to generate the target number of materials, wherein the target material includes the target number of materials.
6. The three-dimensional model generation method according to claim 5, characterized in that: Based on the type of the target map, determining a target quantity of the target material includes: In response to the type of the target map characterizing that the target map is the multi-quadrant map, determining the target number based on the number of the multi-quadrant maps; In response to the type of the target map indicating that the target map is not the multi-quadrant map, the target quantity is determined to be a preset quantity.
7. The three-dimensional model generation method according to claim 1, characterized in that: Generating the target three-dimensional model based on the original three-dimensional model and the target material includes: Determining the material texture coordinates of the target material based on the type of the target map, wherein the type of the target map is used to indicate whether the target map is a multi-quadrant map; Based on the material texture coordinates of the target material, the target material is mapped onto the surface of the original three-dimensional model to generate the target three-dimensional model.
8. The three-dimensional model generation method according to claim 7, characterized in that: Determining the material texture coordinates of the target material based on the type of the target map includes: In response to the target map type characterizing that the target map is the multi-quadrant map, obtaining a map multi-quadrant identifier corresponding to the multi-quadrant map, obtaining a material multi-quadrant identifier of the target material, and converting the material multi-quadrant identifier to obtain material texture coordinates of the target material; In response to the type characterization of the target map indicating that the target map is not the multi-quadrant map, a map texture coordinate of the target map is acquired to obtain a material texture coordinate of the target material.
9. The three-dimensional model generation method according to any one of claims 1 to 8, characterized in that: In response to the original three-dimensional model including a plurality of three-dimensional models, determining the original material corresponding to the original three-dimensional model, and acquiring the original map corresponding to the original material, comprises: Acquire a first mapping relationship corresponding to the plurality of three-dimensional models, wherein the first mapping relationship is used to represent a mapping relationship between the plurality of three-dimensional models and at least one original material; Traversing any original material in the first mapping relationship, and obtaining an original map corresponding to the any original material; A second mapping relationship is constructed based on the any one original material and the original map corresponding to the any one original material.
10. The three-dimensional model generation method according to claim 9, characterized in that: After performing resolution conversion on the original map to obtain the target map, the method further includes: Traversing any original map in the second mapping relationship; A third mapping relationship is constructed based on the any one original map and the target map corresponding to the any one original map.
11. The three-dimensional model generation method according to claim 10, characterized in that: Mapping the target map onto the surface of the preset illumination model to generate the target material includes: Traversing any one of the original materials in the first mapping relationship, and acquiring an original map corresponding to the any one of the original materials from the second mapping relationship; Based on the original map corresponding to the any one original material, acquiring the target map corresponding to the any one original material from the third mapping relationship; Mapping a target map corresponding to any one of the original materials onto a surface of the preset illumination model to generate a target material corresponding to any one of the original materials; A fourth mapping relationship is constructed based on the any one original material and the target material corresponding to the any one original material.
12. The three-dimensional model generation method according to claim 11, characterized in that: Generating the target three-dimensional model based on the original three-dimensional model and the target material includes: Traversing any one of the plurality of three-dimensional models; Based on the any one three-dimensional model, determining an original material corresponding to the any one three-dimensional model from the first mapping relationship; Based on the original material corresponding to the any one of the three-dimensional models, determining the target material corresponding to the any one of the three-dimensional models from the fourth mapping relationship; Based on the material texture coordinates of the target material corresponding to any one of the three-dimensional models, the target material corresponding to the any one of the three-dimensional models is mapped onto the surface of the any one of the three-dimensional models to obtain a new three-dimensional model corresponding to the any one of the three-dimensional models, wherein the target three-dimensional model includes the new three-dimensional models corresponding to the multiple three-dimensional models.
13. A three-dimensional model generating device, characterized in that: include: An acquisition module, used for acquiring an original texture corresponding to the original three-dimensional model based on an original material corresponding to the original three-dimensional model, wherein the original three-dimensional model is used for rendering; A conversion module, used for performing resolution conversion on the original map to obtain a target map, wherein the resolution of the target map is smaller than the resolution of the original map; A mapping module, used for mapping the target map onto a surface of a preset illumination model to generate a target material; A generating module is used to generate a target three-dimensional model based on the original three-dimensional model and the target material, wherein the target three-dimensional model is used for previewing.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the three-dimensional model generating method according to any one of claims 1 to 12 when executed by a processor.
15. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the three-dimensional model generating method according to any one of claims 1 to 12.
16. A computer program product, characterized in that The invention comprises a computer program, which implements the three-dimensional model generating method according to any one of claims 1 to 12 when being executed by a processor.
