Special effects video generation method, device, equipment and storage medium

By determining the motion information and surface state of the virtual fluid and rendering, the problem of low efficiency of fluid motion special effects video generation in the prior art is solved, and efficient fluid motion special effects video generation is achieved.

CN114663553BActive Publication Date: 2025-04-01BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210273163.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-18
Publication Date
2025-04-01
Estimated Expiration
2042-03-18

AI Technical Summary

Technical Problem

The existing fluid simulation algorithm has a large budget and cannot generate fluid motion special effects videos in real time.

Method used

By determining the motion information of the virtual fluid in the current frame and the state information of the virtual fluid surface in the previous frame, the state information of the fluid surface in the current frame is determined based on these information, and rendering it to generate a fluid motion special effect diagram.

Benefits of technology

The calculation amount of simulated fluid motion is reduced and the efficiency of fluid motion special effects video generation is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114663553B_ABST
    Figure CN114663553B_ABST
Patent Text Reader

Abstract

The disclosed embodiments disclose a special effects video generation method, apparatus, device and storage medium. Determine the motion information of the virtual fluid in the current frame and the first state information of the virtual fluid surface in the previous frame; wherein the virtual fluid is placed in a virtual container; determine the second state information of the virtual fluid surface in the current frame based on the motion information and the first state information; wherein the second state information includes second fluid surface orientation information and second disturbance information; render the fluid surface state of the current frame according to the second fluid surface orientation information and the second disturbance information, and obtain the fluid motion special effects map corresponding to the current frame. The disclosed embodiments render the fluid surface state through the second fluid surface orientation information and the second disturbance information of the current frame to obtain the fluid motion special effects map corresponding to the current frame, which can reduce the amount of calculation for simulating fluid motion, thereby improving the efficiency of generating fluid motion special effects videos.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the technical field of image special effects processing, and in particular to a special effects video generation method, device, equipment and storage medium. Background Art

[0002] Most of the existing flow object (referred to as fluid) simulation algorithms are based on the Particle Base Dynamics (PBD) algorithm, which abstracts the fluid into multiple particles and calculates the motion state of the particles in each frame to generate a video with fluid motion effects. However, this algorithm has a large budget and cannot generate a video with fluid motion effects in real time. Summary of the invention

[0003] The embodiments of the present disclosure provide a special effects video generation method, device, equipment and storage medium, which can reduce the amount of calculation for simulating fluid motion, thereby improving the efficiency of fluid motion special effects video generation.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for generating a special effects video, including:

[0005] Determining motion information of a virtual fluid in a current frame and first state information of a surface of the virtual fluid in a previous frame; wherein the virtual fluid is placed in a virtual container;

[0006] Determine second state information of the virtual fluid surface in the current frame based on the motion information and the first state information; wherein the second state information includes second fluid surface orientation information and second disturbance information;

[0007] The fluid surface state of the current frame is rendered according to the second fluid surface orientation information and the second disturbance information to obtain a fluid motion special effects image corresponding to the current frame.

[0008] In a second aspect, the embodiments of the present disclosure further provide a special effects video generation device, including:

[0009] A motion information determination module, used to determine the motion information of the virtual fluid in the current frame and the first state information of the surface of the virtual fluid in the previous frame; wherein the virtual fluid is placed in a virtual container;

[0010] A second state information determination module, configured to determine second state information of the virtual fluid surface in a current frame based on the motion information and the first state information; wherein the second state information includes second fluid surface orientation information and second disturbance information;

[0011] The fluid motion special effects image acquisition module is used to render the fluid surface state of the current frame according to the second fluid surface orientation information and the second disturbance information to obtain the fluid motion special effects image corresponding to the current frame.

[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0013] one or more processing devices;

[0014] A storage device for storing one or more programs;

[0015] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the special effects video generation method as described in the embodiment of the present disclosure.

[0016] In a fourth aspect, the embodiments of the present disclosure further provide a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the special effects video generation method as described in the embodiments of the present disclosure is implemented.

[0017] The disclosed embodiments disclose a special effects video generation method, apparatus, device and storage medium. Determine the motion information of the virtual fluid in the current frame and the first state information of the virtual fluid surface in the previous frame; wherein the virtual fluid is placed in a virtual container; determine the second state information of the virtual fluid surface in the current frame based on the motion information and the first state information; wherein the second state information includes the second fluid surface orientation information and the second disturbance information; render the fluid surface state of the current frame according to the second fluid surface orientation information and the second disturbance information, and obtain the fluid motion special effects map corresponding to the current frame. The disclosed embodiments render the fluid surface state by using the second fluid surface orientation information and the second disturbance information of the current frame to obtain the fluid motion special effects map corresponding to the current frame, which can reduce the amount of calculation for simulating fluid motion, thereby improving the efficiency of generating fluid motion special effects videos. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flow chart of a special effects video generation method in an embodiment of the present disclosure;

[0019] Figure 2 is an example diagram of a water motion special effect image in an embodiment of the present disclosure;

[0020] Figure 3 is a structural schematic diagram of a special effects video generating device in an embodiment of the present disclosure;

[0021] Figure 4 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0022] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, but rather these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0023] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0024] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0025] It should be noted that the concepts such as “first” and “second” mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0026] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0027] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0028] Figure 1 This is a flowchart of a special effect video generation method provided by an embodiment of the present disclosure. This embodiment can be applied to the case of simulating the motion state of a virtual fluid. The method can be executed by a special effect video generation device, which can be composed of hardware and / or software and can generally be integrated in a device with a special effect image generation function, which can be an electronic device such as a server, a mobile terminal or a server cluster. Figure 1 As shown, the method specifically comprises the following steps:

[0029] S110, determining the motion information of the virtual fluid in the current frame and the first state information of the surface of the virtual fluid in the previous frame.

[0030] The virtual fluid is placed in a virtual container. The motion information of the current frame may include motion speed and acceleration. The first state information of the previous frame may include first disturbance information, first fluid surface orientation information, first fluid surface motion speed and first swing amplitude. The first disturbance information may be information about the disturbance added to the fluid surface in the previous frame to generate waves; the first fluid surface orientation information may be represented by normal information (such as normal vector) of the fluid surface in the previous frame.

[0031] Optionally, the method of determining the motion information of the virtual fluid in the current frame may be: determining the motion information of the mobile terminal in the current frame as the motion information of the virtual fluid in the current frame; or, identifying the limbs of the person in the picture; and determining the motion information of the virtual fluid in the current frame using the motion information of the limbs of the person in the current frame.

[0032] In this embodiment, when the user turns on the camera in the terminal device, a virtual container (such as a transparent virtual water cup or a transparent virtual fish tank, etc.) is generated in the current screen, and a virtual fluid (such as water, milk or a colored beverage, etc.) is generated in the virtual container. When the user swings the mobile terminal, the virtual container and the virtual fluid move with the swinging mobile terminal, or, when a person's limbs (such as the head, legs, body or arms, etc.) are detected in the screen, and when the person's limbs move, the virtual container and the virtual fluid move with the movement of the person's limbs. In this embodiment, the simulation of the movement state of the virtual fluid in the virtual container is realized, so that the virtual fluid moves with the movement of the container like a real fluid.

[0033] Optionally, the method for determining the motion information of the virtual fluid in the current frame may be: obtaining the first position information of the virtual fluid in the current frame and the second position information of the virtual fluid in the previous frame; determining the movement speed of the virtual fluid in the current frame according to the first position information and the second position information; obtaining the movement speed of the virtual fluid in the previous frame; and determining the acceleration of the virtual fluid in the current frame according to the movement speed of the current frame and the movement speed of the previous frame.

[0034] In this embodiment, the virtual fluid moves with the virtual container, and the position information of the virtual fluid can be determined by the position information of the center point of the virtual container. If the motion information of the mobile terminal in the current frame is determined as the motion information of the virtual fluid in the current frame, the virtual container moves with the mobile terminal, so the position information of the virtual container can be determined by obtaining the position information of any point of the mobile terminal. If the motion information of the human body in the current frame is used to determine the motion information of the virtual fluid in the current frame, the virtual container moves with the motion of the human body, so the position information of the virtual container can be determined by obtaining the position information of any key point of the human body. Assume that the three-dimensional position coordinates of the center point of the virtual container in the current frame are P t , the three-dimensional position coordinates of the center point of the virtual container in the previous frame are P t-1 , then the velocity of the virtual fluid in the current frame is: u t =P t -P t-1 , the acceleration is d t =u t -u t-1 All parameters appearing in this embodiment are three-dimensional parameters and will not be described in detail below.

[0035] S120, determining second state information of the virtual fluid surface in the current frame based on the motion information and the first state information.

[0036] The second state information includes second fluid surface orientation information and second disturbance information. The second disturbance information can be information about the disturbance added to the fluid surface in the current frame to generate waves; the second fluid surface orientation information can be represented by normal information (such as normal vector) of the fluid surface in the current frame.

[0037] Specifically, the process of determining the second state information of the virtual fluid surface in the current frame based on the motion information and the first state information can be: determining the second swing amplitude and initial fluid surface orientation information of the virtual fluid surface in the current frame according to the motion information and the first state information; determining the second fluid surface orientation information based on the second swing amplitude and the initial fluid surface orientation information; determining the second disturbance information based on the second swing amplitude and the first disturbance information.

[0038] The initial fluid surface orientation information may be an initial normal vector of the fluid surface in the current frame.

[0039] In this embodiment, the process of determining the initial fluid surface orientation information of the virtual fluid surface in the current frame based on the motion information and the first state information can be: determining the second fluid surface movement speed based on the acceleration and the first fluid surface movement speed; obtaining the set rotation matrix corresponding to the set Euler angle; and determining the initial fluid surface orientation information based on the set rotation matrix and the second fluid surface movement speed.

[0040] The second fluid surface velocity can be determined according to the acceleration and the first fluid surface velocity by the following formula: t =0.6·v t-1 -0.4 d t-1 The set Euler angle can be (0, 180°, 0). The set rotation matrix corresponding to the set Euler angle can be understood as a four-element rotation matrix rotating around the set Euler angle. The set rotation matrix can be expressed as Q u , then according to the set rotation matrix and the second fluid surface velocity, the initial fluid surface orientation information can be calculated according to the following formula: N t =Q u ·(-0.5·v t +0.5n), where n is the gravity vector (0, 1, 0).

[0041] Specifically, the method for determining the second swing amplitude of the virtual fluid surface in the current frame according to the motion information and the first state information can be: determining the first angular velocity of the fluid surface in the current frame; determining the second swing amplitude based on the first angular velocity, the first swing amplitude, the motion speed and the first fluid surface orientation information.

[0042] The calculation formula for determining the second swing amplitude based on the first angular velocity, the first swing amplitude, the movement speed and the first fluid surface orientation information can be expressed as: m t =0.02(m t-1.x +0.05 N t-1.x +A t-1.z , m t-1.y +0.002 u t.y , m t-1.z +0.05 N t-1.z +A t-1.x ), where m t is the second swing amplitude of the current frame, m t-1.x , m t-1.y ,m t-1.z are the x-direction component, y-direction component and z-direction component of the second swing amplitude respectively, N t-1.x ,N t-1.z are the x-direction component and the z-direction component of the first fluid surface orientation information, A t-1.x ,A t-1.z are the x-direction component and the z-direction component of the first angular velocity respectively.

[0043] Specifically, the second angular velocity of the fluid surface in the current frame can be determined by: obtaining the first rotation matrix of the virtual fluid in the previous frame and the second rotation matrix in the current frame; determining the rotation axis information according to the first rotation matrix and the second rotation matrix, and obtaining the first angular velocity of the fluid surface in the previous frame; determining the second angular velocity according to the first angular velocity and the rotation axis information.

