CN108921927B - Particle-based firework special effect realization method, device and equipment - Google Patents

Particle-based firework special effect realization method, device and equipment Download PDF

Info

Publication number
CN108921927B
CN108921927B CN201810598120.4A CN201810598120A CN108921927B CN 108921927 B CN108921927 B CN 108921927B CN 201810598120 A CN201810598120 A CN 201810598120A CN 108921927 B CN108921927 B CN 108921927B
Authority
CN
China
Prior art keywords
particle
calculating
map
rendering
emission
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.)
Active
Application number
CN201810598120.4A
Other languages
Chinese (zh)
Other versions
CN108921927A (en
Inventor
谭旻
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201810598120.4A priority Critical patent/CN108921927B/en
Publication of CN108921927A publication Critical patent/CN108921927A/en
Application granted granted Critical
Publication of CN108921927B publication Critical patent/CN108921927B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/56Particle system, point based geometry or rendering

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)

Abstract

The embodiment of the specification discloses a particle-based firework special effect realization method, device and equipment. The scheme comprises the following steps: acquiring a particle map used for representing particles, wherein the particle map comprises a particle tail; calculating the elapsed time after each particle has been emitted; calculating the position and the speed direction of each particle according to the running time; according to the speed direction, calculating a direction to which the particle map corresponding to each particle needs to be rotated when rendering, wherein the rotation is used for enabling the trailing direction of the particle to be consistent with the speed direction of the corresponding particle; and rendering to obtain the image frame after each particle is emitted according to the position, the direction to which the particle needs to be rotated and the particle map.

Description

