CN112446942A - Special effect rendering method and device, electronic equipment and storage medium - Google Patents

Special effect rendering method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112446942A
CN112446942A CN202011241946.9A CN202011241946A CN112446942A CN 112446942 A CN112446942 A CN 112446942A CN 202011241946 A CN202011241946 A CN 202011241946A CN 112446942 A CN112446942 A CN 112446942A
Authority
CN
China
Prior art keywords
initial
target
virtual
density
particle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011241946.9A
Other languages
Chinese (zh)
Other versions
CN112446942B (en
Inventor
戴强
王延青
刘斌
马重阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202011241946.9A priority Critical patent/CN112446942B/en
Publication of CN112446942A publication Critical patent/CN112446942A/en
Application granted granted Critical
Publication of CN112446942B publication Critical patent/CN112446942B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation
    • G06T15/205Image-based rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/02Non-photorealistic rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Abstract

The method comprises the steps of responding to a special effect rendering trigger instruction, obtaining initial parameters of virtual particles simulating a target substance, wherein the initial parameters represent layout information and motion information of the virtual particles in an initial state; determining a target key point of a target object in a target page; rendering the virtual particle based on the initial parameters to generate a first effect of the target substance flowing from the target keypoint. By utilizing the embodiment of the disclosure, real-time online special effect rendering can be realized, the reality of the rendered special effect is improved, and the simulation effect is improved.

Description

Special effect rendering method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of special effect rendering technologies, and in particular, to a special effect rendering method and apparatus, an electronic device, and a storage medium.
Background
Special effect simulation based on physical properties of substances is an important element in the fields of computer graphics, digital entertainment (e.g., games, etc.), and virtual reality. In the related art, when special effect simulation is performed on continuous substances such as water and jelly, SPH (Smoothed Particle Hydrodynamics) and MPM (Material Point Method) are mainly used to perform offline simulation and simulation on a large number of virtual particles, so real-time online simulation rendering cannot be realized and a relatively real simulation effect cannot be realized.
Disclosure of Invention
The disclosure provides a special effect rendering method, a special effect rendering device, an electronic device and a storage medium, which are used for at least solving the problems that real-time online simulation rendering cannot be realized and the simulation effect is poor in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of an embodiment of the present disclosure, there is provided a special effect rendering method, including:
responding to a special effect rendering triggering instruction, and acquiring initial parameters of virtual particles simulating a target substance, wherein the initial parameters represent layout information and motion information of the virtual particles in an initial state;
determining a target key point of a target object in a target page;
rendering the virtual particle based on the initial parameters to generate a first effect of the target substance flowing from the target keypoint.
Optionally, the initial parameters include an initial density, and the rendering the virtual particle based on the initial parameters to generate a first effect that the target substance flows out of the target keypoint includes:
determining the initial position of the virtual particle on the target page according to the target key point and the initial density;
determining initial color information of the virtual particles according to a density color mapping relation, the initial density and the initial position, wherein the density color mapping relation represents a mapping relation between the average density and the color of the virtual particles on each pixel point;
rendering the virtual particle based on the initial color information and an initial shape corresponding to the virtual particle to generate a first effect that the target substance flows out of the target keypoint.
Optionally, the initial parameters further include an initial density, and before rendering the virtual particle based on the initial color information and an initial shape corresponding to the virtual particle to generate a first special effect that the target substance flows out from the target key point, the method further includes:
converting the magnitude and direction of the initial velocity of the virtual particle into a target vector starting from the initial position;
according to the target vector, stretching the initial shape corresponding to the virtual particle to obtain the target shape of the virtual particle;
the rendering the virtual particle based on the initial color information and the initial shape corresponding to the virtual particle to generate a first effect that the target substance flows out of the target keypoint comprises:
rendering the virtual particle based on the initial color information and the target shape to generate a first effect of the target substance flowing from the target keypoint.
Optionally, the virtual particles include a first number of virtual particles; the determining initial color information of the virtual particle according to the density-color mapping relationship, the initial density, and the initial position includes:
sequentially rendering the preset texture of each virtual particle according to the initial position of each virtual particle on the target page to obtain a target texture;
extracting the transparency of the position of each virtual particle from the target texture, and taking the transparency of the position of each virtual particle as the density weight of each virtual particle;
calculating the sum of the density weights of the virtual particles on each pixel point of the target texture according to the density weights of the first number of virtual particles;
calculating the density weighted sum of the virtual particles on each pixel point of the target texture according to the density weights of the first number of virtual particles and the initial density of the first number of virtual particles;
determining the average density on each pixel point according to the density weighted sum and the density weighted sum;
and determining initial color information of the virtual particles on each pixel point according to the density-color mapping relation and the average density on each pixel point.
Optionally, after determining the initial color information of the virtual particle on each pixel point according to the density-color mapping relationship and the average density on each pixel point, the method further includes:
acquiring a preset transparency corresponding to each pixel point;
and updating the initial color information of the virtual particles on each pixel point based on the preset transparency corresponding to each pixel point.
Optionally, the initial parameters further include: the initial particle network transmission parameters represent physical attributes transmitted to a target grid in the physical attributes of the virtual particles, and the target grid is obtained by carrying out grid subdivision on the target page; the method further comprises the following steps:
determining the physical attribute of the target grid at the current moment according to the initial particle grid transmission parameter of the virtual particle;
determining a mesh transmission parameter of the target mesh at the next moment of the current moment according to the physical attribute of the target mesh at the current moment, wherein the mesh transmission parameter represents the physical attribute transmitted to the virtual particle in the physical attribute of the target mesh;
determining a velocity of the virtual particle at the next time based on the mesh drive parameter of the target mesh at the next time;
determining the position of the virtual particle at the next moment according to the speed of the virtual particle at the next moment, the physical property of the target grid at the next moment and the initial position;
determining the density of the virtual particle at the next moment according to the position of the virtual particle at the next moment;
updating the first effect to a second effect that the target substance flows on the target page based on the density at the next time, the position at the next time, and the speed at the next time.
Optionally, the determining the density of the virtual particle at the next time according to the position of the virtual particle at the next time includes:
determining the number of virtual particles in the preset range of each virtual particle according to the position of the virtual particle at the next moment;
and calculating the density of each virtual particle at the next moment according to the number of the virtual particles in the preset range of each virtual particle.
Optionally, the calculating, according to the number of virtual particles in the preset range of each virtual particle, the density of each virtual particle at the next time includes:
determining an initial density value of each virtual particle at the next moment according to a mapping relation between the number of the virtual particles and the density value and the number of the virtual particles in a preset range of each virtual particle;
setting the virtual particle with the initial density value at the next moment being larger than or equal to a first density threshold value as a first virtual particle, and setting the first density threshold value as the density of the first virtual particle at the next moment;
setting the virtual particle with the initial density value less than or equal to a second density threshold value at the next moment as a second virtual particle, and setting the second density threshold value as the density of the second virtual particle at the next moment;
setting the initial density value of the third virtual particle at the next time as the density of the third virtual particle at the next time, wherein the initial density value of the third virtual particle at the next time is larger than the second density threshold and smaller than the first density threshold;
wherein the first density threshold is greater than the second density threshold.
Optionally, the target mesh comprises a second number of sub-meshes; the initial transmission parameters include: an initial mass and an initial momentum; the physical properties include mass and momentum, the virtual particles include a first number of virtual particles, and determining the physical properties of the target mesh at the current time according to the initial transmission parameters of the virtual particles includes:
taking the submesh where each virtual particle is located and submeshes adjacent to the submesh where each virtual particle is located as submeshes associated with each virtual particle, and taking each virtual particle as an associated virtual particle of the submesh associated with each virtual particle;
calculating a transmission influence factor of each virtual particle on a sub-grid associated with each virtual particle according to a moving least square method;
and calculating the mass and the momentum of each sub-network at the current moment according to the initial mass, the initial momentum and the corresponding transmission influence factors of the associated virtual particle of each sub-network.
Optionally, the initial transmission parameters further include: initial deformation gradient, initial volume and initial elastic parameters; the physical attributes further include force information; the determining the physical property of the target grid at the current moment according to the initial transmission parameter of the virtual particle further comprises:
calculating the relative distance between the associated virtual particle of each sub-grid and each sub-grid at the current moment;
determining the elasticity of each sub-grid at the current moment based on a preset elasticity model, the corresponding relative distance of each sub-grid, the initial volume of the associated virtual particle of each sub-grid, the initial deformation gradient and the initial elasticity parameters;
calculating the gravity of each sub-grid at the current moment according to the mass and the gravity acceleration of each sub-grid at the current moment;
and taking the gravity and the elasticity of the second number of sub-grids at the current moment as the stress information of the target grid at the current moment.
Optionally, before calculating the gravity of each sub-grid at the current time according to the mass and the gravity acceleration of each sub-grid at the current time, the method further includes:
acquiring direction deviation information corresponding to the target grid;
updating the gravity acceleration of each sub-grid at the current moment according to the direction deviation information to obtain the updated gravity acceleration of each sub-grid at the current moment;
the calculating the gravity of each sub-grid at the current moment according to the mass and the gravity acceleration of each sub-grid at the current moment comprises: and calculating the gravity of each sub-grid at the current moment according to the mass of each sub-grid at the current moment and the updated gravity acceleration.
Optionally, after the first special effect is updated to the second special effect of the target substance flowing on the target page based on the density at the next time, the position at the next time, and the speed at the next time, the next time is updated to the current time, and the method further includes:
respectively updating the speed, the density and the position of the virtual particle at the next moment to the speed, the density and the position of the virtual particle at the updated current moment;
and repeating the steps of determining the physical properties of the target grid at the current moment to the density at the next moment, the position at the next moment and the speed at the next moment based on the updated speed, density and position of the virtual particle at the current moment, and updating the first special effect to the second special effect of the target substance flowing on the target page, so as to update the second special effect to the third special effect of the target substance flowing on the target page.
Optionally, the initial parameters further include an initial elasticity parameter, and when the target substance is a solid soft body, the method further includes:
obtaining the volume of the virtual particle at the current moment after the updating;
calculating the ratio of the volume of the virtual particle at the current time after the updating to the initial volume;
calculating the elastic parameter of the virtual particle at the current moment after the updating according to the initial elastic parameter of the virtual particle and the corresponding ratio;
and updating the stress information of the target grid based on the elastic parameters of the virtual particles at the updated current moment.
Optionally, the initial parameters further include an initial deformation gradient, and the method further includes:
acquiring an angular momentum matrix and a rotational inertia matrix of the virtual particles at the updated current moment;
determining the deformation gradient of the virtual particle at the updated current moment according to the angular momentum matrix, the rotational inertia matrix and the initial deformation gradient;
and updating the stress information of the target grid based on the deformation gradient of the virtual particles at the updated current moment.
According to a second aspect of the embodiments of the present disclosure, there is provided a special effect rendering apparatus including:
an initial parameter acquisition module configured to execute an initial parameter acquisition module, which is used for acquiring an initial parameter of a virtual particle simulating a target substance in response to a special effect rendering trigger instruction, wherein the initial parameter characterizes the layout information and the motion information of the virtual particle in an initial state;
the target key point determining module is configured to determine target key points of target objects in the target page;
a special effect rendering module configured to perform rendering the virtual particle based on the initial parameters to generate a first special effect of the target substance flowing from the target keypoint.
Optionally, the initial parameter includes an initial density, and the special effect rendering module includes:
an initial position determining unit configured to determine an initial position of the virtual particle on the target page according to the target key point and the initial density;
an initial color information determining unit configured to perform determining initial color information of the virtual particle according to a density-color mapping relationship, the initial density and the initial position, the density-color mapping relationship representing a mapping relationship between an average density and a color of the virtual particle on each pixel point;
a special effect rendering unit configured to perform rendering of the virtual particle based on the initial color information and an initial shape corresponding to the virtual particle to generate a first special effect in which the target substance flows out from the target keypoint.
Optionally, the initial parameters further include an initial density, and the special effect rendering module further includes:
a vector conversion unit configured to perform conversion of a magnitude and a direction of an initial velocity of the virtual particle into a target vector starting from the initial position;
a stretching processing unit configured to perform stretching processing on an initial shape corresponding to the virtual particle according to the target vector to obtain a target shape of the virtual particle;
the effect rendering unit is further configured to perform rendering the virtual particle based on the initial color information and the target shape to generate a first effect of the target substance flowing out of the target keypoint.
Optionally, the virtual particles include a first number of virtual particles; the initial color information determination unit includes:
the target texture rendering unit is configured to sequentially render the preset texture of each virtual particle according to the initial position of each virtual particle on the target page to obtain a target texture;
a density weight determination unit configured to extract transparency of a position where each virtual particle is located from the target texture, and take the transparency of the position where each virtual particle is located as a density weight of each virtual particle;
a density weight sum calculation unit configured to perform calculation of a sum of density weights of virtual particles at each pixel point of the target texture according to the density weights of the first number of virtual particles;
a density weighted sum calculation unit configured to calculate a density weighted sum of the virtual particles at each pixel point of the target texture according to the density weights of the first number of virtual particles and the initial density of the first number of virtual particles;
an average density determination unit configured to perform determining an average density at each of the pixel points according to the sum of the density weights and the sum of the density weights;
an initial color information determining subunit configured to perform determining initial color information of the virtual particle at each pixel point according to the density-color mapping relationship and the average density at each pixel point.
Optionally, the initial color information determining unit further includes:
a preset transparency obtaining unit configured to perform obtaining of a preset transparency corresponding to each pixel point;
and the initial color information updating unit is configured to update the initial color information of the virtual particles on each pixel point based on the preset transparency corresponding to each pixel point.
Optionally, the initial parameters further include: the initial particle network transmission parameters represent physical attributes transmitted to a target grid in the physical attributes of the virtual particles, and the target grid is obtained by carrying out grid subdivision on the target page; the device further comprises:
a grid physical property determination module configured to perform determining a physical property of the target grid at a current moment according to an initial grid transmission parameter of the virtual particle;
a mesh transmission parameter determination module configured to perform determining a mesh transmission parameter of the target mesh at a next moment of the current moment according to the physical properties of the target mesh at the current moment, wherein the mesh transmission parameter characterizes the physical properties of the target mesh, which are transmitted to the virtual particles;
a particle velocity update module configured to perform determining a velocity of the virtual particle at the next time instant based on the mesh driving parameters of the target mesh at the next time instant;
a particle location update module configured to perform determining a location of the virtual particle at the next time instant based on the velocity of the virtual particle at the next time instant, the physical properties of the target grid at the next time instant, and the initial location;
a particle density update module configured to perform determining a density of the virtual particle at the next time instant according to a position of the virtual particle at the next time instant;
a first special effect update module configured to perform an update of the first special effect to a second special effect of the target substance flowing on the target page based on the density at the next time, the position at the next time, and the speed at the next time.
Optionally, the dummy particles include a first number of dummy particles, and the particle density update module includes:
a virtual particle number determining unit configured to determine the number of virtual particles within the preset range of each virtual particle according to the position of the virtual particle at the next moment;
a density calculating unit configured to calculate a density of each of the virtual particles at the next time according to the number of the virtual particles within a preset range of each of the virtual particles.
Optionally, the density calculating unit includes:
an initial density value determination unit configured to determine an initial density value of each virtual particle at the next time according to a mapping relation between the number of virtual particles and the density value and the number of virtual particles within a preset range of each virtual particle;
a first density determination unit configured to perform, as a first dummy particle, a dummy particle whose initial density value at the next time is equal to or greater than a first density threshold value, and to perform, as a density of the first dummy particle at the next time;
a second density determination unit configured to perform, as a second dummy particle, a dummy particle whose initial density value at the next time is equal to or less than a second density threshold value, the second density threshold value being a density of the second dummy particle at the next time;
a third density determination unit configured to perform, as a third virtual particle, a virtual particle whose initial density value at the next time is larger than the second density threshold and smaller than the first density threshold, and perform, as a density of the third virtual particle at the next time, an initial density value of the third virtual particle at the next time;
wherein the first density threshold is greater than the second density threshold.
Optionally, the target mesh comprises a second number of sub-meshes; the initial transmission parameters include: an initial mass and an initial momentum; the physical properties include mass and momentum, the virtual particles include a first number of virtual particles, the grid physical property determination module includes:
an associated grid determining unit configured to perform a sub-grid where each virtual particle is located and a sub-grid adjacent to the located sub-grid as a sub-grid associated with each virtual particle;
an associated virtual particle determination unit configured to perform associating the each virtual particle as a child mesh associated with the each virtual particle;
a transmission influence factor calculation unit configured to perform calculation of a transmission influence factor of the each virtual particle on a sub-grid associated with the each virtual particle according to a moving least squares method;
a mass and momentum calculation unit configured to perform a calculation of the mass and momentum of each sub-network at the current time instant based on the initial mass, initial momentum and corresponding transmission influencing factors of the associated virtual particle of said each sub-network.
Optionally, the initial transmission parameters further include: initial deformation gradient, initial volume and initial elastic parameters; the physical attributes further include force information; the grid physical property determination module further comprises:
a relative distance calculation unit configured to perform calculation of a relative distance between the associated virtual particle of each sub-grid and each sub-grid at the current time;
an elasticity determining unit configured to perform determining elasticity of each sub-grid at the current moment based on a preset elasticity model, a corresponding relative distance of each sub-grid, an initial volume of an associated virtual particle of each sub-grid, an initial deformation gradient, and an initial elasticity parameter;
a gravity calculation unit configured to perform calculation of gravity of each submesh at the current time from the mass and the gravitational acceleration of each submesh at the current time;
a force information determination unit configured to perform taking gravity and elastic force of the second number of sub-grids at the current time as force information of the target grid at the current time.
Optionally, the grid physical property determining module further includes:
a direction offset information acquisition unit configured to perform acquisition of direction offset information corresponding to the target mesh;
a gravitational acceleration updating unit configured to update the gravitational acceleration of each sub-grid at the current time according to the direction deviation information, so as to obtain an updated gravitational acceleration of each sub-grid at the current time;
the gravity calculation unit is further configured to calculate the gravity of each submesh at the current time according to the mass of each submesh at the current time and the updated gravitational acceleration.
Optionally, after the first special effect is updated to the second special effect in which the target substance flows on the target page based on the density at the next time, the position at the next time, and the speed at the next time, the next time is updated to the current time, and the apparatus further includes:
a parameter updating module configured to perform updating of the velocity, density and position of the virtual particle at the next time to the velocity, density and position of the virtual particle at the updated current time, respectively;
a second effect updating module configured to execute the step of repeating the above-mentioned steps of determining the physical property of the target grid at the current moment to the density at the next moment, the position at the next moment and the speed at the next moment based on the density at the current moment, the position at the next moment and the initial transmission parameter of the virtual particle, and updating the first effect to a second effect that the target substance flows on the target page, so as to update the second effect to a third effect that the target substance flows on the target page.
Optionally, the initial parameters further include an initial elasticity parameter, and when the target substance is a solid soft body, the apparatus further includes:
a volume acquisition module configured to perform acquiring a volume of the virtual particle at the updated current time;
a volume ratio calculation module configured to perform a calculation of a ratio between a volume of the virtual particle at the current time after the update and an initial volume;
an elastic parameter updating module configured to perform calculation of an elastic parameter of the virtual particle at the updated current time according to the initial elastic parameter of the virtual particle and the corresponding ratio;
a first stress information updating module configured to perform updating of stress information of the target mesh based on an elasticity parameter of the virtual particle at the updated current time.
Optionally, the initial parameters further include an initial deformation gradient, and the apparatus further includes:
a matrix obtaining module configured to perform obtaining of an angular momentum matrix and a rotational inertia matrix of the virtual particle at the updated current time;
a deformation gradient determination module configured to perform determining a deformation gradient of the virtual particle at the updated current time according to the angular momentum matrix, the moment of inertia matrix, and the initial deformation gradient;
a second stress information updating module configured to perform updating of the stress information of the target mesh based on a deformation gradient of the virtual particle at the updated current time.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method of any of the first aspects above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions, when executed by a processor of an electronic device, enable the electronic device to perform the method of any one of the first aspects of the embodiments of the present disclosure.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of any one of the first aspects of the embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the initial parameters of the virtual particles simulating the target substances are preset, the target key points of the target objects in the target page are determined, the first special effect that the real-time online simulation target substances flow out of the target key points can be achieved, the preset initial parameters can represent the layout information and the motion information of the virtual particles in the initial state, the reality of the rendered special effect can be greatly improved, and the simulation effect is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow diagram illustrating a method of special effects rendering, according to an example embodiment.
FIG. 2 is a flow diagram illustrating a first special effects method for rendering virtual particles based on initial parameters to generate a target substance outflow from a target keypoint, according to an example embodiment;
FIG. 3 is a flowchart illustrating a method for determining initial color information for a virtual particle based on a density-color mapping, initial densities, and initial positions in accordance with an exemplary embodiment;
FIG. 4 is a schematic diagram illustrating a virtual particle without rendered color information in accordance with an illustrative embodiment;
FIG. 5 is a flow diagram illustrating an effect update on a first effect basis in accordance with an illustrative embodiment;
FIG. 6 is a flow diagram illustrating a method for determining physical properties of a target mesh at a current time based on initial masses and initial momentums of a first number of virtual particles, according to an exemplary embodiment;
FIG. 7 is a flow diagram illustrating another method for determining physical properties of a target mesh at a current time based on initial transmission parameters of a virtual particle in accordance with an exemplary embodiment;
FIG. 8 is a block diagram of a special effects rendering apparatus, according to an example embodiment;
FIG. 9 is a block diagram illustrating an electronic device for special effects rendering in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a special effect rendering method according to an exemplary embodiment, where the special effect rendering method is used in an electronic device such as a terminal, an edge computing node, and the like, as shown in fig. 1, and includes the following steps.
In step S101, in response to a special effect rendering trigger instruction, initial parameters of virtual particles simulating a target substance are acquired.
In an optional embodiment, when a user enters a target page for special effect rendering, the special effect rendering triggering instruction may be triggered, and initial parameters of virtual particles simulating a target substance may be obtained.
In the embodiments of the present specification, the target substance may be a continuous substance; alternatively, the target substance may be water, beverage, or other liquid; alternatively, the target substance may be solid soft material such as snow, jelly, etc.
In this embodiment, the virtual particle may be used to simulate the target substance when rendering the special effect. Specifically, the number of the virtual particles simulating the target substance may be a first number, optionally, the first number may be at least two, and optionally, the first number may also be one; in an alternative embodiment, the number of corresponding virtual particles may be set in conjunction with the computational power of the device; specifically, the stronger the calculation power of the device is, the more the number of corresponding virtual particles can be; on the contrary, the weaker the calculation power of the device is, the smaller the number of the corresponding virtual particles can be, and generally, the larger the number of the virtual particles is, the better the simulation effect of the special effect is.
In this embodiment, the initial parameter represents layout information and motion information of the virtual particle in an initial state. In a specific embodiment, the initial parameter may include a physical property of at least one particle of an initial density, an initial velocity, an elasticity parameter, an initial mass, an initial position, an initial volume, an initial momentum, and an initial deformation gradient; wherein the initial momentum is the product of the initial velocity and the initial mass; alternatively, the elastic parameter may include, but is not limited to, at least one of a young's modulus and a poisson's ratio of the substance.
In step S103, a target key point of the target object in the target page is determined.
In an alternative embodiment, the target key point of the target object in the target page with the fixed scene may be a preset key point in the target page, for example, in a fixed scene simulating a waterfall of a mountain, since the position of the mountain in the fixed scene is fixed, the target key point may be an edge of the mountain (the preset key point) in the fixed position, accordingly.
In another alternative embodiment, in the case of a dynamic change in the scene in the target page, determining the target key point of the target object in the target page may include: detecting a target object in a target page; extracting key points in the target object; target keypoints are determined from the keypoints.
In an alternative embodiment, the target object may be an object from which a target substance flows, and specifically, the target object may be different according to a different actual application scene, for example, a scene simulating tearing of a human, the target object may be a human face, and the corresponding target substance may be tears. For example, in a scene simulating a waterfall of a high mountain, the target object may be a mountain, and the corresponding target substance may be water; for example, a scene simulating the rolling of snow from a snow mountain, the target object may be a snow mountain, and the corresponding target substance may be snow.
In addition, it should be noted that, in practical applications, multiple scenes can be simulated based on one target object, for example, when the target object is a human face, in addition to the scene simulating tearing of a human, the simulation of running saliva, running nose of a human, and the like of a human head bag (correspondingly, running water from the human ear to the outside) can be simulated.
In an optional embodiment, in a case that one target object corresponds to a plurality of scenes, extracting the key points in the target object may include extracting key points corresponding to a plurality of scenes of the target object; accordingly, the preset scene selection instruction may be received before the target keypoints are determined from the keypoints, and correspondingly, the determining of the target keypoints from the keypoints may include using the keypoints corresponding to the preset scene selection instruction as the target keypoints. Optionally, the preset scene selection instruction may have different trigger modes in combination with different scenes, for example, the preset scene selection instruction corresponding to a scene simulating tearing of a person may be triggered by detecting eye blinking of the person; the preset scene selection instruction corresponding to the scene simulating the water inflow of the human brain bag can be triggered by detecting the action of shooting the brain bag.
In addition, the triggering of the preset scene selection instruction is only an example, and in practical applications, the triggering may also be performed in other manners, for example, the preset scene selection instruction may be triggered by setting time, and in a specific embodiment, for example, a scene simulating tearing of a person is triggered in 5 seconds, a scene simulating running of a person is triggered in 10 seconds, and the like.
In another optional embodiment, the receiving of the preset scene selection instruction may also be before extracting key points in the target object or detecting the target object in the target page, and correspondingly, extracting key points in the target object may include extracting key points in the target object corresponding to the preset scene selection instruction.
In an alternative embodiment, the detection of the target object and the extraction of the key points of the target object may be combined with corresponding artificial intelligence techniques.
In step S105, the virtual particle is rendered based on the initial parameters to generate a first effect in which the target substance flows out of the target keypoint.
In an alternative embodiment, as shown in fig. 2, rendering the virtual particle based on the initial parameters to generate the first effect of the target substance flowing from the target keypoint may comprise the steps of:
in step S201, determining an initial position of a virtual particle on a target page according to the target key point and the initial density;
in practical applications, the initial density of a virtual particle may represent the number of virtual particles within a preset range of the virtual particle; correspondingly, under the condition that the number of the virtual particles and the number of the virtual particles in each virtual particle preset range are determined in the initial state, the relative position relation of the virtual particles is fixed, and then, the initial position of the first number of the virtual particles on the target page under the condition that the target substance flows out of the target key point can be determined by combining the target key point.
In the embodiment, the initial position of the virtual particle on the target page is determined by combining the target key point detected in the actual application scene, so that the requirements under different dynamic scenes can be met, and the dynamic determination of the special effect rendering position is realized.
In step S203, initial color information of the virtual particle is determined according to the density-color mapping relationship, the initial density, and the initial position.
In this embodiment of the present specification, a density-color mapping relationship may be obtained in advance, and specifically, the density-color mapping relationship may represent a mapping relationship between an average density of a virtual particle on each pixel point and a color. In a specific embodiment, the density color mapping relationship may be: vec3 color ═ pow (color0,2.0 × r), where vec3 color may represent the color on a certain pixel covered by at least one dummy particle (generally, at least two), and color0 is a preset reference color; vec3 represents a three-dimensional floating-point number array, i.e., the color information is a three-dimensional floating-point number array. r is the average density of the virtual particles on the pixel, pow (color0,2.0 r) represents the 2.0 r power returned to color 0.
In one particular embodiment, when the target substance is water, color0 may be RGB38, 150, 179.
In an alternative embodiment, as shown in fig. 3, determining the initial color information of the virtual particle according to the density-color mapping relationship, the initial density and the initial position may include the following steps:
in step S301, sequentially rendering a preset texture of each virtual particle according to an initial position of each virtual particle on a target page to obtain a target texture;
in step S303, the transparency of the position of each virtual particle is extracted from the target texture, and the transparency of the position of each virtual particle is used as the density weight of each virtual particle;
in step S305, calculating a sum of density weights of the virtual particles at each pixel point of the target texture according to the density weights of the first number of virtual particles;
in step S307, calculating a density weighted sum of the virtual particles at each pixel point of the target texture according to the density weights of the first number of virtual particles and the initial densities of the first number of virtual particles;
in step S309, determining an average density on each pixel point according to the sum of the density weights and the sum of the density weights;
in step S311, the initial color information of the virtual particle on each pixel point is determined according to the density-color mapping relationship and the average density on each pixel point.
In an alternative embodiment, the pre-set texture of the virtual particle may be rendered on an off-screen floating-point texture. In this embodiment, the off-screen floating-point texture may be a texture preset in the cache, and rendering of virtual particles may be simulated on the off-screen floating-point texture. The density weight of each virtual particle represents the weight of each virtual particle on the covered pixel point.
In one embodiment, the average density at each pixel may be obtained by dividing the sum of the density weights by the density weight.
Correspondingly, the initial color information of the virtual particles on each pixel point is used as the initial color information of the first number of virtual particles.
In the above embodiment, the rendering of the virtual particles is simulated in advance, and the weight of each virtual particle on the covered pixel point can be determined by combining the simulated rendering result, so that the initial color information of the virtual particle on each pixel point is determined quickly, and data support is provided for the subsequent rendering in an actual target page, so that the color of a part with higher subsequent virtual particle density (usually, more violent collision) is more white, and the reality of a special effect is greatly improved.
In an alternative embodiment, after step S311, in order to better simulate a liquid such as water, the method may further include:
acquiring a preset transparency corresponding to each pixel point;
updating initial color information of the virtual particles on each pixel point based on the preset transparency corresponding to each pixel point;
correspondingly, the step of taking the initial color information of the virtual particles on each pixel point as the initial color information of the first number of virtual particles includes the step of taking the updated initial color information of the virtual particles on each pixel point as the initial color information of the first number of virtual particles.
In an alternative embodiment, the preset transparency may be a transparency determined by combining a sum of density weights of the virtual particles at each pixel point, and in a specific embodiment, the preset transparency may be a mask _ val ═ clamp (d.y, p1, p2), where the mask _ val is the preset transparency corresponding to each pixel point, d.y is the sum of density weights of the virtual particles at each pixel point, and p1 is a transparency lower limit value set in combination with an actual transparency condition of a transparent liquid such as water; p2 is a transparency upper limit value set in connection with the actual transparency of a transparent liquid such as water, and in a specific embodiment, it is assumed that p1 is 0.0, p2 is 0.8, and clamp (d.y,0.0,0.8) indicates that when the sum of the density weights of the virtual particles on any pixel point is greater than or equal to 0.8, 0.8 is returned; when the sum of the density weights of the virtual particles on any pixel point is less than or equal to 0.0, returning to 0; when the sum of the density weights of the virtual particles on any pixel point is more than 0.0 and is less than 0.8, the process returns to d.y. Correspondingly, the updated initial color information of the virtual particle on each pixel point may be gl _ FragColor ═ vec4(color, mask _ val), where color is the initial color information of the virtual particle on each pixel point. vec4 indicates that color data is saved.
In the above embodiment, the preset transparency corresponding to each pixel point is updated into the initial color information corresponding to each pixel point, so that the simulation effect of simulating the transparent liquid can be effectively improved.
In step S205, the virtual particle is rendered based on the initial color information and the initial shape corresponding to the virtual particle to generate a first special effect in which the target substance flows out from the target key point.
In this embodiment, the first special effect may be a special effect in an initial state in which the target substance is simulated to flow out from the target key point. In practical applications, when rendering a virtual particle, the virtual particle is often a square (i.e. an initial shape) with a predetermined texture (a predetermined circular aperture), and specifically, as shown in fig. 4, fig. 4 is a schematic diagram of a virtual particle without rendering color information according to an exemplary embodiment.
In this embodiment of the present specification, when rendering the first number of virtual particles, a full-screen rectangular patch corresponding to the target page may be pre-drawn, and the corresponding virtual particles are rendered on each pixel point on the full-pieced rectangular patch in combination with the initial color information and the initial shape of the first number of virtual particles, so as to generate a first special effect in which the target substance flows out from the target key point.
As can be seen from the technical solutions provided by the embodiments of the present specification, in the embodiments of the present specification, by presetting initial parameters of virtual particles simulating a target substance and determining target key points of a target object in a target page, a first special effect of simulating the target substance flowing out from the target key points in real time and on line can be realized, and the preset initial parameters can represent layout information and motion information of the virtual particles in an initial state, so that the reality of a rendered special effect can be greatly improved, and a simulation effect is improved.
In an optional embodiment, before rendering the virtual particle based on the initial color information and the initial shape corresponding to the virtual particle to generate the first special effect of the target substance flowing out of the target key point, the method may further include:
converting the size and direction of the initial speed of the virtual particle into a target vector starting from the initial position;
according to the target vector, stretching the initial shape corresponding to the virtual particle to obtain the target shape of the virtual particle;
rendering the virtual particle based on the initial color information and the initial shape corresponding to the virtual particle to generate a first effect that the target substance flows out of the target keypoint comprises:
rendering the virtual particle based on the initial color information and the target shape to generate a first effect of the target substance flowing from the target keypoint.
The virtual particles based on the squares are directly rendered, and the granular sensation often exists, so that the simulated special effect is distorted.
In this embodiment of the present specification, in order to reduce a sense of distortion grain generated during rendering and improve a special effect simulation effect of rendering, a magnitude and a direction of an initial velocity of each virtual particle may be converted into an object vector starting from an initial position of the virtual particle, and accordingly, according to the object vector corresponding to each virtual particle, a corresponding initial shape is stretched from the respective initial position to obtain target shapes of a first number of virtual particles, where the target shape of the virtual particle may be a parallelogram, and correspondingly, a circular aperture preset in the initial shape is stretched from a circle to an ellipse.
In the above embodiment, the target vector starting from the initial position of the virtual particle is generated according to the velocity and the direction of the virtual particle, and the initial shape of the virtual particle is stretched in combination with the target vector, so that the distorted granular sensation generated during rendering can be reduced, the reality of the rendered special effect is greatly improved, and the simulation effect is improved.
In an alternative embodiment, in a dynamic scene, the rendered special effect needs to be updated and changed continuously, accordingly, as shown in fig. 5, fig. 5 is a flowchart illustrating a special effect update based on a first special effect according to an exemplary embodiment, and specifically, the method may include the following steps:
in step S501, determining a physical attribute of the target grid at the current time according to the initial particle grid transmission parameter of the virtual particle;
in this embodiment of the present description, the target page may be divided into a target grid including a second number of sub-grids in advance, that is, the target grid is obtained by mesh division of the target page. Specifically, the number of sub-grids (second number) may be set in conjunction with the size of the actual page. Accordingly, the initial mesh transmission parameters for the first number of virtual particles at the current time may be transferred to the target mesh. In this embodiment, the initial particle network transmission parameter may characterize the physical property transmitted to the target network in the physical properties of the virtual particle.
In an alternative embodiment, the initial mesh driving parameters may include an initial mass and an initial momentum, and accordingly, the physical properties of the target mesh may include a mass and a momentum; as shown in fig. 6, determining the physical properties of the target mesh at the current time based on the initial mass and the initial momentum of the first number of virtual particles may include the steps of:
in step S601, the submesh where each virtual particle is located and the submesh adjacent to the submesh where each virtual particle is located are taken as submeshs associated with each virtual particle, and each virtual particle is taken as an associated virtual particle of the submesh associated with each virtual particle.
In an alternative embodiment, a sub-grid adjacent to a certain sub-grid may be a k-th order grid adjacent to the sub-grid, for example, if k is 1, one sub-grid is diffused to the periphery of the sub-grid to obtain the sub-grid adjacent to the sub-grid, and taking a target grid of 3 × 3 as an example, one sub-grid is diffused to the periphery of a middle sub-grid to obtain 8 adjacent sub-grids; if k is 2, two sub-grids are diffused to the periphery of the sub-grid. Specifically, the size of k can be set according to the practical application requirements.
In step S603, the transmission influencing factor of each virtual particle on the subgrid associated with each virtual particle is calculated according to the moving least squares method.
In the embodiment of the present specification, the transmission influence factor of each virtual particle on the sub-grid associated with each virtual particle characterizes the mass and momentum of each virtual particle, and the influence degree on the mass and momentum of the sub-grid associated with each virtual particle.
Specifically, the transmission influence factor of each virtual particle on the sub-grid associated with each virtual particle can be sequentially calculated according to the position of each virtual particle, the position of the sub-grid associated with each virtual particle and the relative distance between the two, and by combining a moving least square method.
In step S605, the mass and momentum of each sub-network at the current time are calculated based on the initial mass, initial momentum, and corresponding transmission influencing factors of the associated virtual particle of each sub-network.
In an alternative embodiment, the quality of each sub-network at the current time may be calculated in combination with the following formula:
Figure RE-GDA0002866029160000151
wherein the content of the first and second substances,
Figure RE-GDA0002866029160000152
representing the quality of the ith sub-grid at the current time instant;
Figure RE-GDA0002866029160000153
representing the transmission influence factor of the p-th associated virtual particle on the ith sub-grid at the current moment (assuming that the current moment is n moment) (or representing the transmission influence factor of the ith sub-grid on the p-th associated virtual particle at the current moment);
Figure RE-GDA0002866029160000154
representing the transmission influence factors of all the associated virtual particles of the ith sub-grid on the ith sub-grid at the current moment; m ispIndicating the mass of the p-th virtual particle at the current time (the mass of the virtual particle is not changed at different times).
In an alternative embodiment, the momentum of each sub-network at the current time may be calculated in combination with the following formula:
Figure RE-GDA0002866029160000155
wherein the content of the first and second substances,
Figure RE-GDA0002866029160000156
representing the momentum, x, of the ith sub-grid at the current time instantiIndicates the position of the ith sub-grid (the grid positions are not changed at different times);
Figure RE-GDA0002866029160000157
represents the position of the p-th associated virtual particle at the current time (at the initial time, i.e. the initial position);
Figure RE-GDA0002866029160000158
representing the speed of the p-th associated virtual particle at the current moment;
Figure RE-GDA0002866029160000159
and
Figure RE-GDA00028660291600001510
the affine transformation relation used for keeping the local speed can reduce the loss of angular momentum information in the process of converting the momentum of the virtual particle into the grid momentum. In particular, the method comprises the following steps of,
Figure RE-GDA00028660291600001511
may be a matrix (angular momentum matrix for short) capable of representing angular momentum of the first number of virtual particles at a time next to the current time
Figure RE-GDA00028660291600001512
A matrix (referred to as a rotational inertia matrix for short) capable of representing the rotational inertia of the first number of virtual particles at the current moment;
in particular, the method comprises the following steps of,
Figure RE-GDA00028660291600001513
wherein the content of the first and second substances,
Figure RE-GDA0002866029160000161
representing transmission influence factors of all associated sub grids of the p-th virtual particle on the p-th virtual particle at the current moment;
Figure RE-GDA0002866029160000162
representing the speed of the ith sub-grid at the next instant in time to the current instant in time.
In the embodiment, the transmission influence factors of each virtual particle on the sub-grids associated with each virtual particle are calculated by combining a moving least square method, the special effect generation speed can be effectively accelerated, the requirements on the calculation power of equipment are greatly reduced, the wide popularization of the special effect on equipment with a large number of different calculation powers is facilitated, the transmission influence factors of the virtual particles on the associated sub-grids are combined, the mass and momentum of the virtual particles can be transmitted to the grids, and the change of a target substance in the motion process is simulated.
In an alternative embodiment, the initial transmission parameters may further include: initial deformation gradient, initial volume and initial elastic parameters; correspondingly, the physical property of the target grid can also comprise stress information; accordingly, as shown in fig. 7, determining the physical property of the target mesh at the current time according to the initial transmission parameter of the virtual particle may further include:
in step S701, calculating a relative distance between each sub-grid and the associated virtual particle of each sub-grid at the current time;
in step S703, determining the elasticity of each sub-grid at the current time based on a preset elastic model, the corresponding relative distance of each sub-grid, the initial volume of the associated virtual particle of each sub-grid, the initial deformation gradient, and the initial elastic parameters;
in step S705, calculating the gravity of each sub-grid at the current time according to the mass and the gravitational acceleration of each sub-grid at the current time;
in step S707, the gravity and the elastic force of the second number of sub-grids at the current time are used as the stress information of the target grid at the current time.
In an alternative embodiment, the predetermined elastic model may include, but is not limited to, a Neo-Hookean superelastic constitutive model or a Fixed-Cortated elastic model.
In the above embodiment, the physical properties of the virtual particles are transferred to the target mesh by combining the initial deformation gradient, the initial volume and the initial elastic parameters of the virtual particles, so as to realize the simulation of the change of the internal force and gravity of the material.
In an optional embodiment, before step S705, the method further includes:
acquiring direction deviation information corresponding to a target grid;
updating the gravity acceleration of each sub-grid at the current moment according to the direction deviation information to obtain the updated gravity acceleration of each sub-grid at the current moment;
calculating the gravity of each sub-grid at the current moment according to the mass and the gravity acceleration of each sub-grid at the current moment comprises the following steps: and calculating the gravity of each sub-grid at the current moment according to the mass of each sub-grid at the current moment and the updated gravity acceleration.
In practical application, when the device is subjected to position deviation (movement, rotation, shaking and the like), a gyroscope event is triggered, direction deviation information corresponding to the gyroscope event is direction deviation information of a target grid at the moment, and accordingly the gravity acceleration of each sub-grid can be updated by combining the direction deviation information so as to adjust stress information (gravity in the stress information) of each sub-grid, and further a special effect that the device can correspondingly move, rotate or shake along with the movement of the device is achieved.
In step S503, the mesh driving parameters of the target mesh at the next moment of the current moment are determined according to the physical properties of the target mesh at the current moment.
In the embodiment of the specification, the mesh transmission parameters represent the physical attributes transmitted to the virtual particles in the physical attributes of the target mesh; in an alternative embodiment, the mesh driving parameters may include momentum, and accordingly, the mesh driving parameters for the next time instant to the current time instant for determining the target mesh may use the following formula:
Figure RE-GDA0002866029160000171
wherein, g represents the acceleration of gravity,
Figure RE-GDA0002866029160000172
indicating the spring force experienced by the ith subgrid at the current time.
Figure RE-GDA0002866029160000173
Representing the gravity of the ith sub-grid at the current time instant.
Figure RE-GDA0002866029160000174
Representing the momentum of the ith sub-grid at the current time instant;
Figure RE-GDA0002866029160000175
representing the momentum of the ith sub-grid at a time next to the current time; Δ t represents the simulated time step (i.e., the time difference between the current time and the time next to the current time).
In an alternative embodiment, the simulation time step size may be on the order of 10-4And second. The smaller the simulation time step is, the higher the updating frequency of the simulation special effect is, and correspondingly, the higher the flowing speed of the target substance is.
In step S505, the velocity of the virtual particle at the next time instant is determined based on the mesh driving parameters of the target mesh at the next time instant.
In an alternative embodiment, the following formula may be used to determine the velocity of each virtual particle at the next time:
Figure RE-GDA0002866029160000176
wherein the content of the first and second substances,
Figure RE-GDA0002866029160000177
the momentum of the p-th virtual particle at the next moment of the current moment is shown, and the mass of the virtual particle is not changed, so that after the momentum of the virtual particle at the next moment of the current moment is obtained, the velocity of the virtual particle at the next moment of the current moment can be obtained by combining the mass of the virtual particle;
Figure RE-GDA0002866029160000178
representing the transmission influencing factor of all the associated sub-grids of the p-th virtual particle to the p-th virtual particle at the next moment;
Figure RE-GDA0002866029160000179
representing the momentum of the ith sub-grid at the next instant in time to the current instant in time.
In step S507, determining the position of the virtual particle at the next time according to the speed of the virtual particle at the next time, the physical attribute of the target grid at the next time, and the initial position;
in an optional embodiment, according to the implicit euler method, the position of the first number of virtual particles at the next time is determined by combining the speed of the first number of virtual particles at the next time, the mass and momentum in the physical properties of the target grid at the next time, and the initial position of the first number of virtual particles.
In step S509, determining the density of the dummy particle at the next time according to the position of the dummy particle at the next time;
in a particular embodiment, determining the density of the virtual particle at the next time based on the position of the virtual particle at the next time may include: determining the number of virtual particles in a preset range of each virtual particle according to the position of the virtual particle at the next moment; and calculating the density of each virtual particle at the next moment according to the number of the virtual particles in the preset range of each virtual particle.
In this embodiment, the number of virtual particles in each virtual particle preset range may be the number of virtual particles in a range formed by a preset radius with each virtual particle as a center. In an optional embodiment, on the off-screen floating point texture, the preset texture of each virtual particle may be sequentially rendered according to the position of each virtual particle at the next time to obtain the target texture corresponding to the next time, and then, with each virtual particle as a center, the number of times of rendering the virtual particle within the preset range is sampled from the target texture corresponding to the next time to obtain the number of virtual particles within the preset range of each virtual particle.
In a specific embodiment, calculating the density of each virtual particle at the next time according to the number of virtual particles within the preset range of each virtual particle may include:
in an alternative embodiment, the number of virtual particles within the preset range of each virtual particle may be directly substituted into the mapping relationship between the number of virtual particles and the density, so as to obtain the density of each virtual particle at the next time.
In the embodiment of the present specification, the mapping relationship between the number of virtual particles and the density value is as follows:
float density=exp(0.025*count)
wherein, density is density, and count is the number of virtual particles.
In the above embodiment, the number of virtual particles in the preset range of each virtual particle is counted by combining the position of the virtual particle at the next time, and the density of the virtual particle can be updated by combining the mapping relationship between the number of virtual particles and the density.
In another optional embodiment, to ensure that the color change of the subsequent special effect is smooth, calculating the density of each virtual particle at the next time according to the number of virtual particles within the preset range of each virtual particle may include:
determining the initial density value of each virtual particle at the next moment according to the mapping relation between the number of the virtual particles and the density value and the number of the virtual particles in the preset range of each virtual particle;
taking the virtual particle with the initial density value being larger than or equal to the first density threshold value at the next moment as a first virtual particle, and taking the first density threshold value as the density of the first virtual particle at the next moment;
taking the virtual particle with the initial density value less than or equal to the second density threshold value at the next moment as a second virtual particle, and taking the second density threshold value as the density of the second virtual particle at the next moment;
taking the virtual particle with the initial density value larger than the second density threshold value and smaller than the first density threshold value at the next moment as a third virtual particle, and taking the initial density value of the third virtual particle at the next moment as the density of the third virtual particle at the next moment;
wherein the first density threshold is greater than the second density threshold.
In a specific embodiment, the first density threshold may be 0.9 and the second density threshold may be 0.1.
In the above embodiment, the density of the virtual particles is mapped to a preset interval, so that a special effect of subsequent rendering can be effectively ensured, the color change is smooth, and the simulation effect is improved.
In step S511, the first effect is updated to the second effect in which the target substance flows on the target page, based on the density at the next time, the position at the next time, and the speed at the next time.
In an alternative embodiment, updating the first effect to a second effect that the target substance flows on the target page based on the density at the next time, the location at the next time, and the velocity at the next time may include updating the first effect to include
Determining color information of the virtual particles at the next moment according to the density-color mapping relation, the density at the next moment and the position at the next moment;
and rendering the virtual particle based on the color information at the next moment and the initial shape corresponding to the virtual particle so as to update the first special effect to a second special effect of the target substance flowing on the target page.
Optionally, before rendering the virtual particle based on the color information at the next time and the initial shape corresponding to the virtual particle to update the first special effect to the second special effect in which the target substance flows on the target page, the step S511 may further include:
stretching the initial shape corresponding to the virtual particle according to the speed at the next moment to obtain the target shape of the virtual particle at the next moment;
accordingly, rendering the virtual particle based on the color information at the next time and the initial shape corresponding to the virtual particle to update the first effect to the second effect that the target substance flows on the target page may include rendering the virtual particle based on the color information at the next time and the target shape at the next time to update the first effect to the second effect that the target substance flows on the target page.
In the embodiment of the present specification, specific details of the step S511 may refer to the step S105, and are not described herein again.
In addition, the special effect is continuously updated along with the time, but the special effect at the subsequent moment does not always flow out from the target key point, and the target substance can still flow out from the target key point or not flow out from the target key point by combining the actual scene requirement and the actual operation.
In the above embodiment, the target page is divided into the target grids including the second number of sub-grids, and then the special effect change at the next moment can be simulated by combining the mutual transmission between the physical attributes of the target grids and the physical attributes of the virtual particles, such as the mass, the speed, the position, the density, and the like, so as to realize the real-time update of the special effect.
In practical applications, the next time may be updated to the current time as time goes on, and accordingly, after the first effect is updated to the second effect that the target substance flows on the target page, the method may further include:
respectively updating the mass, the momentum and the position of the first number of virtual particles at the next moment to the mass, the momentum and the position of each virtual particle at the updated current moment, and repeating the steps S501-S511 based on the mass, the momentum and the position of each virtual particle at the updated current moment so as to update the second special effect of the target substance flowing on the target page to the third special effect of the target substance flowing on the target page.
In an alternative embodiment, the elastic parameter of the liquid substance does not change during the flowing process, but the elastic parameter of the virtual particles changes along with the change of the pressure during the flowing process of some solid soft bodies; specifically, the volume of the virtual particles becomes smaller with the increase of the pressure, and accordingly, the elasticity parameters such as young's modulus and poisson's ratio become larger, and the substance becomes harder (for example, the snow is harder under pressure). Correspondingly, the elastic parameters of the virtual particles need to be updated, and the elastic parameters are used for updating the elastic force in the stress information of the grid at the next moment so as to realize the simulation of various elastic and elastic-plastic materials, and correspondingly, when the target substance is a solid soft body, the method can further comprise the following steps:
obtaining the volume of the virtual particle at the current moment after updating;
calculating the ratio of the volume of the virtual particle at the current moment after updating to the initial volume;
calculating the elastic parameters of the virtual particles at the current moment after updating according to the initial elastic parameters of the virtual particles and the corresponding ratio;
and updating the stress information of the target grid based on the elastic parameters of the virtual particles at the updated current moment.
In an alternative embodiment, when the elastic parameters are young's modulus and poisson's ratio; the above scheme for updating the elastic parameters can be implemented by combining the following formulas:
Figure RE-GDA0002866029160000201
Figure RE-GDA0002866029160000202
wherein the content of the first and second substances,
Figure RE-GDA0002866029160000203
representing the ratio of the volume of the p-th virtual particle at the current moment after updating to the initial volume; xi is a preset proportional parameter, lambda0Representing the initial poisson ratio; mu.s0Represents the initial young's modulus;
Figure RE-GDA0002866029160000204
representing the Young modulus of the p-th virtual particle at the current moment after updating;
Figure RE-GDA0002866029160000205
representing the poisson's ratio of the p-th virtual particle at the current time after the update.
In the embodiment, the Young modulus, Poisson's ratio and other elastic parameters of the substance are updated by combining the volume change condition of the virtual particles in the motion process of the solid software, so that the property that the solid software substance becomes smaller and becomes harder along with the increase of the pressure can be effectively simulated, and the special simulation effect is greatly improved.
In an alternative embodiment, the deformation gradient of the virtual particle is also changed during the movement process, so as to form an elastic force to the target grid, and accordingly, the method further includes:
acquiring an angular momentum matrix and a rotational inertia matrix of the virtual particle at the updated current moment;
determining the deformation gradient of the virtual particles at the current moment after updating according to the angular momentum matrix, the rotational inertia matrix and the initial deformation gradient;
and updating the stress information of the target grid based on the deformation gradient of the virtual particles at the updated current moment.
In an alternative embodiment, the deformation gradient of each virtual particle at the updated current time may be determined according to the following formula:
Figure RE-GDA0002866029160000206
wherein the content of the first and second substances,
Figure RE-GDA0002866029160000207
representing the deformation gradient of the p-th virtual particle at the current moment after updating;
Figure RE-GDA0002866029160000208
Figure RE-GDA0002866029160000209
may be a matrix (angular momentum matrix for short) capable of representing the angular momentum of the first number of virtual particles at the updated current time
Figure RE-GDA00028660291600002010
A matrix (referred to as a rotational inertia matrix for short) capable of representing the rotational inertia of the first number of virtual particles at the updated current time may be used; i represents the initial deformation gradient; Δ t represents the simulation time step.
Specifically, the step S703 may be referred to for updating the stress information of the target grid based on the deformation gradient of the virtual particle at the updated current time, which is not described herein again.
In the above embodiment, the deformation gradient of the virtual particle in the movement process can be updated by combining the updated angular momentum matrix, the updated moment of inertia matrix and the initial deformation gradient of the virtual particle at the current moment, so as to simulate the change of the stress information such as the pressure (i.e., the elastic force received by the target grid) on the target grid in the movement process of the virtual particle.
In the above embodiment, the target page is divided into the target grids including the second number of sub-grids, and then special effect changes at different times can be simulated by combining the physical attributes of the virtual particles, such as mass, speed, position, density, and the like, with the mutual transmission between the physical attributes of the target grids, so as to realize vivid special effect simulation.
FIG. 8 is a block diagram illustrating a special effects rendering apparatus according to an example embodiment. Referring to fig. 8, the apparatus includes:
an initial parameter obtaining module 810 configured to perform obtaining initial parameters of virtual particles simulating a target substance in response to a special effect rendering trigger instruction, the initial parameters representing layout information and motion information of the virtual particles in an initial state;
a target key point determination module 820 configured to perform determining a target key point of a target object in a target page;
a special effect rendering module 830 configured to perform rendering the virtual particle based on the initial parameters to generate a first special effect of the target substance flowing from the target keypoint.
Optionally, the initial parameter includes an initial density, and the special effect rendering module 830 includes:
the initial position determining unit is configured to determine the initial position of the virtual particle on the target page according to the target key point and the initial density;
an initial color information determination unit configured to perform determination of initial color information of the virtual particle according to a density-color mapping relationship, an initial density, and an initial position, the density-color mapping relationship characterizing a mapping relationship between an average density and a color of the virtual particle at each pixel point;
a special effect rendering unit configured to perform rendering of the virtual particle based on the initial color information and the initial shape corresponding to the virtual particle to generate a first special effect in which the target substance flows out from the target key point.
Optionally, the initial parameters further include an initial density, and the special effect rendering module 830 further includes:
a vector conversion unit configured to perform conversion of a magnitude and a direction of an initial velocity of the virtual particle into a target vector starting from an initial position;
the stretching processing unit is configured to perform stretching processing on the initial shape corresponding to the virtual particle according to the target vector to obtain a target shape of the virtual particle;
the effect rendering unit is further configured to perform rendering of the virtual particle based on the initial color information and the target shape to generate a first effect of the target substance flowing out of the target keypoint.
Optionally, the virtual particles include a first number of virtual particles; the initial color information determination unit includes:
the target texture rendering unit is configured to sequentially render the preset texture of each virtual particle according to the initial position of each virtual particle on the target page to obtain a target texture;
a density weight determination unit configured to perform extraction of the transparency of the position of each virtual particle from the target texture, and to take the transparency of the position of each virtual particle as a density weight of each virtual particle;
a density weight sum calculation unit configured to perform calculation of a density weight sum of virtual particles on each pixel point of the target texture according to density weights of the first number of virtual particles;
a density weighted sum calculation unit configured to perform calculating a density weighted sum of the virtual particles at each pixel point of the target texture according to the density weights of the first number of virtual particles and the initial densities of the first number of virtual particles;
an average density determination unit configured to perform determination of an average density on each pixel point according to the sum of the density weights and the sum of the density weights;
and the initial color information determining subunit is configured to determine the initial color information of the virtual particles on each pixel point according to the density-color mapping relation and the average density on each pixel point.
Optionally, the initial color information determining unit further includes:
the preset transparency obtaining unit is configured to execute obtaining of a preset transparency corresponding to each pixel point;
and the initial color information updating unit is configured to update the initial color information of the virtual particles on each pixel point based on the preset transparency corresponding to each pixel point.
Optionally, the initial parameters further include: the method comprises the steps of obtaining initial particle network transmission parameters, wherein the initial particle network transmission parameters represent physical attributes transmitted to a target grid in the physical attributes of virtual particles, and the target grid is obtained by carrying out grid subdivision on a target page; the above-mentioned device still includes:
a grid physical property determination module configured to perform determining a physical property of a target grid at a current moment according to an initial particle grid transmission parameter of a virtual particle;
the mesh transmission parameter determining module is configured to determine mesh transmission parameters of the target mesh at the next moment of the current moment according to the physical attributes of the target mesh at the current moment, and the mesh transmission parameters represent the physical attributes of the target mesh, which are transmitted to the virtual particles;
a particle velocity update module configured to perform determining a velocity of the virtual particle at a next time instant based on the mesh transmission parameters of the target mesh at the next time instant;
a particle position updating module configured to determine the position of the virtual particle at the next moment according to the speed of the virtual particle at the next moment, the physical attribute of the target grid at the next moment and the initial position;
a particle density updating module configured to determine the density of the virtual particle at the next time according to the position of the virtual particle at the next time;
a first special effect updating module configured to execute updating of the first special effect to a second special effect of the target substance flowing on the target page based on the density at the next time, the position at the next time, and the speed at the next time.
Optionally, the dummy particles include a first number of dummy particles, and the particle density update module includes:
a virtual particle number determining unit configured to determine the number of virtual particles within a preset range of each virtual particle according to the position of the virtual particle at the next moment;
and the density calculation unit is configured to calculate the density of each virtual particle at the next moment according to the number of the virtual particles in the preset range of each virtual particle.
Optionally, the density calculating unit includes:
an initial density value determination unit configured to perform determination of an initial density value of each virtual particle at a next time according to a mapping relationship between the number of virtual particles and the density value and the number of virtual particles within a preset range of each virtual particle;
a first density determination unit configured to perform, as a first dummy particle, a dummy particle whose initial density value at the next time is equal to or greater than a first density threshold value, and to perform, as a density of the first dummy particle at the next time;
a second density determination unit configured to perform, as a second dummy particle, a dummy particle whose initial density value at the next time is equal to or less than a second density threshold value, and to perform, as a density of the second dummy particle at the next time, the second density threshold value;
a third density determination unit configured to perform, as a third virtual particle, a virtual particle whose initial density value at the next time is larger than the second density threshold and smaller than the first density threshold, and to perform, as a density of the third virtual particle at the next time, an initial density value of the third virtual particle at the next time;
wherein the first density threshold is greater than the second density threshold.
Optionally, the target mesh comprises a second number of sub-meshes; the initial transmission parameters include: an initial mass and an initial momentum; the physical properties include mass and momentum, the virtual particles include a first number of virtual particles, and the grid physical property determination module includes:
an associated grid determining unit configured to perform the operation of regarding the sub-grid where each virtual particle is located and the sub-grids adjacent to the sub-grid where each virtual particle is located as the sub-grids associated with each virtual particle;
an associated virtual particle determination unit configured to perform associating virtual particles each of which is a child grid associated with each virtual particle;
a transmission influence factor calculation unit configured to perform calculation of a transmission influence factor of each virtual particle on the sub-grid associated with each virtual particle according to a moving least squares method;
and the quality and momentum calculation unit is configured to calculate the quality and the momentum of each sub-network at the current moment according to the initial quality, the initial momentum and the corresponding transmission influence factors of the associated virtual particle of each sub-network.
Optionally, the initial transmission parameters further include: initial deformation gradient, initial volume and initial elastic parameters; the physical attributes further comprise stress information; the grid physical property determination module further includes:
a relative distance calculation unit configured to perform calculation of a relative distance between each sub-grid and the associated virtual particle of each sub-grid at the current time;
the elastic force determining unit is configured to determine the elastic force of each sub-grid at the current moment based on a preset elastic model, the corresponding relative distance of each sub-grid, the initial volume of the associated virtual particles of each sub-grid, the initial deformation gradient and the initial elastic parameters;
a gravity calculation unit configured to perform calculation of gravity of each sub-grid at a current time from a mass and a gravitational acceleration of each sub-grid at the current time;
and the stress information determining unit is configured to perform taking the gravity and the elastic force of the second number of sub-grids at the current moment as the stress information of the target grid at the current moment.
Optionally, the grid physical property determining module further includes:
a direction offset information acquisition unit configured to perform acquisition of direction offset information corresponding to the target mesh;
the gravity acceleration updating unit is configured to update the gravity acceleration of each sub-grid at the current moment according to the direction deviation information to obtain the updated gravity acceleration of each sub-grid at the current moment;
the gravity calculation unit is further configured to perform calculating the gravity of each submesh at the current time according to the mass of each submesh at the current time and the updated gravitational acceleration.
Optionally, after the first special effect is updated to the second special effect in which the target substance flows on the target page based on the density at the next time, the position at the next time, and the speed at the next time, the next time is updated to the current time, and the apparatus further includes:
a parameter updating module configured to perform updating of the velocity, density and position of the virtual particle at the next time to the velocity, density and position of the virtual particle at the updated current time, respectively;
and the second special effect updating module is configured to execute the step of determining the physical property of the target grid at the current moment to the density at the next moment, the position at the next moment and the speed at the next moment based on the density at the current moment, the position at the next moment and the speed at the next moment, and updating the first special effect to the second special effect of the target substance flowing on the target page, so as to update the second special effect to the third special effect of the target substance flowing on the target page.
Optionally, the initial parameters further include initial elasticity parameters, and when the target substance is a solid soft body, the apparatus further includes:
a volume acquisition module configured to perform acquisition of a volume of the virtual particle at a current time after the update;
a volume ratio calculation module configured to perform calculation of a ratio between a volume of the virtual particle at the current time after the update and the initial volume;
the elastic parameter updating module is configured to calculate the elastic parameters of the virtual particles at the current moment after updating according to the initial elastic parameters of the virtual particles and the corresponding ratios;
and the first stress information updating module is configured to update the stress information of the target grid based on the elastic parameters of the virtual particles at the updated current moment.
Optionally, the initial parameter further includes an initial deformation gradient, and the apparatus further includes:
the matrix acquisition module is configured to acquire an angular momentum matrix and a rotational inertia matrix of the virtual particle at the updated current moment;
a deformation gradient determination module configured to perform determining a deformation gradient of the virtual particle at the updated current moment according to the angular momentum matrix, the moment of inertia matrix and the initial deformation gradient;
and the second stress information updating module is configured to update the stress information of the target grid based on the deformation gradient of the virtual particles at the updated current moment.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 9 is a block diagram illustrating an electronic device for special effect rendering, which may be a terminal according to an exemplary embodiment, and an internal structure thereof may be as shown in fig. 9. The electronic device comprises a processor, a memory, a network interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the electronic device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a method of image defect filling network determination or image defect processing. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the electronic equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and does not constitute a limitation on the electronic devices to which the disclosed aspects apply, as a particular electronic device may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
In an exemplary embodiment, there is also provided an electronic device including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the special effects rendering method as in embodiments of the present disclosure.
In an exemplary embodiment, there is also provided a storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the special effect rendering method in the embodiments of the present disclosure.
In an exemplary embodiment, a computer program product containing instructions is also provided, which when run on a computer, causes the computer to perform the special effects rendering method in embodiments of the present disclosure.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A special effect rendering method is characterized by comprising
Responding to a special effect rendering triggering instruction, and acquiring initial parameters of virtual particles simulating a target substance, wherein the initial parameters represent layout information and motion information of the virtual particles in an initial state;
determining a target key point of a target object in a target page;
rendering the virtual particle based on the initial parameters to generate a first effect of the target substance flowing from the target keypoint.
2. The effect rendering method of claim 1, wherein the initial parameters comprise an initial density, and wherein rendering the virtual particle based on the initial parameters to generate the first effect of the target substance flowing from the target keypoint comprises:
determining the initial position of the virtual particle on the target page according to the target key point and the initial density;
determining initial color information of the virtual particles according to a density color mapping relation, the initial density and the initial position, wherein the density color mapping relation represents a mapping relation between the average density and the color of the virtual particles on each pixel point;
rendering the virtual particle based on the initial color information and an initial shape corresponding to the virtual particle to generate a first effect that the target substance flows out of the target keypoint.
3. The effect rendering method of claim 2, wherein the initial parameters further include an initial density, and prior to rendering the virtual particles based on the initial color information and an initial shape corresponding to the virtual particles to generate the first effect of the target substance flowing from the target keypoint, the method further comprises:
converting the magnitude and direction of the initial velocity of the virtual particle into a target vector starting from the initial position;
according to the target vector, stretching the initial shape corresponding to the virtual particle to obtain the target shape of the virtual particle;
the rendering the virtual particle based on the initial color information and the initial shape corresponding to the virtual particle to generate a first effect that the target substance flows out of the target keypoint comprises:
rendering the virtual particle based on the initial color information and the target shape to generate a first effect of the target substance flowing from the target keypoint.
4. The special effect rendering method of claim 2, wherein the virtual particles comprise a first number of virtual particles; the determining initial color information of the virtual particle according to the density-color mapping relationship, the initial density, and the initial position includes:
sequentially rendering the preset texture of each virtual particle according to the initial position of each virtual particle on the target page to obtain a target texture;
extracting the transparency of the position of each virtual particle from the target texture, and taking the transparency of the position of each virtual particle as the density weight of each virtual particle;
calculating the sum of the density weights of the virtual particles on each pixel point of the target texture according to the density weights of the first number of virtual particles;
calculating the density weighted sum of the virtual particles on each pixel point of the target texture according to the density weights of the first number of virtual particles and the initial density of the first number of virtual particles;
determining the average density on each pixel point according to the density weighted sum and the density weighted sum;
and determining initial color information of the virtual particles on each pixel point according to the density-color mapping relation and the average density on each pixel point.
5. The special effect rendering method of claim 4, wherein after determining the initial color information of the virtual particle at each pixel point according to the density-color mapping relationship and the average density at each pixel point, the method further comprises:
acquiring a preset transparency corresponding to each pixel point;
and updating the initial color information of the virtual particles on each pixel point based on the preset transparency corresponding to each pixel point.
6. The special effect rendering method of any one of claims 2 to 5, wherein the initial parameters further include: the initial particle network transmission parameters represent physical attributes transmitted to a target grid in the physical attributes of the virtual particles, and the target grid is obtained by carrying out grid subdivision on the target page; the method further comprises the following steps:
determining the physical attribute of the target grid at the current moment according to the initial particle grid transmission parameter of the virtual particle;
determining a mesh transmission parameter of the target mesh at the next moment of the current moment according to the physical attribute of the target mesh at the current moment, wherein the mesh transmission parameter represents the physical attribute transmitted to the virtual particle in the physical attribute of the target mesh;
determining a velocity of the virtual particle at the next time based on the mesh drive parameter of the target mesh at the next time;
determining the position of the virtual particle at the next moment according to the speed of the virtual particle at the next moment, the physical property of the target grid at the next moment and the initial position;
determining the density of the virtual particle at the next moment according to the position of the virtual particle at the next moment;
updating the first effect to a second effect that the target substance flows on the target page based on the density at the next time, the position at the next time, and the speed at the next time.
7. The special effects rendering method of claim 6, wherein the virtual particles comprise a first number of virtual particles, and wherein determining the density of the virtual particles at the next time instant from the positions of the virtual particles at the next time instant comprises:
determining the number of virtual particles in the preset range of each virtual particle according to the position of the virtual particle at the next moment;
and calculating the density of each virtual particle at the next moment according to the number of the virtual particles in the preset range of each virtual particle.
8. A special effect rendering apparatus, comprising:
an initial parameter acquisition module configured to execute an initial parameter acquisition module, which is used for acquiring an initial parameter of a virtual particle simulating a target substance in response to a special effect rendering trigger instruction, wherein the initial parameter characterizes the layout information and the motion information of the virtual particle in an initial state;
the target key point determining module is configured to determine target key points of target objects in the target page;
a special effect rendering module configured to perform rendering the virtual particle based on the initial parameters to generate a first special effect of the target substance flowing from the target keypoint.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the special effects rendering method of any of claims 1 to 7.
10. A computer readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the special effects rendering method of any of claims 1 to 7.
CN202011241946.9A 2020-11-09 2020-11-09 Special effect rendering method and device, electronic equipment and storage medium Active CN112446942B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011241946.9A CN112446942B (en) 2020-11-09 2020-11-09 Special effect rendering method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011241946.9A CN112446942B (en) 2020-11-09 2020-11-09 Special effect rendering method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112446942A true CN112446942A (en) 2021-03-05
CN112446942B CN112446942B (en) 2023-12-19

Family

ID=74736593

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011241946.9A Active CN112446942B (en) 2020-11-09 2020-11-09 Special effect rendering method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112446942B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113378445A (en) * 2021-05-10 2021-09-10 中国科学院过程工程研究所 Gas-liquid multiphase system calculation method and system based on discrete simulation
CN113486591A (en) * 2021-07-13 2021-10-08 吉林大学 Gravity multi-parameter data density weighted inversion method for convolutional neural network result
CN113521738A (en) * 2021-08-11 2021-10-22 网易(杭州)网络有限公司 Special effect generation method and device, computer readable storage medium and electronic equipment
CN113689534A (en) * 2021-10-25 2021-11-23 腾讯科技(深圳)有限公司 Physical special effect rendering method and device, computer equipment and storage medium
WO2023065948A1 (en) * 2021-10-18 2023-04-27 北京字节跳动网络技术有限公司 Special effect processing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101710465A (en) * 2009-12-16 2010-05-19 西南石油大学 Method for simulating drilling tool lifting for drilling simulator
WO2019052313A1 (en) * 2017-09-13 2019-03-21 腾讯科技(深圳)有限公司 Liquid simulation method, liquid interaction method and apparatus
CN109583385A (en) * 2018-11-30 2019-04-05 深圳市脸萌科技有限公司 Face image processing process, device, electronic equipment and computer storage medium
CN110427131A (en) * 2019-07-26 2019-11-08 珠海豹趣科技有限公司 Cartoon display method and device based on pressing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101710465A (en) * 2009-12-16 2010-05-19 西南石油大学 Method for simulating drilling tool lifting for drilling simulator
WO2019052313A1 (en) * 2017-09-13 2019-03-21 腾讯科技(深圳)有限公司 Liquid simulation method, liquid interaction method and apparatus
CN109583385A (en) * 2018-11-30 2019-04-05 深圳市脸萌科技有限公司 Face image processing process, device, electronic equipment and computer storage medium
CN110427131A (en) * 2019-07-26 2019-11-08 珠海豹趣科技有限公司 Cartoon display method and device based on pressing

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113378445A (en) * 2021-05-10 2021-09-10 中国科学院过程工程研究所 Gas-liquid multiphase system calculation method and system based on discrete simulation
CN113378445B (en) * 2021-05-10 2024-02-02 中国科学院过程工程研究所 Gas-liquid multiphase system calculation method and system based on discrete simulation
CN113486591A (en) * 2021-07-13 2021-10-08 吉林大学 Gravity multi-parameter data density weighted inversion method for convolutional neural network result
CN113521738A (en) * 2021-08-11 2021-10-22 网易(杭州)网络有限公司 Special effect generation method and device, computer readable storage medium and electronic equipment
WO2023065948A1 (en) * 2021-10-18 2023-04-27 北京字节跳动网络技术有限公司 Special effect processing method and device
CN113689534A (en) * 2021-10-25 2021-11-23 腾讯科技(深圳)有限公司 Physical special effect rendering method and device, computer equipment and storage medium
CN113689534B (en) * 2021-10-25 2022-03-01 腾讯科技(深圳)有限公司 Physical special effect rendering method and device, computer equipment and storage medium
WO2023071579A1 (en) * 2021-10-25 2023-05-04 腾讯科技(深圳)有限公司 Physical special effect rendering method and apparatus, computer device and storage medium

Also Published As

Publication number Publication date
CN112446942B (en) 2023-12-19

Similar Documents

Publication Publication Date Title
CN112446942B (en) Special effect rendering method and device, electronic equipment and storage medium
EP4006843A1 (en) Animation implementation method and apparatus, electronic device, and storage medium
CN110827383B (en) Attitude simulation method and device of three-dimensional model, storage medium and electronic equipment
EP3751521A1 (en) Expression animation data processing method, computer device and storage medium
EP4009282A1 (en) Animation processing method and apparatus, and computer storage medium and electronic device
CN108122234A (en) Convolutional neural networks training and method for processing video frequency, device and electronic equipment
CN107067451A (en) The implementation method and device of dynamic bone in animation
CN110555796A (en) image adjusting method, device, storage medium and equipment
CN112363402B (en) Gait training method and device of foot type robot based on model-related reinforcement learning, electronic equipment and medium
CN105243375B (en) A kind of motion characteristic extracting method and device
CN106485773A (en) A kind of method and apparatus for generating animation data
CN112598769A (en) Special effect rendering method and device, electronic equipment and computer readable storage medium
WO2008146972A1 (en) System and method for real-time cloth simulation
CN111773688A (en) Flexible object rendering method and device, storage medium and electronic device
US8194079B2 (en) Inertial field generator: a method for controllably coupling kinematic character motions to dynamically simulated elements
CA3182690A1 (en) Method and system for real-time simulation of elastic body
CN105528188B (en) The method and apparatus of browsing pictures
CN106842984A (en) A kind of dynamic electron instrument simulation method that real-time textures are rendered
CN114063761B (en) Gaze point display method and related device
US10864434B2 (en) Simulation of multiple connected bodies for real-time application
CN115661935B (en) Human body action accuracy determining method and device
Qi et al. A Infrared Cloud Image Simulation Method for Cloud Segmentation Network Training
CN109597480A (en) Man-machine interaction method, device, electronic equipment and computer readable storage medium
CN110866417A (en) Image processing method and device and electronic equipment
CN110992444B (en) Image processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant