CN114202598A - Rendering method, device and system of fluid particles and storage medium - Google Patents

Rendering method, device and system of fluid particles and storage medium Download PDF

Info

Publication number
CN114202598A
CN114202598A CN202111521903.0A CN202111521903A CN114202598A CN 114202598 A CN114202598 A CN 114202598A CN 202111521903 A CN202111521903 A CN 202111521903A CN 114202598 A CN114202598 A CN 114202598A
Authority
CN
China
Prior art keywords
frame
positions
adjacent
frames
screen
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.)
Pending
Application number
CN202111521903.0A
Other languages
Chinese (zh)
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 Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network 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 Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202111521903.0A priority Critical patent/CN114202598A/en
Publication of CN114202598A publication Critical patent/CN114202598A/en
Priority to PCT/CN2022/136692 priority patent/WO2023109555A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/269Analysis of motion using gradient-based methods

Abstract

The embodiment of the disclosure relates to a rendering method, a device and a system of fluid particles and a storage medium. In at least one embodiment of the present disclosure, after acquiring positions of consecutive N frames of the same fluid particle in a time sequence, instead of directly performing a ball-melting process on the positions of the N frames, at least one frame position of the fluid particle is obtained through interpolation based on the positions of the N frames, and then, from the positions of the consecutive N frames and the at least one frame position obtained through interpolation, a non-adjacent N frame position is selected, so that a trailing rendering of the fluid particle is performed based on the non-adjacent N frame position, a problem that a trailing effect is not obvious because the position distance of the consecutive N frames is short due to a slow velocity of the fluid particle is avoided, and the method is suitable for a trailing rendering of a large number of fluid particles in a two-dimensional scene.

Description

Rendering method, device and system of fluid particles and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a rendering method, a device, a system and a storage medium for fluid particles.
Background
At present, the tailing effect of the fluid particles can be rendered in various ways.
For example, a single particle is rendered by employing a trailing Renderer (Trail render) component to achieve the trailing effect of the particle. However, the Trail render component generates a plurality of meshes after the mesh corresponding to a single particle by using a mesh (mesh) to complete the trailing rendering, and for the trailing rendering of a large number of fluid particles in a two-dimensional scene, the Trail render component generates a large number of meshes, so that the Trail render component cannot be applied to a mobile terminal with limited performance.
Therefore, it is desirable to provide a fluid particle tailing rendering scheme to solve at least one of the above technical problems.
Disclosure of Invention
To solve at least one problem of the prior art, at least one embodiment of the present disclosure provides a rendering method, apparatus, system, and storage medium for fluid particles.
In a first aspect, an embodiment of the present disclosure provides a rendering method for fluid particles, including:
acquiring the positions of continuous N frames of the same fluid particle in a time sequence, wherein N is a positive integer greater than or equal to 2;
interpolating to obtain at least one frame position of the same fluid particle based on the positions of the continuous N frames;
selecting non-adjacent N frame positions from the positions of the continuous N frames and at least one frame position;
and performing trailing rendering of the fluid particles based on the non-adjacent N frame positions.
In some embodiments, performing a trailing rendering of fluid particles based on non-adjacent N frame locations comprises:
respectively setting corresponding particle size and attenuation curve for the positions of the non-adjacent N frames;
and performing ball melting treatment on non-adjacent N frame positions based on the particle size and the attenuation curve.
In some embodiments, setting the corresponding particle sizes for the non-adjacent N frame positions respectively comprises:
the sizes of the particles corresponding to the non-adjacent N frame positions are increased along with the increment of the time sequence.
In some embodiments, before performing the ball-melting processing on the non-adjacent N frame positions based on the particle size and the attenuation curve, the rendering method of the fluid particles further includes:
converting the non-adjacent N frame positions to N frame screen positions under a screen coordinate system;
determining a distance between adjacent 2-frame screen positions based on the N-frame screen positions;
determining a distance threshold corresponding to the positions of the adjacent 2 frames of screens based on the sizes of the particles corresponding to the positions of the adjacent 2 frames of screens;
and if the distance between the adjacent 2-frame screen positions is larger than or equal to the distance threshold value, reducing the distance between the adjacent 2-frame screen positions.
In some embodiments, the distance threshold corresponding to the adjacent 2 frame screen positions is determined by:
distance threshold is a × particle size 1+ b × particle size 2;
wherein a and b are preset constants, and the particle size 1 and the particle size 2 are particle sizes corresponding to the screen positions of the adjacent 2 frames respectively.
In some embodiments, the N frame screen positions include: a 1 st frame screen position, a 3 rd frame screen position and a 5 th frame screen position;
narrowing the distance between adjacent 2-frame screen locations includes:
fixing the 1 st frame screen position, and adjusting the 3 rd frame screen position until the distance between the 1 st frame screen position and the adjusted 3 rd frame screen position is smaller than a first distance threshold; the first distance threshold is a threshold determined based on the particle sizes corresponding to the 1 st frame screen position and the 3 rd frame screen position respectively;
fixing the adjusted 3 rd frame screen position, and adjusting the 5 th frame screen position until the distance between the adjusted 3 rd frame screen position and the adjusted 5 th frame screen position is smaller than a second distance threshold; the second distance threshold is a threshold determined based on the particle sizes corresponding to the 3 rd frame screen position and the 5 th frame screen position, respectively.
In some embodiments, narrowing the distance between adjacent 2 frame screen locations comprises:
fixing any one of the adjacent 2-frame screen positions;
determining a distance vector corresponding to the position of the adjacent 2 frames of screens based on the fixed position;
and determining the screen position after the distance is reduced based on the fixed position, the distance vector, the distance between the adjacent 2 frames of screen positions and a distance threshold value.
In some embodiments, the reduced distance screen position is determined by:
the screen position after the distance reduction is the fixed position + distance vector x (distance threshold ÷ distance between adjacent 2-frame screen positions).
In some embodiments, said interpolating the position of at least one frame of the same fluid particle based on the positions of the consecutive N frames comprises:
and if N is less than or equal to the preset frame number threshold, taking the position of the Nth frame as the center, and symmetrically arranging at least one of the position of the 1 st frame and the position of the (N-1) th frame to obtain at least one frame position of the same fluid particle.
In some embodiments, said selecting non-adjacent N frame positions from the positions of the consecutive N frames and the at least one frame position comprises:
selecting X frames from the positions of the continuous N frames and selecting Y frames from the at least one frame position; wherein X is a positive integer less than N, Y is a positive integer greater than or equal to 1, and X + Y ═ N.
In some embodiments, the N consecutive frames are 3 consecutive frames, and the preset frame number threshold is 3 frames.
In some embodiments, said interpolating the position of at least one frame of the same fluid particle based on the positions of the consecutive N frames comprises:
and taking the position of the 3 rd frame as a center, and symmetrical the position of the 1 st frame to obtain the position of the 5 th frame of the same fluid particle.
In some embodiments, said selecting non-adjacent N frame positions from the positions of the consecutive N frames and the at least one frame position comprises:
the position of the 1 st frame, the position of the 3 rd frame and the position of the 5 th frame are selected.
In a second aspect, an embodiment of the present disclosure provides a rendering apparatus for fluid particles, including:
the device comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for acquiring the positions of N continuous frames of the same fluid particle in a time sequence, and N is a positive integer greater than or equal to 2;
the interpolation unit is used for interpolating to obtain at least one frame position of the same fluid particle based on the positions of the continuous N frames;
a selecting unit, configured to select non-adjacent N frame positions from the positions of consecutive N frames and at least one frame position;
and the rendering unit is used for performing trailing rendering on the fluid particles based on the non-adjacent N frame positions.
In a third aspect, the disclosed embodiments also provide a system comprising at least one computing device and at least one storage device storing instructions, wherein the instructions, when executed by the at least one computing device, cause the at least one computing device to perform the steps of the method for rendering fluid particles according to any one of the embodiments of the first aspect.
In a fourth aspect, the disclosed embodiments also provide a computer-readable storage medium storing a program or instructions, which, when executed by at least one computing device, causes the at least one computing device to perform the steps of the rendering method for fluid particles according to any one of the embodiments of the first aspect.
It can be seen that, in at least one embodiment of the present disclosure, after acquiring positions of consecutive N frames of the same fluid particle in a time sequence, instead of directly performing molten ball (metaball) processing on the positions of the N frames, at least one frame position of the fluid particle is obtained by interpolation based on the positions of the N frames, and then, from the positions of the consecutive N frames and the at least one frame position obtained by interpolation, a non-adjacent N frame position is selected, so that a trailing rendering of the fluid particle is performed based on the non-adjacent N frame position, a problem that a trailing effect is not obvious because a position distance of the consecutive N frames is short due to a slow velocity of the fluid particle is avoided, and the method is suitable for a trailing rendering of a large number of fluid particles in a two-dimensional scene.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is an exemplary flowchart of a rendering method of fluid particles according to an embodiment of the present disclosure;
fig. 2 is a schematic rendering flow chart of fluid particles according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram illustrating a process of adjusting a distance between adjacent particles according to an embodiment of the disclosure;
fig. 4 is an exemplary flowchart of another rendering method for fluid particles according to an embodiment of the present disclosure;
fig. 5 is an exemplary flowchart of a rendering method for fluid particles according to an embodiment of the present disclosure;
fig. 6 is a schematic rendering flow chart of another fluid particle provided in the embodiment of the present disclosure;
fig. 7 is a schematic view illustrating a process of adjusting the distance between adjacent particles according to an embodiment of the present disclosure;
fig. 8 is an exemplary block diagram of a rendering apparatus for fluid particles provided by an embodiment of the present disclosure;
FIG. 9 is an exemplary block diagram of a system including at least one computing device and at least one storage device storing instructions provided by embodiments of the present disclosure;
FIG. 10 is a schematic illustration of a disjointing phenomenon provided by embodiments of the present disclosure;
fig. 11 is a schematic diagram of a droplet-shaped tailing effect provided by an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure can be more clearly understood, the present disclosure will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. The specific embodiments described herein are merely illustrative of the disclosure and are not intended to be limiting. All other embodiments derived by one of ordinary skill in the art from the described embodiments of the disclosure are intended to be within the scope of the disclosure.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
Fig. 1 is an exemplary flowchart of a rendering method for fluid particles according to an embodiment of the present disclosure. The execution main body of the rendering method can be a server side or a mobile side.
The rendering method may include, but is not limited to, the following steps 101 to 104:
in step 101, positions of consecutive N frames of the same fluid particle in time sequence are obtained, where N is a positive integer greater than or equal to 2.
Wherein the fluid particles are particles generated in simulation space by a Vertex shading engine (Vertex Shader). In some embodiments, the simulation space is a square planar area, and the aspect ratio of the planar area can be set to 16:9 to satisfy the screen aspect ratio of the service end or the mobile end. For example, the Y-axis coordinate range of the simulation space is negative 27.2 to positive 27.2, the X-axis coordinate range of the simulation space is negative 15.3 to positive 15.3, and the origin of the simulation space is at the center position of the simulation space.
The above-mentioned simulation space may be understood as a particle space, and thus, the position of the acquired same fluid particle in N consecutive frames in time sequence may be understood as the particle space position of the fluid particle in N consecutive frames in time sequence.
The position of the same fluid particle in time sequence for N consecutive frames is recorded as: a 1 st frame position, a 2 nd frame position, a 3 rd frame position, … …, and an nth frame position, wherein the 1 st frame position can be understood as a position of the current frame of fluid particles, and the 2 nd to nth frame positions can be understood as positions of the history frame of fluid particles.
In step 102, at least one frame position of the same fluid particle is interpolated based on the positions of the consecutive N frames.
Based on the positions of the consecutive N frames, the position of the (N + 1) th frame, the position of the (N + 2) th frame, or even more frames of the same fluid particle can be interpolated. The locus formed by the positions of the continuous N frames and the positions of the interpolated frames is a straight line or a curve (such as a Bezier curve).
In step 103, non-adjacent N frame positions are selected from the positions of consecutive N frames and at least one frame position.
Selecting X frames from the positions of the continuous N frames, and selecting Y frames from at least one frame position; wherein X is a positive integer less than N, Y is a positive integer greater than or equal to 1, and X + Y ═ N.
In step 104, a trailing rendering of the fluid particles is performed based on non-adjacent N frame positions.
In this embodiment, a molten ball (metaball) process may be performed based on non-adjacent N frame positions to achieve a tailing effect of the fluid particle. The specific process of the molten ball (metaball) processing is a mature technology in the field, and is not described in detail.
It can be seen that, in this embodiment, after acquiring positions of consecutive N frames of the same fluid particle in a time sequence, instead of directly performing molten ball (metaball) processing on the positions of the N frames, at least one frame position of the fluid particle is obtained through interpolation based on the positions of the N frames, and then, from the positions of the consecutive N frames and the at least one frame position obtained through interpolation, a non-adjacent N frame position is selected, so that the trailing rendering of the fluid particle is performed based on the non-adjacent N frame position, the problem that a trailing effect is not obvious because the position distance of the consecutive N frames is short due to a slow velocity of the fluid particle is avoided, and the method is suitable for the trailing rendering of the fluid particle in a two-dimensional scene.
Fig. 2 is a schematic drawing illustrating a tailing rendering process of fluid particles according to an embodiment of the present disclosure, which is applicable to step 104 in fig. 1. As shown in fig. 2, performing trailing rendering of fluid particles based on non-adjacent N frame positions may include, but is not limited to, the following steps 201 and 202:
in step 201, the particle size and attenuation curve are set for non-adjacent N frame positions.
The particle size is understood to be the diameter of the particle. By setting the particle size, different tailing effects can be achieved. For example, the particle sizes corresponding to non-adjacent N frame positions are increased with the time sequence, and the final ball-melting treatment can realize a drop-shaped tailing effect.
The attenuation curve is the attenuation curve of the particle from the center of the circle outward of the alpha (alpha) channel, which characterizes transparency, so that the center of the particle is opaque and becomes gradually transparent from the center outward according to the attenuation curve. In some embodiments, the attenuation curve is a cubic attenuation curve or a quintic attenuation curve.
In step 202, based on the particle size and the attenuation curve, a global melting process is performed for non-adjacent N frame positions.
After the particle size and attenuation curve are set, the particles at one frame position become transparent gradually from the center to the outside, and the particles at the other frame position also become transparent gradually from the center to the outside, so that the particles at the two frame positions have a superposition effect at the edge, which causes the alpha channel to change, i.e. the transparency to change.
Therefore, a transparency threshold may be set, and it is determined whether the transparency of the particles at the two frame positions after being superimposed at the edges is greater than or equal to the transparency threshold, and if so, the particles at the two frame positions are subjected to the ball-melting process.
In some embodiments, considering a scene with a fast fluid particle speed, if the distance between two frame positions is relatively far, the particle fusion at the two frame positions may not be completed, resulting in a disjointing phenomenon, which is shown in fig. 10. The disjointing phenomenon exists in both a cubic attenuation curve and a quintic attenuation curve. Therefore, in order to solve the disjointing problem, the distance between adjacent particles needs to be reduced before performing the ball-melting process on non-adjacent N frame positions.
Fig. 3 is a schematic diagram illustrating a process of adjusting a distance between adjacent particles according to an embodiment of the disclosure. Before the process is applied to step 202 shown in fig. 2, as shown in fig. 3, the process may include, but is not limited to, the following steps 301 to 304:
in step 301, non-adjacent N frame positions are converted to N frame screen positions in a screen coordinate system.
Since the acquired positions of the same fluid particle in the time sequence of N frames are the particle space positions of the fluid particle in the time sequence of N frames, but not the screen space position of the moving end, at least one frame position of the same fluid particle is obtained by interpolation based on the particle space positions of the N frames, and is also the position in the particle space, but is not the screen space position of the moving end, so that the non-adjacent N frame positions are also the positions in the particle space, but are selected from the positions of the N frames and the at least one frame position.
In this embodiment, the non-adjacent N frame positions are converted from the particle space to the N frame screen positions in the screen coordinate system, and specifically, the non-adjacent N frame positions are normalized first and then converted to the N frame screen positions in the screen coordinate system. The formula is as follows:
screen position-particle space position ÷ particle space size × (screen size ÷ 2).
Wherein the particle space position/particle space size is the normalization process.
In step 302, based on the N frame screen locations, the distance between adjacent 2 frame screen locations is determined.
The distance between the adjacent 2-frame screen positions can be solved by using the existing distance calculation formula.
In step 303, a distance threshold corresponding to the adjacent 2-frame screen position is determined based on the particle sizes corresponding to the adjacent 2-frame screen positions.
In this embodiment, the distance threshold corresponding to the screen position of the adjacent 2 frames is determined by the following formula:
distance threshold is a × particle size 1+ b × particle size 2;
wherein a and b are preset constants, and the particle size 1 and the particle size 2 are particle sizes corresponding to the screen positions of the adjacent 2 frames respectively.
In step 304, if the distance between the adjacent 2-frame screen positions is greater than or equal to the distance threshold, the distance between the adjacent 2-frame screen positions is narrowed.
In some embodiments, narrowing the distance between adjacent 2-frame screen positions includes the following three steps S1 to S3:
and S1, fixing any one of the adjacent 2-frame screen positions.
And S2, determining a distance vector corresponding to the position of the adjacent 2 frames of screens based on the fixed position.
And S3, determining the screen position after the distance is reduced based on the fixed position, the distance vector, the distance between the adjacent 2 frames of screen positions and the distance threshold value.
In this embodiment, the screen position after the distance reduction is determined by the following formula:
the screen position after the distance reduction is the fixed position + distance vector x (distance threshold ÷ distance between adjacent 2-frame screen positions).
After the distance between the adjacent 2 frames of screen positions is reduced, the N frames of screen positions are converted into normalized coordinates, and then step 202 shown in fig. 2 is performed: based on the particle size and the attenuation curve, the ball-melting processing is performed on the non-adjacent N frame positions, which are N frame positions of the normalized coordinates.
It can be seen that, in the above embodiment, by setting the distance threshold, when the distance between adjacent particles is greater than or equal to the distance threshold, the position of the particle with an earlier occurrence time is changed to be closer to the position of the particle in the current frame, so as to avoid the disjointing phenomenon when the particle moving speed is faster. In addition, by setting the particle size and the attenuation curve, different trailing effects can be achieved, for example, the particle size corresponding to non-adjacent N frame positions is increased with the time sequence, and finally the ball melting process can achieve a droplet-shaped trailing effect, which is shown in fig. 11.
Fig. 4 is an exemplary flowchart of a rendering method for fluid particles according to an embodiment of the present disclosure, as shown in fig. 4, including the following steps 401 to 404:
in step 401, positions of consecutive N frames of the same fluid particle in time sequence are obtained, where N is a positive integer greater than or equal to 2.
In step 402, if N is less than or equal to the threshold of the predetermined number of frames, the position of the nth frame is taken as the center, and at least one of the positions from the 1 st frame to the N-1 st frame is symmetric to obtain at least one frame position of the same fluid particle.
In step 403, non-adjacent N frame positions are selected from the positions of the consecutive N frames and at least one frame position.
Selecting X frames from the positions of the continuous N frames, and selecting Y frames from at least one frame position; wherein X is a positive integer less than N, Y is a positive integer greater than or equal to 1, and X + Y ═ N.
In step 404, a trailing rendering of the fluid particle is performed based on non-adjacent N frame positions.
Steps 401, 403, and 404 are the same as steps 101, 103, and 104 in fig. 1, and are not described again.
It can be seen that, in this embodiment, after acquiring positions of consecutive N frames of the same fluid particle in a time sequence, instead of directly performing molten ball (metaball) processing on the positions of the N frames, at least one frame position of the fluid particle is obtained through interpolation based on the positions of the N frames, and then, from the positions of the consecutive N frames and the at least one frame position obtained through interpolation, a non-adjacent N frame position is selected, so that the trailing rendering of the fluid particle is performed based on the non-adjacent N frame position, the problem that a trailing effect is not obvious because the position distance of the consecutive N frames is short due to a slow velocity of the fluid particle is avoided, and the method is suitable for the trailing rendering of the fluid particle in a two-dimensional scene.
At present, due to performance limitations of mobile end devices such as smartphones and tablet computers, the positions of the same fluid particle in 3 consecutive frames in a time sequence are usually recorded, that is, the motion path of the same fluid particle is also recorded. For example, the position of the fluid particle in the current frame is recorded as the position of the 1 st frame, the position of the fluid particle in the previous frame of the current frame is recorded as the position of the 2 nd frame, and so on, the earlier the time is, the larger the corresponding frame number is. Therefore, the mobile-end device does not record the position of the fluid particles at the 4 th frame and the 5 th frame.
However, if the moving speed of the fluid particles is low, for example, if the water cup is shaken lightly, the speed of the water droplets when the water droplets are splashed out is low, the positions of the water droplets in 3 consecutive frames in the time sequence may be close to each other, so that the water droplets are not separated, and the tailing effect is not obvious when the molten ball (metaball) processing is directly performed at the positions of the 3 consecutive frames.
Therefore, in at least one embodiment of the present disclosure, after acquiring positions of 3 consecutive frames of the same fluid particle in a time sequence, instead of directly performing a molten ball (metaball) process on the positions of the 3 frames, at least one frame position of the fluid particle is obtained by interpolation based on the positions of the 3 frames, and then from the positions of the 3 consecutive frames and the at least one frame position obtained by interpolation, a non-adjacent 3 frame position is selected, so that a trailing rendering of the fluid particle is performed based on the non-adjacent 3 frame position, a problem that a trailing effect is not obvious because the position distance of the 3 consecutive frames is short due to a slow velocity of the fluid particle is avoided, and the method is suitable for a trailing rendering of a large number of fluid particles in a two-dimensional scene and for a moving end.
Fig. 5 is an exemplary flowchart of a rendering method of fluid particles according to an embodiment of the present disclosure. The execution main body of the rendering method is a mobile terminal, for example, a mobile terminal device such as a smart phone and a tablet computer. The rendering method may include, but is not limited to, the following steps 501 to 504:
in step 501, the positions of 3 consecutive frames in time sequence of the same fluid particle are obtained.
Wherein the fluid particles are particles generated in simulation space by a Vertex shading engine (Vertex Shader). In some embodiments, the simulation space is a square planar area, and the aspect ratio of the planar area can be set to 16:9 to satisfy the aspect ratio of the mobile terminal. For example, the Y-axis coordinate range of the simulation space is negative 27.2 to positive 27.2, the X-axis coordinate range of the simulation space is negative 15.3 to positive 15.3, and the origin of the simulation space is at the center position of the simulation space.
The above mentioned simulation space may be understood as a particle space, and thus the position of the same fluid particle acquired in time series for 3 consecutive frames may be understood as the particle space position of the fluid particle in time series for 3 consecutive frames.
The position of the same fluid particle in time sequence for 3 consecutive frames is recorded as: a 1 st frame position, a 2 nd frame position and a 3 rd frame position, wherein the 1 st frame position can be understood as a position of a current frame of the fluid particle, and the 2 nd frame position and the 3 rd frame position can be understood as positions of a history frame of the fluid particle.
In step 502, at least one frame position of the same fluid particle is interpolated based on the positions of consecutive 3 frames.
Based on the positions of consecutive 3 frames, the 4 th, 5 th, and even more 3 th frame positions of the same fluid particle can be interpolated. The locus formed by the positions of the continuous 3 frames and the positions of the interpolated 3 frames is a straight line or a curve (such as a bezier curve).
In step 503, non-adjacent 3 frame positions are selected from the positions of consecutive 3 frames and at least one frame position.
For example, the 4 th frame position and the 5 th frame position are obtained by interpolation, then the 1, 2, 4 frame positions may be selected, the 1, 2, 5 frame positions may be selected, the 1, 3, 4 frame positions may be selected, and the 1, 3, 5 frame positions may be selected.
In step 504, a trailing rendering of the fluid particles is performed based on non-adjacent 3 frame positions.
In this embodiment, a molten ball (metaball) process may be performed based on non-adjacent 3-frame positions to achieve a tailing effect of the fluid particles. The specific process of the molten ball (metaball) processing is a mature technology in the field, and is not described in detail.
It can be seen that, in this embodiment, after acquiring positions of consecutive 3 frames of the same fluid particle in a time sequence, instead of directly performing molten ball (metaball) processing on the positions of the 3 frames, at least one frame position of the fluid particle is obtained through interpolation based on the positions of the 3 frames, and then from the positions of the consecutive 3 frames and the at least one frame position obtained through interpolation, a non-adjacent 3 frame position is selected, so that the trailing rendering of the fluid particle is performed based on the non-adjacent 3 frame position, the problem that the trailing effect is not obvious because the position distance of the consecutive 3 frames is short due to the slow velocity of the fluid particle is avoided, and the method is suitable for the trailing rendering of the fluid particle in a two-dimensional scene and for a moving end.
In some embodiments, due to the performance limitation of the moving end, only the 3-frame image may be processed by a molten ball (metallic), and in order to avoid the problem that the positions of consecutive 3 frames are closer to each other, which may cause insignificant tailing effect, in this embodiment, after acquiring the positions of consecutive 3 frames of the same fluid particle in time sequence, only the position of the 1 st frame and the position of the 3 rd frame are retained, and the position of the 2 nd frame is discarded. In addition, in order to achieve 3 frames, in this embodiment, the 5 th frame position of the same fluid particle is obtained by interpolation, for example, the position of the 1 st frame is centrosymmetric with respect to the position of the 3 rd frame, so as to obtain the position of the 5 th frame of the same fluid particle. Thus, the present embodiment performs trailing rendering of the fluid particles at 1, 3, and 5 frame positions.
Fig. 6 is a schematic view of a rendering process of fluid particles according to another embodiment of the disclosure, which is applied to step 504 in fig. 5. As shown in fig. 6, performing trailing rendering of fluid particles based on non-adjacent 3-frame positions may include, but is not limited to, the following steps 601 and 602:
in step 601, the corresponding particle size and attenuation curve are set for non-adjacent 3-frame positions respectively.
The particle size is understood to be the diameter of the particle. By setting the particle size, different tailing effects can be achieved. For example, the particle sizes corresponding to non-adjacent 3-frame positions are increased along with the time sequence, and the final ball-melting treatment can realize the drop-shaped tailing effect. Taking the 1, 3, and 5 frame positions as examples, the incremental arrangement of the 1, 3, and 5 frame positions according to the time sequence is denoted as 5, 3, and 1 frame positions, where the 1 st frame position can be understood as the current frame position, the 3 rd frame and the 5 th frame are historical frame positions, then the particle size corresponding to the 1 st frame position is set to be the largest, and the particle size corresponding to the 3 rd frame position and the 5 th frame position is set to be decreased.
The attenuation curve is the attenuation curve of the particle from the center of the circle outward of the alpha (alpha) channel, which characterizes transparency, so that the center of the particle is opaque and becomes gradually transparent from the center outward according to the attenuation curve. In some embodiments, the attenuation curve is a cubic attenuation curve or a quintic attenuation curve.
In step 602, based on the particle size and attenuation curve, a blend process is performed for non-adjacent 3-frame locations.
Taking the 1, 3 and 5 frame positions as examples, after the particle size and the attenuation curve are set, the particle at the 1 st frame position gradually becomes transparent from the center to the outside, and the particle at the 3 rd frame position also gradually becomes transparent from the center to the outside, so that the particle at the 1 st frame position and the particle at the 3 rd frame position generate a superposition effect at the edge, resulting in a change of the alpha channel, that is, a change of the transparency.
Therefore, a transparency threshold may be set, and it is determined whether the transparency of the particle at the 1 st frame position and the particle at the 3 rd frame position after being superimposed at the edge is greater than or equal to the transparency threshold, and if so, the particle at the 1 st frame position and the particle at the 3 rd frame position are subjected to the ball-melting processing. In addition, for the particle at the 3 rd frame position and the particle at the 5 th frame position, it may be determined whether the transparency of the particle at the 3 rd frame position and the particle at the 5 th frame position after being superimposed at the edge is greater than or equal to a transparency threshold, and if so, the particle at the 3 rd frame position and the particle at the 5 th frame position are subjected to the ball-melting processing. Thus, after the particle ball-melting processing at the 1, 3 and 5 frame positions is completed, a water drop-shaped tailing effect can be realized.
In some embodiments, considering that the distance between the 1, 3, and 5 frame positions is relatively long in a scenario where the fluid particle velocity is fast, the particle fusion may not be completed, resulting in a disjointing phenomenon, which is shown in fig. 10. The disjointing phenomenon exists in both a cubic attenuation curve and a quintic attenuation curve. Therefore, in order to solve the disjointing problem, the distance between adjacent particles needs to be reduced before the 3-frame position which is not adjacent is subjected to the ball-melting process.
Fig. 7 is a schematic diagram illustrating a process of adjusting a distance between adjacent particles according to an embodiment of the disclosure. Before the flow is applied to step 602 shown in fig. 6, as shown in fig. 7, the following steps 701 to 704 may be included, but not limited to:
in step 701, non-adjacent 3 frame positions are converted to 3 frame screen positions in the screen coordinate system.
Since the acquired positions of 3 consecutive frames of the same fluid particle in time sequence are the particle space positions of the fluid particle in 3 consecutive frames in time sequence, but not the screen space position of the moving end, at least one frame position of the same fluid particle is obtained by interpolation based on the particle space positions of the 3 consecutive frames, and is also the position in the particle space, but is not the screen space position of the moving end, so that the non-adjacent 3 frame positions are selected from the positions of the 3 consecutive frames and the at least one frame position, and are also the positions in the particle space, but are not the screen space position of the moving end.
In this embodiment, the non-adjacent 3-frame position is converted from the particle space to the 3-frame screen position in the screen coordinate system, and specifically, the non-adjacent 3-frame position is normalized first and then converted to the 3-frame screen position in the screen coordinate system. The formula is as follows:
screen position-particle space position ÷ particle space size × (screen size ÷ 2).
Wherein the particle space position/particle space size is the normalization process.
For example, the 1 st frame particle space position is denoted as (firstpos.x, firstpos.y). The particle space size is 15.3X 27.2, i.e. the Y-axis coordinate range of the particle space is negative 27.2 to positive 27.2 and the X-axis coordinate range of the particle space is negative 15.3 to positive 15.3. The screen size is 720 × 1280. Then, the 1 st frame screen position is noted as (firstpos.x ÷ 15.3 × 360, firstpos.y ÷ 27.2 × 640).
For another example, the 3 rd frame particle spatial position is noted as (thirdpos.x, thirdpos.y). Then, the 3 rd frame screen position is noted as (thirdpos.x ÷ 15.3 × 360, thirdpos.y ÷ 27.2 × 640).
As another example, the 5 th frame particle space position is denoted as (fifthpos.x, fifthpos.y). Then, the 5 th frame screen position is noted as (fifthpos.x ÷ 15.3 × 360, fifthpos.y ÷ 27.2 × 640).
In step 702, based on the 3-frame screen position, the distance between adjacent 2-frame screen positions is determined.
Taking the screen positions of 1, 3 and 5 frames as examples, the screen position of the 1 st frame and the screen position of the 3 rd frame are the screen positions of the adjacent 2 frames, and the screen position of the 3 rd frame and the screen position of the 5 th frame are also the screen positions of the adjacent 2 frames. The distance between the adjacent 2-frame screen positions can be solved by using the existing distance calculation formula.
In step 703, a distance threshold corresponding to the adjacent 2-frame screen position is determined based on the particle sizes corresponding to the adjacent 2-frame screen positions.
In this embodiment, the distance threshold corresponding to the screen position of the adjacent 2 frames is determined by the following formula:
distance threshold is a × particle size 1+ b × particle size 2;
wherein a and b are preset constants, and the particle size 1 and the particle size 2 are particle sizes corresponding to the screen positions of the adjacent 2 frames respectively.
Taking screen positions of 1, 3 and 5 frames as examples, the screen position of the 1 st frame and the screen position of the 3 rd frame are adjacent screen positions of 2 frames, and the corresponding distance threshold is recorded as a first distance threshold, and then the first distance threshold is a × particle size corresponding to the screen position of the 1 st frame + b × particle size corresponding to the screen position of the 3 rd frame. In addition, the 3 rd frame screen position and the 5 th frame screen position are adjacent 2 th frame screen positions, and the corresponding distance threshold is recorded as a second distance threshold, so that the second distance threshold is a × the particle size corresponding to the 3 rd frame screen position + b × the particle size corresponding to the 5 th frame screen position.
In step 704, if the distance between the adjacent 2-frame screen positions is greater than or equal to the distance threshold, the distance between the adjacent 2-frame screen positions is narrowed.
Taking the screen positions of the 1 st frame, the 3 rd frame and the 5 th frame as examples, if the distance between the screen position of the 1 st frame and the screen position of the 3 rd frame is greater than or equal to the first distance threshold, fixing the screen position of the 1 st frame, and adjusting the screen position of the 3 rd frame until the distance between the screen position of the 1 st frame and the adjusted screen position of the 3 rd frame is less than the first distance threshold.
In addition, if the distance between the adjusted 3 rd frame screen position and the adjusted 5 th frame screen position is greater than or equal to the second distance threshold, the adjusted 3 rd frame screen position is fixed, and the 5 th frame screen position is adjusted until the distance between the adjusted 3 rd frame screen position and the adjusted 5 th frame screen position is less than the second distance threshold.
It should be noted that, if the distance between the 1 st frame screen position and the 3 rd frame screen position is smaller than the first distance threshold, the distance does not need to be adjusted, and meanwhile, if the distance between the 3 rd frame screen position and the 5 th frame screen position is greater than or equal to the second distance threshold, the 3 rd frame screen position is fixed, and the 5 th frame screen position is adjusted until the distance between the 3 rd frame screen position and the adjusted 5 th frame screen position is smaller than the second distance threshold.
In some embodiments, narrowing the distance between adjacent 2-frame screen positions includes the following three steps S1 to S3:
and S1, fixing any one of the adjacent 2-frame screen positions.
Taking the screen positions of 1, 3 and 5 frames as an example, if the distance between the screen position of the 1 st frame and the screen position of the 3 rd frame is greater than or equal to the first distance threshold, the screen position of the 1 st frame is fixed.
And if the distance between the adjusted 3 rd frame screen position and the 5 th frame screen position is greater than or equal to the second distance threshold, fixing the adjusted 3 rd frame screen position.
And if the distance between the 3 rd frame screen position and the 5 th frame screen position is greater than or equal to the second distance threshold, fixing the 3 rd frame screen position.
And S2, determining a distance vector corresponding to the position of the adjacent 2 frames of screens based on the fixed position.
After the 1 st frame screen position is fixed, the distance vector between the 1 st frame screen position and the 3 rd frame screen position is the obtained vector (1 st frame screen position-3 rd frame screen position).
After the adjusted 3 rd frame screen position is fixed, the distance vector between the adjusted 3 rd frame screen position and the adjusted 5 th frame screen position is the vector obtained (the adjusted 3 rd frame screen position-the 5 th frame screen position).
After the 3 rd frame screen position is fixed, the distance vector between the 3 rd frame screen position and the 5 th frame screen position is the obtained vector (3 rd frame screen position-5 th frame screen position).
And S3, determining the screen position after the distance is reduced based on the fixed position, the distance vector, the distance between the adjacent 2 frames of screen positions and the distance threshold value.
In this embodiment, the screen position after the distance reduction is determined by the following formula:
the screen position after the distance reduction is the fixed position + distance vector x (distance threshold ÷ distance between adjacent 2-frame screen positions).
Taking the screen positions of 1, 3 and 5 frames as an example, if the screen position of the 1 st frame is fixed and the screen position of the 3 rd frame is adjusted, the adjusted screen position of the 3 rd frame is the distance vector x (the first distance threshold value ÷ the distance between the screen position of the 1 st frame and the screen position of the 3 rd frame) between the screen position of the 1 st frame and the screen position of the 3 rd frame.
If the adjusted 3 rd frame screen position is fixed and the 5 th frame screen position is adjusted, the adjusted 5 th frame screen position is equal to the adjusted 3 rd frame screen position + the distance vector x between the adjusted 3 rd frame screen position and the 5 th frame screen position (the second distance threshold ÷ the distance between the adjusted 3 rd frame screen position and the 5 th frame screen position).
If the 3 rd frame screen position is fixed and the 5 th frame screen position is adjusted, the adjusted 5 th frame screen position is equal to the 3 rd frame screen position + the distance vector x between the 3 rd frame screen position and the 5 th frame screen position (the second distance threshold value ÷ the distance between the 3 rd frame screen position and the 5 th frame screen position).
After the distance between the adjacent 2 frames of screen positions is narrowed, the 3 frames of screen positions are converted into normalized coordinates, and then step 202 shown in fig. 2 is performed: based on the particle size and the attenuation curve, the sphere melting processing is performed on the non-adjacent 3-frame positions, and it should be noted that the non-adjacent 3-frame positions are 3-frame positions with normalized coordinates.
It can be seen that, in the above embodiment, by setting the distance threshold, when the distance between adjacent particles is greater than or equal to the distance threshold, the position of the particle with an earlier occurrence time is changed to be closer to the position of the particle in the current frame, so as to avoid the disjointing phenomenon when the particle moving speed is faster. In addition, by setting the particle size and the attenuation curve, different trailing effects can be achieved, for example, the particle size corresponding to non-adjacent 3-frame positions is increased with the time sequence, and finally the ball melting treatment can achieve a droplet-shaped trailing effect, which is shown in fig. 11.
It is noted that, for simplicity of description, the foregoing method embodiments are described as a series of acts or combination of acts, but those skilled in the art will appreciate that the disclosed embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently with other steps in accordance with the disclosed embodiments. In addition, those skilled in the art can appreciate that the embodiments described in the specification all belong to alternative embodiments.
Fig. 8 is a rendering apparatus for fluid particles according to an embodiment of the disclosure, where the rendering apparatus for fluid particles can be applied to a mobile terminal, such as a mobile terminal device like a smart phone or a tablet computer. The rendering device of the fluid particles includes but is not limited to: an acquisition unit 81, an interpolation unit 82, a selection unit 83, and a rendering unit 84.
An obtaining unit 81, configured to obtain positions of N consecutive frames of the same fluid particle in a time sequence, where N is a positive integer greater than or equal to 2;
an interpolation unit 82, configured to interpolate to obtain at least one frame position of the same fluid particle based on positions of consecutive N frames;
a selecting unit 83 for selecting non-adjacent N frame positions from the positions of consecutive N frames and at least one frame position;
and a rendering unit 84, configured to perform a trailing rendering of the fluid particles based on non-adjacent N frame positions.
In some embodiments, rendering unit 84 is to: respectively setting corresponding particle size and attenuation curve for the positions of the non-adjacent N frames; and performing ball melting treatment on non-adjacent N frame positions based on the particle size and the attenuation curve.
In some embodiments, the particle sizes corresponding to non-adjacent N frame positions increase with increasing timing.
In some embodiments, the rendering apparatus of fluid particles may further include a distance adjusting unit 85, not shown in fig. 8, for: converting the non-adjacent N frame positions to N frame screen positions under a screen coordinate system; determining a distance between adjacent 2-frame screen positions based on the N-frame screen positions; determining a distance threshold corresponding to the positions of the adjacent 2 frames of screens based on the sizes of the particles corresponding to the positions of the adjacent 2 frames of screens; and if the distance between the adjacent 2-frame screen positions is larger than or equal to the distance threshold value, reducing the distance between the adjacent 2-frame screen positions.
Accordingly, the rendering unit 84 performs the ball-melting process on the non-adjacent N frame positions based on the particle size and the attenuation curve after the distance between the adjacent 2 frame screen positions is reduced by the distance adjusting unit 85.
In some embodiments, the distance threshold corresponding to the adjacent 2 frame screen positions is determined by:
distance threshold is a × particle size 1+ b × particle size 2;
wherein a and b are preset constants, and the particle size 1 and the particle size 2 are particle sizes corresponding to the screen positions of the adjacent 2 frames respectively.
In some embodiments, the N frame screen positions include: frame 1 screen position, frame 3 screen position, and frame 5 screen position.
The distance adjusting unit 85 is configured to:
fixing the 1 st frame screen position, and adjusting the 3 rd frame screen position until the distance between the 1 st frame screen position and the adjusted 3 rd frame screen position is smaller than a first distance threshold; the first distance threshold is a threshold determined based on the particle sizes corresponding to the 1 st frame screen position and the 3 rd frame screen position respectively;
fixing the adjusted 3 rd frame screen position, and adjusting the 5 th frame screen position until the distance between the adjusted 3 rd frame screen position and the adjusted 5 th frame screen position is smaller than a second distance threshold; the second distance threshold is a threshold determined based on the particle sizes corresponding to the 3 rd frame screen position and the 5 th frame screen position, respectively.
In some embodiments, the distance adjustment unit 85 is configured to: fixing any one of the adjacent 2-frame screen positions; determining a distance vector corresponding to the position of the adjacent 2 frames of screens based on the fixed position; and determining the screen position after the distance is reduced based on the fixed position, the distance vector, the distance between the adjacent 2 frames of screen positions and a distance threshold value.
In some embodiments, the reduced distance screen position is determined by:
the screen position after the distance reduction is the fixed position + distance vector x (distance threshold ÷ distance between adjacent 2-frame screen positions).
In some embodiments, the interpolation unit 82 is configured to: and if N is less than or equal to the preset frame number threshold, taking the position of the Nth frame as the center, and symmetrically arranging at least one of the position of the 1 st frame and the position of the (N-1) th frame to obtain at least one frame position of the same fluid particle.
In some embodiments, the selection unit 83 is configured to: selecting X frames from the positions of the continuous N frames and selecting Y frames from the at least one frame position; wherein X is a positive integer less than N, Y is a positive integer greater than or equal to 1, and X + Y ═ N.
In some embodiments, the N consecutive frames are 3 consecutive frames, and the preset frame number threshold is 3 frames.
In some embodiments, the interpolation unit 82 is configured to: and taking the position of the 3 rd frame as a center, and symmetrical the position of the 1 st frame to obtain the position of the 5 th frame of the same fluid particle.
In some embodiments, the selection unit 83 is configured to: the position of the 1 st frame, the position of the 3 rd frame and the position of the 5 th frame are selected.
For the technical details of the rendering apparatus for fluid particles disclosed in the above embodiments, reference may be made to the description of each embodiment of the rendering method for fluid particles, and in order to avoid repetition, the description is not repeated.
In some embodiments, the division of each unit in the rendering apparatus of the fluid particles is only one logic function division, and there may be another division manner in actual implementation, for example, at least two units in the rendering apparatus of the fluid particles may be implemented as one unit; each cell in the rendering apparatus of fluid particles may also be divided into a plurality of sub-cells. It will be understood that the various units or sub-units may be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application.
Fig. 9 is an exemplary block diagram of a system including at least one computing device and at least one storage device storing instructions provided by embodiments of the present disclosure. In some embodiments, the system may be used for big data processing, and the at least one computing device and the at least one storage device may be deployed in a distributed manner, making the system a distributed data processing cluster.
As shown in fig. 9, the system includes: at least one computing device 91, at least one storage device 92 storing instructions. It will be appreciated that the storage 92 in this embodiment may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory.
In some embodiments, storage 92 stores elements, executables or data structures, or a subset thereof, or an expanded set thereof: an operating system and an application program.
The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic tasks and processing hardware-based tasks. The application programs, including various application programs such as a Media Player (Media Player), a Browser (Browser), etc., are used to implement various application tasks. The program for implementing the rendering method for fluid particles provided by the embodiments of the present disclosure may be included in an application program.
In the embodiment of the present disclosure, the at least one computing device 91 is configured to execute the steps of the embodiments of the rendering method for fluid particles provided by the embodiment of the present disclosure by calling a program or an instruction stored in the at least one storage device 92, specifically, a program or an instruction stored in an application program.
The rendering method for the fluid particles provided by the embodiment of the present disclosure may be applied to the computing device 91, or implemented by the computing device 91. The computing device 91 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be implemented by integrated logic circuits of hardware or instructions in the form of software in the computing device 91. The computing device 91 may be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The steps of the rendering method for fluid particles provided by the embodiments of the present disclosure may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software units in the decoding processor. The software elements may be located in ram, flash, rom, prom, or eprom, registers, among other storage media that are well known in the art. The storage medium is located in a storage device 92, and the computing device 91 reads the information in the storage device 92 and performs the steps of the method in combination with the hardware thereof.
Embodiments of the present disclosure also provide a computer-readable storage medium storing a program or instructions, where the program or instructions, when executed by at least one computing device, cause the at least one computing device to perform steps of various embodiments of a rendering method for fluid particles, which are not described herein again to avoid repeated descriptions. The computing device may be the computing device 91 shown in fig. 9. In some embodiments, the computer-readable storage medium is a non-transitory computer-readable storage medium.
Embodiments of the present disclosure also provide a computer program product, where the computer program product includes a computer program, the computer program is stored in a non-transitory computer-readable storage medium, and at least one processor of the computer reads and executes the computer program from the storage medium, so that the computer executes the steps of the embodiments of the rendering method for fluid particles, and in order to avoid repeated descriptions, the description is omitted here.
Wherein the computer program product may write program code for carrying out operations for embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than others, combinations of features of different embodiments are meant to be within the scope of the disclosure and form different embodiments.
Those skilled in the art will appreciate that the description of each embodiment has a respective emphasis, and reference may be made to the related description of other embodiments for those parts of an embodiment that are not described in detail.
Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations fall within the scope defined by the appended claims.

Claims (16)

1. A method of rendering of fluid particles, the method comprising:
acquiring the positions of continuous N frames of the same fluid particle in a time sequence, wherein N is a positive integer greater than or equal to 2;
interpolating to obtain at least one frame position of the same fluid particle based on the positions of the continuous N frames;
selecting non-adjacent N frame positions from the positions of the continuous N frames and the at least one frame position;
and performing trailing rendering of the fluid particles based on the non-adjacent N-frame positions.
2. The method of claim 1, wherein the performing a hangover rendering of the fluid particles based on the non-adjacent N frame locations comprises:
respectively setting corresponding particle size and attenuation curve for the non-adjacent N frame positions;
and performing ball melting processing on the non-adjacent N frame positions based on the particle size and the attenuation curve.
3. The method of claim 2, wherein the setting the corresponding particle sizes for the non-adjacent N frame positions respectively comprises:
the sizes of the particles corresponding to the non-adjacent N frame positions are increased along with the increment of the time sequence.
4. The method of claim 2, wherein prior to said performing a global melting process on said non-adjacent N frame locations based on said particle size and said attenuation curve, said method further comprises:
converting the non-adjacent N frame positions to N frame screen positions under a screen coordinate system;
determining a distance between adjacent 2-frame screen positions based on the N-frame screen positions;
determining a distance threshold corresponding to the positions of the adjacent 2 frames of screens based on the sizes of the particles corresponding to the positions of the adjacent 2 frames of screens;
if the distance between the adjacent 2-frame screen positions is larger than or equal to the distance threshold, reducing the distance between the adjacent 2-frame screen positions.
5. The method of claim 4, wherein the distance threshold corresponding to the adjacent 2-frame screen position is determined by:
distance threshold is a × particle size 1+ b × particle size 2;
wherein a and b are preset constants, and the particle size 1 and the particle size 2 are particle sizes corresponding to the screen positions of the adjacent 2 frames respectively.
6. The method of claim 4, wherein the N frame screen positions comprise: a 1 st frame screen position, a 3 rd frame screen position and a 5 th frame screen position;
the narrowing the distance between the adjacent 2-frame screen positions comprises:
fixing the 1 st frame screen position, and adjusting the 3 rd frame screen position until the distance between the 1 st frame screen position and the adjusted 3 rd frame screen position is smaller than a first distance threshold; the first distance threshold is a threshold determined based on the particle sizes corresponding to the 1 st frame screen position and the 3 rd frame screen position respectively;
fixing the adjusted 3 rd frame screen position, and adjusting the 5 th frame screen position until the distance between the adjusted 3 rd frame screen position and the adjusted 5 th frame screen position is smaller than a second distance threshold; the second distance threshold is a threshold determined based on the particle sizes corresponding to the 3 rd frame screen position and the 5 th frame screen position respectively.
7. The method of any of claims 4 to 6, wherein said narrowing the distance between said adjacent 2 frame screen locations comprises:
fixing any one of the adjacent 2-frame screen positions;
determining a distance vector corresponding to the adjacent 2 frames of screen positions based on the fixed position;
and determining the screen position after the distance is reduced based on the fixed position, the distance vector, the distance between the adjacent 2 frames of screen positions and the distance threshold.
8. The method of claim 7, wherein the reduced distance screen position is determined by:
the screen position after the distance reduction is the fixed position + distance vector x (distance threshold ÷ distance between adjacent 2-frame screen positions).
9. The method of claim 1, wherein interpolating at least one frame of positions of the same fluid particle based on the positions of the consecutive N frames comprises:
and if N is less than or equal to the preset frame number threshold, taking the position of the Nth frame as the center, and symmetrically arranging at least one of the position of the 1 st frame and the position of the (N-1) th frame to obtain at least one frame position of the same fluid particle.
10. The method of claim 1, wherein said selecting non-adjacent N frame locations from the locations of the consecutive N frames and the at least one frame location comprises:
selecting X frames from the positions of the continuous N frames and selecting Y frames from the at least one frame position; wherein X is a positive integer less than N, Y is a positive integer greater than or equal to 1, and X + Y ═ N.
11. The method of claim 9, wherein the N consecutive frames are 3 consecutive frames and the preset frame number threshold is 3 frames.
12. The method of claim 11, wherein interpolating at least one frame of positions of the same fluid particle based on the positions of the consecutive N frames comprises:
and taking the position of the 3 rd frame as a center, and symmetrical the position of the 1 st frame to obtain the position of the 5 th frame of the same fluid particle.
13. The method of claim 12, wherein said selecting non-adjacent N frame locations from the locations of the consecutive N frames and the at least one frame location comprises:
the position of the 1 st frame, the position of the 3 rd frame and the position of the 5 th frame are selected.
14. An apparatus for rendering of fluid particles, the apparatus comprising:
the device comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for acquiring the positions of N continuous frames of the same fluid particle in a time sequence, and N is a positive integer greater than or equal to 2;
the interpolation unit is used for interpolating to obtain at least one frame position of the same fluid particle based on the positions of the continuous N frames;
a selecting unit, configured to select non-adjacent N frame positions from the positions of the consecutive N frames and the at least one frame position;
and the rendering unit is used for performing trailing rendering on the fluid particles based on the non-adjacent N-frame positions.
15. A system comprising at least one computing device and at least one storage device storing instructions, wherein the instructions, when executed by the at least one computing device, cause the at least one computing device to perform the steps of the method of rendering fluid particles according to any one of claims 1 to 13.
16. A computer readable storage medium, wherein the computer readable storage medium stores a program or instructions which, when executed by at least one computing device, causes the at least one computing device to perform the steps of the method of rendering fluid particles according to any one of claims 1 to 13.
CN202111521903.0A 2021-12-13 2021-12-13 Rendering method, device and system of fluid particles and storage medium Pending CN114202598A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111521903.0A CN114202598A (en) 2021-12-13 2021-12-13 Rendering method, device and system of fluid particles and storage medium
PCT/CN2022/136692 WO2023109555A1 (en) 2021-12-13 2022-12-05 Fluid particle rendering method, apparatus, system, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111521903.0A CN114202598A (en) 2021-12-13 2021-12-13 Rendering method, device and system of fluid particles and storage medium

Publications (1)

Publication Number Publication Date
CN114202598A true CN114202598A (en) 2022-03-18

Family

ID=80653267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111521903.0A Pending CN114202598A (en) 2021-12-13 2021-12-13 Rendering method, device and system of fluid particles and storage medium

Country Status (2)

Country Link
CN (1) CN114202598A (en)
WO (1) WO2023109555A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023109555A1 (en) * 2021-12-13 2023-06-22 北京字跳网络技术有限公司 Fluid particle rendering method, apparatus, system, and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722647B (en) * 2012-05-30 2016-01-06 北京像素软件科技股份有限公司 A kind of method and device generating band particle path based on motion path
US10121221B2 (en) * 2016-01-18 2018-11-06 Advanced Micro Devices, Inc. Method and apparatus to accelerate rendering of graphics images
CN109688346B (en) * 2018-12-28 2021-04-27 广州方硅信息技术有限公司 Method, device and equipment for rendering trailing special effect and storage medium
CN112700518B (en) * 2020-12-28 2023-04-07 北京字跳网络技术有限公司 Method for generating trailing visual effect, method for generating video and electronic equipment
CN114202598A (en) * 2021-12-13 2022-03-18 北京字跳网络技术有限公司 Rendering method, device and system of fluid particles and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023109555A1 (en) * 2021-12-13 2023-06-22 北京字跳网络技术有限公司 Fluid particle rendering method, apparatus, system, and storage medium

Also Published As

Publication number Publication date
WO2023109555A1 (en) 2023-06-22

Similar Documents

Publication Publication Date Title
CN108228050B (en) Picture scaling method and device and electronic equipment
US11481908B2 (en) Data processing method and computing device
US20200327078A1 (en) Data processing method and device, dma controller, and computer readable storage medium
CN112036236B (en) Image detection method, device and medium based on GhostNet
CN114202598A (en) Rendering method, device and system of fluid particles and storage medium
US11543299B2 (en) Method, apparatus, touch chip and electronic device for determining temperature status of touch screen
CN107766703B (en) Watermark adding processing method and device and client
KR20210070369A (en) Data reading/writing method and system, storage medium and terminal during 3D image processing
CN116245051A (en) Simulation software rendering method and device, storage medium and electronic equipment
CN107977923B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN115019148A (en) Target detection method
US11663453B2 (en) Information processing apparatus and memory control method
CN104517273A (en) Image super-resolution processing method and apparatus
CN114863206A (en) Model training method, target detection method and device
CN116188633B (en) Method, device, medium and electronic equipment for generating simulated remote sensing image
CN113379600A (en) Short video super-resolution conversion method, device and medium based on deep learning
CN110262732B (en) Picture moving method and device
CN111523539A (en) Character detection method and device
CN113407029B (en) Page object state information determining method, device, equipment and readable medium
CN117173321B (en) Method and device for selecting three-dimensional reconstruction texture view
CN116126750B (en) Data processing method and device based on hardware characteristics
CN116107636B (en) Hardware acceleration method and device, storage medium and electronic equipment
CN113361703B (en) Data processing method and device
CN117726760A (en) Training method and device for three-dimensional human body reconstruction model of video
CN116430841A (en) Ground robot speed continuous obstacle avoidance track optimization method and system

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