Particle-based firework special effect implementation method, device and equipment
Technical Field
The specification relates to the technical field of computer software, in particular to a particle-based firework special effect realization method, device and equipment.
Background
Particle systems represent techniques for simulating certain blurring phenomena in three-dimensional computer graphics, which are difficult to achieve realism with other conventional rendering techniques. Phenomena that are often simulated using particle systems are fires, explosions, smoke, water currents, sparks, fallen leaves, clouds, fog, snow, dust, meteor trails or abstract visual effects like luminous trajectories, etc. In particle systems, a fuzzy object is defined as being composed of a large number of irregular, randomly distributed particles. Each particle has a certain life cycle, and the particles continuously move and change the shape, so that the properties of irregular objects are fully reflected. Currently, particle system technology is widely used in large 3D games.
The characteristic of the particle system makes the particle system very suitable for realizing the special effect of fireworks, and one of the technical difficulties is the simulation of the visual trailing effect of the fireworks. In the prior art, a string of particles is continuously emitted in one direction to move along the same track, the later emitted particles are lighter in color and smaller in size, so that the visual tailing effect of fireworks is simulated by a large number of particles, and the position and the size of each particle are stored and calculated.
Based on the prior art, a firework special effect implementation scheme which saves resources more is needed.
Disclosure of Invention
The embodiment of the specification provides a particle-based firework special effect realization method, a particle-based firework special effect realization device and particle-based firework special effect realization equipment, which are used for solving the following technical problems: a firework special effect implementation scheme which saves more resources is needed.
In order to solve the above technical problem, the embodiments of the present specification are implemented as follows:
the embodiment of the specification provides a particle-based firework special effect implementation method, which comprises the following steps:
acquiring a particle map for representing particles, wherein the particle map comprises a particle tail;
calculating the running time of each particle after emission;
calculating the position and the speed direction of each particle according to the running time;
calculating the direction to which the particle map corresponding to each particle needs to be rotated when rendering according to the speed direction, wherein the rotation is used for enabling the opposite direction of the trailing of the particle to be consistent with the speed direction of the corresponding particle;
and rendering to obtain the image frame after each particle is emitted according to the position, the direction to which the particle needs to be rotated and the particle map.
The embodiment of this specification provides a fireworks special effect realization device based on particle, includes:
the particle mapping system comprises an acquisition module, a particle mapping module and a particle tracking module, wherein the acquisition module is used for acquiring a particle mapping representing particles, and the particle mapping comprises a particle trailing;
the first calculation module is used for calculating the running time of each particle after emission;
a second calculation module for calculating the position and the speed direction of each particle according to the running time;
a third calculating module, configured to calculate, according to the speed direction, a direction to which a particle map corresponding to each particle needs to be rotated when rendering is performed, where the rotation is used to make a direction in which the particle is trailing coincide with a speed direction of the corresponding particle;
and the rendering module is used for rendering to obtain the image frame after each particle is emitted according to the position, the direction to which the particle needs to be rotated and the particle map.
The embodiment of this specification provides a fireworks special effect implementation equipment based on particle, includes:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the at least one processor to cause the at least one processor to:
acquiring a particle map for representing particles, wherein the particle map comprises a particle tail;
calculating the elapsed time after each particle has been emitted;
calculating the position and the speed direction of each particle according to the running time;
according to the speed direction, calculating a direction to which the particle map corresponding to each particle needs to be rotated when rendering, wherein the rotation is used for enabling the trailing direction of the particle to be consistent with the speed direction of the corresponding particle;
and rendering to obtain the image frame after each particle is emitted according to the position, the direction to which the particle needs to be rotated and the particle map.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects: can be through according to the current speed direction of particle, the particle map that correspondingly the rotation contains the particle trailing simulates the visual trailing effect of fireworks, so, can realize the fireworks special effect with a small amount of particles promptly, the calculated amount is little, and storage space occupies fewly, can save the resource, also can improve the performance.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the description below are only some embodiments described in the present specification, and for those skilled in the art, other drawings may be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for implementing a particle-based firework special effect provided in an embodiment of the present specification;
FIG. 2 is an exemplary particle map provided by embodiments of the present disclosure;
fig. 3a to fig. 3c are schematic diagrams illustrating determining a direction to which a particle map needs to be rotated and an effect after the rotation in an actual application scenario provided by the embodiment of the present specification;
FIG. 4 is an exemplary transparency mask provided by embodiments of the present description;
fig. 5 is a schematic flow diagram of a specific implementation of the method for implementing a firework effect based on particles in an actual application scenario provided in an embodiment of the present specification;
fig. 6 is an exemplary image frame of a firework special effect rendered by the method for implementing a particle-based firework special effect provided in an embodiment of the present specification;
fig. 7 is a schematic structural diagram of a particle-based firework effect implementation device corresponding to fig. 1 provided in an embodiment of the present disclosure.
Detailed Description
The embodiment of the specification provides a particle-based firework special effect realization method, device and equipment.
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments of the present disclosure, shall fall within the scope of protection of the present application.
The scheme of the specification utilizes the particle map containing the particle tailing, calculates the speed direction of each particle based on a particle system, and then correspondingly rotates the particle map to enable the reverse direction of the particle tailing to be consistent with the speed direction of the corresponding particle, so that the aim of realizing the special effect of the firework more efficiently and truly by using a small amount of particles is fulfilled. The particle system used herein is not particularly limited, and may be, for example, a Graphics Processing Unit (GPU) particle system based on a 3D engine.
It should be noted that the scheme in this specification can be used not only to implement a special effect of fireworks, but also to implement other phenomena that can be represented by trailing particles, such as flames, clouds, meteor, comet, etc. Some embodiments below mainly take the implementation of the firework specific effect as an example.
Fig. 1 is a schematic flow chart of a method for implementing a special effect of fireworks based on particles according to an embodiment of the present specification, and an execution main body includes the particle system and the device thereof. The device may be a server, or may be a user terminal such as a smartphone, a tablet, a smart watch, or the like.
The process in fig. 1 may include the following steps:
s102: and acquiring a particle map used for representing the particles, wherein the particle map comprises a particle tail.
In the embodiment of the specification, the particle tailing is represented by the particle map instead of a large number of particles, and therefore, the number of particles used for realizing the firework effect can be reduced. The particle map and the specific pattern of the particle tails included in the particle map are not limited, and may be designed according to actual needs, for example, fig. 2 shows an exemplary particle map. In fig. 2, the right side of the map represents the particle head, and the left side represents the tail formed by the particle during operation. Under the scene of realizing the firework special effect, the particles simulate firework particles, and the firework particles can form a tail similar to that in fig. 2 in actual operation.
In the embodiment of the present specification, the particle map may be a map on a two-dimensional plane, or may be a 3D map.
S104: calculating the elapsed time after each of said particle emissions.
In the present embodiment, the transmission in step S104 is simulated by a computer, not actual physical motion. Each particle is emitted to simulate the emission of fireworks, and the respective initial parameters of each particle during the emission can be configured according to the emission condition of the fireworks, so that the emission process of the fireworks can be simulated more truly. The initial parameters include, for example: the launching system comprises launching starting time, launching position, launching initial speed, launching acceleration, life cycle, size, color, appearance change mode and the like.
During the period from the particle emission to the particle disappearance, the particle is in a continuous operation state (from a visual point of view, the particle moves according to a certain track), and the operation time after the particle emission can be calculated according to the emission starting time and the current time of the particle.
S106: and calculating the position and the speed direction of each particle according to the running time.
In the embodiments of the present specification, more specifically, the position of the particle at any time may be calculated based on the parameters such as the elapsed time, the emission start time, the emission position, the emission initial velocity, and the emission acceleration, and the velocity direction of the particle at any time may be calculated based on the parameters such as the elapsed time, the emission initial velocity, and the emission acceleration.
S108: and calculating the direction to which the particle map corresponding to each particle needs to be rotated during rendering according to the speed direction, wherein the rotation is used for enabling the opposite direction of the trailing of the particle to be consistent with the speed direction of the corresponding particle.
In the embodiment of the specification, when the real firework particles operate, as the speed direction changes, the firework particle tailing changes the direction correspondingly. In order to simulate the changing state, the particle map can be correspondingly rotated according to the change of the speed direction of the particles during rendering, so that a more real firework special effect is presented.
In the embodiment of the present specification, the direction in which the particle is trailing can be regarded as being the same as possible as the direction of the velocity of the corresponding particle by rotation. In practical applications, the particle map is usually two-dimensional, and the velocity direction of the particle may be three-dimensional, in which case, if the map is only mapped on a single two-dimensional plane during rendering, the opposite direction of the particle tail can be considered to be consistent with the component direction of the velocity direction of the corresponding particle on the two-dimensional plane by rotating the particle map on the two-dimensional plane as much as possible.
S110: and rendering to obtain an image frame after each particle is emitted according to the position, the direction to which the particle needs to be rotated and the particle mapping.
In the embodiment of the present specification, the continuous image frames constitute the firework special effect image. Besides the elements required for rendering in step S110, there may be other factors such as particle size, color, stretching degree and the like to increase the reality of the special effect, and the other factors may also change during the particle operation, so that the size, color and stretching degree of the particle map may be adjusted accordingly during rendering.
In the present specification embodiment, steps S102 to S108 may also belong to steps performed in the rendering process themselves.
Through the method of fig. 1, the visual tailing effect of the fireworks can be simulated by correspondingly rotating the particle map containing the particle tailing according to the current speed direction of the particles, so that the special effect of the fireworks can be realized by a small amount of particles, the calculated amount is small, the occupied storage space is small, the resources can be saved, and the performance can be improved.
Based on the method of fig. 1, the present specification also provides some specific embodiments of the method, and further embodiments, which are described below.
In this embodiment of the present disclosure, as can be seen from the foregoing description, the above calculation process further needs to use configured initial parameters, for example, for step S104, before calculating the elapsed time after each particle is emitted, the following steps may be further performed: and determining initial parameters of the particles, such as emission starting time, emission position, emission initial velocity, emission acceleration, life cycle and the like.
In this embodiment of the present specification, for step S104, the calculating the elapsed time after each particle is emitted may further perform: calculating the remaining time after each particle is emitted; and calculating parameters such as the size and the color of each particle according to the remaining time for rendering.
In this embodiment of the present specification, for step S108, calculating, according to the speed direction, a direction to which a particle map corresponding to each particle needs to be rotated when rendering, specifically may include: and calculating the direction of the velocity component of the velocity of each particle in the coordinate system of the corresponding particle map as the direction to which the particle map needs to rotate during rendering. More intuitively, the embodiment of the present specification further provides a schematic diagram for determining a direction to which the particle map needs to be rotated and an effect after the rotation in an actual application scenario, as shown in fig. 3a to 3 c. In this practical scenario, it is assumed that the velocity of the particle is in the x-y-z three-dimensional coordinate system and the particle map is in the x-y two-dimensional coordinate system.
Fig. 3a shows an exemplary velocity of a particle at a certain time instant, represented by a velocity vector. It can be seen that the velocity vector is perpendicularly projected onto the x-y plane, and the velocity component of the velocity in the x-y two-dimensional coordinate system can be obtained.
Further, fig. 3b shows the x-y plane, and it can be seen that the particle map contains a particle tail whose currently opposite direction is the x-axis direction, and the angle between this opposite direction and the direction of the velocity component is α. Then in rendering, the particle map can be rotated counterclockwise by α around the center of the coordinate system, so that the opposite direction of the trailing particle after rotation is the same as the direction of the velocity component, as shown in fig. 3 c. Exemplary mathematical equations are further provided to implement the rotation operations described above.
The assumed velocity vector is recorded as
Figure BDA0001692513710000071
The inverse direction of the particle tail before rotation is expressed as a unit vector
Figure BDA0001692513710000072
The angle between the velocity vector and the unit vector is alpha, the rotation matrix is expressed as
Figure BDA0001692513710000073
By vector rotation formula
Figure BDA0001692513710000074
From this calculation, x '= cos α, y' = sin α. Substituting the rotation matrix to obtain a rotation matrix represented by the velocity vector
Figure BDA0001692513710000075
When rendering, each particle map is multiplied by the rotation matrix, namely, the rotation operation can be realized.
In the embodiment of the present specification, the particle light emitting effect can also be simulated by using the transparency mask, which is also beneficial to reduce the number of particles required to be used. In this case, for step S102, acquiring a particle map representing a particle, the following steps may be further performed: and obtaining a transparency mask, and matching the transparency mask with the particle map during rendering to simulate the light emitting effect of the particles. The shape of the transparency mask can be adapted to the shape of the particle map, and the transparency of different parts of the transparency mask can be automatically adjusted according to a preset algorithm in the operation process of the particles so as to simulate the light-emitting variation effect more truly. An exemplary transparency mask is shown in fig. 4, a glowing effect is currently simulated by the transparency mask in which the particle heads are darkened, while the particle tails are still bright.
According to the above description, an embodiment of the present specification further provides a flowchart of a specific implementation of the method for implementing a special effect of a particle-based firework in an actual application scenario, as shown in fig. 5.
The flow in fig. 5 may include the following steps:
transmitting the particle map into a GPU particle system; configuring parameters such as the emission position (position), the initial emission speed (velocity), the acceleration emission (acceleration), the life cycle (life time), the size (size), the color (color) and the like of each particle; an incoming transmission start time (start _ time); triggering each frame image frame to be rendered according to a preset frame rate, and transmitting current _ time; calculating the running time (deltaTime = current _ time-start _ time) and the normalized remaining time (left _ time =1.0- (deltaTime/lifeTime)) of each particle during each frame rendering, calculating the current speed (v = velocity + acquisition _ deltaTime) and position (p = position + v _ deltaTime) of each particle according to the running time, calculating the current size (e.g., s = size _ lifeLeft) and color (e.g., c = color _ lifeTime) of each particle according to the remaining time, obtaining the direction vector of the component after normalizing the component of the current speed vector of the particle on an x-y plane, rotating the corresponding particle map to the direction of the direction vector, and rendering the image frame; until rendering is finished.
Fig. 6 is an exemplary firework special effect image frame rendered by the particle-based firework special effect implementation method provided in the embodiment of the present specification. In fig. 6, it can be seen that each particle map has been rotated into place, enabling a more realistic simulation of fireworks.
Based on the same idea, the embodiment of the present specification further provides an apparatus corresponding to the method of fig. 1, as shown in fig. 7.
Fig. 7 is a schematic structural diagram of a particle-based firework effect implementation apparatus corresponding to fig. 1 provided in an embodiment of the present specification, where a dashed box represents an optional module, and the apparatus includes:
an obtaining module 701, configured to obtain a particle map used for representing a particle, where the particle map includes a particle tail;
a first calculation module 702, which calculates the operation time of each particle after emission;
a second calculation module 703 for calculating the position and the velocity direction of each particle according to the running time;
a third calculating module 704, configured to calculate, according to the speed direction, a direction to which a particle map corresponding to each particle needs to be rotated when rendering is performed, where the rotation is used to make a reverse direction of trailing of the particle coincide with the speed direction of the corresponding particle;
and a rendering module 705, for rendering to obtain an image frame after each particle is emitted according to the position, the direction to be rotated and the particle map.
Optionally, the apparatus further comprises:
a determining module 706, configured to determine an emission start time, an emission position, an emission initial velocity, an emission acceleration, and a life cycle of each particle before the first calculating module 702 calculates the elapsed time after the emission of each particle.
Optionally, the first calculating module 702 calculates a running time of each particle after emission, and further includes:
the first calculation module 702 calculates the remaining time after each particle is emitted;
and calculating the size and the color of each particle according to the remaining time for the rendering.
Optionally, the third calculating module 704 calculates, according to the speed direction, a direction to which the particle map corresponding to each particle needs to be rotated when rendering the particle map, and specifically includes:
the third calculating module 704 calculates a direction of a velocity component of the velocity of each particle in the coordinate system of the corresponding particle map as a direction to which the particle map needs to be rotated during rendering.
Optionally, the obtaining module 701 obtains a particle map for representing a particle, further includes:
the obtaining module 701 obtains a transparency mask for simulating a light emitting effect of a particle in cooperation with the particle map during the rendering.
Based on the same idea, the embodiments of the present specification further provide a device and a non-volatile computer storage medium corresponding to the foregoing method.
The embodiment of the present specification provides a particle-based firework special effect implementation apparatus corresponding to fig. 1, including:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to cause the at least one processor to:
acquiring a particle map used for representing particles, wherein the particle map comprises a particle tail;
calculating the elapsed time after each particle has been emitted;
calculating the position and the speed direction of each particle according to the running time;
calculating the direction to which the particle map corresponding to each particle needs to be rotated when rendering according to the speed direction, wherein the rotation is used for enabling the opposite direction of the trailing of the particle to be consistent with the speed direction of the corresponding particle;
and rendering to obtain the image frame after each particle is emitted according to the position, the direction to which the particle needs to be rotated and the particle map.
A non-volatile computer storage medium corresponding to fig. 1 provided by the embodiments of the present description stores computer-executable instructions configured to:
acquiring a particle map used for representing particles, wherein the particle map comprises a particle tail;
calculating the running time of each particle after emission;
calculating the position and the speed direction of each particle according to the running time;
calculating the direction to which the particle map corresponding to each particle needs to be rotated when rendering according to the speed direction, wherein the rotation is used for enabling the opposite direction of the trailing of the particle to be consistent with the speed direction of the corresponding particle;
and rendering to obtain an image frame after each particle is emitted according to the position, the direction to which the particle needs to be rotated and the particle mapping.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
All the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the apparatus, the device, and the nonvolatile computer storage medium, since they are substantially similar to the embodiments of the method, the description is simple, and for the relevant points, reference may be made to the partial description of the embodiments of the method.
The apparatus, the device, the nonvolatile computer storage medium, and the method provided in the embodiments of the present specification correspond to each other, and therefore, the apparatus, the device, and the nonvolatile computer storage medium also have advantageous technical effects similar to those of the corresponding method.
In the 90's of the 20 th century, improvements to a technology could clearly distinguish between improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements to process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain a corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical blocks. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as ABEL (Advanced Boolean Expression Language), AHDL (alternate Hardware Description Language), traffic, CUPL (core universal Programming Language), HDCal, jhddl (Java Hardware Description Language), lava, lola, HDL, PALASM, rhyd (Hardware Description Language), and vhigh-Language (Hardware Description Language), which is currently used in most popular applications. It will also be apparent to those skilled in the art that hardware circuitry for implementing the logical method flows can be readily obtained by a mere need to program the method flows with some of the hardware description languages described above and into an integrated circuit.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in purely computer readable program code means, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be conceived to be both a software module implementing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the various elements may be implemented in the same one or more pieces of software and/or hardware in the practice of this description.
As will be appreciated by one skilled in the art, the present specification embodiments may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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 phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises that element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
All the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The above description is only an example of the present specification, and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (11)

1. A particle-based firework special effect implementation method comprises the following steps:
obtaining particle maps used for representing particles, wherein each particle is used for simulating one firework particle, and the particle maps contain particle tails;
calculating the elapsed time after each particle has been emitted;
calculating the position and the speed direction of each particle according to the running time;
according to the speed direction, calculating a direction to which the particle map corresponding to each particle needs to be rotated when rendering, wherein the rotation is used for enabling the trailing direction of the particle to be consistent with the direction of the speed component of the corresponding particle in the coordinate system of the particle map;
and rendering to obtain the image frame after each particle is emitted according to the position, the direction to which the particle needs to be rotated and the particle map.
2. The method of claim 1, wherein prior to calculating a elapsed time after each of the particle emissions, the method further comprises:
and determining the emission starting time, the emission position, the emission initial velocity, the emission acceleration and the life cycle of each particle.
3. The method of claim 1, said calculating a elapsed time after each of said particle emissions, further comprising:
calculating the remaining time after each particle is emitted;
and calculating the size and the color of each particle according to the remaining time for the rendering.
4. The method according to claim 1, wherein the calculating, according to the speed direction, a direction to which a particle map corresponding to each particle needs to be rotated when rendering the particle map includes:
and calculating the direction of the velocity component of the velocity of each particle in the coordinate system of the corresponding particle map as the direction to which the particle map needs to rotate during rendering.
5. The method of claim 1, the obtaining a particle map representing particles, further comprising:
and obtaining a transparency mask, and matching the transparency mask with the particle map during rendering to simulate the light emitting effect of the particles.
6. A particle-based firework special effect implementation device comprises:
the particle simulation system comprises an acquisition module, a particle mapping module and a particle simulation module, wherein the acquisition module is used for acquiring particle maps for representing particles, each particle is used for simulating one firework particle, and the particle maps contain particle trails;
the first calculation module is used for calculating the running time of each particle after emission;
a second calculation module that calculates a position and a velocity direction of each of the particles based on the operated time;
a third calculating module, configured to calculate, according to the speed direction, a direction to which a particle map corresponding to each particle needs to be rotated during rendering, where the rotation is used to make a direction in which the particle is trailing coincide with a direction of a speed component of the corresponding particle in a coordinate system in which the particle map is located;
and the rendering module is used for rendering to obtain an image frame after each particle is emitted according to the position, the direction to which the particle needs to be rotated and the particle mapping.
7. The apparatus of claim 6, further comprising:
and the determining module is used for determining the emission starting time, the emission position, the emission initial speed, the emission acceleration and the life cycle of each particle before the first calculating module calculates the operated time of each particle after the particle is emitted.
8. The apparatus of claim 6, the first computation module to compute a run-time after each of the particle emissions, further comprising:
the first calculation module calculates the remaining time after each particle is emitted;
and calculating the size and the color of each particle according to the remaining time for the rendering.
9. The apparatus of claim 6, wherein the third calculating module calculates a direction to which the particle map corresponding to each particle needs to be rotated during rendering according to the speed direction, and specifically includes:
and the third calculation module calculates the direction of the velocity component of the velocity of each particle in the coordinate system of the corresponding particle map as the direction to which the particle map needs to be rotated during rendering.
10. The apparatus of claim 6, the obtaining module to obtain a particle map representing a particle, further comprising:
the obtaining module obtains a transparency shade for simulating the light emitting effect of the particles by matching with the particle mapping during the rendering.
11. A particle-based firework effect realization device comprises:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to cause the at least one processor to:
obtaining particle maps used for representing particles, wherein each particle is used for simulating one firework particle, and the particle maps contain particle tails;
calculating the running time of each particle after emission;
calculating the position and the speed direction of each particle according to the running time;
calculating the direction to which the particle map corresponding to each particle needs to be rotated during rendering according to the speed direction, wherein the rotation is used for enabling the direction of the trailing direction of the particle to be consistent with the direction of the speed component of the corresponding particle in the coordinate system of the particle map;
and rendering to obtain the image frame after each particle is emitted according to the position, the direction to which the particle needs to be rotated and the particle map.
CN201810598120.4A 2018-06-12 2018-06-12 Particle-based firework special effect realization method, device and equipment Active CN108921927B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810598120.4A CN108921927B (en) 2018-06-12 2018-06-12 Particle-based firework special effect realization method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810598120.4A CN108921927B (en) 2018-06-12 2018-06-12 Particle-based firework special effect realization method, device and equipment

