A particle effect rendering method, device, equipment and medium
By obtaining the vertex sub-model in the particle morphology model and determining the running trajectory based on the particle reorganization rules, the dynamic reorganization effect of the particles is rendered in real time, which solves the problem of insufficient types of special effects processing in the existing technology and achieves diversified special effects display.
Patent Information
- Application Number
- CN202111602150.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-12-24
AI Technical Summary
Existing special effects processing methods have fewer types of objects displayed in videos and short videos, and cannot meet the diverse needs of users.
By obtaining the vertex sub-model in the particle shape model, the running trajectory is determined based on the particle reorganization rules, and the running process of the vertex sub-model is rendered in real time to simulate the dynamic reorganization effect of particles.
It realizes diversified particle effect rendering, enhances the diversity and interactivity of object display, and meets users' diverse needs for special effects display.
Smart Images

Figure CN114332323B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the technical field of special effect rendering processing, and in particular to a particle effect rendering method, device, equipment and medium. Background Art
[0002] With the continuous development of video and short video technology, the demand for display of objects is increasing. Currently, the diversity of object display can be improved by adding special effects during the display process.
[0003] However, there are still few types of special effects processing methods currently, which are insufficient to meet user needs. Summary of the invention
[0004] The embodiments of the present disclosure provide a particle effect rendering method, device, equipment and medium, which have achieved the running effect of simulating particle effects.
[0005] In a first aspect, an embodiment of the present disclosure provides a particle effect rendering method, including:
[0006] Acquire a particle morphology model, wherein the particle morphology model includes vertex sub-models constituting the overall model;
[0007] Determining the running trajectory of the vertex sub-model based on the particle reorganization rule;
[0008] The vertex sub-model is controlled to run based on the corresponding running track, and the vertex sub-model in the running process is rendered in real time.
[0009] In a second aspect, the present disclosure also provides a particle effect rendering device, including:
[0010] A model acquisition module, used for acquiring a particle morphology model, wherein the particle morphology model includes vertex sub-models constituting the overall model;
[0011] A running track determination module, used for determining the running track of the vertex sub-model based on a particle reorganization rule;
[0012] The rendering module is used to control the vertex sub-model to run based on the corresponding running track and render the vertex sub-model in real time during the running process.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the particle effect rendering method as described in any one of the embodiments of the present disclosure.
[0017] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the particle effect rendering method as described in any one of the embodiments of the present disclosure.
[0018] The technical solution of the disclosed embodiment is to obtain each vertex sub-model in the particle morphology model, simulate the particles constituting the model through the vertex sub-model, determine the running trajectory of the vertex sub-model based on the particle recombination rule, control the vertex sub-model to run based on the corresponding running trajectory, and render the vertex sub-model in real time during the running process, so as to realize the running process of the recombinant model of the simulated particles, render the running process, and realize the rendering effect of simulating the dynamic recombination of the particles. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 A schematic diagram of a particle effect rendering method provided by an embodiment of the present disclosure;
[0021] Figure 2 A schematic diagram of the structure of a particle effect rendering device provided by an embodiment of the present disclosure;
[0022] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0024] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0025] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0026] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0027] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0028] Figure 1 The present invention provides a flow chart of a particle effect rendering method provided by an embodiment of the present invention. The present invention is applicable to realizing a simulated particle effect reorganization process in a model reorganization process. The method can be executed by a particle effect rendering device, which can be implemented in the form of software and / or hardware. Optionally, the particle effect rendering device is implemented by an electronic device, which can be a mobile terminal or a PC. Figure 1 , the method of this embodiment includes:
[0029] S110, obtaining a particle morphology model, wherein the particle morphology model includes vertex sub-models constituting the overall model.
[0030] S120: Determine the running trajectory of the vertex sub-model based on the particle reorganization rule.
[0031] S130, controlling the vertex sub-model to run based on the corresponding running track, and rendering the vertex sub-model in the running process in real time.
[0032] In this embodiment, the model can be a model used to display and simulate the reconstruction process. The model can include but is not limited to any type of model such as a mask model, an accessory model, a clothing model, a building model, a vehicle model, etc. The type and structure of the model are not limited here. The model can be a three-dimensional structural model.
[0033] A particle refers to the smallest material component that can exist in a free state. Any model includes a large number of particles. In order to simulate the particle effect, the overall model is converted into a particle morphology model, where the particle morphology model includes all vertex sub-models that make up the overall model, and each vertex sub-model is used to simulate a particle.
[0034] In some embodiments, particle morphology models corresponding to each overall model are pre-stored, and the corresponding particle morphology model is called according to the selection of the model. Exemplarily, the overall model and the particle morphology model are stored based on the model library, and the overall model and the particle morphology model can be stored in association with the model identifier. Among them, the particle morphology model can be obtained by pre-simulating particle division of the overall model. Specifically, the overall model can be gridded, and the size of the unit grid can be pre-set, or it can be determined according to the size of the overall model and the target vertex data. Based on the pre-set grid, simulate particle division is performed on the overall model, and the overall model is divided into sub-models corresponding to each vertex based on the grid, that is, vertex sub-models. An identifier is set for each vertex sub-model in the particle morphology model, for example, it can be a serial number identifier, and according to the position of each vertex sub-model in the overall model, for example, it can be the center coordinates of the vertex sub-model in the overall model. The identifier of each vertex sub-model is associated with the corresponding position information and stored.
[0035] In some embodiments, obtaining a particle morphology model includes: in response to a selection operation on a model, calling a particle morphology model of the model. Optionally, a selection area for a model identifier is included in the interactive interface of the electronic device, and the model identifier of each model is displayed in the selection area for the model identifier, wherein the model identifier may be a two-dimensional icon of the model, or a descriptive text, etc. For example, the model to be rendered is a head model, and accordingly, the model identifier may include but is not limited to identifiers in the form of descriptive text such as "fox head" and "hammer head". When a selection operation of any model identifier is detected, a rendering instruction including the model identifier is triggered to be generated, and the rendering instruction is responded to, that is, in response to the selection operation on the model. Optionally, the user's selection operation on the model is identified by detecting a specific behavior of the user. For example, the user's image is collected in real time by a camera and displayed in real time on the interactive page, and it is identified whether the user image includes a specific behavior. If so, it is determined that the selection operation on the model is detected. Optionally, the correspondence between different models and different behaviors is pre-stored. For example, the behavior corresponding to the first model may be nodding, and the behavior corresponding to the second model may be shaking the head. Optionally, the selection order of each model is stored in advance, and a specific behavior can be used to switch models, for example, the first behavior is used to switch to the previous model, and the second behavior is used to switch to the next model. After determining the user's selection operation on the model by detecting the user behavior, triggering the generation of a rendering instruction including the model identifier.
[0036] In some embodiments, the rendering mode of the model may include multiple modes, among which the rendering mode of the simulated particles provided in this embodiment is one of them. Exemplarily, the rendering modes include but are not limited to point rendering, module rendering, overall rendering, etc., among which the point rendering mode is used to render the particle morphology model in units of vertex sub-models, the module rendering mode may be used to render the model in units of modules, and the overall rendering mode is used to render the model as a whole. Before calling the particle morphology model, it also includes determining whether the current rendering model is point rendering. If so, continue to call the particle morphology model. The interactive page includes a selection control for the rendering mode, which is used to input rendering mode information or switch the rendering model, and there is no limitation on this.
[0037] For each vertex sub-model in the particle morphology model, its running trajectory is determined based on the particle reorganization rule. The running trajectory is used to control the vertex sub-model to run to its original position in the particle morphology model. Correspondingly, each vertex sub-model runs to its original position in the particle morphology model, thereby realizing the reorganization of the model.
[0038] Optionally, determining the running trajectory of the vertex sub-model based on the particle reorganization rule includes: determining the running position of the vertex sub-model at each moment based on the particle reorganization rule, and forming a running trajectory based on the running position at each moment. In this embodiment, for each vertex sub-model in the particle morphology model, the running position of the vertex sub-model at each moment during the running process is determined, and each running position is connected to form a running trajectory. In some embodiments, the above-mentioned running trajectory is smoothed to improve the smoothness and connectivity of the running of each vertex sub-model.
[0039] In some embodiments, the particle reorganization rule includes the target position, running direction and running time of the vertex sub-model, where the vertex sub-model is all vertex sub-models rendered in the particle morphology model. The vertex sub-model runs in the running direction, and the unit running distance of the vertex sub-model can be fixed, that is, the vertex sub-model is located in the running direction at the farthest distance from the target position at the initial moment, and is located at the target position at the end moment. Accordingly, the running position of the vertex sub-model at each moment can be determined in reverse.
[0040] In this embodiment, the running time of the vertex sub-model can be preset or set by the user. The running time of different vertex sub-models can be the same or different. An input control or selection control for the running time can be set on the interactive interface to facilitate the collection of the running time input by the user. Different running times can control the running range of each vertex sub-model. By setting the interactive control, interaction with the user is achieved, and the interactivity of the model simulation process is improved.
[0041] In some embodiments, the unit running distance of the vertex sub-model can be set according to user needs. Accordingly, an input control or selection control for the unit running distance can be set on the interactive interface to facilitate the collection of the unit running distance input by the user, thereby generating corresponding simulation effects according to user needs, and improving the diversity and flexibility of the simulation effects.
[0042] Exemplarily, the particle reorganization rule may include the following formula: V1=V0+(NT)*Normal, wherein V1 may be the running position corresponding to each moment T, V0 may be the target position of the vertex sub-model, N is the running time of the vertex sub-model, and Normal is the running direction of the vertex sub-model. The target position of the vertex sub-model in the above formula is the position information of the vertex sub-model in the particle morphology model. In this embodiment, the particle morphology model is reorganized in the form of particle simulation to determine the rendering range of the particle morphology model, which may be, for example, the rendering range in the interactive interface. Taking the model as a head model as an example, the rendering range of the particle morphology model is the range where the head of the target object in the interactive interface is located. The coordinate information of the particle morphology model is converted to the coordinate system where the interactive interface is located, and the coordinate information of each vertex sub-model, that is, the target position of the vertex sub-model, is determined in the coordinate system where the interactive interface is located.
[0043] In the above formula, Normal can also be a unit vector in the running direction, representing the unit running distance in the running direction. In some embodiments, the particle recombination rule can also include a unit matrix representing the unit running distance, which is not limited.
[0044] Optionally, the running direction of the vertex sub-model is the normal direction of the vertex sub-model, that is, Normal in the above formula can be the normal direction of the vertex sub-model. Based on the running position of the vertex sub-model in its normal direction, its running trajectory from far to near in the normal direction is determined, and accordingly, each vertex sub-model is controlled to run from far to near along the determined running trajectory until each vertex sub-model runs to the target position in the particle morphology model. At the initial moment of the operation of each vertex sub-model, each vertex sub-model is rendered in real time according to the running position of each vertex sub-model, realizing the reorganization process of rendering the model in the form of points, and achieving the rendering effect of simulating particle reorganization of the model.
[0045] Optionally, the running direction of the vertex sub-model is determined based on the normal direction of the vertex sub-model and the rotation matrix, that is, the normal direction of each vertex sub-model is rotated to control the reorganization of the running trajectory of each vertex sub-model based on the rotation, thereby improving the variability and diversity of the running of the vertex sub-model. Accordingly, based on the running position of the vertex sub-model in its rotation direction, its running trajectory in the rotation direction is determined, and each vertex sub-model is controlled to run along the determined running trajectory until each vertex sub-model runs to the target position in the particle morphology model.
[0046] Optionally, the operation rotation mode of different vertex sub-models may be the same, that is, different vertex sub-models correspond to the same rotation matrix. Optionally, the operation rotation mode of different vertex sub-models may be different, and multiple rotation matrices may be set. For example, the vertex sub-models in the particle morphology model may be divided into multiple regions, and different regions call different rotation matrices. Alternatively, the rotation matrix called by each vertex sub-model may be randomly determined to disrupt the operation uniformity of each vertex sub-model and improve the operation variability. Among them, the rotation matrix may include but is not limited to a first rotation matrix rotating around any axis in XYZ, a second rotation matrix rotating around any two axes in XYZ, and a third rotation matrix rotating around three axes of XYZ.
[0047] In the above embodiment, the rotation angle of the above rotation matrix can be determined based on the time parameters of the operation to ensure that it can run to the target position at the end of the operation while rotating. Optionally, the rotation angle can decrease as the running time increases. Exemplarily, the rotation direction can be Normal1=(10-T)*Rot*Normal, where Normal1 is the rotation running direction, Normal is the normal direction of the vertex sub-model, and Rot is the rotation matrix. Correspondingly, the running position of the vertex sub-model at each moment can be V1=V0+(10-T)*Normal0=V0+(10-T)*(10-T)*Rot*Normal.
[0048] On the basis of the above-mentioned embodiment, the particle reorganization rule also includes the operation random parameters of each of the vertex sub-models, wherein the operation random parameters can be determined according to the target position of the vertex sub-model. Specifically, a preset random number generation function is called, and the target position is input into the random number generation function to obtain the operation random parameters of the vertex sub-model, and the operation random parameters can be within the preset parameter range. By setting the operation random parameters, the operation uniformity of the vertex sub-model can be further reduced and the variability of the operation trajectory can be improved. Exemplarily, the operation position of the vertex sub-model at each moment can be V1=V0+(10-T)*Normal0=V0+(10-T)*(10-T)*Rot*Normal*P(V0), wherein P(V0) is the operation random parameter generated based on the target position.
[0049] On the basis of the above embodiment, the reorganization process of the model may include a particle contraction and reorganization process, or may include a particle diffusion process and a particle contraction and reorganization process. Accordingly, the particle reorganization rule includes a contraction sub-rule such as provided in the above embodiment, or may include a diffusion sub-rule and a contraction sub-rule. Wherein, the diffusion sub-rule is used to determine the running trajectory of each vertex sub-model in the particle morphology model during the diffusion process from the initial position to the outside. The diffusion sub-rule includes the initial position, running direction and running time of each vertex sub-model, wherein the initial position of each vertex sub-model is the position information of the vertex sub-model in the particle morphology model, and accordingly, the diffusion sub-rule may include the following formula: V1=V2+D*Normal0, wherein V2 is the initial position of the vertex sub-model during the diffusion process, D is an offset parameter, such as the running time T, and Normal0 is the running direction. In some embodiments, the running direction in the diffusion sub-rule may be the normal direction of the vertex sub-model, or the rotation direction may be determined based on the normal direction of the vertex sub-model and the rotation matrix. In some embodiments, the diffusion sub-rule also includes the running random parameters of each vertex sub-model to improve the trajectory diversity of each vertex sub-model during the diffusion process.
[0050] In some embodiments, the running time of the diffusion process and the contraction process of the model can be the same. A diffusion running trajectory of the vertex sub-model is generated based on the diffusion sub-rule, and a contraction running trajectory of the vertex sub-model is generated based on the contraction sub-rule. The tail of the diffusion running trajectory is connected with the head of the contraction running trajectory to obtain the contraction running trajectory. The vertex sub-model to be rendered is controlled to run based on the contraction running trajectory, thereby realizing the diffusion and reorganization process of simulating the model with particle effects.
[0051] On the basis of the above embodiment, in order to simulate the effect of particles gradually increasing to reorganize the model, the starting rendering time of the vertex sub-model at different positions can be set to achieve the process effect of simulating particles from few to many. Optionally, along the preset rendering direction, the starting rendering time of the vertex sub-model increases in sequence. The rendering direction can be from bottom to top, from top to bottom, etc., which is not limited.
[0052] In some embodiments, each vertex sub-model in the real-time rendering running process includes: determining the transparency at each moment in the rendering process according to the position information of the vertex sub-model; rendering based on the transparency of the point sub-model being rendered at each moment and the running position at each moment.
[0053] The position information of the vertex sub-model is the position information of the vertex sub-model in the particle morphology model. The transparency of each vertex sub-model can vary between 0-100%. The vertex sub-model with a transparency of 100% cannot be displayed in the interactive interface, which is equivalent to not being rendered. During the rendering process, different vertex sub-models sample different transparencies to simulate the appearance and increase of individual vertex sub-models.
[0054] Optionally, the initial transparency of different vertex sub-models may be different, for example, the initial transparency of the vertex sub-model may be different values between 0-100%. Exemplarily, the initial transparency of a local vertex sub-model may be 1, the initial transparency of a local vertex sub-model may be 0, the initial transparency of a local vertex sub-model may be 0.5, etc. Optionally, the vertex sub-models with an initial transparency of 1 may be distributed at initial positions along the rendering direction.
[0055] In some embodiments, the initial transparency of each vertex sub-model along the rendering direction increases successively to simulate the situation where particles first appear at the initial position along the rendering direction. During the rendering process, the transparency of each vertex sub-model gradually decreases until the transparency is the first transparency to simulate the situation where newly added particles appear successively along the rendering direction, wherein the first transparency may be a value less than 1 and greater than or equal to 0, for example, the third transparency may be zero. In this embodiment, the rendering direction may include but is not limited to from bottom to top, from top to bottom, from left to right, from right to left, from the center to the surroundings, and from the surroundings to the center, etc.
[0056] The technical solution in this embodiment obtains each vertex sub-model in the particle morphology model, simulates the particles that constitute the model through the vertex sub-models, determines the running trajectory of each vertex sub-model based on the particle recombination rule, controls each vertex sub-model to run based on the corresponding running trajectory, and renders each vertex sub-model in the running process in real time, realizes the running process of the reorganization model of the simulated particles, renders the running process, and realizes the dynamic reorganization process of the particles of the simulation model.
[0057] On the basis of the above-mentioned embodiment, by controlling the operation of each vertex sub-model, the vertex sub-model to be rendered is controlled to run to the target position in the particle morphology model based on the running trajectory, thereby forming a particle morphology model. However, there is a difference between the particle morphology model and the overall model, that is, the particle morphology model is drawn based on the vertex sub-model, rather than the complete model. In view of the above-mentioned problem, the method provided in this embodiment also includes: in the process of real-time rendering of the vertex sub-model, synchronously rendering the overall model, and at the end of the rendering, setting the vertex sub-model to a fully transparent state, and the rendering process duration of the particle morphology model and the overall model is the same. By rendering the running vertex sub-model, the simulation of the particle recombination process is realized, and by rendering the overall model, it is used to display the overall model at the end of the rendering, and by setting each vertex sub-model to a fully transparent state at the end of the rendering, it is avoided that the particle morphology model interferes with the display of the overall model at the end.
[0058] In some embodiments, rendering the whole model can be achieved by controlling the transparency of the whole model, and according to the rendering time of the whole model, the transparency of the whole model is uniformly adjusted from 100% to 0 to achieve the rendering of the whole model. That is, the transparency of each pixel in the whole model is 100% at the initial moment and 0 at the end moment.
[0059] In some embodiments, rendering the overall model includes: adjusting the transparency of the data points on each position line of the overall model in the rendering direction in sequence according to the rendering direction, wherein the initial transparency of the overall model is the second transparency, and each position line is perpendicular to the rendering direction, wherein the second transparency can be a value greater than 0 and less than or equal to 1, and exemplary, the second transparency can be 1. In this embodiment, the particle morphology model and the overall model have the same rendering direction to achieve synchronous rendering of the particle morphology model and the overall model. For the overall model, along the rendering direction, the model data in the rendering direction are sequentially rendered to simulate the appearance process of the overall model along the rendering direction. Taking the rendering direction from bottom to top as an example, the position line is a vertical line in the rendering direction, for example, the rendering direction is a vertical rendering direction from bottom to top, then the position line can be each pixel row on the overall model, for example, the rendering direction is a horizontal rendering direction, then the position line can be each pixel column on the overall model, for example, the rendering direction is a circular rendering direction from the center to the surroundings, then the position line can be a circular line perpendicular to the rendering direction.
[0060] Correspondingly, according to the rendering direction, the transparency of the data points on each position line of the overall model in the rendering direction is adjusted in sequence, and the transparency of the data points on each position line can be reduced in sequence to simulate the process of the data points on each position line appearing from nothing.
[0061] Optionally, adjusting the transparency of the data points on each position line of the overall model in the rendering direction includes: adjusting the transparency of the data points on the triggered position line to a third transparency, wherein the third transparency may be a value less than 1 and greater than or equal to 0, and the third transparency may be 0. Exemplarily, the transparency of the data points on the triggered position line is adjusted from 1 to 0, wherein the triggered position lines appear in sequence along the rendering direction, realizing the appearance process of the data points on the simulated position line.
[0062] Optionally, adjusting the transparency of the data points on each position line of the overall model in the rendering direction includes: gradually reducing the transparency of the data points on the triggered position line until the transparency is a third transparency, so as to simulate the gradual appearance of the data points on the position line. In this embodiment, the change efficiency of the transparency of each data point can also be limited to control the transparency change of each data point.
[0063] The technical solution provided in this embodiment controls the synchronous rendering of the particle morphology model and the overall model, thereby compensating for the defects of the vertex sub-model rendering process in the particle morphology model and realizing the particle effect rendering in the model reconstruction process.
[0064] Based on the above embodiment, the embodiment of the present disclosure also provides an optional example. The method includes: in response to the selection operation of the model identifier, calling the particle morphology model and the overall model corresponding to the model identifier, specifically, matching through the model identifier in the model library, determining the associated stored particle morphology model and the overall model, wherein the particle morphology model includes the vertex sub-models constituting the overall model, and the position information of each vertex sub-model.
[0065] In response to the setting operation of the rendering parameters, the rendering parameters of the model are obtained, and the rendering parameters include at least one of the rendering duration and the rotation type. The rotation type is used to adjust the rotation matrix in the particle reorganization rule, and the rotation type may include rotation around a single axis, rotation around two axes, and rotation around three axes, and the rotation axis may be any one of the XYZ coordinate axes in the coordinate system. The rendering parameters are used to adjust the particle reorganization rules that are subsequently called.
[0066] In response to the effect type selection operation, the particle reorganization rule corresponding to the effect type is called, wherein the particle reorganization rule includes at least one of a diffusion sub-rule and a contraction sub-rule. The effect types include contraction reorganization and a reorganization of diffusion followed by contraction, wherein the contraction sub-rule is called based on the effect type of contraction reorganization, and the diffusion sub-rule and the contraction sub-rule are called based on the effect type of the reorganization of diffusion followed by contraction. The called particle reorganization rule is updated according to the acquired rendering parameters to obtain the particle reorganization rule applicable to the current reorganization process. Exemplarily, the model to be rendered is a head model, an image of an interactive object is acquired, the image includes a portrait, the image is displayed in an interactive interface, the position of the portrait in the interactive interface is identified, and the rendering range of the model is determined, and the rendering range can be the range of the head of the portrait in the image. Based on the coordinate transformation relationship between the rendering range and each vertex sub-model in the particle morphology model, the target position of each vertex sub-model within the rendering range is determined, and the target position is used as a parameter to update the particle reorganization rule to determine the running trajectory of each vertex sub-model based on the particle reorganization rule of the current reorganization process.
[0067] Synchronously render the particle morphology model and the overall model, wherein the particle morphology model and the overall model are rendered based on the same rendering direction. Specifically, control each of the vertex sub-models to run based on the corresponding running trajectory, and render each vertex sub-model in the running process in real time, and render the overall model at the same time. Wherein, by controlling the transparency of each data point in the overall model and the transparency of each vertex sub-model in the particle morphology model, the synchronous rendering of the particle morphology model and the overall model in the rendering direction is achieved. At the end of the rendering, the transparency of each vertex sub-model in the particle morphology model is controlled to switch to 100%, completing the particle reorganization simulation process of the model.
[0068] Figure 2 Schematic diagram of a particle effect rendering device provided by an embodiment of the present disclosure. Figure 2 As shown, the device comprises:
[0069] A model acquisition module 210 is used to acquire a particle morphology model, wherein the particle morphology model includes vertex sub-models constituting the overall model;
[0070] A running track determination module 220, used to determine the running track of the vertex sub-model based on the particle reorganization rule;
[0071] The rendering module 230 is used to control the vertex sub-model to run based on the corresponding running track, and to render the vertex sub-model in the running process in real time.
[0072] Based on the above embodiment, the running trajectory determination module 220 is used to:
[0073] The running position of the vertex sub-model at each moment is determined based on the particle reorganization rule, and the running track is formed based on the running position at each moment.
[0074] Optionally, the particle reorganization rule includes a target position, a running direction, and a running time of the vertex sub-model.
[0075] Optionally, the running direction of the vertex sub-model is the normal direction of the vertex sub-model, or the running direction of the vertex sub-model is determined based on the normal direction of the vertex sub-model and a rotation matrix.
[0076] Optionally, the particle reorganization rule also includes a running random parameter of each vertex sub-model.
[0077] Based on the above embodiment, the rendering module 230 includes:
[0078] A transparency setting unit, used to determine the transparency at each moment in the rendering process according to the position information of the vertex sub-model;
[0079] The first rendering unit is used for rendering based on the transparency of the vertex sub-model at each moment and the running position at each moment.
[0080] Optionally, the initial transparency of the vertex sub-model increases successively along the rendering direction; during the rendering process, the transparency of the vertex sub-model gradually decreases until the transparency reaches the first transparency.
[0081] The rendering module 230 also includes:
[0082] The second rendering unit is used to synchronously render the overall model during the real-time rendering of each vertex sub-model, and to set each vertex sub-model to a fully transparent state at the end of rendering. The rendering process of the particle morphology model and the overall model takes the same time.
[0083] Optionally, the second rendering unit is used to:
[0084] According to the rendering direction, the transparency of the data points on each position line of the overall model in the rendering direction is adjusted in sequence, wherein the initial transparency of the overall model is the second transparency, and each position line is perpendicular to the rendering direction.
[0085] Optionally, the second rendering unit is used to: adjust the transparency of the data points on the triggered position line to a third transparency; or gradually reduce the transparency of the data points on the triggered position line until the transparency reaches the third transparency.
[0086] Based on the above embodiment, the model acquisition module 210 is used to:
[0087] The model is called, and the model is segmented based on the mesh of the model to obtain a plurality of vertex sub-models, and the vertex sub-models constitute the particle morphology model.
[0088] Based on the above embodiment, the model acquisition module 210 is used to:
[0089] In response to a selection operation on a model, a particle morphology model of the model is called.
[0090] Based on the above embodiment, the device further includes:
[0091] The parameter setting operation response module is used to obtain the rendering parameters of the model in response to the setting operation of the rendering parameters, and the rendering parameters include at least one of the rendering duration and the rotation type.
[0092] Based on the above embodiment, the device further includes:
[0093] The effect type operation response module is used to call the particle reorganization rule corresponding to the effect type in response to the effect type selection operation, wherein the particle reorganization rule includes at least one of a diffusion sub-rule and a contraction sub-rule.
[0094] The device provided by the embodiments of the present disclosure can execute the method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0095] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0096] Reference below Figure 3 , which shows an electronic device (eg, Figure 3 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0097] like Figure 3As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0098] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0099] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0100] The electronic device provided by the embodiment of the present disclosure and the particle effect rendering method provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0101] The embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the particle effect rendering method provided by the above embodiment is implemented.
[0102] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. 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 of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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 of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0103] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0104] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0105] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0106] Acquire a particle morphology model, wherein the particle morphology model includes vertex sub-models constituting the overall model;
[0107] Determining the running trajectory of the vertex sub-model based on the particle reorganization rule;
[0108] The vertex sub-model is controlled to run based on the corresponding running track, and the vertex sub-model in the running process is rendered in real time.
[0109] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0110] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0111] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit / module does not, in some cases, constitute a limitation on the unit itself.
[0112] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0113] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 of the foregoing.
[0114] According to one or more embodiments of the present disclosure, [Example 1] provides a particle effect rendering method, the method comprising:
[0115] Acquire a particle morphology model, wherein the particle morphology model includes vertex sub-models constituting the overall model;
[0116] Determining the running trajectory of the vertex sub-model based on the particle reorganization rule;
[0117] The vertex sub-model is controlled to run based on the corresponding running track, and the vertex sub-model in the running process is rendered in real time.
[0118] According to one or more embodiments of the present disclosure, [Example 2] provides a particle effect rendering method, further comprising:
[0119] The step of determining the running track of the vertex sub-model based on the particle reorganization rule comprises:
[0120] The running position of the vertex sub-model at each moment is determined based on the particle reorganization rule, and the running track is formed based on the running position at each moment.
[0121] According to one or more embodiments of the present disclosure, [Example 3] provides a particle effect rendering method, further comprising:
[0122] The particle reorganization rules include the target position, running direction and running time of the vertex sub-model.
[0123] According to one or more embodiments of the present disclosure, [Example 4] provides a particle effect rendering method, further comprising:
[0124] The running direction of the vertex sub-model is the normal direction of the vertex sub-model, or the running direction of the vertex sub-model is determined based on the normal direction of the vertex sub-model and a rotation matrix.
[0125] According to one or more embodiments of the present disclosure, [Example 5] provides a particle effect rendering method, further comprising:
[0126] The particle reorganization rules also include operational random parameters of the vertex sub-model.
[0127] According to one or more embodiments of the present disclosure, [Example 6] provides a particle effect rendering method, further comprising:
[0128] The vertex sub-model in the real-time rendering operation process includes: determining the transparency at each moment in the rendering process according to the position information of the vertex sub-model; and rendering based on the transparency of the vertex sub-model at each moment and the operation position at each moment.
[0129] According to one or more embodiments of the present disclosure, [Example 7] provides a particle effect rendering method, further comprising:
[0130] The initial transparency of each vertex sub-model increases in sequence along the rendering direction; during the rendering process, the transparency of each vertex sub-model decreases gradually until the transparency reaches the first transparency.
[0131] According to one or more embodiments of the present disclosure, [Example 8] provides a particle effect rendering method, further comprising:
[0132] The method also includes: in the process of real-time rendering of each vertex sub-model, synchronously rendering the overall model, and at the end of rendering, setting each vertex sub-model to a fully transparent state, and the rendering process of the particle morphology model and the overall model takes the same time.
[0133] According to one or more embodiments of the present disclosure, [Example 9] provides a particle effect rendering method, further comprising:
[0134] The rendering of the overall model includes: adjusting the transparency of data points on each position line of the overall model in the rendering direction in sequence according to the rendering direction, wherein the initial transparency of the overall model is the second transparency, and each position line is perpendicular to the rendering direction.
[0135] According to one or more embodiments of the present disclosure, [Example 10] provides a particle effect rendering method, further comprising:
[0136] The adjusting the transparency of the data points on each position line of the overall model in the rendering direction includes: adjusting the transparency of the data points on the triggered position line to a third transparency; or gradually reducing the transparency of the data points on the triggered position line until the transparency is the third transparency.
[0137] According to one or more embodiments of the present disclosure, [Example 11] provides a particle effect rendering method, further comprising:
[0138] The obtaining of the particle morphology model comprises: calling the model, segmenting the model based on the mesh of the model to obtain a plurality of vertex sub-models, and the vertex sub-models constitute the particle morphology model.
[0139] According to one or more embodiments of the present disclosure, [Example 12] provides a particle effect rendering method, further comprising:
[0140] The obtaining of the particle morphology model comprises: in response to a selection operation on the model, calling the particle morphology model of the model.
[0141] According to one or more embodiments of the present disclosure, [Example 13] provides a particle effect rendering method, further comprising:
[0142] The method further includes: in response to a setting operation of the rendering parameters, acquiring the rendering parameters of the model, wherein the rendering parameters include at least one of a rendering duration and a rotation type.
[0143] According to one or more embodiments of the present disclosure, [Example 14] provides a particle effect rendering method, further comprising:
[0144] The method further includes: in response to the effect type selection operation, calling a particle reorganization rule corresponding to the effect type, wherein the particle reorganization rule includes at least one of a diffusion sub-rule and a contraction sub-rule.
[0145] According to one or more embodiments of the present disclosure, [Example 15] provides a particle effect rendering device, the device comprising:
[0146] A model acquisition module, used for acquiring a particle morphology model, wherein the particle morphology model includes vertex sub-models constituting the overall model;
[0147] A running track determination module, used for determining the running track of the vertex sub-model based on a particle reorganization rule;
[0148] The rendering module is used to control the vertex sub-model to run based on the corresponding running track and render the vertex sub-model in real time during the running process.
[0149] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0150] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0151] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A particle effect rendering method, characterized in that: include: Acquire the selected overall model and the particle morphology model corresponding to the overall model, wherein the particle morphology model includes vertex sub-models constituting the overall model, and the particle morphology model is obtained by simulating particle division of the overall model, and during the rendering process of the vertex sub-model in the particle morphology model, the overall model is synchronously rendered, and at the end of the rendering, the vertex sub-model is set to a fully transparent state to display the overall model; The rendering process of the vertex sub-model in the particle morphology model is as follows: determining the running track of the vertex sub-model based on the particle reorganization rule; controlling the vertex sub-model to run based on the corresponding running track, and rendering the vertex sub-model in the running process in real time; The rendering process of the overall model is: adjusting the transparency of the overall model.
2. The method according to claim 1, characterized in that: The step of determining the running track of the vertex sub-model based on the particle reorganization rule comprises: The running position of the vertex sub-model at each moment is determined based on the particle reorganization rule, and the running track is formed based on the running position at each moment.
3. The method according to claim 1 or 2, characterized in that: The particle reorganization rules include the target position, running direction and running time of the vertex sub-model.
4. The method according to claim 3, characterized in that The running direction of the vertex sub-model is the normal direction of the vertex sub-model, or the running direction of the vertex sub-model is determined based on the normal direction of the vertex sub-model and a rotation matrix.
5. The method according to claim 3, characterized in that: The particle reorganization rules also include operational random parameters of the vertex sub-model.
6. The method according to claim 1, characterized in that The vertex sub-model in the real-time rendering process includes: Determine the transparency at each moment in the rendering process based on the position information of the vertex sub-model; Rendering is performed based on the transparency of the vertex sub-model at each moment and the running position at each moment.
7. The method according to claim 6, characterized in that The initial transparency of the vertex sub-model increases successively along the rendering direction; during the rendering process, the transparency of the vertex sub-model decreases gradually until the transparency reaches the first transparency.
8. The method according to claim 6, characterized in that The rendering process of the particle morphology model and the overall model takes the same time.
9. The method according to claim 1, characterized in that: The rendering overall model includes: According to the rendering direction, the transparency of the data points on each position line of the overall model in the rendering direction is adjusted in sequence, wherein the initial transparency of the overall model is the second transparency, and each position line is perpendicular to the rendering direction.
10. The method according to claim 9, characterized in that The adjusting the transparency of the data points on each position line of the overall model in the rendering direction includes: adjusting the transparency of the data point on the triggered position line to a third transparency; or, The transparency of the data points on the position line to be triggered is gradually reduced until the transparency is the third transparency.
11. The method according to claim 1, characterized in that: The step of obtaining a particle morphology model comprises: In response to a selection operation on a model, a particle morphology model of the model is called.
12. The method according to claim 1, characterized in that The method further comprises: In response to the setting operation of the rendering parameters, the rendering parameters of the model are acquired, and the rendering parameters include at least one of a rendering duration and a rotation type.
13. The method according to claim 1, characterized in that The method further comprises: In response to the effect type selection operation, a particle reorganization rule corresponding to the effect type is called, wherein the particle reorganization rule includes at least one of a diffusion sub-rule and a contraction sub-rule.
14. A particle effect rendering device, characterized in that: include: A model acquisition module, used to acquire the selected overall model and a particle morphology model corresponding to the overall model, wherein the particle morphology model includes vertex sub-models constituting the overall model, and the particle morphology model is obtained by simulating particle division of the overall model; A running track determination module, used for determining the running track of the vertex sub-model based on a particle reorganization rule; A rendering module, used to control the vertex sub-model to run based on the corresponding running track, and to render the vertex sub-model in the running process in real time; The rendering module is also used to: synchronously render the overall model during the real-time rendering of each vertex sub-model, and at the end of the rendering, set each vertex sub-model to a fully transparent state to display the overall model; The rendering module is also used to adjust the transparency of the overall model.
15. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the particle effect rendering method as described in any one of claims 1-13.
16. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to execute the particle effect rendering method according to any one of claims 1 to 13 when executed by a computer processor.
Citation Information
Patent Citations
Special effect realization method and device
CN106204696A
Particle special effect rendering method, device and equipment and storage medium
CN112652044A