[0044] The first rotation matrix and the second rotation matrix can both be obtained by a posture sensor (such as a gyroscope sensor) installed in the mobile terminal. The process of determining the rotation axis information according to the first rotation matrix and the second rotation matrix can be: converting the matrix obtained by multiplying the second rotation matrix and the first rotation matrix to obtain the rotation axis information. Assume that the second rotation matrix is ​​represented by Q t , then the first rotation matrix is ​​expressed as Q t-1 , for Q t Q t-1 Do the conversion and get the rotation axis c t Then the formula for determining the second angular velocity from the first angular velocity and the rotation axis information can be: t =Q u ·(0.5·(0.9·A t-1 +0.09 A t-1 c t )-0.5·n), where n is the gravity vector. Similarly, the first angular velocity of the previous frame can also be calculated according to the above formula.

[0045] In this embodiment, in order to simulate the real fluid motion state, the swing amplitude of the fluid surface needs to be considered. Specifically, the method of determining the second fluid surface orientation information based on the second swing amplitude and the initial fluid surface orientation information can be: determining the disturbance angle based on the initial fluid surface orientation information and the gravity vector; determining the disturbance vector based on the disturbance angle and the volume of the virtual container; determining the second fluid surface orientation information based on the disturbance vector, the second swing amplitude and the initial fluid surface orientation information.

[0046] Among them, the calculation formula of the disturbance angle can be: N t is the initial fluid surface orientation information, and n is the gravity vector. The calculation formula of the disturbance vector can be expressed as: Wherein, V is the volume of the virtual container, t is the timestamp of the current frame, and β is the disturbance angle. The calculation formula for determining the second fluid surface orientation information according to the disturbance vector, the second swing amplitude, and the initial fluid surface orientation information is: t =Γ(m t.x *s t.x +0.25 N t.x , 1.0, m t.z *st.y +0.25 N t.z ), where Γ() represents the normalization of the vector, m t.x ,m t.z represent the x-direction component and z-direction component of the second swing amplitude respectively, N t.x ,N t.z They represent the x-direction component and the z-direction component of the initial fluid surface orientation information, s t.x ,s t.y are the x- and y-direction components of the disturbance vector respectively.

[0047] Specifically, the calculation formula for determining the second disturbance information based on the second swing amplitude and the first disturbance information may be: Among them, h t is the second disturbance information of the current frame, h t-1 is the first disturbance information of the previous frame.

[0048] S130, rendering the fluid surface state of the current frame according to the second fluid surface orientation information and the second disturbance information, to obtain a fluid motion special effects image corresponding to the current frame.

[0049] Specifically, after obtaining the second fluid surface orientation information w of the current frame t and the second disturbance information h t , w t and h t Pass it to the rendering shader to obtain the fluid motion special effects map corresponding to the current frame.

[0050] Specifically, the fluid surface state of the current frame is rendered according to the second fluid surface orientation information and the second disturbance information, and the process of obtaining the fluid motion special effects image corresponding to the current frame can be: determining the initial fluid surface state according to the second fluid surface orientation information; superimposing the second disturbance information on the initial fluid surface state to obtain the target fluid surface state; rendering the target fluid surface state to obtain the fluid motion special effects image corresponding to the current frame.

[0051] Among them, the second fluid surface orientation information is represented by a normal vector, and the normal vector is perpendicular to the fluid surface. Therefore, according to the normal vector, the plane function corresponding to the initial fluid surface state can be obtained. The second disturbance information can be superimposed on the initial fluid surface state by: inputting the second disturbance information into a set noise function to obtain a noise function carrying the second disturbance information, linearly superimposing the noise function with the plane function corresponding to the initial surface state, and obtaining a state function corresponding to the target fluid surface state. Finally, the target fluid surface state is rendered based on the state function to obtain a fluid motion special effects image corresponding to the current frame. Exemplary, Figure 2is an example of a water motion special effect image in this embodiment. Figure 2 As shown, the motion state of the water surface in this frame is demonstrated.

[0052] The technical solution of the disclosed embodiment determines the motion information of the virtual fluid in the current frame and the first state information of the virtual fluid surface in the previous frame; wherein the virtual fluid is placed in a virtual container; based on the motion information and the first state information, the second state information of the virtual fluid surface in the current frame is determined; wherein the second state information includes second fluid surface orientation information and second disturbance information; the fluid surface state of the current frame is rendered according to the second fluid surface orientation information and the second disturbance information to obtain a fluid motion special effects graph corresponding to the current frame. The disclosed embodiment renders the fluid surface state by using the second fluid surface orientation information and the second disturbance information of the current frame to obtain a fluid motion special effects graph corresponding to the current frame, which can reduce the amount of calculation for simulating fluid motion, thereby improving the efficiency of generating fluid motion special effects videos.

[0053] Figure 3 is a structural diagram of a special effect video generating device provided by an embodiment of the present disclosure, such as Figure 3 As shown, the device comprises:

[0054] The motion information determination module 210 is used to determine the motion information of the virtual fluid in the current frame and the first state information of the surface of the virtual fluid in the previous frame; wherein the virtual fluid is placed in a virtual container;

[0055] A second state information determination module 220, configured to determine second state information of the virtual fluid surface in a current frame based on the motion information and the first state information; wherein the second state information includes second fluid surface orientation information and second disturbance information;

[0056] The fluid motion special effects image acquisition module 230 is used to render the fluid surface state of the current frame according to the second fluid surface orientation information and the second disturbance information to obtain the fluid motion special effects image corresponding to the current frame.

[0057] Optionally, the motion information includes motion speed and acceleration, and the first state information includes first disturbance information, first fluid surface orientation information, first fluid surface motion speed and first swing amplitude.

[0058] Optionally, the motion information determination module 210 is further configured to:

[0059] Determine the motion information of the mobile terminal in the current frame as the motion information of the virtual fluid in the current frame; or,

[0060] Identify the body parts of people in the picture;

[0061] The motion information of the character's limbs in the current frame is used to determine the motion information of the virtual fluid in the current frame.

[0062] Optionally, the motion information determination module 210 is further configured to:

[0063] Acquire first position information of the virtual fluid in the current frame and second position information of the virtual fluid in the previous frame;

[0064] determining a movement speed of the virtual fluid in a current frame according to the first position information and the second position information;

[0065] Obtaining the movement speed of the virtual fluid in the previous frame;

[0066] The acceleration of the virtual fluid in the current frame is determined according to the movement speed of the current frame and the movement speed of the previous frame.

[0067] Optionally, the second state information determining module 220 is further configured to:

[0068] Determine a second swing amplitude of the virtual fluid surface in a current frame and initial fluid surface orientation information according to the motion information and the first state information;

[0069] Determining second fluid surface orientation information based on the second swing amplitude and the initial fluid surface orientation information;

[0070] Second disturbance information is determined based on the second swing amplitude and the first disturbance information.

[0071] Optionally, the second state information determining module 220 is further configured to:

[0072] Determining a first angular velocity of the fluid surface in a previous frame;

[0073] A second swing amplitude is determined based on the first angular velocity, the first swing amplitude, the movement speed, and the first fluid surface orientation information.

[0074] Optionally, the second state information determining module 220 is further configured to:

[0075] Obtaining a first rotation matrix of the virtual fluid in a previous frame and a second rotation matrix in a current frame;

[0076] Determine the rotation axis information according to the first rotation matrix and the second rotation matrix, and obtain the first angular velocity of the fluid surface in the previous frame;

[0077] A second angular velocity is determined according to the first angular velocity and the rotation axis information.

[0078] Optionally, the second state information determining module 220 is further configured to:

[0079] determining a second fluid surface velocity according to the acceleration and the first fluid surface velocity;

[0080] Get the set rotation matrix corresponding to the set Euler angle;

[0081] Initial fluid surface orientation information is determined according to the set rotation matrix and the second fluid surface movement speed.

[0082] Optionally, the second state information determining module 220 is further configured to:

[0083] Determining a disturbance angle according to the initial fluid surface orientation information and a gravity vector;

[0084] determining a disturbance vector based on the disturbance angle and the volume of the virtual container;

[0085] The second fluid surface orientation information is determined according to the disturbance vector, the second swing amplitude and the initial fluid surface orientation information.

[0086] Optionally, the fluid motion special effects image acquisition module 230 is further configured to:

[0087] determining an initial fluid surface state according to the second fluid surface orientation information;

[0088] superimposing the second disturbance information onto the initial fluid surface state to obtain a target fluid surface state;

[0089] The surface state of the target fluid is rendered to obtain a fluid motion special effects image corresponding to the current frame.

[0090] The above device can execute the methods provided by all the above embodiments of the present disclosure, and has the corresponding functional modules and beneficial effects of executing the above methods. For technical details not fully described in this embodiment, please refer to the methods provided by all the above embodiments of the present disclosure.

[0091] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device 300 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc., or various forms of servers, such as independent servers or server clusters. Figure 4The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0092] like Figure 4 As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only storage device (ROM) 302 or a program loaded from a storage device 308 to a random access storage device (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0093] Typically, the following devices may be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 309. The communication devices 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0094] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing a method for recommending words. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 309, or installed from a storage device 308, or installed from a ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0095] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0096] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0097] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0098] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: determines the motion information of the virtual fluid in the current frame and the first state information of the virtual fluid surface in the previous frame; wherein the virtual fluid is placed in a virtual container; determines the second state information of the virtual fluid surface in the current frame based on the motion information and the first state information; wherein the second state information includes second fluid surface orientation information and second disturbance information; renders the fluid surface state of the current frame according to the second fluid surface orientation information and the second disturbance information, and obtains the fluid motion special effects diagram corresponding to the current frame.

[0099] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0100] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0101] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0102] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0103] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0104] According to one or more embodiments of the present disclosure, the present disclosure discloses a method for generating a special effects video, including:

[0105] Determining motion information of a virtual fluid in a current frame and first state information of a surface of the virtual fluid in a previous frame; wherein the virtual fluid is placed in a virtual container;

[0106] Determine second state information of the virtual fluid surface in the current frame based on the motion information and the first state information; wherein the second state information includes second fluid surface orientation information and second disturbance information;

[0107] The fluid surface state of the current frame is rendered according to the second fluid surface orientation information and the second disturbance information to obtain a fluid motion special effects image corresponding to the current frame.

[0108] Furthermore, the motion information includes motion speed and acceleration, and the first state information includes first disturbance information, first fluid surface orientation information, first fluid surface motion speed and first swing amplitude.

[0109] Furthermore, the motion information of the virtual fluid in the current frame is determined, including:

[0110] Determine the motion information of the mobile terminal in the current frame as the motion information of the virtual fluid in the current frame; or,

[0111] Identify the body parts of people in the picture;

[0112] The motion information of the character's limbs in the current frame is used to determine the motion information of the virtual fluid in the current frame.

[0113] Furthermore, the motion information of the virtual fluid in the current frame is determined, including:

[0114] Acquire first position information of the virtual fluid in the current frame and second position information of the virtual fluid in the previous frame;

[0115] determining a movement speed of the virtual fluid in a current frame according to the first position information and the second position information;

[0116] Obtaining the movement speed of the virtual fluid in the previous frame;

[0117] The acceleration of the virtual fluid in the current frame is determined according to the movement speed of the current frame and the movement speed of the previous frame.

[0118] Further, determining second state information of the virtual fluid surface in the current frame based on the motion information and the first state information includes:

[0119] Determine a second swing amplitude of the virtual fluid surface in a current frame and initial fluid surface orientation information according to the motion information and the first state information;

[0120] Determining second fluid surface orientation information based on the second swing amplitude and the initial fluid surface orientation information;

[0121] Second disturbance information is determined based on the second swing amplitude and the first disturbance information.

[0122] Further, determining a second swing amplitude of the virtual fluid surface in a current frame according to the motion information and the first state information includes:

[0123] Determining a first angular velocity of the fluid surface in a previous frame;

[0124] A second swing amplitude is determined based on the first angular velocity, the first swing amplitude, the movement speed, and the first fluid surface orientation information.

[0125] Further, determining a second angular velocity of the fluid surface in the current frame includes:

[0126] Obtaining a first rotation matrix of the virtual fluid in a previous frame and a second rotation matrix in a current frame;

[0127] Determine the rotation axis information according to the first rotation matrix and the second rotation matrix, and obtain the first angular velocity of the fluid surface in the previous frame;

[0128] A second angular velocity is determined according to the first angular velocity and the rotation axis information.

[0129] Further, determining initial fluid surface orientation information of the virtual fluid surface in the current frame according to the motion information and the first state information includes:

[0130] determining a second fluid surface velocity according to the acceleration and the first fluid surface velocity;

[0131] Get the set rotation matrix corresponding to the set Euler angle;

[0132] Initial fluid surface orientation information is determined according to the set rotation matrix and the second fluid surface movement speed.

[0133] Further, determining the second fluid surface orientation information based on the second swing amplitude and the initial fluid surface orientation information includes:

[0134] Determining a disturbance angle according to the initial fluid surface orientation information and a gravity vector;

[0135] determining a disturbance vector based on the disturbance angle and the volume of the virtual container;

[0136] The second fluid surface orientation information is determined according to the disturbance vector, the second swing amplitude and the initial fluid surface orientation information.

[0137] Further, rendering the fluid surface state of the current frame according to the second fluid surface orientation information and the second disturbance information to obtain a fluid motion special effects image corresponding to the current frame includes:

[0138] determining an initial fluid surface state according to the second fluid surface orientation information;

[0139] superimposing the second disturbance information onto the initial fluid surface state to obtain a target fluid surface state;

[0140] The surface state of the target fluid is rendered to obtain a fluid motion special effects image corresponding to the current frame.

[0141] Note that the above are only preferred embodiments of the present disclosure and the technical principles used. Those skilled in the art will understand that the present disclosure is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present disclosure. Therefore, although the present disclosure is described in more detail through the above embodiments, the present disclosure is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present disclosure, and the scope of the present disclosure is determined by the scope of the attached claims.

Claims

1. A special effects video generation method, characterized in that: include: Determining motion information of a virtual fluid in a current frame and first state information of a surface of the virtual fluid in a previous frame; wherein the virtual fluid is placed in a virtual container; Determine second state information of the virtual fluid surface in the current frame based on the motion information and the first state information; wherein the second state information includes second fluid surface orientation information and second disturbance information; Rendering the fluid surface state of the current frame according to the second fluid surface orientation information and the second disturbance information to obtain a fluid motion special effects image corresponding to the current frame; The motion information includes motion speed and acceleration, and the first state information includes first disturbance information, first fluid surface orientation information, first fluid surface motion speed and first swing amplitude; the first disturbance information is the disturbance information added to the fluid surface in the previous frame.

2. The method according to claim 1, characterized in that Determine the motion information of the virtual fluid in the current frame, including: Determine the motion information of the mobile terminal in the current frame as the motion information of the virtual fluid in the current frame; or, Identify the body parts of people in the picture; The motion information of the character's limbs in the current frame is used to determine the motion information of the virtual fluid in the current frame.

3. The method according to claim 2, characterized in that Determine the motion information of the virtual fluid in the current frame, including: Acquire first position information of the virtual fluid in the current frame and second position information of the virtual fluid in the previous frame; determining a movement speed of the virtual fluid in a current frame according to the first position information and the second position information; Obtaining the movement speed of the virtual fluid in the previous frame; The acceleration of the virtual fluid in the current frame is determined according to the movement speed of the current frame and the movement speed of the previous frame.