Publications (2)

Publication Number Publication Date
CN108921927A CN108921927A (en) 2018-11-30
CN108921927B true CN108921927B (en) 2022-12-23

Family

ID=64419155

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810598120.4A Active CN108921927B (en) 2018-06-12 2018-06-12 Particle-based firework special effect realization method, device and equipment

Country Status (1)

Country Link
CN (1) CN108921927B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109663357A (en) * 2018-12-19 2019-04-23 北京像素软件科技股份有限公司 Game special implementation method and device
CN111054072B (en) * 2019-12-17 2023-11-07 米哈游科技(上海)有限公司 Method, device, equipment and storage medium for role model tailing
CN111124579B (en) * 2019-12-24 2023-12-19 北京金山安全软件有限公司 Special effect rendering method and device, electronic equipment and storage medium
CN111540035B (en) * 2020-05-07 2022-05-06 支付宝(杭州)信息技术有限公司 Particle rendering method, device and equipment
CN112700517B (en) * 2020-12-28 2022-10-25 北京字跳网络技术有限公司 Method for generating visual effect of fireworks, electronic equipment and storage medium
CN112529997B (en) * 2020-12-28 2022-08-09 北京字跳网络技术有限公司 Firework visual effect generation method, video generation method and electronic equipment
CN112652044A (en) * 2021-01-05 2021-04-13 网易(杭州)网络有限公司 Particle special effect rendering method, device and equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102903140A (en) * 2012-10-17 2013-01-30 沈阳创达技术交易市场有限公司 Particle rendering optimization method
CN103455323A (en) * 2013-07-05 2013-12-18 新奥特(北京)视频技术有限公司 Implementation method and device of particle effects
CN103714568A (en) * 2013-12-31 2014-04-09 北京像素软件科技股份有限公司 Method for achieving large-scale particle system
CN104700446A (en) * 2015-03-31 2015-06-10 境界游戏股份有限公司 Method for updating particle top point data in particle system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060155576A1 (en) * 2004-06-14 2006-07-13 Ryan Marshall Deluz Configurable particle system representation for biofeedback applications
US8260590B2 (en) * 2009-04-29 2012-09-04 Honeywell International Inc. Method and system for modeling three-dimensional smoke propagation animation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102903140A (en) * 2012-10-17 2013-01-30 沈阳创达技术交易市场有限公司 Particle rendering optimization method
CN103455323A (en) * 2013-07-05 2013-12-18 新奥特(北京)视频技术有限公司 Implementation method and device of particle effects
CN103714568A (en) * 2013-12-31 2014-04-09 北京像素软件科技股份有限公司 Method for achieving large-scale particle system
CN104700446A (en) * 2015-03-31 2015-06-10 境界游戏股份有限公司 Method for updating particle top point data in particle system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
基于粒子系统的火箭尾焰实时模拟;白彬 等;《计算机测量与控制》;20100430;第18卷(第4期);第887-889页 *
新型烟花模拟方法;孙劲光 等;《计算机工程与应用》;20160731;第52卷(第14期);全文 *
航海视景中特效的实时模拟;刘晓平 等;《工程图学学报》;20070630;第28卷(第3期);第44-49页 *

