Model generation method and device, storage medium, electronic device and computer program product
By converting the basic three-dimensional model into voxel model and introducing random data, combined with surface reduction topology processing, the automated generation of three-dimensional models is achieved, solving the problems of high labor costs, low efficiency and poor flexibility in the existing technology, and improving the Efficiency and diversity of model generation.
Patent Information
- Application Number
- CN202411441099.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, the three-dimensional model generation solution has problems such as high labor cost, low efficiency and poor flexibility, and lacks effective solutions.
By converting the basic three-dimensional model into voxel model, and using the target random data to add random shape and texture information, combined with the surface reduction topology processing, diverse target model data are generated to achieve automated rendering output.
It reduces the cost of model production, improves the production effect and flexibility, improves the efficiency and diversity of model generation, and solves the problems of high labor costs, low efficiency and poor flexibility.
Smart Images

Figure CN119251369A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer graphics technology, and in particular to a model generation method, device, storage medium, electronic device and computer program product. Background Art
[0002] In the field of computer graphics technology, it is often necessary to generate 3D model resources with different shapes but similar overall performance. To this end, artists usually need to carve high-precision models to create a 3D model of a certain shape. Although this solution that relies on manual production of 3D models has a high degree of artistic control, the production process is cumbersome and the labor cost is extremely high. In addition, the overall effect of a large number of 3D models in the virtual scene depends on the production level of the artists. The replacement of artists during the iteration process will also have a significant impact on the overall effect.
[0003] As can be seen from the above, the three-dimensional model generation solutions provided in the relevant technologies have the following defects: high labor costs; time-consuming and low efficiency; and strong reliance on manual labor, which leads to a lack of flexibility, diversity and scalability in model production.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] At least some embodiments of the present application provide a model generation method, device, storage medium, electronic device and computer program product to at least solve the technical problems of high labor cost, low efficiency and poor flexibility of the model generation solutions in the related art.
[0007] According to one embodiment of the present application, a model generation method is provided, including: performing voxel conversion based on a basic three-dimensional model to obtain an initial voxel model; superimposing target random data with the initial voxel model to obtain first model data, wherein the target random data is used to characterize random shape information and random texture information to be superimposed on the basic three-dimensional model; performing face reduction topology processing on the first model data to generate second model data, wherein the number of mesh faces corresponding to the second model data is less than the number of mesh faces corresponding to the first model data; and rendering and outputting the target model using the second model data.
[0008] According to one embodiment of the present application, a model generation device is also provided, including: a conversion module, used to perform voxel conversion based on a basic three-dimensional model to obtain an initial voxel model; a first processing module, used to superimpose target random data with the initial voxel model to obtain first model data, wherein the target random data is used to characterize random shape information and random texture information to be superimposed on the basic three-dimensional model; a second processing module, used to perform face reduction topology processing on the first model data to generate second model data, wherein the number of mesh faces corresponding to the second model data is less than the number of mesh faces corresponding to the first model data; a rendering module, used to render and output the target model using the second model data.
[0009] According to one embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute any one of the above-mentioned model generation methods when running.
[0010] According to one embodiment of the present application, an electronic device is also provided, including: a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute any one of the above-mentioned model generation methods.
[0011] According to one embodiment of the present application, a computer program product is also provided, including a computer program, which implements any of the above-mentioned model generation methods when executed by a processor.
[0012] In at least some embodiments of the present application, voxel conversion is performed based on the basic three-dimensional model to obtain an initial voxel model; the target random data and the initial voxel model are superimposed to obtain first model data, wherein the target random data is used to characterize the random shape information and random texture information to be superimposed on the basic three-dimensional model; the first model data is subjected to face reduction topology processing to generate second model data, wherein the number of mesh faces corresponding to the second model data is less than the number of mesh faces corresponding to the first model data; and the target model is rendered and output using the second model data. The present application converts the basic three-dimensional model into a voxel model to facilitate subsequent high-modulus processing of the model data at the voxel level, and the present application introduces the target random data to determine the random shape and random texture added to the basic three-dimensional model, which can improve the diversity of the three-dimensional model while automating the target model production process. Further, combined with face reduction topology processing and rendering, the present application achieves the purpose of realizing rich and diverse target model generation through an automated process, thereby achieving the technical effect of reducing model production costs, improving production effects, and improving the flexibility of model production schemes, thereby solving the technical problems of high labor costs, low efficiency, and poor flexibility of the model generation scheme in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0014] Figure 1 It is a hardware structure block diagram of a mobile terminal according to a model generation method in one embodiment of the present application;
[0015] Figure 2 is a flow chart of a model generation method according to one embodiment of the present application;
[0016] Figure 3 is a schematic diagram of an optional basic three-dimensional model according to one embodiment of the present application;
[0017] Figure 4 is a schematic diagram of an optional first superposition result according to one embodiment of the present application;
[0018] Figure 5 is a schematic diagram of an optional visualization result of fourth model data according to one embodiment of the present application;
[0019] Figure 6 is a schematic diagram of an optional visualization result of fifth model data according to one embodiment of the present application;
[0020] Figure 7 is a schematic diagram of an optional second superposition result according to one embodiment of the present application;
[0021] Figure 8 is a schematic diagram of an optional first noise map according to one embodiment of the present application;
[0022] Fig. 9 is a schematic diagram of an optional second noise map according to one embodiment of the present application;
[0023] Fig.10 is a schematic diagram of an optional third noise map according to one embodiment of the present application;
[0024] Fig.11 is a schematic diagram of an optional target model according to one embodiment of the present application;
[0025] Fig.12 is a structural block diagram of a model generation device according to one embodiment of the present application;
[0026] Fig.13 is a schematic diagram of an electronic device according to one embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] It should be noted that, in the specification of the present application, the word "for example" is used to mean "used as an example, illustration or description". Any embodiment described as "for example" in the present application is not necessarily interpreted as being more preferred or more advantageous than other embodiments. In order to enable any technician in the field to implement and use the present application, the following description is given. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid unnecessary details that make the description of the present application obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the present application.
[0030] In the process of describing the embodiments of the present application, some nouns or terms that appear are subject to the following explanations.
[0031] Model mesh: used to represent the shape and structure of a virtual three-dimensional model, usually including vertices, edges and faces, where faces can be triangular faces or polygonal faces, which are connected by vertices and edges to form the surface of the virtual three-dimensional model.
[0032] Voxel: In the field of computer graphics, voxel is regarded as the smallest unit for dividing three-dimensional space. Voxel can also be regarded as the concept of spatializing the smallest unit (pixel) in two-dimensional space. Each voxel can be regarded as a small polyhedron (such as a cube, tetrahedron, etc.). Each voxel can store various types of information, such as density, color, temperature, etc. The information stored in these voxels can be used to represent related objects in the three-dimensional scene.
[0033] In a possible implementation of the present application, for the solution of relying on manual high-poly carving commonly used in scenes involving virtual three-dimensional model generation in the field of computer graphics technology, the inventor, after practice and careful research, still has technical problems of high labor cost, low efficiency and poor flexibility. Based on this, the embodiment of the present application proposes a model generation method, by performing voxel conversion based on a basic three-dimensional model to obtain an initial voxel model, further superimposing target random data with the initial voxel model to obtain first model data, wherein the target random data is used to characterize random shape information and random texture information to be superimposed on the basic three-dimensional model, and then performing face reduction topology processing on the first model data to generate second model data, wherein the number of mesh faces corresponding to the second model data is less than the number of mesh faces corresponding to the first model data, and finally using the second model data to render and output the target model, thereby achieving the purpose of realizing rich and diverse three-dimensional model generation through an automated process, thereby achieving the technical effect of reducing the production cost of the target model, improving the production effect and enhancing the flexibility of the model production scheme, thereby solving the technical problems of high labor cost, low efficiency and poor flexibility of the model generation scheme in the related art.
[0034] The above method embodiments involved in this application can be executed in a terminal device (for example, 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 PDA, a mobile Internet device, a game console and other terminal devices.
[0035] Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal according to a model generation method in one embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1The present invention relates to a processor 102 (only one of which is shown in the figure), a memory 104, a transmission device 106, an input / output device 108, and a display device 110. Taking the application of the model generation method to an electronic game scene through the mobile terminal as an example, the processor 102 calls and runs the computer program stored in the memory 104 to execute the model generation method, and the target model (or the scene screen containing the target model) in the generated electronic game scene is transmitted to the input / output device 108 and / or the display device 110 through the transmission device 106, and then the target model (or the scene screen containing the target model) is provided to the player.
[0036] Still like Figure 1 As shown, the processor 102 may include but is not limited to: a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microcontroller unit (MCU), a programmable logic device (Field Programmable Gate Array, FPGA), a neural network processor (Neural-Network Processing Unit, NPU), a tensor processor (Tensor Processing Unit, TPU), an artificial intelligence (Artificial Intelligence, AI) type processor and other processing devices.
[0037] 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 shown.
[0038] In some optional embodiments mainly based on game scenarios, the above-mentioned terminal 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 (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.
[0039] The above method embodiments involved in this application can also be executed in a server. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. Taking the application of the model generation method to an electronic game scene through an electronic game server as an example, the electronic game server can generate a target model in the electronic game scene based on the model generation method, and provide the target model (or the scene screen containing the target model) to the player (for example, it can be rendered and displayed on the display screen of the player's terminal, or provided to the player through holographic projection, etc.).
[0040] According to one embodiment of the present application, an embodiment of a model generation method 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.
[0041] In this embodiment, a model generation method running on the above mobile terminal is provided. Figure 2 is a flow chart of a model generation method according to one embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0042] Step S21, performing voxel conversion based on the basic three-dimensional model to obtain an initial voxel model;
[0043] Step S22, superimposing the target random data with the initial voxel model to obtain first model data, wherein the target random data is used to represent random shape information and random texture information to be superimposed on the basic three-dimensional model;
[0044] Step S23, performing surface reduction topology processing on the first model data to generate second model data, wherein the number of mesh surfaces corresponding to the second model data is less than the number of mesh surfaces corresponding to the first model data;
[0045] Step S24: Render and output the target model using the second model data.
[0046] The basic three-dimensional model may be a three-dimensional model unit pre-made for a virtual scene. The basic three-dimensional model is used as a basic shape model in the process of generating a random shape target model. For example, the basic three-dimensional model may be a three-dimensional meteorite model, which is used as a basic model for generating a random shape target model. The random shape target model may be a plurality of meteorite models with different shapes but similar overall styles.
[0047] The above virtual scenes may be virtual exhibition halls, virtual conference rooms, virtual classrooms, electronic game scenes, etc. In particular, the game types corresponding to the above electronic game scenes may be: action games (for example: first-person or third-person shooting games, two-dimensional or three-dimensional fighting games, war action games, and sports action games, etc.), adventure games (for example: exploration games, collection games, puzzle games, etc.), simulation games (for example: simulation sandbox games, simulation development games, strategy simulation games, city construction simulation games, business simulation games, etc.), role-playing games, and leisure games (for example: chess and card table games, casual competitive games, music rhythm games, dress-up development games, etc.), etc.
[0048] The basic three-dimensional model is represented by a model grid, and voxel conversion is performed based on the basic three-dimensional model to obtain an initial voxel model corresponding to the basic three-dimensional model, and the initial voxel model is represented by voxel data.
[0049] Furthermore, the target random data and the initial voxel model are superimposed to obtain first model data, wherein the target random data is random data predefined according to the application scenario requirements for making a target model of a random shape, and the target random data may include multiple categories of random data, for example, the target random data at least includes the first category of random data corresponding to the random shape information and the second category of random data corresponding to the random texture information. The superimposition processing may be based on voxel data, and the number of mesh faces (or the number of voxel faces) corresponding to the first model data may generally be large, that is, the first model data is high-modulus data. In other words, the process of superimposing the target random data and the initial voxel model to obtain the first model data may achieve the effect of high-modulus engraving.
[0050] Furthermore, the first model data is subjected to a face reduction topology process, and the number of mesh faces corresponding to the generated second model data is smaller than the number of mesh faces corresponding to the first model data, that is, the second model data is low-poly data. Rendering based on the second model data to obtain the target model can improve efficiency and reduce device resources occupied by rendering.
[0051] From the above, compared with the model generation scheme in the related art, the embodiment of the present application can generate the target model of random shapes corresponding to the above-mentioned basic three-dimensional model in batches with an automated process, and the production process is simple, time-saving and low in dependence on manual labor. In addition, the embodiment of the present application supports the user to control the generation effect of the target model by replacing the basic three-dimensional model, replacing the target random data, or replacing the algorithms in the overlay processing and the face reduction topology processing. The whole solution is highly flexible and scalable. With limited production costs, the embodiment of the present application can quickly generate a rich variety of target models with random shapes.
[0052] Specifically, the above-mentioned model generation method provided in the embodiment of the present application may also include other method steps, which can be referred to the further introduction of the embodiment of the present application below and will not be repeated here.
[0053] In an embodiment of the present application, voxel conversion is performed based on the basic three-dimensional model to obtain an initial voxel model; the target random data and the initial voxel model are superimposed to obtain first model data, wherein the target random data is used to characterize the random shape information and random texture information to be superimposed on the basic three-dimensional model; the first model data is subjected to face reduction topology processing to generate second model data, wherein the number of mesh faces corresponding to the second model data is less than the number of mesh faces corresponding to the first model data; and the target model is rendered and output using the second model data. The present application converts the basic three-dimensional model into a voxel model to facilitate subsequent high-modulus processing of the model data at the voxel level, and the present application introduces the target random data to determine the random shape and random texture added to the basic three-dimensional model, which can improve the diversity of the model while automating the three-dimensional model making process. Furthermore, combined with face reduction topology processing and rendering, the present application achieves the purpose of realizing rich and diverse model generation through an automated process, thereby achieving the technical effect of reducing the model making cost, improving the making effect and improving the flexibility of the model making scheme, thereby solving the technical problems of high labor cost, low efficiency and poor flexibility of the scheme for generating models in the related technology.
[0054] The above method of the embodiment of the present application is further introduced below.
[0055] Optionally, the target random data includes random hollowing data and multiple noise maps; in step S22, the target random data is superimposed with the initial voxel model to obtain the first model data, which may include the following execution steps:
[0056] Step S221, randomly scattering points on the surface of the initial voxel model to determine the target random position;
[0057] Step S222, based on the target random position, perform a superposition Boolean operation on the initial voxel model and the random hollowing data to obtain third model data;
[0058] Step S223 , superimposing a plurality of noise maps on the third model data to obtain the first model data, wherein the plurality of noise maps are used to respectively describe different model surface details.
[0059] In the application scenario of generating a meteorite model of a random shape, the random hollowing data may be random meteorite crater data. The multiple noise maps are used to describe different meteorite surface details respectively.
[0060] Avoid random scattering in the initial voxel model, and the determined target random position can be used as the superposition position of the random hollowing data on the initial voxel model. Further, the virtual pothole component corresponding to the random hollowing data is superimposed on the initial voxel model to perform Boolean operations (such as intersection pruning operations, union operations, etc.) to obtain third model data. The third model data can be the model data corresponding to the voxel model after the Boolean operation.
[0061] The above-mentioned multiple noise maps can be used to determine the random texture information of the model surface. The above-mentioned multiple noise maps can respectively describe different model surface details. Based on this, after the texture data of multiple noise maps are superimposed on the third model data, the first model data is obtained. The above-mentioned first model data is the model data corresponding to the target voxel model after high-poly carving.
[0062] Through the above-mentioned steps S221 to S223, the embodiment of the present application achieves high-poly engraving of the model with high randomness by adding random hollow bodies (such as meteorite crater holes) at random positions on the model surface and superimposing different model surface details (that is, noise data) on the model surface. The obtained first model data has strong diversity.
[0063] Optionally, the target random position includes a first random position and a second random position; in step S221, randomly scattering points on the surface of the initial voxel model to determine the target random position may include the following execution steps:
[0064] Step S2211, randomly scattering points on the surface of the initial voxel model to determine a first random position;
[0065] Step S2212, determining a secondary scattering area on the surface of the initial voxel model based on the first random position and a preset distance threshold;
[0066] Step S2213, randomly scattering points in the secondary scattering area to determine a second random position.
[0067] After the first random positions are obtained by the first random scattering on the surface of the initial voxel model, the range of the preset distance threshold near these first random positions is determined as the secondary scattering area, and further, random scattering is performed in the secondary scattering area to determine the second random position.
[0068] Through the above steps S2211 to S2213, the embodiment of the present application determines a variety of different random positions on the surface of the initial voxel model by randomly scattering points multiple times, which facilitates subsequent different overlay processing based on these different random positions, thereby enhancing the randomness of the model's high-poly carving process.
[0069] Optionally, the random hollowing data includes first shape data corresponding to a hollowed-out body of a first size and second shape data corresponding to a hollowed-out body of a second size, and the first size is larger than the second size; in step S222, based on the target random position, the initial voxel model and the random hollowing data are superimposed to obtain the third model data, which may include the following execution steps:
[0070] Step S2221, based on the first random position, performing a superposition Boolean operation on the initial voxel model and the first shape data to obtain fourth model data;
[0071] Step S2222, performing a random voxel surface crushing operation on the current voxel model corresponding to the fourth model data to obtain fifth model data;
[0072] Step S2223: Based on the second random position, perform a superposition Boolean operation on the fifth model data and the second shape data to obtain third model data.
[0073] The first shape data can be used to determine the hollowed-out shape corresponding to the larger hollowed-out body. The second shape data can be used to determine the hollowed-out shape corresponding to the smaller hollowed-out body. In an application scenario, the hollowed-out shapes corresponding to the larger hollowed-out body and the smaller hollowed-out body may be consistent based on the different sizes corresponding to the larger hollowed-out body and the smaller hollowed-out body.
[0074] In the application scenario of generating a random-shaped meteorite model, the hollowed-out body may be a random pit. The first shape data may be used to determine the random pit shape corresponding to a larger meteorite pit. The second shape data may be used to determine the random pit shape corresponding to a smaller meteorite pit. In one application scenario, the random pit shapes corresponding to the larger meteorite pit and the smaller meteorite pit may be the same based on the different pit sizes corresponding to the larger meteorite pit and the smaller meteorite pit.
[0075] The first shape data is superimposed on a first random position on the surface of the initial voxel model and a Boolean operation is performed to obtain fourth model data. The fourth model data may be model data of the voxel model after the superimposed Boolean operation corresponding to the first random position is performed.
[0076] In an exemplary application scenario, taking the generation of a random-shaped meteorite model as an example, a basic three-dimensional model (i.e., a basic meteorite model) is provided as follows: Figure 3 As shown, Figure 3 The basic meteorite model shown in FIG. 1 is subjected to voxel conversion to obtain an initial voxel model. A random pit of a first size is superimposed at a first random position on the surface of the initial voxel model. The first superposition result is as follows: Figure 4 As shown, it can be seen that there are multiple large meteorite crater components randomly distributed on the surface of the voxel model. Figure 4 After the first superposition result shown in FIG. 1 is subjected to Boolean operation, the visualization result of the fourth model data is obtained as follows: Figure 5 As shown, it can be seen, Figure 5 The voxel model surface shown in the figure already contains randomly distributed larger craters; however, the surface of the meteorite model is still relatively smooth.
[0077] Furthermore, for the current voxel model corresponding to the fourth model data (ie Figure 5 The fifth model data may be the model data of the current voxel model after random fragmentation.
[0078] It should be noted that the above VDBFracture tool is a tool or algorithm for creating and simulating the fragmentation effect of the model. The key point of the VDBFracture tool is to divide the voxels contained in the model into multiple small blocks to simulate the fragmentation effect.
[0079] In the above exemplary application scenario, Figure 5 After the corresponding fourth model data is subjected to voxel surface reduction processing and voxel random fragmentation processing, the visualization result of the fifth model data is obtained as follows Figure 6 As shown. It can be seen that the current voxel model corresponding to the fifth model data already has the random shape effect after adding a larger meteorite crater hole (similar to Figure 5 The surface smoothness is reduced compared to the corresponding voxel model).
[0080] Further, the second shape data is superimposed at a second random position on the current voxel model surface corresponding to the fifth model data, to obtain Figure 7 The second superposition result shown is subjected to Boolean operation processing based on the second superposition result to obtain third model data.
[0081] Through the above steps S2221 to S2223, the embodiment of the present application adds hollow bodies of different sizes to the model surface based on the random positions determined by two random scattering operations, thereby improving the diversity of the model shape.
[0082] Optionally, in step S223, superimposing a plurality of noise maps on the third model data to obtain the first model data may include the following execution steps:
[0083] Step S2231, performing a weighted sum operation on multiple noise maps to obtain a weighted result;
[0084] Step S2232, performing a superposition operation on the third model data and the weighted result to obtain sixth model data;
[0085] Step S2233: Based on a preset smoothing area selection rule, a mask smoothing operation is performed on at least a portion of the sixth model data to obtain the first model data.
[0086] The above-mentioned multiple noise maps can be noise maps with different noise scales (Tiling). Multiple noise maps can be used to superimpose to obtain different levels of model surface details.
[0087] Further, a weighted sum operation is performed on the multiple noise maps to obtain a weighted result. The third model data and the weighted result are further superimposed to obtain sixth model data. The sixth model data may be model data after the third model data is noise-perturbed. The sixth model data may be model data of the current voxel model after weighted superposition of the noise maps.
[0088] The preset smooth region selection rule may include: a region selection rule based on the model surface curvature and a preset curvature threshold, and a region selection rule based on the model surface light mask information and a preset light and dark threshold. Further, based on the smooth region selection rule, at least a partial region is selected from the surface of the current voxel model corresponding to the sixth model data, and a mask smoothing operation is performed on at least a portion of the sixth model data corresponding to the at least partial region to obtain the first model data.
[0089] In an exemplary application scenario, a mask Mask is generated based on the selected area to be smoothed, the model vertex position in the sixth model data is recorded as Position6, and the model vertex position in the first model data is recorded as Position1, then the above-mentioned mask smoothing operation process can be expressed as: Position1=smooth(Position6, Mask).
[0090] Through the above steps S2231 to S2233, the embodiment of the present application comprehensively considers various levels of model surface details by performing weighted summation and superposition operations on the noise map, and enhances the overall visual performance of the high model obtained after the high-model engraving is completed by performing mask smoothing operations on at least part of the model surface.
[0091] Optionally, the multiple noise maps include: a first noise map and a second noise map; in step S2231, performing a weighted sum operation on the multiple noise maps to obtain a weighted result may include the following execution steps:
[0092] Step S2234, determining a first weight coefficient corresponding to the first noise map and a second weight coefficient corresponding to the second noise map, wherein the first noise map and the second noise map are used to respectively describe different levels of texture details on the surface of the model, and the first weight coefficient is greater than the second weight coefficient;
[0093] Step S2235, based on the first weight coefficient and the second weight coefficient, perform a weighted sum operation on the first noise map and the second noise map to obtain a weighted result.
[0094] By setting noise maps with different weights, we can control the different levels of texture details on the model surface and further enhance the random visual performance of the model surface.
[0095] In an exemplary application scenario, taking the generation of a random shape meteorite model as an example, multiple noise maps include: a first noise map, a second noise map and a third noise map; a weighted sum operation is performed on the multiple noise maps to obtain a weighted result, including: determining a first weight coefficient corresponding to the first noise map, a second weight coefficient corresponding to the second noise map, and a third weight coefficient corresponding to the third noise map, wherein the first noise map, the second noise map and the third noise map are used to respectively describe different levels of texture details on the surface of the meteorite, the first weight coefficient is greater than the second weight coefficient, and the second weight coefficient is greater than the third weight coefficient; based on the first weight coefficient, the second weight coefficient and the third weight coefficient, a weighted sum operation is performed on the first noise map, the second noise map and the third noise map to obtain a weighted result.
[0096] In the above exemplary application scenario, the following is provided: Figure 8 The first noise map (denoted as Noise1) shown in Fig. 9 The second noise map (denoted as Noise2) and Fig.10The third noise map shown (denoted as Noise3). The Tiling of the first noise map, the second noise map and the third noise map are different. The first noise map is used to determine the surface texture details of the meteorite model with a larger noise scale (such as large cracks or large pits on the surface of the meteorite model). The second noise map is used to determine the surface texture details of the meteorite model with a medium noise scale (such as small cracks or weathering layers on the surface of the meteorite model). The third noise map is used to determine the surface texture details of the meteorite model with a smaller noise scale (such as tiny particles or crystal structures on the surface of the meteorite model).
[0097] According to the application scenario requirements, obtain the first weight coefficient corresponding to the first noise map (take 1 in this example), the second weight coefficient corresponding to the second noise map (take 0.5 in this example), and the third weight coefficient corresponding to the third noise map (take 0.25 in this example).
[0098] Furthermore, a weighted sum operation is performed on the first noise map, the second noise map and the third noise map to obtain a weighted result, that is, Noise1×1+Noise2×0.5+Noise3×0.25.
[0099] Based on this, the weighted result is superimposed on the third model data to obtain the sixth model data. The model vertex position in the third model data is recorded as Position3, and the model vertex position in the sixth model data is recorded as Position6. The superposition process of the above weighted results is expressed as: Position6 = Position3 + Noise1×1 + Noise2×0.5 + Noise3×0.25.
[0100] Through the above steps S2234 to S2235, taking the generation of a random shape meteorite model as an example, the embodiment of the present application performs weighted sum calculation on the noise maps of three different tilings to obtain a weighted result for noise offset, which helps to comprehensively consider the influence of different noise maps on the surface effect of the meteorite model in the process of noise offset of the third model data, and create a meteorite model surface that includes both large-scale cracks and pit effects and small and medium-scale cracks or particles, making the meteorite model look more real and complex, and enhancing the detail performance of the meteorite model.
[0101] Optionally, the second model data includes: low-poly mesh data, texture map, normal map and light occlusion map; in step S23, performing face reduction topology processing on the first model data to generate the second model data may include the following execution steps:
[0102] Step S231, grid-converting the target voxel model corresponding to the first model data to obtain seventh model data;
[0103] Step S232, performing a surface reduction operation and a topology structure adjustment operation based on the seventh model data to obtain low-poly mesh data;
[0104] Step S233, performing texture splitting operation on the low-poly mesh data to generate a texture map;
[0105] Step S234, performing a texture baking operation based on the low-poly mesh data to obtain a normal map and a light occlusion map.
[0106] Taking the generation of a random-shaped meteorite model as an example, the above-mentioned low-poly mesh data may include data of a single mesh corresponding to the meteorite low-poly model and multi-level mesh data (ie, LOD mesh data) corresponding to the meteorite low-poly model.
[0107] The target voxel model is a voxel model obtained after high-poly carving processing of the initial voxel model, that is, the voxel model corresponding to the first model data. Based on this, the target voxel model is mesh-converted, that is, the voxel model is converted into a mesh model represented by a model mesh. The seventh model data is the model data of the mesh model obtained by converting the target voxel model (still high-poly data).
[0108] The seventh model data is subjected to a face reduction operation and a topology structure adjustment operation to obtain low-poly mesh data. The low-poly mesh data can be obtained by exporting the seventh model data through an export tool after the face reduction operation and the topology structure adjustment operation are performed on the seventh model data.
[0109] Furthermore, the low-poly mesh data is texture-split to obtain the texture map (i.e., UV map) corresponding to the low-poly model of the meteorite. The texture baking operation is performed based on the low-poly mesh data to obtain the normal map (NormalMap) and the light occlusion map (i.e., AOMap).
[0110] Through the above steps S231 to S234, after generating the high-poly data of the model, the embodiment of the present application still generates low-poly mesh data and texture maps, normal maps and lighting occlusion maps corresponding to the low-poly data of the model based on the model mesh data, thereby providing a data basis for subsequent target model rendering.
[0111] Optionally, the above model generation method may further include the following execution steps:
[0112] Step S251, performing an export and naming operation on the second model data to generate a target asset file;
[0113] Step S252, inputting the target asset file into a rendering engine for rendering to obtain a target model.
[0114] The second model data corresponding to the low-poly model is exported and named by a pre-written export and naming script (such as a Python script) to generate a target asset file. The target asset file may have a preset standardized data export format and data naming format. The target asset file may also be obtained by digitally packaging the low-poly mesh data, texture map, normal map, and light occlusion map. Furthermore, the target asset file is input into a rendering engine for rendering to obtain a target model.
[0115] In an exemplary application scenario, the target model (ie, the target meteorite model) obtained by rendering based on the target asset file corresponding to the second model data is as follows: Fig.11 As shown in Figure 2, the target meteorite model has a random shape, a strong sense of reality and surface details.
[0116] Through the above-mentioned steps S251 to S252, the embodiment of the present application combines the generation process of the second model data corresponding to the low-poly model with the rendering process of the target model through an automated export naming operation, thereby improving the rendering efficiency of the target meteorite model.
[0117] Optionally, in step S251, performing an export and naming operation on the second model data to generate a target asset file may include the following execution steps:
[0118] Step S2511, exporting the second model data frame by frame based on a preset programming language to obtain an exported asset;
[0119] Step S2512: rename the exported assets according to a preset naming rule to generate a target asset file.
[0120] The preset programming language may be Python. Based on the export script written in the preset programming language, the second model data is exported frame by frame to obtain multiple data frames of the second model data, thereby generating an export asset.
[0121] Furthermore, a preset naming rule is determined according to application scenario requirements, and the exported assets are renamed according to the preset naming rule to obtain a target asset file.
[0122] Through the above steps S2511 to S2512, the embodiment of the present application improves the rendering efficiency of the target model and reduces the risk of errors in rendering through standardized data export operations and exported asset naming operations.
[0123] In summary, in the embodiments of the present application, by converting the basic three-dimensional model into voxel data, it can help to perform more efficient processing operations on the model-related data in the subsequent process of generating the target model (especially in the process of high-poly carving). For example, for the process of adding small holes to the target meteorite model, the use of voxel data can have a higher processing speed than the use of ordinary model grid data. Voxel data can also directly superimpose multiple layers of noise maps to quickly realize random details on the surface of the meteorite. In summary, the present application makes the random shape model generation process more flexible and efficient by converting the basic three-dimensional model into a voxel model for high-poly carving.
[0124] 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 this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a disk, 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 application.
[0125] In this embodiment, a model generation 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 term "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 conceivable.
[0126] Fig.12 According to a structural block diagram of a model generation device according to one embodiment of the present application, as shown in Fig.12 As shown, the device includes: a conversion module 1201, which is used to perform voxel conversion based on a basic three-dimensional model to obtain an initial voxel model; a first processing module 1202, which is used to superimpose target random data and the initial voxel model to obtain first model data, wherein the target random data is used to characterize random shape information and random texture information to be superimposed on the basic three-dimensional model; a second processing module 1203, which is used to perform face reduction topology processing on the first model data to generate second model data, wherein the number of mesh faces corresponding to the second model data is less than the number of mesh faces corresponding to the first model data; a rendering module 1204, which is used to render and output the target model using the second model data.
[0127] Optionally, the target random data includes random hollowing data and multiple noise maps; the above-mentioned first processing module 1202 is also used to: randomly scatter points on the surface of the initial voxel model to determine the target random position; based on the target random position, perform a superposition Boolean operation on the initial voxel model and the random hollowing data to obtain third model data; superimpose multiple noise maps on the third model data to obtain the first model data, wherein the multiple noise maps are used to respectively describe different model surface details.
[0128] Optionally, the target random position includes a first random position and a second random position; the above-mentioned first processing module 1202 is also used to: randomly scatter points on the surface of the initial voxel model to determine the first random position; based on the first random position and a preset distance threshold, determine a secondary scattering area on the surface of the initial voxel model; randomly scatter points within the secondary scattering area to determine the second random position.
[0129] Optionally, the random hollowing-out data includes first shape data corresponding to a hollowing-out body of a first size and second shape data corresponding to a hollowing-out body of a second size, and the first size is larger than the second size; the above-mentioned first processing module 1202 is also used to: based on the first random position, perform a superimposed Boolean operation on the initial voxel model and the first shape data to obtain fourth model data; perform a random crushing operation on the voxel surface of the current voxel model corresponding to the fourth model data to obtain fifth model data; based on the second random position, perform a superimposed Boolean operation on the fifth model data and the second shape data to obtain third model data.
[0130] Optionally, the first processing module 1202 is also used to: perform weighted sum operation on multiple noise maps to obtain a weighted result; perform superposition operation on the third model data and the weighted result to obtain sixth model data; based on a preset smooth area selection rule, perform a mask smoothing operation on at least part of the data in the sixth model data to obtain the first model data.
[0131] Optionally, the multiple noise maps include: a first noise map, a second noise map and a third noise map; the above-mentioned first processing module 1202 is also used to: determine a first weight coefficient corresponding to the first noise map, a second weight coefficient corresponding to the second noise map, and a third weight coefficient corresponding to the third noise map, wherein the first noise map, the second noise map and the third noise map are used to respectively describe different levels of texture details on the surface of the model, the first weight coefficient is greater than the second weight coefficient, and the second weight coefficient is greater than the third weight coefficient; based on the first weight coefficient, the second weight coefficient and the third weight coefficient, a weighted sum operation is performed on the first noise map, the second noise map and the third noise map to obtain a weighted result.
[0132] Optionally, the second model data includes: low-poly mesh data, texture map, normal map and lighting occlusion map; the above-mentioned second processing module 1203 is also used to: perform mesh conversion on the target voxel model corresponding to the first model data to obtain seventh model data; perform face reduction operation and topology structure adjustment operation based on the seventh model data to obtain low-poly mesh data; perform texture splitting operation on the low-poly mesh data to generate texture map; perform map baking operation based on the low-poly mesh data to obtain normal map and lighting occlusion map.
[0133] Optionally, in addition to all the above modules, the above model generation device also includes an export module (not shown in the figure), which is used to: export and name the second model data to generate a target asset file; input the target asset file into the rendering engine for rendering to obtain the target model.
[0134] Optionally, the export module is further used to: perform frame-by-frame export operation on the second model data based on a preset programming language to obtain exported assets; and rename the exported assets according to preset naming rules to generate a target asset file.
[0135] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0136] An embodiment of the present application 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.
[0137] 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.
[0138] 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.
[0139] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0140] S1, voxel transformation is performed based on the basic three-dimensional model to obtain an initial voxel model;
[0141] S2, superimposing the target random data with the initial voxel model to obtain first model data, wherein the target random data is used to represent random shape information and random texture information to be superimposed on the basic three-dimensional model;
[0142] S3, performing surface reduction topology processing on the first model data to generate second model data, wherein the number of mesh surfaces corresponding to the second model data is less than the number of mesh surfaces corresponding to the first model data;
[0143] S4: Render and output the target model using the second model data.
[0144] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: the target random data includes random hollowing data and multiple noise maps; randomly scattering points on the surface of the initial voxel model to determine the target random position; based on the target random position, superimposing Boolean operations on the initial voxel model and the random hollowing data to obtain third model data; superimposing multiple noise maps on the third model data to obtain the first model data, wherein the multiple noise maps are used to respectively describe different model surface details.
[0145] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: the target random position includes a first random position and a second random position; randomly scattering points on the surface of the initial voxel model to determine the first random position; based on the first random position and a preset distance threshold, a secondary scattering area is determined on the surface of the initial voxel model; and randomly scattering points within the secondary scattering area to determine the second random position.
[0146] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: the random hollowing-out data includes first shape data corresponding to a hollowing-out body of a first size and second shape data corresponding to a hollowing-out body of a second size, the first size being larger than the second size; based on the first random position, performing a superimposed Boolean operation on the initial voxel model and the first shape data to obtain fourth model data; performing a random voxel surface crushing operation on the current voxel model corresponding to the fourth model data to obtain fifth model data; based on the second random position, performing a superimposed Boolean operation on the fifth model data and the second shape data to obtain third model data.
[0147] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: performing a weighted sum operation on multiple noise maps to obtain a weighted result; superimposing the third model data and the weighted result to obtain sixth model data; and based on a preset smoothing area selection rule, performing a mask smoothing operation on at least part of the sixth model data to obtain the first model data.
[0148] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: multiple noise maps include: a first noise map, a second noise map and a third noise map; determining a first weight coefficient corresponding to the first noise map, a second weight coefficient corresponding to the second noise map, and a third weight coefficient corresponding to the third noise map, wherein the first noise map, the second noise map and the third noise map are used to respectively describe different levels of texture details on the surface of the meteorite, the first weight coefficient is greater than the second weight coefficient, and the second weight coefficient is greater than the third weight coefficient; based on the first weight coefficient, the second weight coefficient and the third weight coefficient, a weighted sum operation is performed on the first noise map, the second noise map and the third noise map to obtain a weighted result.
[0149] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: the second model data includes: low-poly mesh data, texture map, normal map and light occlusion map; mesh conversion is performed on the target voxel model corresponding to the first model data to obtain seventh model data; surface reduction operations and topology structure adjustment operations are performed based on the seventh model data to obtain low-poly mesh data; texture splitting operations are performed on the low-poly mesh data to generate texture maps; map baking operations are performed based on the low-poly mesh data to obtain normal maps and light occlusion maps.
[0150] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: performing an export and naming operation on the second model data to generate a target asset file; and inputting the target asset file into a rendering engine for rendering to obtain a target model.
[0151] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: exporting the second model data frame by frame based on a preset programming language to obtain exported assets; and renaming the exported assets according to preset naming rules to generate a target asset file.
[0152] In the computer-readable storage medium of the above embodiment, a technical solution for implementing a model generation method is provided. Based on the basic three-dimensional model, voxel conversion is performed to obtain an initial voxel model; the target random data and the initial voxel model are superimposed to obtain first model data, wherein the target random data is used to characterize the random shape information and random texture information to be superimposed on the basic three-dimensional model; the first model data is subjected to face reduction topology processing to generate second model data, wherein the number of mesh faces corresponding to the second model data is less than the number of mesh faces corresponding to the first model data; and the target model is rendered and output using the second model data. This application facilitates subsequent high-modulus processing of the model data at the voxel level by converting the basic three-dimensional model into a voxel model, and this application introduces target random data to determine the random shape and random texture added to the basic three-dimensional model, which can improve the diversity of the model while automating the model making process. Furthermore, combined with face reduction topology processing and rendering, this application achieves the purpose of realizing rich and diverse model generation through an automated process, thereby achieving the technical effect of reducing the model making cost, improving the making effect and improving the flexibility of the model making scheme, thereby solving the technical problems of high labor cost, low efficiency and poor flexibility of the model generation scheme in the related technology.
[0153] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application 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, and includes 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 methods of the present application.
[0154] 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 application can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present application described in the above "Exemplary Method" section of the present embodiment.
[0155] According to the program product for implementing the above method in the embodiment of the present application, 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 application is not limited thereto. In the embodiment of the present application, 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.
[0156] 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.
[0157] 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.
[0158] An embodiment of the present application 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.
[0159] 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.
[0160] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0161] S1, voxel transformation is performed based on the basic three-dimensional model to obtain an initial voxel model;
[0162] S2, superimposing the target random data with the initial voxel model to obtain first model data, wherein the target random data is used to represent random shape information and random texture information to be superimposed on the basic three-dimensional model;
[0163] S3, performing surface reduction topology processing on the first model data to generate second model data, wherein the number of mesh surfaces corresponding to the second model data is less than the number of mesh surfaces corresponding to the first model data;
[0164] S4: Render and output the target model using the second model data.
[0165] Optionally, the processor can also be configured to perform the following steps through a computer program: the target random data includes random hollowing data and multiple noise maps; randomly scattering points on the surface of the initial voxel model to determine the target random position; based on the target random position, superimposing Boolean operations on the initial voxel model and the random hollowing data to obtain third model data; superimposing multiple noise maps on the third model data to obtain the first model data, wherein the multiple noise maps are used to describe different model surface details respectively.
[0166] Optionally, the processor can also be configured to perform the following steps through a computer program: the target random position includes a first random position and a second random position; points are randomly scattered on the surface of the initial voxel model to determine the first random position; based on the first random position and a preset distance threshold, a secondary scattering area is determined on the surface of the initial voxel model; points are randomly scattered within the secondary scattering area to determine the second random position.
[0167] Optionally, the processor can also be configured to execute the following steps through a computer program: the random hollowing-out data includes first shape data corresponding to a hollowing-out body of a first size and second shape data corresponding to a hollowing-out body of a second size, the first size being larger than the second size; based on the first random position, the initial voxel model is subjected to a superimposed Boolean operation on the first shape data to obtain fourth model data; the corresponding current voxel model of the fourth model data is subjected to a random voxel surface crushing operation to obtain fifth model data; based on the second random position, the fifth model data is subjected to a superimposed Boolean operation on the second shape data to obtain third model data.
[0168] Optionally, the processor can also be configured to execute the following steps through a computer program: performing a weighted sum operation on multiple noise maps to obtain a weighted result; superimposing the third model data and the weighted result to obtain sixth model data; and based on a preset smooth area selection rule, performing a mask smoothing operation on at least part of the sixth model data to obtain the first model data.
[0169] Optionally, the processor may also be configured to perform the following steps through a computer program: multiple noise maps include: a first noise map, a second noise map and a third noise map; determining a first weight coefficient corresponding to the first noise map, a second weight coefficient corresponding to the second noise map, and a third weight coefficient corresponding to the third noise map, wherein the first noise map, the second noise map and the third noise map are used to respectively describe different levels of texture details on the surface of the model, the first weight coefficient is greater than the second weight coefficient, and the second weight coefficient is greater than the third weight coefficient; based on the first weight coefficient, the second weight coefficient and the third weight coefficient, performing a weighted sum operation on the first noise map, the second noise map and the third noise map to obtain a weighted result.
[0170] Optionally, the processor can also be configured to perform the following steps through a computer program: the second model data includes: low-poly mesh data, texture map, normal map and light occlusion map; mesh conversion is performed on the target voxel model corresponding to the first model data to obtain seventh model data; face reduction and topology structure adjustment operations are performed based on the seventh model data to obtain low-poly mesh data; texture splitting operations are performed on the low-poly mesh data to generate texture maps; map baking operations are performed based on the low-poly mesh data to obtain normal maps and light occlusion maps.
[0171] Optionally, the processor may also be configured to execute the following steps through a computer program: export and name the second model data to generate a target asset file; and input the target asset file into a rendering engine for rendering to obtain a target model.
[0172] Optionally, the processor may also be configured to execute the following steps through a computer program: exporting the second model data frame by frame based on a preset programming language to obtain exported assets; and renaming the exported assets according to preset naming rules to generate a target asset file.
[0173] In the electronic device of the above embodiment, a technical solution for realizing a model generation method is provided. Based on the basic three-dimensional model, voxel conversion is performed to obtain an initial voxel model; the target random data and the initial voxel model are superimposed to obtain first model data, wherein the target random data is used to characterize the random shape information and random texture information to be superimposed on the basic three-dimensional model; the first model data is subjected to face reduction topological processing to generate second model data, wherein the number of mesh faces corresponding to the second model data is less than the number of mesh faces corresponding to the first model data; and the target model is rendered and output using the second model data. The present application converts the basic three-dimensional model into a voxel model to facilitate subsequent high-modulus processing of the model data at the voxel level, and the present application introduces the target random data to determine the random shape and random texture added to the basic three-dimensional model, which can improve the diversity of the model while automating the model making process. Furthermore, combined with face reduction topological processing and rendering, the present application achieves the purpose of realizing rich and diverse model generation through an automated process, thereby achieving the technical effect of reducing the model making cost, improving the making effect and improving the flexibility of the model making scheme, thereby solving the technical problems of high labor cost, low efficiency and poor flexibility of the scheme for generating models in the related technology.
[0174] Fig.13 is a schematic diagram of an electronic device according to one embodiment of the present application. Fig.13 As shown, the electronic device 1300 is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0175] like Fig.13 As shown, the electronic device 1300 is in the form of a general computing device. The components of the electronic device 1300 may include but are not limited to: at least one processor 1310, at least one memory 1320, a bus 1330 connecting different system components (including the memory 1320 and the processor 1310), and a display 1340.
[0176] The memory 1320 stores program codes, which can be executed by the processor 1310, so that the processor 1310 executes the steps described in the method part of the embodiment of the present application according to various exemplary embodiments of the present application.
[0177] The memory 1320 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 13201 and / or a cache memory unit 13202, and may further include a read-only memory unit (ROM) 13203, 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.
[0178] In some examples, the memory 1320 may also include a program / utility 13204 having a set (at least one) of program modules 13205, such program modules 13205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include the implementation of a network environment. The memory 1320 may further include a memory remotely disposed relative to the processor 1310, and these remote memories may be connected to the electronic device 1300 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.
[0179] The bus 1330 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 the processor 1310, or a bus using any of a variety of bus architectures.
[0180] The display 1340 may be, for example, a touch screen liquid crystal display (LCD), which may enable a user to interact with a user interface of the electronic device 1300 .
[0181] Optionally, the electronic device 1300 may also communicate with one or more external devices 1400 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 1300, and / or any device that enables the electronic device 1300 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 1350. Furthermore, the electronic device 1300 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 1360. Fig.13 As shown, the network adapter 1360 communicates with other modules of the electronic device 1300 via the bus 1330. It should be understood that although Fig.13 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 1300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.
[0182] The electronic device 1300 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.
[0183] It can be understood by those skilled in the art that Fig.13 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.13 More or fewer components as shown, or with Fig.13 The memory 1320 may be used to store computer programs and corresponding data, such as the computer programs and corresponding data corresponding to the model generation method in the embodiment of the present application. The processor 1310 executes various functional applications and data processing by running the computer programs stored in the memory 1320, that is, implementing the above-mentioned model generation method.
[0184] 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.
[0185] The present application also provides 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 the computer program implements the method provided in the above embodiment when executed by a processor.
[0186] 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.
[0187] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0188] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0189] 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.
[0190] 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.
[0191] In addition, each functional unit in each embodiment of the present application 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.
[0192] 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 application can be essentially or partly or all or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as 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.
[0193] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A model generation method, characterized in that: include: Perform voxel transformation based on the basic three-dimensional model to obtain an initial voxel model; Superimposing the target random data with the initial voxel model to obtain first model data, wherein the target random data is used to represent random shape information and random texture information to be superimposed on the basic three-dimensional model; Performing surface reduction topology processing on the first model data to generate second model data, wherein the number of mesh surfaces corresponding to the second model data is less than the number of mesh surfaces corresponding to the first model data; The target model is rendered and outputted using the second model data.
2. The model generation method according to claim 1, characterized in that: The target random data includes random hollowing data and multiple noise maps; The target random data and the initial voxel model are superimposed to obtain the first model data, including: Randomly scatter points on the surface of the initial voxel model to determine a random target position; Based on the target random position, performing a superposition Boolean operation on the initial voxel model and the random hollowing data to obtain third model data; The first model data is obtained by superimposing the plurality of noise maps on the third model data, wherein the plurality of noise maps are used to respectively describe different model surface details.
3. The model generation method according to claim 2, characterized in that: The target random position includes a first random position and a second random position; randomly scattering points on the surface of the initial voxel model to determine the target random position includes: Randomly scatter points on the surface of the initial voxel model to determine the first random position; Based on the first random position and a preset distance threshold, determining a secondary scattering area on the surface of the initial voxel model; Random dots are scattered in the secondary dot scattering area to determine the second random position.
4. The model generation method according to claim 3, characterized in that: The random hollowing data includes first shape data corresponding to a hollow body of a first size and second shape data corresponding to a hollow body of a second size, wherein the first size is larger than the second size; Based on the random position of the target, the initial voxel model and the random hollowing data are superimposed to obtain the third model data, including: Based on the first random position, performing a superposition Boolean operation on the initial voxel model and the first shape data to obtain fourth model data; Performing a random voxel surface crushing operation on the current voxel model corresponding to the fourth model data to obtain fifth model data; Based on the second random position, a superposition Boolean operation is performed on the fifth model data and the second shape data to obtain third model data.
5. The model generation method according to claim 2, characterized in that: Superimposing the plurality of noise maps on the third model data to obtain the first model data comprises: Performing a weighted sum operation on the multiple noise maps to obtain a weighted result; Performing a superposition operation on the third model data and the weighted result to obtain sixth model data; Based on a preset smoothing area selection rule, a mask smoothing operation is performed on at least a portion of the sixth model data to obtain the first model data.
6. The model generation method according to claim 5, characterized in that: The multiple noise maps include: a first noise map and a second noise map; performing a weighted sum operation on the multiple noise maps to obtain the weighted result includes: Determine a first weight coefficient corresponding to the first noise map, and a second weight coefficient corresponding to the second noise map, wherein the first noise map and the second noise map are used to respectively describe different levels of texture details on the surface of the model, and the first weight coefficient is greater than the second weight coefficient; Based on the first weight coefficient and the second weight coefficient, a weighted sum operation is performed on the first noise map and the second noise map to obtain the weighted result.
7. The model generation method according to claim 1, characterized in that: The second model data includes: low-poly mesh data, texture map, normal map and light occlusion map; performing face reduction topology processing on the first model data to generate the second model data includes: Performing grid conversion on the target voxel model corresponding to the first model data to obtain seventh model data; Performing a surface reduction operation and a topology structure adjustment operation based on the seventh model data to obtain the low-poly mesh data; Performing a texture splitting operation on the low-poly mesh data to generate the texture map; A map baking operation is performed based on the low-poly mesh data to obtain the normal map and the lighting occlusion map.
8. The model generation method according to claim 1, characterized in that: The model generation method further comprises: Performing an export and naming operation on the second model data to generate a target asset file; The target asset file is input into a rendering engine for rendering to obtain the target model.
9. The model generation method according to claim 8, characterized in that: Performing an export and naming operation on the second model data to generate the target asset file includes: Performing a frame-by-frame export operation on the second model data based on a preset programming language to obtain an exported asset; The exported asset is renamed according to a preset naming rule to generate the target asset file.
10. A model generation device, characterized in that: include: A conversion module, used for performing voxel conversion based on the basic three-dimensional model to obtain an initial voxel model; A first processing module is used to perform superposition processing on the target random data and the initial voxel model to obtain first model data, wherein the target random data is used to represent the random shape information and random texture information to be superimposed on the basic three-dimensional model; A second processing module is used to perform surface reduction topology processing on the first model data to generate second model data, wherein the number of mesh surfaces corresponding to the second model data is less than the number of mesh surfaces corresponding to the first model data; A rendering module is used to render and output the target model using the second model data.
11. 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 model generation method described in any one of claims 1 to 9 when executed by a processor.
12. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the model generation method described in any one of claims 1 to 9.
13. A computer program product, characterized in that The invention comprises a computer program, which implements the model generation method described in any one of claims 1 to 9 when being executed by a processor.