4. The method according to claim 1, characterized in that Determining second state information of the virtual fluid surface in the current frame based on the motion information and the first state information includes: Determine a second swing amplitude of the virtual fluid surface in a current frame and initial fluid surface orientation information according to the motion information and the first state information; Determining second fluid surface orientation information based on the second swing amplitude and the initial fluid surface orientation information; Second disturbance information is determined based on the second swing amplitude and the first disturbance information.

5. The method according to claim 4, characterized in that Determining a second swing amplitude of the virtual fluid surface in a current frame according to the motion information and the first state information includes: Determining a first angular velocity of the fluid surface in a previous frame; A second swing amplitude is determined based on the first angular velocity, the first swing amplitude, the movement speed, and the first fluid surface orientation information.

6. The method according to claim 5, characterized in that Determining a second angular velocity of the fluid surface in a current frame includes: Obtaining a first rotation matrix of the virtual fluid in a previous frame and a second rotation matrix in a current frame; Determine the rotation axis information according to the first rotation matrix and the second rotation matrix, and obtain the first angular velocity of the fluid surface in the previous frame; A second angular velocity is determined according to the first angular velocity and the rotation axis information.

7. The method according to claim 4, characterized in that Determining initial fluid surface orientation information of the virtual fluid surface in the current frame according to the motion information and the first state information includes: determining a second fluid surface velocity according to the acceleration and the first fluid surface velocity; Get the set rotation matrix corresponding to the set Euler angle; Initial fluid surface orientation information is determined according to the set rotation matrix and the second fluid surface movement speed.

8. The method according to claim 4, characterized in that Determining second fluid surface orientation information based on the second swing amplitude and the initial fluid surface orientation information includes: Determining a disturbance angle according to the initial fluid surface orientation information and a gravity vector; determining a disturbance vector based on the disturbance angle and the volume of the virtual container; The second fluid surface orientation information is determined according to the disturbance vector, the second swing amplitude and the initial fluid surface orientation information.

9. The method according to claim 1, characterized in that: Rendering the fluid surface state of the current frame according to the second fluid surface orientation information and the second disturbance information to obtain a fluid motion special effects graph corresponding to the current frame includes: determining an initial fluid surface state according to the second fluid surface orientation information; superimposing the second disturbance information onto the initial fluid surface state to obtain a target fluid surface state; The surface state of the target fluid is rendered to obtain a fluid motion special effects image corresponding to the current frame.

10. A special effects video generation device, characterized in that: include: A motion information determination module, used to determine the motion information of the virtual fluid in the current frame and the first state information of the surface of the virtual fluid in the previous frame; wherein the virtual fluid is placed in a virtual container; A second state information determination module, configured to determine second state information of the virtual fluid surface in a current frame based on the motion information and the first state information; wherein the second state information includes second fluid surface orientation information and second disturbance information; A fluid motion special effects image acquisition module, used for rendering the fluid surface state of the current frame according to the second fluid surface orientation information and the second disturbance information, to obtain the fluid motion special effects image corresponding to the current frame; The motion information includes motion speed and acceleration, and the first state information includes first disturbance information, first fluid surface orientation information, first fluid surface motion speed and first swing amplitude; the first disturbance information is the disturbance information added to the fluid surface in the previous frame.

11. An electronic device, characterized in that: The electronic device comprises: one or more processing devices; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the special effects video generation method as described in any one of claims 1-9.

12. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the special effects video generation method as described in any one of claims 1-9 is implemented.

Citation Information

Patent Citations

  • Disturbing fluid rendering method and device

    CN108182721A

  • Virtual content display method and device, terminal equipment and storage medium

    CN111459263A

  • Image special effect generation method and device, electronic equipment and storage medium

    CN112634420A