Also Published As

Publication number Publication date
CN108921927A (en) 2018-11-30

Similar Documents

Publication Publication Date Title
CN108921927B (en) Particle-based firework special effect realization method, device and equipment
US10217289B2 (en) Augmented reality device with predefined object data
US11816782B2 (en) Rendering of soft shadows
US11896904B2 (en) Scripting engine and implementations
US9418629B2 (en) Optical illumination mapping
US9164723B2 (en) Virtual lens-rendering for augmented reality lens
CN112700517B (en) Method for generating visual effect of fireworks, electronic equipment and storage medium
US20140368494A1 (en) Method and system for rendering simulated depth-of-field visual effect
CN111768473B (en) Image rendering method, device and equipment
CN110162089B (en) Unmanned driving simulation method and device
CN111540035B (en) Particle rendering method, device and equipment
CN109993822B (en) Ink and wash style rendering method and device
CN112700518B (en) Method for generating trailing visual effect, method for generating video and electronic equipment
CN111739142A (en) Scene rendering method and device, electronic equipment and computer readable storage medium
CN112396684A (en) Ray tracing method, ray tracing device and machine-readable storage medium
CN108986227B (en) Particle special effect program file package generation method and device and particle special effect generation method and device
US9483873B2 (en) Easy selection threshold
KR102250254B1 (en) Method and apparatus for processing image
CN113230659A (en) Game display control method and device
Dirksen Learn Three. js: Programming 3D animations and visualizations for the web with HTML5 and WebGL
CN115761105A (en) Illumination rendering method and device, electronic equipment and storage medium
CN115618649A (en) War chess deduction system
CN112473135A (en) Real-time illumination simulation method, device, equipment and storage medium for mobile game
Roughton Interactive Generation of Path-Traced Lightmaps
Sousa et al. Cryengine 3: Three years of work in review

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200930

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

Effective date of registration: 20200930

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant