Model generation method and device, electronic equipment and readable storage medium
By distributing particle elements on the basic model in mobile games, generating particle models with the same shape, and calculating the ablation effect in the material of the particle model, and using GPU for calculation, the performance consumption problem of particle composition model on mobile is solved. , achieve accurate and natural effects display.
Patent Information
- Application Number
- CN202311616394.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-01-10
AI Technical Summary
In mobile games, it is difficult for the existing technology to achieve the precise effect of the particle composition model under low performance consumption, and the dependence of the particle system on the CPU leads to excessive performance consumption, which makes it impossible to effectively simulate the precise contact and dissolution effect of particles and the model.
By distributing particle elements on the basic model, a particle model with the same shape as the basic model, and calculating the ablation effect in the material of the particle model, dynamic calculation is used to avoid dependence on the particle system, and accurate display of the particle model is achieved.
The accuracy of the particle composition model is achieved with low performance consumption, reducing the burden on the CPU, and improving the accuracy and naturalness of model display.
Smart Images

Figure CN119280796A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of game production, and in particular to a model generation method, device, electronic device and readable storage medium. Background Art
[0002] In order to enrich the visual performance and character creation in the game, some characters or special objects in the scene require some special appearance effects, such as being composed of a large number of floating particles. The method in the related technology is to use the particle system to read the information on the surface of the model, use a certain algorithm to make the particles gather at the position of the model, and then use the dissolution effect on the material to match the particles to achieve the effect of combining the particles into a model.
[0003] The main platform of the game project is the mobile terminal. However, in order to obtain the surface information of the model in the particle system, the CPU needs to read the various information of the model and pass it to the particle system. This CPU reading process will cause performance consumption. At the same time, such an operation also requires the particle system to be driven by the CPU. The performance consumption of the CPU driving a large number of particles is very large, which is unacceptable on the mobile terminal.
[0004] In addition, the particle composition model needs to display the part of the model that the particle touches little by little. Even if the position of the model surface is obtained, the basic algorithm cannot accurately achieve this effect. It may happen that the model does not appear after the particle falls on the position of the model, or the particle falls on the model that has already appeared. If you need to pursue accuracy, you need to perform the same operation as dissolving in the material in the particle system, which will increase performance consumption. Summary of the invention
[0005] In view of this, the present application provides a model generation method, device, electronic device and readable storage medium, which can achieve a more accurate particle composition model effect at a lower performance consumption.
[0006] In a first aspect, an embodiment of the present application provides a model generation method, comprising:
[0007] Get the basic model needed to create particle composition effects;
[0008] Distributing particle elements on the basic model to generate a particle model, wherein the particle model has the same model information as the basic model;
[0009] An ablation effect of the particle model is calculated, and a visualization effect of the base model matched with the particle model is calculated.
[0010] According to the above method of the embodiment of the present application, the following additional technical features may also be provided:
[0011] In the above technical solution, optionally, distributing particle elements on the basic model to generate a particle model includes:
[0012] Distributing N particle elements on the surface and / or inside of the basic model, and saving model information corresponding to each particle element in the basic model, wherein N is a positive integer;
[0013] Making N face patches, and copying the N face patches to the N particle elements respectively, and copying the model information stored in each particle element to the face patch corresponding to it respectively;
[0014] The center point position of each of the face patches is calculated and stored, and the particle model is composed of a plurality of the face patches.
[0015] In any of the above technical solutions, optionally, storing the center point position of each of the face patches includes:
[0016] The center point position of each of the face patches is stored in the vertex color or UV information of the particle model.
[0017] In any of the above technical solutions, optionally, the model information includes position information and UV information.
[0018] In any of the above technical solutions, optionally, calculating the ablation effect of the particle model includes:
[0019] In the material of the particle model, calculating the motion information and transparency information of each of the face pieces;
[0020] The motion information and the transparency information are used to control the aggregation of the N face patches to obtain an ablation effect of the particle model generated by the N face patches during the aggregation process.
[0021] In any of the above technical solutions, optionally, the motion information includes at least one of the following: initial position, motion sequence, motion trajectory, and motion direction;
[0022] The step of calculating the motion information of each of the facets in the material of the particle model includes:
[0023] Determining the initial position according to the starting point of the particle element required for the particle composition effect;
[0024] Determining the movement sequence according to the model appearance mode required by the particle composition effect;
[0025] Determining the motion trajectory according to the initial position and the model information of the basic model;
[0026] The movement direction is determined according to the center point position and the model information of the basic model.
[0027] In any of the above technical solutions, optionally, the calculating the visualization effect of the basic model matching the particle model includes:
[0028] The display effect of the basic model is calculated according to the model display mode matching the movement sequence.
[0029] In a second aspect, an embodiment of the present application provides a model generation device, including:
[0030] Acquisition module, used to obtain the basic model needed to make particle composition effects;
[0031] A first processing module, configured to distribute particle elements on the basic model to generate a particle model, wherein the particle model has the same model information as the basic model;
[0032] The second processing module is used to calculate the ablation effect of the particle model and calculate the visualization effect of the basic model matching the particle model.
[0033] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method of the first aspect are implemented.
[0034] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method of the first aspect are implemented.
[0035] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method of the first aspect.
[0036] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method of the first aspect.
[0037] In the embodiment of the present application, a basic model for which a particle composition effect needs to be produced is determined, and particle elements are distributed on the basic model, thereby generating a particle model that inherits the model information of the basic model. Further, the ablation effect of the particle model is calculated in the material of the particle model, and the appearance effect of the basic model that matches the ablation effect of the particle model is calculated in the material of the basic model, and the relevant particle model and its material are saved to ensure that when the model is displayed, the basic model is correspondingly displayed while the particle model is ablated.
[0038] The embodiment of the present application does not rely on the particle system, but scatters points on the base model to generate a particle model with a similar shape to the base model. The particle model inherits the model information of the base model, and the dynamics of the particles are calculated in the material of the particle model. As a result, all calculations are placed on the GPU (Graphics Processing Unit), which greatly alleviates the pressure on performance; at the same time, because the particle model inherits the model information of the original base model, it can easily implement the same dissolution algorithm as the original base model, providing accurate and reliable performance at an acceptable performance cost.
[0039] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] 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:
[0041] Figure 1 A schematic diagram showing a flow chart of a model generation method according to an embodiment of the present application is shown;
[0042] Figure 2 One of the schematic diagrams showing the snowflake combination effect of an embodiment of the present application;
[0043] Figure 3 The second schematic diagram shows the snowflake combination effect of the embodiment of the present application;
[0044] Figure 4 The third schematic diagram shows the snowflake combination effect of the embodiment of the present application;
[0045] Figure 5 A fourth schematic diagram showing the snowflake combination effect of an embodiment of the present application;
[0046] Figure 6 A structural block diagram of a model generation device according to an embodiment of the present application is shown;
[0047] Figure 7 A structural block diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0049] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0050] The model generation method, device, electronic device and readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0051] The present application embodiment provides a model generation method, such as Figure 1 As shown, the method includes:
[0052] Step 101, obtaining a basic model for producing a particle composition effect;
[0053] Step 102, distributing particle elements on the basic model to generate a particle model, wherein the particle model has the same model information as the basic model;
[0054] Step 103: calculating the ablation effect of the particle model and calculating the visualization effect of the basic model matching the particle model.
[0055] In this embodiment, a basic model for which a particle composition effect needs to be produced is determined, and particle elements are distributed on the basic model, thereby generating a particle model that inherits the model information of the basic model. Further, the ablation effect of the particle model is calculated in the material of the particle model, and the appearance effect of the basic model that matches the ablation effect of the particle model is calculated in the material of the basic model, and the relevant particle model and its material are saved to ensure that when the model is displayed, the basic model is correspondingly displayed while the particle model is ablated.
[0056] The embodiment of the present application does not rely on the particle system, but scatters points on the basic model to generate a particle model with a similar shape to the basic model. The particle model inherits the model information of the basic model, and the dynamics of the particles are calculated in the material of the particle model. As a result, all calculations are placed on the GPU (Graphics Processing Unit), which greatly alleviates the pressure on performance; at the same time, because the particle model inherits the model information of the original basic model, it can easily implement the same dissolution algorithm as the original basic model, providing accurate and reliable effect performance at an acceptable performance cost.
[0057] In one embodiment of the present application, distributing particle elements on the basic model to generate a particle model includes:
[0058] Distributing N particle elements on the surface and / or inside of the basic model, and saving model information corresponding to each particle element in the basic model, wherein N is a positive integer;
[0059] Making N face patches, and copying the N face patches to the N particle elements respectively, and copying the model information stored in each particle element to the face patch corresponding to it respectively;
[0060] The center point position of each of the face patches is calculated and stored, and the particle model is composed of a plurality of the face patches.
[0061] In this embodiment, points are randomly scattered on the basic model, and the number of scattered points is the number of final particle elements. The particle elements need to inherit the model information corresponding to them on the basic model.
[0062] When particles are combined into a model, some particle elements will move into the interior of the model to appear more natural. Therefore, in addition to scattering dots on the surface of the basic model, this application also scatters dots inside the model to ensure that the combined model has a better effect.
[0063] Furthermore, a patch (e.g., a square patch) is made and copied to the particle elements generated by scattering points. One patch is copied to one particle element, and the model information saved on the particle element is also copied to its corresponding patch. In other words, the model information of the basic model is first inherited to the particle elements obtained by scattering points, and then inherited to the patch corresponding to the particle element.
[0064] The center point position of each patch is calculated and stored, and a particle model can be formed by multiple patches.
[0065] The embodiment of the present application can construct a particle model that inherits the model information based on the basic model, thereby achieving a particle composition effect. It can achieve a more accurate particle composition model effect at a lower performance consumption, so that players can see the effect of particles combining into models that previously only appeared in console games in mobile games.
[0066] In one embodiment of the present application, storing the center point position of each of the face patches includes:
[0067] The center point position of each of the face patches is stored in the vertex color or UV information of the particle model.
[0068] In this embodiment, the calculated center point position of each facet is stored in the vertex color or UV of the particle model. If it is stored in the vertex color, no additional UV channel is required, and the memory consumption of the vertex will be less. In order to ensure better accuracy and ensure that it will not cause the position to be inconsistent with the basic model or display errors when used on a larger model, the center point position of each facet can also be saved in the UV.
[0069] In one embodiment of the present application, the model information includes position information and UV information.
[0070] In this embodiment, the model information includes at least position information and UV information. Each particle element inherits the corresponding position, UV and other model information on the base model. When subsequently calculating the billboard effect (that is, the effect of the patch being fixed toward the virtual camera during movement), the position information is needed as the axis point so that the patch always faces the virtual camera. In addition, inheriting the UV information allows the patch to sample the map in the same way as the base model, making the combined effect more realistic. In addition, the position and UV can be used to determine the movement order of the patch later, such as dissolving from bottom to top according to the position or dissolving according to the UV matching model.
[0071] Position and UV are the most basic information. Depending on the actual application scenario, the required information is also different. For example, a completely flattened UV and a random two-dimensional vector are baked for each particle element. The former is used to sample the texture, and the latter is used as the component of the particle's initial position in the xy plane.
[0072] In one embodiment of the present application, the calculating the ablation effect of the particle model includes:
[0073] In the material of the particle model, calculating the motion information and transparency information of each of the face pieces;
[0074] The motion information and the transparency information are used to control the aggregation of the N face patches to obtain an ablation effect of the particle model generated by the N face patches during the aggregation process.
[0075] In this embodiment, in the material of the particle model, the motion information and transparency information of each facet are calculated, and when the N facets are aggregated, they move according to the corresponding motion information, wherein the motion information includes but is not limited to the initial position, motion sequence, motion trajectory, motion direction, etc. And, in the process of moving to the position of the base model, they are gradually hidden according to the transparency information.
[0076] Since the particle model inherits the model information of the base model, the dynamics of the particles can be calculated in the material of the particle model, which greatly alleviates the pressure on performance. In addition, by calculating the motion information and transparency information, the effect is more natural when the patches are aggregated according to the motion information and transparency information to form a model.
[0077] In one embodiment of the present application, the motion information includes at least one of the following: initial position, motion sequence, motion trajectory, and motion direction;
[0078] The step of calculating the motion information of each of the facets in the material of the particle model includes:
[0079] Determining the initial position according to the starting point of the particle element required for the particle composition effect;
[0080] Determining the movement sequence according to the model appearance mode required by the particle composition effect;
[0081] Determining the motion trajectory according to the initial position and the model information of the basic model;
[0082] The movement direction is determined according to the center point position and the model information of the basic model.
[0083] In this embodiment, the motion information includes but is not limited to the initial position, motion sequence, motion trajectory, motion direction, etc. The initial position, motion sequence and motion trajectory of each facet of the particle model are calculated in the engine's material. At the same time, the rotation is calculated based on the position of the center point of the facet, that is, the movement direction of the facet, so that the facet is always facing the virtual camera.
[0084] The initial position of the patch points to the starting point of the model gathering. The calculation of the initial position is determined according to the desired effect. For example, if the model is composed of snowflakes, the initial position of the patch is a random position in the sky. When baking the patch, first calculate a random two-dimensional vector for each patch as the component of the initial position in the xy plane, and then specify a height, such as 15 meters, as the z-axis component of the initial position, so that the initial position is a random position on the plane at a height of 15 meters.
[0085] The movement order is the order in which the patches are combined. For example, the effect of a model composed of snowflakes is that the snowflakes are combined into a model from bottom to top. The movement order is to move from bottom to top according to the position of the basic model.
[0086] The motion trajectory is the trajectory of the patch moving from its initial position to its original position on the model. Some detailed movements will be added according to the properties of the particles. For example, in order to simulate the falling effect of snowflakes, some random movements in the left and right directions are added on the basis of the snowflakes floating from the initial position to the model position.
[0087] The movement direction is calculated based on the center point position of the patch and matched with the direction of the virtual camera, so that the player can see the front of the patch no matter from which angle, resulting in a better display effect.
[0088] like Figures 2 to 5 As shown, the above information allows the facets to be gathered from the initial position to the position of the basic model, thereby achieving the effect of particle composition model while reducing performance consumption.
[0089] Assume that the position of the patch on the motion trajectory is controlled by the parameter p. When p is 0, the patch is at the initial position; when p is 1, the patch reaches the position of the base model. The calculation method of p is as follows:
[0090] p=clamp(k×2–i,0,1)
[0091] Among them, k is the overall motion control parameter of the patch, which is controlled by the program and ranges from 0 to 1; i is the motion order parameter of each patch, ranging from 0 to 1. For example, in the order from bottom to top, the i parameter of the patch at the bottom of the model is 0, and the i parameter of the patch at the top is 1.
[0092] Transparency information includes opacity, and the calculation method of opacity a is:
[0093] a=clamp((1-p)×32,0,1)
[0094] That is, when the value of p changes from 0.96875 to 1, the opacity of the patch changes from 1 to 0 and gradually disappears. When the patch moves from the initial position to the position close to the corresponding basic model, the opacity of the patch is reduced to achieve the ablation effect.
[0095] In one embodiment of the present application, the calculating the visualization effect of the basic model matching the particle model includes:
[0096] The display effect of the basic model is calculated according to the model display mode matching the movement sequence.
[0097] In this embodiment, in coordination with the ablation effect of the particle model, the engine calculates the dissolution effect for the base model. For example, if the particle model gradually falls and ablates from bottom to top, the base model should also gradually appear from bottom to top to ensure a natural effect. Figures 2 to 5 As shown, the effect displayed is that snowflakes falling from the sky gradually form a basic model. Snowflakes are patches. Based on this rule, the basic model appears most naturally in a bottom-up order.
[0098] As a specific implementation of the above-mentioned model generation method, the present application embodiment provides a model generation device. Figure 6 As shown, the model generation device 600 includes: an acquisition module 601 , a first processing module 602 and a second processing module 603 .
[0099] The acquisition module 601 is used to acquire the basic model needed to produce the particle composition effect;
[0100] A first processing module 602 is used to distribute particle elements on the basic model to generate a particle model, wherein the particle model has the same model information as the basic model;
[0101] The second processing module 603 is used to calculate the ablation effect of the particle model and calculate the visualization effect of the basic model matching the particle model.
[0102] In this embodiment, a basic model for which a particle composition effect needs to be produced is determined, and particle elements are distributed on the basic model, thereby generating a particle model that inherits the model information of the basic model. Further, the ablation effect of the particle model is calculated in the material of the particle model, and the appearance effect of the basic model that matches the ablation effect of the particle model is calculated in the material of the basic model, and the relevant particle model and its material are saved to ensure that when the model is displayed, the basic model is correspondingly displayed while the particle model is ablated.
[0103] The embodiment of the present application does not rely on the particle system, but scatters points on the base model to generate a particle model with a similar shape to the base model. The particle model inherits the model information of the base model, and the dynamics of the particles are calculated in the material of the particle model. As a result, all calculations are placed on the GPU (Graphics Processing Unit), which greatly alleviates the pressure on performance; at the same time, because the particle model inherits the model information of the original base model, it can easily implement the same dissolution algorithm as the original base model, providing accurate and reliable performance at an acceptable performance cost.
[0104] Furthermore, the first processing module 602 is specifically configured to:
[0105] Distributing N particle elements on the surface and / or inside of the basic model, and saving model information corresponding to each particle element in the basic model, wherein N is a positive integer;
[0106] Making N face patches, and copying the N face patches to the N particle elements respectively, and copying the model information stored in each particle element to the face patch corresponding to it respectively;
[0107] The center point position of each of the face patches is calculated and stored, and the particle model is composed of a plurality of the face patches.
[0108] Furthermore, the first processing module 602 is specifically configured to store the center point position of each of the face patches into the vertex color or UV information of the particle model.
[0109] Furthermore, the model information includes position information and UV information.
[0110] Further, the second processing module 603 is specifically configured to:
[0111] In the material of the particle model, calculating the motion information and transparency information of each of the face pieces;
[0112] The motion information and the transparency information are used to control the aggregation of the N face patches to obtain an ablation effect of the particle model generated by the N face patches during the aggregation process.
[0113] Further, the motion information includes at least one of the following: initial position, motion sequence, motion trajectory, and motion direction;
[0114] The second processing module 603 is specifically used for:
[0115] Determining the initial position according to the starting point of the particle element required for the particle composition effect;
[0116] Determining the movement sequence according to the model appearance mode required by the particle composition effect;
[0117] Determining the motion trajectory according to the initial position and the model information of the basic model;
[0118] The movement direction is determined according to the center point position and the model information of the basic model.
[0119] Furthermore, the second processing module 603 is specifically configured to calculate the visualization effect of the basic model according to the model visualization method that matches the motion sequence.
[0120] The model generation device 600 in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (Augmented Reality, AR) / virtual reality (Virtual Reality, VR) device, a robot, a wearable device, a super mobile personal computer (Ultra-Mobile Personal Computer, UMPC), a netbook or a personal digital assistant (Personal Digital Assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (Personal Computer, PC), a television (Television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0121] The model generation device 600 provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented in the model generation method embodiment are not described here.
[0122] The present application also provides an electronic device, such as Figure 7 As shown, the electronic device 700 includes a processor 701 and a memory 702. The memory 702 stores programs or instructions that can be executed on the processor 701. When the program or instructions are executed by the processor 701, the various steps of the above-mentioned model generation method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, they are not repeated here.
[0123] It should be noted that the electronic devices in the embodiments of the present application include mobile electronic devices and non-mobile electronic devices.
[0124] The memory 702 can be used to store software programs and various data. The memory 702 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 702 may include a volatile memory or a non-volatile memory, or the memory 702 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 702 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0125] The processor 701 may include one or more processing units; optionally, the processor 701 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 701.
[0126] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned model generation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0127] An embodiment of the present application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned model generation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0128] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0129] An embodiment of the present application also provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned model generation method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0130] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0131] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A model generation method, characterized in that: include: Get the basic model needed to create particle composition effects; Distributing particle elements on the basic model to generate a particle model, wherein the particle model has the same model information as the basic model; An ablation effect of the particle model is calculated, and a visualization effect of the base model matched with the particle model is calculated.
2. The method according to claim 1, characterized in that The step of distributing particle elements on the basic model to generate a particle model comprises: Distributing N particle elements on the surface and / or inside of the basic model, and saving model information corresponding to each particle element in the basic model, wherein N is a positive integer; Making N face patches, and copying the N face patches to the N particle elements respectively, and copying the model information stored in each particle element to the face patch corresponding to it respectively; The center point position of each of the face patches is calculated and stored, and the particle model is composed of a plurality of the face patches.
3. The method according to claim 2, characterized in that The center point position of each of the patches is stored, including: The center point position of each of the face patches is stored in the vertex color or UV information of the particle model.
4. The method according to claim 2, characterized in that: The model information includes position information and UV information.
5. The method according to claim 2, characterized in that: The calculating the ablation effect of the particle model includes: In the material of the particle model, calculating the motion information and transparency information of each of the face pieces; The motion information and the transparency information are used to control the aggregation of the N face patches to obtain an ablation effect of the particle model generated by the N face patches during the aggregation process.
6. The method according to claim 5, characterized in that The motion information includes at least one of the following: initial position, motion sequence, motion trajectory, and motion direction; The step of calculating the motion information of each of the facets in the material of the particle model includes: Determining the initial position according to the starting point of the particle element required for the particle composition effect; Determining the movement sequence according to the model appearance mode required by the particle composition effect; Determining the motion trajectory according to the initial position and the model information of the basic model; The movement direction is determined according to the center point position and the model information of the basic model.
7. The method according to claim 6, characterized in that The calculating the visualization effect of the basic model matching the particle model includes: The display effect of the basic model is calculated according to the model display mode matching the movement sequence.
8. A model generation device, characterized in that: include: Acquisition module, used to obtain the basic model needed to make particle composition effects; A first processing module, configured to distribute particle elements on the basic model to generate a particle model, wherein the particle model has the same model information as the basic model; The second processing module is used to calculate the ablation effect of the particle model and calculate the visualization effect of the basic model matching the particle model.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction running on the processor, and when the program or instruction is executed by the processor, the steps of the model generation method according to any one of claims 1 to 7 are implemented.
10. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by a processor, the steps of the model generation method according to any one of claims 1 to 7 are implemented.