Method, electronic device, and storage medium for generating firework visual effects - Patents.com

The method generates realistic fireworks visual effects by creating and superimposing firework and trailing particles in three-dimensional space, addressing the challenge of achieving lifelike fireworks in computer graphics and enhancing user experience across various devices.

JP7612868B2Active Publication Date: 2025-01-14BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023536832
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-12-28
Filing Date
2021-11-24
Publication Date
2025-01-14
Estimated Expiration
2041-11-24

AI Technical Summary

Technical Problem

Existing methods struggle to achieve realistic fireworks visual effects using particle systems in three-dimensional computer graphics.

Method used

A method involving the generation of firework particles and trailing particles in three-dimensional space, with specific attributes and textures, and superimposing these models to create a realistic fireworks visual effect, which can be applied in real-time on various devices.

Benefits of technology

The method produces rich and realistic 3D fireworks visual effects that enhance user experience, suitable for mobile devices and various electronic devices, and can simulate fireworks in real-world scenarios and augmented reality applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007612868000001
    Figure 0007612868000001
  • Figure 0007612868000002
    Figure 0007612868000002
  • Figure 0007612868000003
    Figure 0007612868000003
Patent Text Reader

Abstract

A method for generating a fireworks visual effect, an electronic device, and a non-transitory computer-readable storage medium are disclosed. The method for generating a fireworks visual effect includes the steps of determining a trajectory of the visual effect, generating a set of firework particles and a set of trailing particles in a three-dimensional space based on the trajectory of the visual effect to generate the fireworks visual effect, rendering the set of firework particles to obtain a set of firework particle graphic models, rendering the set of trailing particles to obtain a set of trailing particle graphic models, and overlaying the set of firework particle graphic models with the set of trailing particle graphic models to generate the fireworks visual effect, wherein at least some of the plurality of trailing particle graphic models are displayed at least for a preset time. The method for generating a fireworks visual effect can visually realize the visual effect of fireworks trailing as the center of the firework moves through the set of particles.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] (Reference to Related Application) This application claims priority to Chinese patent application No. 202011583044.3, filed on December 28, 2020, the entire contents of which are incorporated herein by reference.

[0002] (Technical field) SUMMARY OF THE DISCLOSURE Embodiments of the present disclosure relate to a method, an electronic device, and a non-transitory computer-readable storage medium for generating a firework visual effect. [Background technology]

[0003] Particle systems can be used to achieve digital trailing visual effects. Three-dimensional computer graphics technology can render virtual three-dimensional spaces in a computer, where three-dimensional objects are described by discrete mathematical formulas (e.g., triangular surfaces). These discrete three-dimensional objects are called three-dimensional (3D, 3-dimension) models. The final color, texture, light and shadow effects of these three-dimensional models in the three-dimensional space are defined and described by a set of graphics algorithms and rules. These algorithms and packages that define the colors in which the three-dimensional objects are visually displayed are usually called three-dimensional model materials.

[0004] In three-dimensional computer graphics, particle systems can be used to simulate visual effects such as fire, explosions, smoke, water flow, sparks, falling leaves, clouds, fog, snow, dust, meteor trails, light trails, etc. However, how to obtain realistic firework visual effects based on particle systems is an urgent problem to be solved by those skilled in the art. Summary of the Invention

[0005] This Summary is provided to introduce in a simplified form concepts that are further described in the specific embodiments below. This Summary is not intended to identify key features or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.

[0006] At least one embodiment of the present disclosure provides a method for generating a firework visual effect, the firework visual effect including a center and a trailing portion of the firework, the method including: determining a trajectory of the visual effect; generating, based on the trajectory of the visual effect, a set of firework particles for generating the center of the firework and a set of trailing particles for generating the trailing portion in a three-dimensional space for generating the firework visual effect; rendering the set of firework particles to obtain a set of firework particle graphic models; rendering the set of trailing particles to obtain a set of trailing particle graphic models including a plurality of trailing particle graphic models; and overlaying and processing the set of firework particle graphic models and the set of trailing particle graphic models to generate the firework visual effect, wherein at least a preset time is displayed on at least a part of the plurality of trailing particle graphic models.

[0007] At least one embodiment of the present disclosure provides an electronic device including a memory for non-transiently storing computer-executable instructions and a processor configured to execute the computer-executable instructions, which, when executed by the processor, perform a method for generating firework visual effects as described in any one embodiment of the present disclosure.

[0008] At least one embodiment of the present disclosure provides a non-transitory computer-readable storage medium having computer-executable instructions stored thereon that, when executed by a processor, perform a method for generating firework visual effects as described in any one embodiment of the present disclosure. [Brief description of the drawings]

[0009] In order to more clearly describe the technical solutions of the embodiments of the present disclosure, the accompanying drawings of the embodiments are briefly introduced below. It is obvious that the accompanying drawings in the following description are only related to some embodiments of the present disclosure, and do not limit the present disclosure. [Figure 1] FIG. 1 is a schematic flow chart of a method for generating firework visual effects provided by at least one embodiment of the present disclosure. [Figure 2A] FIG. 2A is a schematic diagram of each central texture in a central particle texture group provided by at least one embodiment of the present disclosure. [Figure 2B] FIG. 2B is a schematic diagram of each spark particle texture in a spark particle texture group provided by at least one embodiment of the present disclosure. [Figure 2C] 1 is a schematic diagram of each first trailing texture in a first trailing texture group provided by at least one embodiment of the present disclosure. FIG. [Figure 2D] FIG. 2D is a schematic wireframe diagram of a zonal model provided by one embodiment of the present disclosure. [Figure 2E] FIG. 2E is a schematic diagram of a trail particle texture provided by one embodiment of the present disclosure. [Diagram 3] FIG. 3 is a schematic diagram of a fireworks visual effect provided by one embodiment of the present disclosure. [Figure 4] FIG. 4 is a schematic block diagram of an electronic device provided in accordance with at least one embodiment of the present disclosure. [Diagram 5]FIG. 5 is a schematic diagram of a non-transitory computer-readable storage medium provided in accordance with at least one embodiment of the present disclosure. [Figure 6] FIG. 6 is a schematic structural diagram of another electronic device provided in accordance with at least one embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

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

[0011] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in a different order and / or in parallel. Additionally, method embodiments may include additional steps and / or omit performing illustrated steps. The scope of the present disclosure is not limited in this respect.

[0012] As used herein, the term "including" and variations thereof are open-ended, i.e., "including but not limited to." The term "based on" means "based at least in part on." The term "in one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one further embodiment," and the term "in some embodiments" means "at least some embodiments." Relevant definitions of other terms are provided in the description below.

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

[0014] It should be noted that the modifications "one" and "multiple" referred to in this disclosure are exemplary and not limiting, and one of ordinary skill in the art should understand it as "one or more" unless the context clearly dictates otherwise.

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

[0016] In graphics, a particle effect refers to a special package of rendering effects functionality. For example, a particle effect can be generated by generating a set of points, i.e. particles, in three-dimensional space, replacing each particle in the set of points with a 3D model (most commonly a flat model), and then rendering it with a specific material. Particle effects are often used to create visual effects such as clouds and fire.

[0017] CPU (Central Processing Unit) particles and GPU (Graphics Processing Unit) particles are two technical means to realize particle effects.

[0018] A particle in a particle effect has a complete particle life cycle, including an initialization phase, an update phase, and a rendering phase. After the rendering phase is completed, a particle graphic model corresponding to the particle can be generated.

[0019] At least one embodiment of the present disclosure provides a method for generating a firework visual effect, an electronic device, and a non-transitory computer-readable storage medium, the method for generating the firework visual effect including: determining a trajectory of the visual effect; generating a set of firework particles for generating a center of the firework and a set of trailing particles for generating a trailing part in a three-dimensional space for generating the firework visual effect based on the trajectory of the visual effect; rendering the set of firework particles to obtain a set of firework particle graphic models; rendering the set of trailing particles to obtain a set of trailing particle graphic models including a plurality of trailing particle graphic models; and superimposing the set of firework particle graphic models and the set of trailing particle graphic models to generate the firework visual effect, wherein at least a part of the trailing particle graphic models among the plurality of trailing particle graphic models are displayed at least for a preset time.

[0020] The method for generating the visual effect of fireworks can visually realize the visual effect of trailing fireworks in accordance with the movement of the center of the fireworks through a collection of multiple particles, and the visual effect of the generated fireworks is a 3D (3-Dimension) special effect, which is rich and realistic visual effect and improves the visual experience of the user; further, the method for generating the visual effect of fireworks can generate the visual effect of fireworks in real time on a mobile terminal, meeting the needs of various usage scenarios.

[0021] It should be noted that the method for generating firework visual effects provided by the embodiments of the present disclosure may be at least partially applicable to a suitable electronic device, for example, in some embodiments, the method for generating firework visual effects may be implemented by an application program installed on the electronic device, or an application program downloaded from a cloud server or the like and not installed. The electronic device may include a personal computer, a mobile terminal, etc., and the mobile terminal may be a mobile phone, a tablet computer, a wearable electronic device, a smart home device, etc. In some embodiments, the method for generating firework visual effects may also be implemented by a server, or some steps of the method for generating firework visual effects may be implemented by a server (e.g., a cloud server) and another part of steps may be implemented by the electronic device. The electronic devices may, for example, communicate with each other via a network (e.g., a wireless or wired communication network).

[0022] In the embodiment of the present disclosure, the fireworks visual effect may include a visual effect displayed on a display interface of an electronic device. The fireworks visual effect refers to a special effect (i.e., a special effect) that is generated based on a collection of particles and can be displayed on a terminal, and is a visually visible effect.

[0023] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings, but the present disclosure is not limited to these specific embodiments.

[0024] FIG. 1 is a schematic flow chart of a method for generating firework visual effects provided by at least one embodiment of the present disclosure.

[0025] For example, as shown in FIG. 1, the method for generating the firework visual effect includes steps S10 to S50. In step S10, the trajectory of the visual effect is determined. In step S20, a set of firework particles and a set of trailing particles are generated in a three-dimensional space for generating the visual effect of fireworks based on the trajectory of the visual effect. In step S30, the set of firework particles is rendered to obtain a set of firework particle graphic models. In step S40, the set of trailing particles is rendered to obtain a set of trailing particle graphic models. In step S50, a set of firework particle graphic models and a set of trailing particle graphic models are superimposed to generate a firework visual effect.

[0026] The method for generating the visual effect of fireworks can realize the visual effect of fireworks through the aggregation of multiple particles, and has a rich and realistic 3D effect, improving the visual experience of users. In some embodiments, the method for generating the visual effect of fireworks can simulate the effect of real fireworks, for example, the visual effect of fireworks trails in real-world time-lapse photography works. In other embodiments, the formation of the visual effect of fireworks with the movement of a target object can be realized by combining technologies such as AR (Augmented Reality) and target object tracking and detection, for example, the center of the fireworks is represented at the location of the target object, the fireworks trailing with the movement of the target object are represented, and the visual effect of fireworks is superimposed on the target object in the video.

[0027] According to an embodiment of the present disclosure, the set of firework particles is used to generate the center of the firework, i.e., the set of firework particles is used to simulate the effect of the center of the firework, for example, the center of the firework may be a visual effect of a hand-held firework. The set of trailing particles is used to generate the trailing portion, i.e., the set of trailing particles is used to simulate the trailing effect with sparks that is generated with the movement of the center of the firework. For example, the set of trailing particle graphic models obtained by rendering the set of trailing particles includes a plurality of trailing particle graphic models, and at least a part of the plurality of trailing particle graphic models is displayed at least at a preset time to form the effect of trailing fireworks.

[0028] For example, a firework trail visual effect is a three-dimensional dynamic special effect. When the firework visual effect is used to form a video clip, the firework trail visual effect displayed in each video frame in the video clip can be different from each other.

[0029] For example, both the firework particle set and the trailing particle set are generated based on GPU particle technology or CPU particle technology.

[0030] For example, in some embodiments, the trajectory of the visual effect can be determined according to the movement of the visual trajectory point, for example, the visual trajectory point may be a detected target point, for example, the target point may be a preset target object such as a fingertip of a hand or a magic wand prop, etc. For example, step S10 may include a step of determining a visual trajectory point and a step of determining a trajectory of the visual effect according to the movement of the visual trajectory point.

[0031] For example, in step S20, the three-dimensional space may represent a virtual three-dimensional space that can be determined by a virtual three-dimensional coordinate system. Note that a two-dimensional plane may be a special case of a three-dimensional space, that is, when a dimension of a three-dimensional space is 0, the three-dimensional space represents a two-dimensional plane.

[0032] For example, the set of firework particles may include a plurality of firework particles, and when the trajectory of the visual effect is determined by a movement of a visual trajectory point, in step S20, generating the set of firework particles in a three-dimensional space for generating the firework visual effect based on the trajectory of the visual effect includes: mapping the visual trajectory points to spatial trajectory points in the three-dimensional space; determining an extended trajectory, which is a trajectory mapped from the trajectory of the visual effect to the three-dimensional space based on the movement of the spatial trajectory points in the three-dimensional space; generating a plurality of firework particles along the extended trajectory during the movement of the spatial trajectory points; and setting, for each of the plurality of firework particles, attribute values ​​of firework particle attributes corresponding to each firework particle to obtain a plurality of firework particle attribute values, wherein the firework particle attributes include any combination of a particle life cycle, a particle size, a particle color, a particle transparency, a particle orientation, a particle position, a particle speed, and a particle rotation angle.

[0033] For example, generating a plurality of firework particles along the extended trajectory during movement of the spatial trajectory point may include determining that the spatial trajectory point has moved to a first location on the extended trajectory, and generating at least one of the plurality of firework particles within a first range of the first location according to a first generation rate.

[0034] In some other embodiments, the visual effect trajectory may be a preset visual effect trajectory, for example, the visual effect trajectory is a preset heart trajectory, a pentagram trajectory, a text trajectory, etc.

[0035] If the trajectory of the visual effect is a preset trajectory, in step S20, generating a set of firework particles in a three-dimensional space for generating a firework visual effect based on the trajectory of the visual effect may include: mapping the trajectory of the visual effect to an extended trajectory in the three-dimensional space; sequentially selecting, along the extended trajectory, any trajectory points on the extended trajectory as spatial trajectory points, and generating at least one of the plurality of firework particles within a first range of locations of the spatial trajectory points according to a first generation speed; and setting, for each of the plurality of firework particles, attribute values ​​of firework particle attributes corresponding to each firework particle to obtain attribute values ​​of the plurality of firework particles, where the firework particle attributes include any combination of a particle life cycle, a particle size, a particle color, a particle transparency, a particle orientation, a particle position, a particle speed, and a particle rotation angle.

[0036] The firework particle attribute corresponding to the firework particle may be reflected in the firework particle graphic model corresponding to the firework particle obtained by rendering. For example, if the particle size of the firework particle attribute corresponding to the firework particle is set to 1 meter*1 meter, after the firework particle is rendered, the size of the firework particle graphic model corresponding to the firework particle is 1 meter*1 meter. The life cycle of the particle in the firework particle attribute corresponding to the firework particle is the life cycle of the firework particle graphic model corresponding to the firework particle.

[0037] In this disclosure, "meter" represents a unit of size in a three-dimensional space determined by a virtual three-dimensional coordinate system.

[0038] The initial attribute value of each firework particle attribute may include an initial value of a particle size, an initial value of a particle color, an initial value of a particle transparency, an initial value of a particle orientation, an initial value of a particle position, an initial value of a particle rotation angle, an initial value of a particle speed, etc. Also, during the particle life cycle of the firework particle, the electronic device may update the attribute value of the firework particle attribute corresponding to the firework particle based on a predetermined setting.

[0039] The first generation speed indicates a speed of generating firework particles, i.e., generate the firework particles in the set of firework particles according to a certain first generation speed, for example, the first generation speed may be a speed of generating S1 firework particles per second. For example, in some embodiments, generating S1 firework particles per second means generating one firework particle every 1 second interval. The specific value of S1 can be selected according to the actual effect and is not limited here.

[0040] For example, the first range may be a three-dimensional region including the first position (i.e., the position of the spatial trajectory point), and for example, the three-dimensional region may be in the shape of a sphere, a cube, a rectangular parallelepiped, or an ellipsoid. For example, the location of the spatial trajectory point may be any position within the three-dimensional region, and for example, the location of the spatial trajectory point may be the center of a sphere, and for example, the center of the sphere may be the origin of a virtual three-dimensional coordinate system.

[0041] For example, in some embodiments, the initial generation positions (i.e., first positions, or positions of spatial trajectory points) of each of the firework particles in the set of firework particles are all the same, e.g., all are the origin of a virtual three-dimensional coordinate system. In other embodiments, the initial generation positions corresponding to each of the firework particles in the set of firework particles are all any position within a three-dimensional region including the origin of the virtual three-dimensional coordinate system, that is, the initial generation positions corresponding to each of the firework particles can be set to any position within the three-dimensional region.

[0042] The particle life cycle of the firework particle may be relatively short, so that the flickering change effect of the firework can be easily expressed. For example, the particle life cycle in the firework particle attribute may be a fixed value or a random value within the range of the first life cycle, and the present disclosure is not limited thereto.

[0043] The color of the particles corresponding to the firework particles may be any color, for example, in some embodiments, the color of the particles corresponding to the firework particles may be initially white, and the color of the particles corresponding to the firework particles may be generally brightened to increase the brightness of the center of the firework.

[0044] For example, in some embodiments, during the particle life cycle of a firework particle, the color of a particle corresponding to the firework particle may remain unchanged, while in other embodiments, during the particle life cycle of a firework particle, the color of a particle corresponding to the firework particle may change.

[0045] In addition, in a collection of particles (for example, a collection of firework particles / a collection of trailing particles), the final display color of the particle graphic model corresponding to each particle is the result of multiplying the particle color by the color of the particle texture, and the final display transparency of the particle graphic model corresponding to each particle is the result of multiplying the particle transparency by the transparency of the particle texture.

[0046] The rotation angle of a particle corresponding to a firework particle may be any value, and for example, when generating a firework particle, an angle between 0 degrees and 360 degrees can be randomly selected as the initial value of the rotation angle of the particle of the firework particle attribute corresponding to the firework particle. Note that the "particle rotation angle" here is not a dynamic speed but a static "direction", and refers to the rotation offset around the axis (the direction in which the patch model faces the virtual camera) on the premise that the patch model faces the virtual camera when generating a patch model corresponding to the particle in the rendering phase.

[0047] The collection of firework particle graphic models includes a plurality of firework particle graphic models, and step S30 may include a step of rendering the plurality of firework particles respectively based on the plurality of firework particle attribute values ​​to obtain a plurality of firework particle graphic models, where the center of the firework is composed of the plurality of firework particle graphic models superimposed on each other.

[0048] In step S30, the step of rendering each of the plurality of firework particles based on the plurality of firework particle attribute values ​​to obtain a plurality of firework particle graphic models may include the steps of: for each firework particle, obtaining a firework particle texture group corresponding to each firework particle; and rendering each firework particle based on the firework particle texture group and attribute values ​​of the firework particle attributes corresponding to each firework particle to obtain a firework particle graphic model corresponding to each firework particle.

[0049] For each firework particle, in each rendering process, firstly, determine a state of a firework particle attribute of the firework particle at the time of rendering, update a firework particle attribute value corresponding to the firework particle based on the state of the firework particle attribute, and obtain an updated firework particle attribute value. Then, obtain a firework particle texture group corresponding to the firework particle, and render the firework particle based on a firework texture in the corresponding firework particle texture group and the updated firework particle attribute value, and obtain a firework particle graphic model corresponding to the firework particle.

[0050] In the particle life cycle of each firework particle, a firework particle attribute value corresponding to the firework particle is updated according to a rendering frame rate, the firework particle is rendered based on the updated firework particle attribute value and the corresponding firework particle texture group, and a firework particle graphic model corresponding to the firework particle is obtained, thereby simulating the change of the firework particle graphic model over time.

[0051] In the rendering process, the rendering frame rate can be set according to the actual situation, for example, the rendering frame rate may be 5 times / second, 10 times / second, etc.

[0052] In the rendering process, any firework texture corresponding to each firework particle always faces the virtual camera, i.e., the position and direction of the lens of the virtual camera. For example, each firework particle of the plurality of firework particles can be rendered multiple times, and in each rendering process of each firework particle, the firework texture used has a random rotation angle around the normal of the plane facing the virtual camera used for rendering.

[0053] In the present disclosure, the rendering method of a collection of firework particles is a patch model, that is, each firework particle is rendered in the form of a patch model and using a specific material, for example, the patch model may be a triangular patch model.

[0054] The plurality of firework particles includes at least one center particle for generating a center portion of the firework, ie, the center particle is used to simulate the effect of a center portion of the firework.

[0055] The initial value of the size of the particle corresponding to the central particle may be a random value within the central size range, and the central size range can be set according to actual circumstances, and the present disclosure is not limited thereto.

[0056] Within the particle life cycle of the central particle, the size of the particle corresponding to the central particle changes continuously, for example, the size of the particle corresponding to the central particle is expanded from an initial value of the size of the particle corresponding to the central particle to N1 times the initial value of the size of the particle corresponding to the central particle, where N1 is greater than 1. Using the change in size of the particle corresponding to each central particle and the relatively short particle life cycle, the effect of firework flames spreading outward can be expressed.

[0057] The particle velocity corresponding to each central particle may be any value, such as 0, ie, each central particle does not move during its life cycle.

[0058] For example, the initial transparency value of the particle corresponding to the central particle may be any value, for example, in some embodiments, the initial transparency value of the particle corresponding to the central particle may be 1, i.e., completely opaque. When the transparency attribute value of a particle is 0, it means that it is completely transparent. The closer the transparency attribute value of a particle is to 1, the more opaque it is, and the closer it is to 0, the more transparent it is.

[0059] In some embodiments, within the particle life cycle of the central particle, the transparency of the particle corresponding to the central particle does not change.

[0060] The firework particle texture group includes a center particle texture group, which includes a plurality of center textures different from each other, and in a particle life cycle of an arbitrary center particle, the plurality of center textures are switched according to a preset switching frequency to render a visual effect of the arbitrary center particle, and a firework particle graphic model corresponding to the arbitrary center particle is obtained.

[0061] For example, the switching frequency may be Q1 times per second. For example, if the particle life cycle of the central particle is 1 second and the rendering frame rate is Q1 times / second, the rendering is performed Q1 times within the particle life cycle of the central particle, and each rendering process needs to switch the central texture used for rendering. The specific value of Q1 can be selected according to the actual effect and is not limited here.

[0062] For example, Fig. 2A shows each center texture in the center particle texture group. As shown in Fig. 2A, the center texture can include a center texture C1 and a center texture C2.

[0063] For example, for each central particle, in an initialization phase, a central texture is randomly selected from among the central textures, rendered and displayed, and within the particle lifecycle of that central particle, the central texture used for rendering is randomly or sequentially switched according to a switching frequency (e.g., a set frequency or a frequency that changes over time).

[0064] For example, for the central texture shown in Figure 2A, if a central particle is rendered multiple times, the first render can be rendered using the left central texture C1, the second render can be rendered using the right central texture C2, the third render can be rendered using the left central texture C1 if the texture needs to be switched, the fourth render can be rendered using the right central texture C2 if the texture needs to be switched, and so on.

[0065] It should be noted that the central texture is not limited to the situation shown in FIG. 2A, and more or other central textures may be used to render the central particles.

[0066] Also, the plurality of firework particles further includes at least one spark particle, and the at least one spark particle is used to generate a spark portion moving along a path away from the central portion of the firework, i.e., the spark particle is used to simulate the effect of spark fragments flying along a direction away from the central portion of the firework, and represents sparks scattering during the burning of the firework. Since the sparks have a flight process, the particle life cycle of each spark particle can be set to be longer than the particle life cycle of each central particle.

[0067] The initial value of the particle size corresponding to the spark particle may be a random value within the spark size range, and the spark size range can be set according to the actual situation, and the present disclosure is not limited thereto.

[0068] During the particle life cycle of a spark particle, the particle size corresponding to the spark particle gradually decreases and eventually becomes zero.

[0069] The initial transparency value of the particles corresponding to the spark particles may be any value, for example, in some embodiments, the initial transparency value of the particles corresponding to the spark particles may be 1.

[0070] During the particle life cycle of the spark particle, the transparency of the particle corresponding to the spark particle gradually decreases, and finally the transparency of the particle becomes 0, that is, the firework particle graphic model corresponding to the spark particle finally becomes completely transparent.

[0071] The initial value of the particle velocity corresponding to the spark particle may be any value within a preset range of velocities, that is, the spark particle can move within the particle's particle life cycle.

[0072] Within the particle life cycle of a spark particle, the movement trajectory and movement speed of the spark particle can be related to gravity or resistance, that is, the process of the spark flying in three-dimensional space can be visually seen.

[0073] The firework particle texture group may include a spark particle texture group, the spark particle texture group may include multiple spark textures different from each other, and the spark texture for rendering the spark particle may remain unchanged within the particle life cycle of the spark particle. The present disclosure is not limited thereto, and the multiple spark textures may be randomly or sequentially switched according to a preset switching frequency within the particle life cycle of the spark particle to render the visual effect of the spark particle.

[0074] 2B shows a schematic diagram of each spark particle texture in the spark particle texture group. As shown in FIG. 2B, the spark textures can include spark texture S01 to spark texture S16. When rendering any spark particle, one spark texture can be randomly selected from the 16 spark textures to be rendered and displayed.

[0075] It should be noted that the spark texture is not limited to the context shown in FIG. 2B, and other spark textures can also be used to render the spark particles.

[0076] The set of trailing particles may include a plurality of trailing particles, and when the trajectory of the visual effect is determined by the movement of the visual trajectory points, in step S20, the step of generating the set of trailing particles in the three-dimensional space for obtaining the visual effect of the fireworks based on the trajectory of the visual effect includes the steps of: mapping the visual trajectory points to spatial trajectory points in the three-dimensional space; determining an extended trajectory, which is a trajectory mapped from the trajectory of the visual effect to the three-dimensional space, based on the movement of the spatial trajectory points in the three-dimensional space; and during the movement of the spatial trajectory points, the spatial trajectory points move a first distance along the extended trajectory. The method includes a step of generating at least one of the plurality of trailing particles within a second range of the location of the spatial trajectory point on the extended trajectory each time, and a step of setting attribute values ​​of trailing particle attributes corresponding to each of the plurality of trailing particles to obtain a plurality of trailing particle attribute values, wherein the trailing particle attributes include any combination of a particle life cycle, a particle size, a particle color, a particle transparency, a particle orientation, a particle position, a particle speed, and a particle rotation angle.

[0077] For example, the spatial trajectory point moving a first distance each time may mean moving the same distance each time, i.e., in this case, the first distance is a fixed value, and for example, the spatial trajectory point moving a first distance each time may mean moving a different distance each time, i.e., in this case, the first distance is a random value.

[0078] For example, M particles are generated each time the spatial trajectory point moves a unit distance, where the unit distance is a unit distance in the aforementioned virtual three-dimensional space, for example, the scale adopted for the virtual three-dimensional space is one "meter" or other virtual unit distance of the virtual three-dimensional space (for example, one percent of the width or length of the virtual three-dimensional space), in which case the first distance may be a ratio of the unit distance to M, i.e., (1 / M) meters, where M is a positive integer equal to or greater than 1. That is, new particles are continuously generated on the extended trajectory due to the continuous movement of the spatial trajectory point. For example, when the trajectory of the visual effect is determined according to the movement of the fingertip as the visual trajectory point, the spatial trajectory point may be a mapping point in the virtual three-dimensional space when the fingertip is used as the visual trajectory point, and according to such a generation method of trailing particles, a trailing firework effect can be generated to move with the movement of the fingertip.

[0079] In one embodiment, when the visual effect trajectory is a preset trajectory, in step S20, generating a set of trailing particles in a three-dimensional space for generating a fireworks visual effect based on the visual effect trajectory includes: mapping the visual effect trajectory to an extended trajectory in the three-dimensional space; generating a plurality of trailing particles at equal or random intervals along the extended trajectory, or generating a plurality of trailing particles at equal or random time intervals along the extended trajectory; and setting attribute values ​​of trailing particle attributes corresponding to each of the plurality of trailing particles to obtain a plurality of trailing particle attribute values, where the trailing particle attributes include any combination of a particle life cycle, a particle size, a particle color, a particle transparency, a particle orientation, a particle position, a particle speed, and a particle rotation angle.

[0080] For example, generating a plurality of trailing particles at equal intervals along the extended trajectory may include randomly generating at least one of the plurality of trailing particles along the extended trajectory and within a second range of second positions spaced a predetermined distance apart on the extended trajectory.

[0081] For example, the second range may be a three-dimensional region including the location of the second position or spatial trajectory point, and for example, the three-dimensional region may be in the shape of a sphere, a cube, a rectangular prism, an ellipsoid, etc., and for example, the location of the second position or spatial trajectory point may be any position within the three-dimensional region, and for example, the location of the second position or spatial trajectory point may be the center of a sphere, and for example, the center of the sphere may be the origin of a virtual three-dimensional coordinate system.

[0082] In order to form the trailing part, at least some of the trailing particle graphic models among the plurality of trailing particle graphic models are displayed for at least a preset time, i.e., for the plurality of trailing particle graphic models respectively corresponding to the plurality of trailing particles sequentially generated along the extended trajectory, at least some of the trailing particle graphic models used to visually configure the trailing part must be displayed for at least a certain period before disappearing in order to visually form a trailing effect. For example, the preset time can be determined according to the display requirements of the trailing part, for example, in some embodiments, the preset time is 3 seconds, and for example, in some other embodiments, the preset time may be 10 seconds. In order to obtain a better trailing visual effect of fireworks, the preset time can be set appropriately long, for example, the preset time can be any time longer than 3 seconds.

[0083] It should be noted that the preset time in the present disclosure defines a lower limit of the required time for the trailing particle graphic model to be displayed, and according to the display requirements, some trailing particle graphic models need to be displayed at least at a first preset time, and some trailing particle graphic models need to be displayed at least at a second preset time, which are different from the first preset time and the second preset time, and in this case, the preset time may be the minimum value of the first preset time and the second preset time.

[0084] For example, to form a trailing part, the life cycle of the trailing particle needs to be set to be equal to or greater than the preset time, so that the trailing particle graphic model corresponding to the trailing particle disappears after the time set by the particle life cycle attribute, realizing the visual disappearance effect of the trailing particle graphic model. For example, the life cycle of the trailing particle may be a random value or a fixed value within a certain range, for example, the preset time is 5 seconds, and the life cycle of the trailing particle may be any value greater than 5 seconds, for example, 6 seconds or infinitely long.

[0085] The color of the particles corresponding to the trailing particles may be any color, for example, in some embodiments, the initial value of the color of the particles corresponding to the trailing particles may be white.

[0086] For example, in some embodiments, during the life cycle of a trailing particle, the color of a particle corresponding to the trailing particle may remain unchanged, and, for example, in other embodiments, during the life cycle of a trailing particle, the color of a particle corresponding to the trailing particle may change.

[0087] The set of trailing particle graphic models includes a plurality of trailing particle graphic models, and step S40 can include a step of rendering the plurality of trailing particles respectively based on the plurality of trailing particle attribute values ​​to obtain a plurality of trailing particle graphic models, and the trailing portion is composed of the plurality of trailing particle graphic models superimposed on each other.

[0088] For example, in step S40, the step of rendering each of the plurality of tailing particles based on a plurality of tailing particle attribute values ​​to obtain a plurality of tailing particle graphic models may include the step of obtaining a texture group of at least one tailing particle corresponding to a set of tailing particles, and the step of rendering each of the plurality of tailing particles based on the texture group of the at least one tailing particle and the plurality of tailing particle attribute values ​​to obtain a plurality of tailing particle graphic models.

[0089] In the life cycle of each trailing particle, a trailing particle attribute value corresponding to the trailing particle is updated according to a rendering frame rate, the trailing particle is rendered based on the updated trailing particle attribute value and the texture group of the corresponding trailing particle, and a trailing particle graphic model corresponding to the trailing particle is obtained, thereby simulating the change over time of the trailing particle graphic model.

[0090] During the rendering process, the trailing texture corresponding to each trailing particle always faces the virtual camera, i.e., the position and direction of the virtual camera's lens.

[0091] During the rendering process, the rendering frame rate can be set according to the actual situation, for example, the rendering frame rate may be 5 times / second, 10 times / second, etc.

[0092] The plurality of trailing particles includes at least one first trailing particle for generating a trailing spark portion of the trailing portion, i.e., the first trailing particle simulates the effect of a trailing spark portion.

[0093] The initial value of the size of the particle corresponding to the first tail particle may be a random value within the size range of the first tail, and the size range of the first tail can be set according to actual circumstances, and the present disclosure is not limited thereto.

[0094] For example, within the life cycle of the first tailing particle, the size of the particle corresponding to the first tailing particle changes continuously, for example, the size of the particle corresponding to the first tailing particle is enlarged from the initial value of the size of the particle corresponding to the first tailing particle to N2 times the initial value of the size of the particle corresponding to the first tailing particle, where N2 is greater than 1. For example, when reaching 10% of the life cycle of the first tailing particle, the size of the particle is enlarged to N2 times the initial value of the size of the particle corresponding to the first tailing particle, and does not change thereafter. Therefore, by controlling the size of the particle, a visual effect is presented in which the trailing particle graphic model corresponding to the first tailing particle grows from small to large rapidly, and then does not change.

[0095] The velocity of the particle corresponding to the first trailing particle may be any value, for example 0, ie the first trailing particle does not move within its particle life cycle.

[0096] The rotation angle of the particle corresponding to the first trailing particle may be any value, for example, 0. For example, when generating the first trailing particle, an angle between 0 degrees and 360 degrees can be randomly selected as the initial value of the rotation angle of the particle corresponding to the first trailing particle. Here, the definition of the particle rotation angle is the same as the definition of the particle rotation angle in the firework particle attribute, so it will not be repeated here.

[0097] The initial transparency value of the particle with the trailing particle attribute corresponding to the first trailing particle may be any value, for example, in some embodiments, the initial transparency value of the particle with the trailing particle attribute corresponding to the first trailing particle may be 1, i.e., completely opaque.

[0098] In some embodiments, within the life cycle of the first trailing particle, the transparency of the particle corresponding to the first trailing particle can change from a first transparency to a second transparency and then to a third transparency, and both the first transparency and the third transparency are also different from the second transparency. For example, the first transparency and the third transparency can be the same or different, for example, in some embodiments, the first transparency and the third transparency are both 0 and the second transparency is 1, in which case the first transparency and the third transparency are both lower than the second transparency, and thus the trailing particle graphic model corresponding to the first trailing particle shows a fade-in-fade-out visual effect.

[0099] In some embodiments, the first transparency and the third transparency may both be 1 and the second transparency may be 0, in which case the first transparency and the third transparency are both higher than the second transparency, and the particle graphic model corresponding to the first trailing particle exhibits a fade-out-fade-in visual effect.

[0100] In some embodiments, within the life cycle of the first trailing particle, the particle transparency of the first trailing particle changes periodically, thereby causing the particle graphic model corresponding to the first trailing particle to visually generate a flickering effect.

[0101] In some embodiments, within the life cycle of the first trailing particle, the particle transparency of the first trailing particle changes periodically from the mth second of the life cycle of the first trailing particle, where m is a positive number, so that the particle graphic model corresponding to the first trailing particle visually represents a flickering effect m seconds after it is born.

[0102] Any combination of the above particle transparency variations can be used to achieve richer visual effects.

[0103] The texture group of the tailing particles includes a first tailing texture group, which includes a plurality of first tailing textures different from each other, and within a life cycle of each first tailing particle, the plurality of first tailing textures are switched according to a first frequency to render each first tailing particle, and a tailing particle graphic model corresponding to each first tailing particle is obtained.

[0104] In the present disclosure, the rendering method of the first trailing particles is a patch model, that is, each first trailing particle is rendered in the form of a patch model through a specific material, for example, the patch model may be a triangular patch model.

[0105] The first frequency may be Q2 times per second. For example, if the life cycle of the first trailing particle is 1 second and the rendering frame rate is Q2 times / second, the rendering is performed Q2 times within the life cycle of the first trailing particle, and the first trailing texture used for rendering needs to be switched during each rendering. The specific value of Q2 can be selected according to the actual effect and is not limited here.

[0106] For example, Fig. 2C is a diagram showing each of the first textures of the first texture group provided by at least one embodiment of the present disclosure. As shown in Fig. 2C, the first textures can include a first texture T11, a first texture T12, a first texture T13, and a first texture T14.

[0107] For example, for a first tail particle, in the initialization phase, one first tail texture is randomly selected from a plurality of first tail textures, rendered, and displayed, and then, within the life cycle of the first tail particle, the first tail texture used for rendering is switched randomly or sequentially according to the switching frequency.

[0108] For example, for the four first tail textures shown in FIG. 2C, when a first tail particle is rendered multiple times, in the first rendering, it can be rendered using first tail texture T11, in the second rendering, if it is necessary to switch textures, it can be rendered using first tail texture T12, in the third rendering, if it is necessary to switch textures, it can be rendered using first tail texture T13, in the fourth rendering, if it is necessary to switch textures, it can be rendered using first tail texture T14, in the fifth rendering, if it is necessary to switch textures, it can be rendered using first tail texture T11, and in the sixth rendering, if it is necessary to switch textures, it can be rendered using first tail texture T12, and so on.

[0109] It should be noted that the first trailing texture is not limited to that shown in FIG. 2C, and more or other first trailing textures can be used to render the first trailing particles.

[0110] The plurality of trailing particles further includes at least one trail particle, and the at least one trail particle generates a trail portion of the trailing portion, that is, the trail particle generates a strip-shaped basic trajectory of the trailing portion.

[0111] For trail particles, a particle rendering mode different from the above-mentioned method, i.e., Trail mode, can be used to render the trail particles, thus obtaining a long, thin strip model generated along the extended trajectory, and rendering the strip model with a specific model material to obtain a strip-like base trajectory formed along the trajectory for the visual effect of the trailing portion.

[0112] The texture group of the at least one trailing particle further includes a trail texture group, the trail texture group including at least one trail particle texture, and in step S40, the step of rendering the multiple trailing particles based on the texture group of the at least one trailing particle and the multiple trailing particle attribute values ​​to obtain multiple trailing particle graphic models may include the steps of generating at least one patch model corresponding one-to-one to the at least one trail particle based on the attribute values ​​of the at least one trail particle and the trailing particle attributes corresponding to the at least one trail particle, joining the at least one patch model to a strip model, and rendering the strip model based on the at least one trail particle texture to obtain a trail particle graphic model, wherein the multiple trailing particle graphic models include the trail particle graphic model, and the trail portion is constituted by the trail particle graphic model.

[0113] During such rendering process, for any trail particle, generate a patch model according to the updated attribute value of the trail particle attribute corresponding to the any trail particle, and the patch model has a visual shape determined by the updated attribute value of the trail particle attribute corresponding to the any trail particle, for example, the size of the patch model is determined by the attribute value of the particle size of the trail particle, the transparency of the patch model is determined by the attribute value of the particle transparency of the trail particle, etc. Then, splice the newly generated patch model with other patch models generated before into a strip model, and render the strip model based on at least one trail particle texture to obtain a trail particle graphic model. In this rendering mode, the strip model can be generated in real time, and rendering is more flexible.

[0114] FIG. 2D is a schematic wireframe diagram of a strip model provided by one embodiment of the present disclosure, and it can be seen that the strip model can be composed of multiple triangular patch models.

[0115] In some other embodiments, a preset strip model can be generated in advance, and before generating the trailing portion, the preset strip model is compressed to one point in the virtual three-dimensional space, and gradually expands with the movement of the spatial trajectory point, or gradually expands along a preset extending trajectory, to form the visual effect of a trail.

[0116] For example, in step S40, the step of rendering each of the multiple trailing particles based on the texture group of at least one trailing particle and the multiple trailing particle attribute values ​​to obtain multiple trailing particle graphic models may include the steps of obtaining a predetermined strip model including multiple patch models, adjusting the multiple patch models of the predetermined strip model based on the attribute values ​​of at least one trail particle and the trailing particle attributes corresponding to the at least one trail particle, distributing the multiple patch models of the adjusted predetermined strip model to an extended trajectory, and rendering the adjusted predetermined strip model based on at least one trail particle texture to obtain a trail particle graphic model, wherein the multiple trailing particle graphic models include the trail particle graphic model, and the trail portion is composed of the trail particle graphic model.

[0117] During such a rendering process, firstly, a pre-generated pre-defined strip model is obtained, the pre-defined strip model includes P patch models, each patch model corresponds to one trail particle, where P is a positive integer, and then, in the generation and update process of the trail particle, the patch model corresponding to the trail particle is adjusted according to the attribute value of the trail particle attribute corresponding to the trail particle, and the adjusted pre-defined strip model is distributed to the extended trajectory where the trail particle is located, and at the same time, the length of the pre-defined strip model is adjusted according to the change in the length of the extended trajectory, and the width of the pre-defined strip model is maintained within a pre-defined width range, that is, the length of the pre-defined strip model can be continuously extended with the movement of the spatial trajectory point, or the length of the pre-defined strip model can be continuously extended along the pre-defined extended trajectory. This rendering method does not need to generate patch models in real time, so that the resource consumption of the electronic device can be reduced.

[0118] The initial transparency value of the particles corresponding to the trail particles may be any value, for example, in some embodiments, the initial transparency value of the particles corresponding to the trail particles may be 1, i.e., completely opaque.

[0119] In some embodiments, during the life cycle of a trail particle, the transparency of the particle does not change.

[0120] For example, FIG. 2E is a schematic diagram of a trail particle texture provided by one embodiment of the present disclosure. A strip model is rendered using the trail particle texture shown in FIG. 2E to obtain a trail whose transparency changes from opaque to transparent along a direction from the center of the trail toward the edge of the trail, and the trail is set as the trail portion of the tail.

[0121] Taking the spatial trajectory points as mapping points in a virtual three-dimensional space when using a fingertip as a visual trajectory point as an example, according to the trail particle generation and rendering method, when the fingertip is waved, the movement trajectory of the fingertip can be continuously displayed as a trail on the display screen.

[0122] The trailing portion may further include a fragmentation portion for representing fragments flying from the trailing portion, representing sparks scattered during the burning of the firework to obtain a richer visual effect. For example, the plurality of trailing particles may further include at least one second trailing particle for generating a fragmentation portion moving along a path away from the trailing spark portion of the trailing portion.

[0123] In step S20, the step of generating a set of trailing particles in a three-dimensional space for generating a fireworks visual effect based on the trajectory of the visual effect may further include the steps of responding to generating an arbitrary first trailing particle of the at least one first trailing particle, determining an initial position of the arbitrary first trailing particle, and generating a second trailing particle corresponding to the arbitrary first trailing particle of the at least one second trailing particle within a third range from the initial position within a preset generation period.

[0124] For example, the third range may be a three-dimensional region including the initial position, and for example, the three-dimensional region may be in the shape of a sphere, a cube, a rectangular prism, an ellipsoid, etc., and for example, the initial position may be any position in the three-dimensional region, and for example, the initial position may be the center of a sphere, and for example, the center of the sphere may be the origin of a virtual three-dimensional coordinate system.

[0125] Each time a first trailing particle is generated, a second trailing particle corresponding to the first trailing particle is generated within a third range from the initial position of the first trailing particle according to a second generation speed within n seconds after the first trailing particle is born.

[0126] For example, the second generation speed indicates the speed at which the second trailing particles are generated, that is, the second trailing particles in the set of trailing particles can be generated at a fixed second generation speed, for example, the second generation speed may be a speed of generating S2 second trailing particles per second. For example, in some embodiments, generating S2 second trailing particles per second can indicate generating one second trailing particle at an interval of 1 / (S2) seconds. The specific value of S2 can be selected according to the actual effect and is not limited here.

[0127] The initial value of the size of the particle corresponding to the second tail particle may be a random value within the size range of the second tail, and the size range of the second tail can be set according to actual conditions, and the present disclosure is not limited thereto.

[0128] Within the life cycle of the secondary trailing particle, the size of the particle corresponding to the secondary trailing particle may not change.

[0129] The color of the particles corresponding to the second trailing particles may be any color, for example, in some embodiments, the initial value of the color of the particles corresponding to the second trailing particles may be orange-red.

[0130] During the life cycle of the second trailing particle, the color of the particle corresponding to the second trailing particle does not have to change.

[0131] The rotation angle of the particle corresponding to the second trailing particle may be any value, and when the second trailing particle is generated, an angle between 0 degrees and 360 degrees can be randomly selected as the initial value of the rotation angle of the particle corresponding to the second trailing particle. Here, the definition of the particle rotation angle is the same as the definition of the particle rotation angle in the firework particle attribute, so it will not be repeated here.

[0132] The initial value of the transparency of the particle corresponding to the second trailing particle may be any value, for example, in some embodiments, the initial value of the transparency of the particle corresponding to the second trailing particle may be a first transparency, for example, the first transparency is 0, i.e., completely transparent.

[0133] During the life cycle of the second trailing particle, the transparency attribute value of the particle corresponding to the second trailing particle changes from the first transparency to the second transparency and then to the third transparency, and both the first transparency and the third transparency are also lower than the second transparency, that is, the trailing particle graphic model corresponding to the second trailing particle exhibits a fade-in-fade-out visual effect.

[0134] The initial value of the velocity of the particle corresponding to the second trailing particle may be any value within a preset range of velocities, ie, the second trailing particle may move within its particle life cycle.

[0135] During the life cycle of the secondary trailing particle, the movement trajectory and movement speed of the secondary trailing particle may be related to gravity or resistance, i.e., there is a visual appearance of spark fragments flying in three-dimensional space near the trailing tail.

[0136] Furthermore, to express the effect of flying spark fragments, the life cycle of the second trailing particle can be set to be relatively short, for example, the life cycle of the particle of the second particle attribute can be a fixed value or a random value within the second life cycle range, and the present disclosure is not limited thereto. For example, the life cycle of the second trailing particle is shorter than a preset time and longer than the life cycle of the spark particle.

[0137] Correspondingly, the texture group of at least one tail particle further includes a second tail texture group, and the second tail texture group includes a plurality of second tail textures different from each other. In the life cycle of the second tail particle, the second tail texture for rendering the second tail particle may not change. The present disclosure is not limited thereto, and the second tail texture may be randomly or sequentially switched according to a preset switching frequency in the life cycle of the second tail particle to render the visual effect of the second tail particle.

[0138] For example, for each second trailing particle, a second trailing texture is randomly selected from a plurality of second trailing textures to render each second trailing particle, and a trailing particle graphic model corresponding to each second trailing particle is obtained.

[0139] For example, as shown in FIG. 2B, the second trailing texture group may include textures S01 to S16 in FIG. 2B, and when rendering any second trailing particle, one of the 16 trailing textures may be randomly selected as the second trailing texture, rendered, and displayed.

[0140] It should be noted that the second trailing texture is not limited to that shown in FIG. 2B, and other second trailing textures can be used to render the second trailing particles.

[0141] For example, because the life cycle of any firework particle in the collection of firework particles is smaller than the life cycle of any trailing particle in the collection of trailing particles, after the center of the firework moves, the trailing tail of the firework may still be displayed for a while.

[0142] GPU particle technology is more suitable for scenes that generate and use a large number of particles, and CPU particle technology is more advantageous than GPU particle technology in combination with a physics system, and therefore, in the present disclosure, the first trailing particle and the second trailing particle of the collection of firework particles and the collection of trailing particles can be generated by GPU particle technology, and the trail particle of the collection of trailing particles can be generated by CPU particle technology.

[0143] The firework visual effect refers to a visual effect formed jointly by the visual effects corresponding to each central particle graphic model and the visual effects corresponding to each spark particle graphic model.

[0144] Step S50 may include overlapping the plurality of firework particle graphic models and the plurality of trailing particle graphic models based on a positional relationship between the plurality of firework particles and the plurality of trailing particles to generate a firework visual effect.

[0145] For example, the step of overlaying a plurality of firework particle graphic models and a plurality of trailing particle graphic models based on the positional relationship to generate a fireworks visual effect may include the step of overlaying pixel values ​​at the same positions of the plurality of firework particle graphic models and the plurality of trailing particle graphic models, respectively, to generate the fireworks visual effect.

[0146] In one embodiment, the step of determining the visual trajectory points may include the steps of acquiring a video to be processed, detecting a target object in the video to be processed, and identifying feature points of the target object and setting the feature points as the visual trajectory points.

[0147] The video to be processed may be a video shot in real time or a video shot in advance and stored. For example, when the video generating method is applied to an application of an electronic device, the video to be processed may be a video stored in the electronic device or a video shot in real time by a user. In this case, when the visual effect of fireworks is realized by the electronic device itself, the electronic device can process the video to be processed in real time, and when the visual effect of fireworks is realized by a server, the video stored in the electronic device or the video shot in real time is uploaded to the server via a network, and the server performs processing of the trailing effect and then transmits it to the electronic device. Furthermore, the user can upload the generated video from the electronic device to the server via a network to send it to other users or make it public to the public.

[0148] Depending on the different configurations of different electronic devices, a user may trigger a video capture event via methods such as a physical button, a displayed touch button, voice control, etc.

[0149] For example, a user can click a video capture button on the display screen to begin capturing real-time video for processing.

[0150] For example, a video capture event can be voice controlled by a user, and this disclosure does not limit the trigger conditions for capture.

[0151] In one embodiment, the target object is a hand, the feature points are fingertips of the hand, and the firework visual effect is displayed along the movement trajectory of the fingertips. For example, the fingertip may be a fingertip such as an index finger. For example, the electronic device can use AR technology to display the generated firework visual effect in addition to the movement trajectory of the fingertip.

[0152] In some embodiments, where the trajectory of the visual effect is determined by the movement of the user's fingertip, a user can trigger a video capture event in various ways, and if the captured video includes the user's fingertip, a fireworks visual effect can be formed on the display screen as the fingertip moves, with the center of the fireworks at the fingertip of the finger and moving with the movement of the fingertip, and a fireworks trailing behind the display screen is displayed as the fingertip moves.

[0153] When the feature point is moved from the display screen displayed in the video to be processed, for example when the feature point is a fingertip and the fingertip is moved from the display screen, by adjusting the attribute value of the trailing particle corresponding to the trailing particle graphic model, a visual effect is presented in which the trailing part gradually disappears from the trailing start position along the visual effect trajectory.

[0154] For at least a portion of the particle graphic model that constitutes a portion that trails in a visual manner, the particle life cycle or transparency is adjusted to make the particle graphic model visually disappear.

[0155] Depending on the shifting of the feature point from the video to be processed, the life cycles of at least some of the trailing particles corresponding to at least some of the trailing particle graphic models are sequentially adjusted according to the order of generating the multiple trailing particles, or the transparency of at least some of the trailing particle graphic models is adjusted to be completely transparent, so that the trailing tail gradually disappears.

[0156] For example, according to the order of generating multiple trailing particles, the life cycles of the trailing particles corresponding to at least some of the trailing particle graphic models are adjusted to the existing time of the trailing particles, and the trailing particles are directly extinguished, or the life cycles of the trailing particles corresponding to at least some of the trailing particle graphic models are sequentially adjusted to the sum of the existing time of the trailing particles and the first time interval, and the trailing particles are extinguished after the first time interval.

[0157] According to the order of generating a plurality of tailing particles, the attribute values ​​of the particle transparency of at least some of the tailing particles corresponding to the tailing particle graphic models are adjusted to 0 in sequence, so that the tailing particle graphic models become completely transparent. For example, the tailing particles generated earlier in time series are adjusted first, for example, tailing particles such as tailing particle A, tailing particle B, and tailing particle C are generated in sequence along the extended trajectory, and the transparency of the tailing particle graphic model corresponding to tailing particle A is first adjusted to be completely transparent, then the transparency of the tailing particle graphic model corresponding to tailing particle B is adjusted to be completely transparent, and then the transparency of the tailing particle graphic model corresponding to tailing particle C is adjusted to be completely transparent, and so on. The adjustment time intervals of two adjacent tailing particles may be equal, and for example, the transparency of the particles of the tailing particles is adjusted in sequence at every second time interval.

[0158] The method of generating firework visual effects further includes adding firework visual effects to the video to be processed to generate a video having firework visual effects.

[0159] 3 is a schematic diagram of a firework visual effect provided by an embodiment of the present disclosure. As shown in FIG. 3, two rectangular boxes indicate the center of the firework and the tail of the firework included in the firework visual effect. The center of the firework includes a circular central portion and a spark portion that scatters along a direction away from the center portion, and the tail of the firework includes a trail portion as a basic trajectory, a trailing spark portion that simulates the continuous firing of fireworks on the trail portion, and a fragment portion that flies out from the tail of the firework.

[0160] In the method for generating fireworks visual effects provided by the embodiments of the present disclosure, the generated fireworks visual effects can be added to the processed video to meet the application requirements of various scenarios, for example, when combined with AR and target object tracking and detection technology, the target object can be tracked in real time to simulate the visual effect of firework trails in real-world time-lapse fireworks photography.

[0161] The implementation process of the method for generating firework visual effects provided according to one embodiment of the present disclosure, in combination with AR and hand tracking detection technology, is outlined below.

[0162] For example, when a video capture event is detected, video is collected in real time for processing, and the manner in which a user triggers a video capture event has been described above and will not be repeated here.

[0163] Taking a target object including a user's hand in a video as an example, during collection of the video to be processed, the hand identification method identifies the tip of the user's index finger on the display screen in real time, and with the tip of the user's index finger as a visual trajectory point, a visual effect of fireworks is generated and displayed on the display screen along the movement trajectory of the user's index fingertip, with the center of the fireworks always moving with the movement of the user's index fingertip, and the trailing fireworks are displayed along the movement trajectory of the user's index fingertip. In one embodiment, the electronic device can use AR technology to superimpose the generated visual effect of fireworks on the movement trajectory of the fingertip.

[0164] For example, at a first time, the tip of the user's index finger is at a first position, at this time, the center of the firework is at the first position and a trailing part is generated in the path passed by the tip of the user's index finger, and at a second time, the tip of the user's index finger is at a second position, at this time, the center of the firework is at the second position and a trailing part is generated in the path passed by the tip of the user's index finger, and the path passed by the tip of the user's index finger is displayed with the visual effect of a trailing part, thereby improving the user's experience.

[0165] When the tip of the user's index finger is moved away from the display screen, the position of the tip of the user's index finger at the start of the video recording becomes the tail of the firework trajectory, and the entire visual effect of the firework gradually fades away from the trailing tail along the trailing portion.

[0166] Furthermore, the visual effect of fireworks can be a trail drawn by the user on the display screen in real time, or a trail of pre-set text, specific graphics, etc., to present the dynamic visual effect of fireworks in the captured photos, animations, or videos.

[0167] Some embodiments of the present disclosure further provide an electronic device. Figure 4 is a schematic block diagram of an electronic device provided by at least one embodiment of the present disclosure.

[0168] For example, as shown in Fig. 4, the electronic device 40 includes a processor 400 and a memory 410. It should be noted that the components of the electronic device 40 shown in Fig. 4 are merely exemplary and not limiting, and the electronic device 40 may include other components according to actual application requirements.

[0169] For example, the processor 400 and the memory 410 may be in direct or indirect communication with each other.

[0170] For example, the processor 400 and the memory 410 may communicate over a network. The network may include a wireless network, a wired network, and / or any combination of wireless and wired networks. The processor 400 and the memory 410 may also communicate with each other over a system bus, although the disclosure is not limited in this respect.

[0171] For example, in some embodiments, the memory 410 is used to non-transiently store computer-readable instructions. When the processor 400 is used to execute the computer-readable instructions, the computer-readable instructions, when executed by the processor 400, implement the method for generating a firework visual effect according to any of the above-mentioned embodiments. For specific implementation and related description of each step of the method for generating a firework visual effect, reference may be made to the above-mentioned embodiment of the method for generating a firework visual effect, and the overlapping description will not be repeated here.

[0172] For example, the processor 400 and the memory 410 may be located on a server (or in the cloud).

[0173] For example, the processor 400 can control other components in the electronic device 40 to perform desired functions. The processor 400 can be a central processing unit (CPU), a graphics processor (Graphics Processing Unit, GPU), a network processor (NP), etc., a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The central processing unit (CPU) can be an X8 or ARM architecture, etc.

[0174] For example, the memory 410 may include any combination of one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, an erasable programmable read-only memory (EPROM), a compact disk read-only memory (CD-ROM), a USB memory, a flash memory, etc. One or more computer-readable instructions may be stored in the computer-readable storage medium, and the processor 400 may execute the computer-readable instructions to realize various functions of the electronic device 40. Various application programs, various data, etc. may also be stored in the storage medium.

[0175] For example, in some embodiments, electronic device 40 may be a mobile phone, a tablet computer, e-paper, a television, a monitor, a laptop, a digital photo frame, a navigator, a wearable electronic device, a smart home device, and the like.

[0176] For example, electronic device 40 may include a display panel that may be used to display firework visual effects, videos with firework visual effects, etc. For example, the display panel may be a rectangular panel, a circular panel, an elliptical panel, or a polygonal panel. Furthermore, the display panel may be a flat panel as well as a curved panel or a spherical panel.

[0177] For example, the electronic device 40 may be equipped with touch functionality, i.e., the electronic device 40 may be a touch device.

[0178] For example, for a detailed description of the process by which the electronic device 40 executes the method for generating a fireworks visual effect, reference may be made to the relevant description in the embodiment of the method for generating a fireworks visual effect, and redundant description will not be repeated.

[0179] 5 is a schematic diagram of a non-transitory computer-readable storage medium provided by at least one embodiment of the present disclosure. For example, as shown in FIG 5, one or more computer-readable instructions 510 may be non-transitory stored in storage medium 500. For example, computer-readable instructions 510, when executed by a processor, may perform one or more steps in the method for generating firework visual effects described above.

[0180] For example, the storage medium 500 may be applied to the above-mentioned electronic device 40. For example, the storage medium 500 may include the memory 410 in the electronic device 40.

[0181] For example, for the description of the storage medium 500, reference may be made to the description of the memory 410 in the embodiment of the electronic device 40, and duplicated descriptions will not be repeated.

[0182] Now referring to FIG. 6, FIG. 6 shows a schematic structural diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure (e.g., the electronic device may include a display device described in the above embodiments). The electronic device in the embodiments of the present disclosure includes, 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), car-mounted terminals (e.g., car navigation terminals), and wearable electronic devices, and fixed terminals such as digital TVs, desktop computers, and smart home devices. The electronic device shown in FIG. 6 is merely an example and does not limit the functions and application scope of the embodiments of the present disclosure.

[0183] 6, the electronic device 600 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 601 capable of performing various suitable operations and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 606 into a random access memory (RAM) 603 to perform one or more steps in the method of generating the firework visual effect described above. The RAM 603 also stores various programs and data necessary for the operation of the electronic device 600. The processing unit 601, the ROM 602, and the RAM 603 are connected to each other by a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0184] Typically, the following devices can be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 606 including, for example, a magnetic tape, hard disk, etc.; and communication devices 609. The communication devices 609 can enable the electronic device 600 to communicate and exchange data with other devices, wirelessly or by wire. Although FIG. 4 illustrates the electronic device 600 having various devices, it should be understood that it is not a requirement to implement or include all of the devices shown. Instead, more or fewer devices can be implemented or included.

[0185] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowcharts can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, the computer program product includes a computer program carried on a non-transitory computer-readable medium, the computer program includes program code for performing the method shown in the flowcharts, and performs one or more steps of the method for generating the firework visual effect described above. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 609, or installed from the storage device 606, or installed from the ROM 602. When the computer program is executed by the processing device 601, it performs the above-mentioned functions defined in the method of the embodiment of the present disclosure.

[0186] It should be noted that in the context of this disclosure, a computer-readable medium may be any tangible medium that can contain or store a program used by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable medium may be a computer-readable signal medium, or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media include, but are not limited to, an electrical connection having 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), 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 context of this disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program used by or in conjunction with an instruction execution system, apparatus, or device. However, in this disclosure, a computer-readable signal medium may include a data signal loaded with computer-readable program code, propagated in baseband or as part of a carrier wave. Such a data signal may take many forms, including, but not limited to, an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. A computer-readable signal medium may be any computer-readable medium other than a computer-readable storage medium, capable of transmitting, propagating, or transporting a program for use by or in conjunction with an instruction execution system, apparatus, or device.The program code contained in the computer readable medium may be transmitted by any suitable medium, including, but not limited to, wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.

[0187] In some embodiments, clients and servers may communicate using any network protocol now known or later developed, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include local area networks ("LANs"), wide area networks ("WANs"), networks between wide area networks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), and any networks now known or later developed.

[0188] The computer-readable medium may be included in the electronic device, or may exist independently and not integrated in the electronic device.

[0189] Computer program code for carrying out the operations of the present disclosure can be written in one or more programming languages, or combinations thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and the like, and further including conventional procedural programming languages, such as "C" or similar programming languages. The program code can run entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. When a remote computer is involved, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., connected over the Internet using an Internet Service Provider).

[0190] The flowcharts and block diagrams in the figures illustrate possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a portion of code, including one or more executable instructions for implementing a specified logical function. It should be noted that in some alternative implementations, the functions described in the blocks may differ from the order described in the figures. For example, two blocks shown in succession may actually be executed substantially simultaneously or may be executed in reverse order depending on the functionality involved. It should be noted that each block of the block diagrams and / or flowchart diagrams, and combinations of blocks in the block diagrams and / or flowchart diagrams, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0191] The units described in the embodiments of the present disclosure may be realized by software or hardware, but the names of the units do not constitute limitations on the units themselves in certain circumstances.

[0192] The functions described herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, typical 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), etc.

[0193] According to one or more embodiments of the present disclosure, a method for generating a firework visual effect including a center and a trailing portion of a firework, the method comprising: determining a trajectory of the visual effect; generating, in a three-dimensional space for generating the firework visual effect based on the trajectory of the visual effect, a set of firework particles for generating the center of the firework and a set of trailing particles for generating the trailing portion; rendering the set of firework particles to obtain a set of firework particle graphic models; rendering the set of trailing particles to obtain a set of trailing particle graphic models including a plurality of trailing particle graphic models; and superimposing the set of firework particle graphic models and the set of trailing particle graphic models to generate the firework visual effect, wherein at least a part of the plurality of trailing particle graphic models are displayed at least for a preset time.

[0194] According to one or more embodiments of the present disclosure, determining a trajectory of the visual effect includes determining visual trajectory points and determining a trajectory of the visual effect according to a movement of the visual trajectory points.

[0195] According to one or more embodiments of the present disclosure, the set of firework particles includes a plurality of firework particles, and the step of generating the set of firework particles in a three-dimensional space for generating the firework visual effect based on the trajectory of the visual effect includes the steps of: mapping the visual trajectory points to spatial trajectory points in the three-dimensional space; determining an extended trajectory, which is a trajectory mapped from the trajectory of the visual effect to the three-dimensional space based on a movement of the spatial trajectory points in the three-dimensional space, from the trajectory of the visual effect to the three-dimensional space; generating the plurality of firework particles along the extended trajectory during the movement of the spatial trajectory points; and setting attribute values ​​of firework particle attributes corresponding to each of the plurality of firework particles to obtain a plurality of firework particle attribute values, wherein the firework particle attributes include any combination of a particle life cycle, a particle size, a particle color, a particle transparency, a particle orientation, a particle position, a particle velocity, and a particle rotation angle.

[0196] According to one or more embodiments of the present disclosure, generating the plurality of firework particles along the extended trajectory during movement of the spatial trajectory point includes determining that the spatial trajectory point has moved to a first position of the extended trajectory, and generating at least one of the plurality of firework particles within a first range of the first position according to a first generation speed.

[0197] According to one or more embodiments of the present disclosure, the collection of firework particles includes a plurality of firework particles, and the trajectory of the visual effect is a preset trajectory, and the step of generating the collection of firework particles in a three-dimensional space for generating the firework visual effect based on the trajectory of the visual effect includes the steps of: mapping the trajectory of the visual effect to an extended trajectory in the three-dimensional space; sequentially selecting, along the extended trajectory, any trajectory points on the extended trajectory as spatial trajectory points, and generating at least one of the plurality of firework particles within a first range of positions of the spatial trajectory points according to a first generation speed; and setting, for each of the plurality of firework particles, attribute values ​​of firework particle attributes corresponding to each of the firework particles to obtain a plurality of firework particle attribute values, wherein the firework particle attributes include any combination of a particle life cycle, a particle size, a particle color, a particle transparency, a particle orientation, a particle position, a particle velocity, and a particle rotation angle.

[0198] According to one or more embodiments of the present disclosure, the collection of firework particle graphic models includes a plurality of firework particle graphic models, and the step of rendering the collection of firework particles to obtain a collection of firework particle graphic models includes the step of rendering each of the plurality of firework particles based on the plurality of firework particle attribute values ​​to obtain the plurality of firework particle graphic models, and a center of the firework is overlapped and configured by the plurality of firework particle graphic models.

[0199] According to one or more embodiments of the present disclosure, the step of rendering each of the plurality of firework particles based on the plurality of firework particle attribute values ​​to obtain a plurality of firework particle graphic models includes the steps of: for each of the firework particles, obtaining a firework particle texture group corresponding to the each of the firework particles; and rendering each of the firework particles based on the firework particle texture group and attribute values ​​of firework particle attributes corresponding to the each of the firework particles to obtain a firework particle graphic model corresponding to the each of the firework particles.

[0200] According to one or more embodiments of the present disclosure, the plurality of firework particles includes at least one center particle for generating a central portion of a center of the firework.

[0201] According to one or more embodiments of the present disclosure, the plurality of firework particles further includes at least one spark particle for generating a spark portion at a center of the firework, the spark portion moving along a path away from the center portion.

[0202] According to one or more embodiments of the present disclosure, each firework particle is rendered multiple times, and each time each firework particle is rendered, the firework texture used has a random rotation angle about the normal of a plane facing the virtual camera used for rendering.

[0203] According to one or more embodiments of the present disclosure, the set of trailing particles includes a plurality of trailing particles, and the step of generating the set of trailing particles in a three-dimensional space for obtaining the fireworks visual effect based on the trajectory of the visual effect includes the steps of: mapping the visual trajectory points to spatial trajectory points in the three-dimensional space; determining an extended trajectory, which is a trajectory mapped from the trajectory of the visual effect to the three-dimensional space based on a movement of the spatial trajectory points in the three-dimensional space; and during the movement of the spatial trajectory points, each time the spatial trajectory points move a first distance along the extended trajectory, generating at least one of the plurality of trailing particles within a second range of a position of the spatial trajectory point on the extended trajectory; and setting attribute values ​​of trailing particle attributes corresponding to each of the plurality of trailing particles to obtain a plurality of trailing particle attribute values, wherein the trailing particle attributes include any combination of a particle life cycle, a particle size, a particle color, a particle transparency, a particle orientation, a particle position, a particle speed, and a particle rotation angle.

[0204] According to one or more embodiments of the present disclosure, the set of trailing particles includes a plurality of trailing particles, the trajectory of the visual effect is a preset trajectory, and the step of generating the set of trailing particles in a three-dimensional space for generating the fireworks visual effect based on the trajectory of the visual effect includes the steps of mapping the trajectory of the visual effect to an extended trajectory in the three-dimensional space, generating the plurality of trailing particles at equal or random intervals along the extended trajectory, or generating the plurality of trailing particles at equal or random time intervals along the extended trajectory, and setting attribute values ​​of trailing particle attributes corresponding to each of the plurality of trailing particles to obtain a plurality of trailing particle attribute values, wherein the trailing particle attributes include any combination of a particle life cycle, a particle size, a particle color, a particle transparency, a particle orientation, a particle position, a particle speed, and a particle rotation angle.

[0205] According to one or more embodiments of the present disclosure, the plurality of trailing particles includes at least one first trailing particle for generating a trailing spark portion of the trailing portion, the plurality of trailing particles further includes at least one second trailing particle for generating a debris portion of the trailing portion moving along a path away from the trailing spark portion, and the step of generating a set of trailing particles in a three-dimensional space for generating the firework visual effect based on a trajectory of the visual effect further includes a step of responding to generating an arbitrary first trailing particle of the at least one first trailing particle, a step of determining an initial position of the arbitrary first trailing particle, and a step of generating a second trailing particle of the at least one second trailing particle corresponding to the arbitrary first trailing particle within a third range from the initial position within a preset generation period.

[0206] According to one or more embodiments of the present disclosure, the step of rendering the set of trailing particles to obtain a set of trailing particle graphic models includes a step of rendering each of the plurality of trailing particles based on the plurality of trailing particle attribute values ​​to obtain the plurality of trailing particle graphic models, and the trailing portion is composed of the plurality of trailing particle graphic models superimposed thereon.

[0207] According to one or more embodiments of the present disclosure, the step of rendering each of the plurality of tailing particles based on the plurality of tailing particle attribute values ​​to obtain the plurality of tailing particle graphic models includes the step of obtaining a texture group of at least one tailing particle corresponding to a set of the tailing particles, and the step of rendering each of the plurality of tailing particles based on the texture group of the at least one tailing particle and the plurality of tailing particle attribute values ​​to obtain the plurality of tailing particle graphic models.

[0208] According to one or more embodiments of the present disclosure, the plurality of tailing particles includes at least one first tailing particle for generating a tailing spark portion of the tailing portion, a texture group of the at least one tailing particle includes a first tailing texture group, the first tailing texture group includes a plurality of first tailing textures different from each other, and within a life cycle of each first tailing particle, the plurality of first tailing textures are switched according to a first frequency, each first tailing particle is rendered, and a tailing particle graphic model corresponding to each first tailing particle is obtained.

[0209] According to one or more embodiments of the present disclosure, the plurality of trailing particles further include at least one trail particle for generating a trail portion of the trailing portion, the texture group of the at least one trailing particle further includes a trail texture group, the trail texture group includes at least one trail particle texture, and the step of rendering each of the plurality of trailing particles based on the texture group of the at least one trailing particle and the plurality of trailing particle attribute values ​​to obtain the plurality of trailing particle graphic models includes the steps of generating at least one patch model corresponding one-to-one to the at least one trail particle based on attribute values ​​of the at least one trail particle and the trailing particle attribute corresponding to the at least one trail particle, joining the at least one patch model to a strip model, and rendering the strip model based on the at least one trail particle texture to obtain a trail particle graphic model, wherein the plurality of trailing particle graphic models include the trail particle graphic model, and the trail portion is constituted by the trail particle graphic model.

[0210] According to one or more embodiments of the present disclosure, the plurality of trailing particles further includes at least one trail particle for generating a trail portion of the trailing portion, the texture group of the at least one trailing particle further includes a trail texture group, and the trail texture group includes at least one trail particle texture, and the plurality of trailing particles are respectively rendered based on the texture group of the at least one trailing particle and the plurality of trailing particle attribute values, and the step of obtaining the plurality of trailing particle graphic models includes the steps of obtaining a preset strip model including a plurality of patch models, and the step of obtaining the plurality of trailing particle graphic models includes the steps of: The method may include a step of adjusting a plurality of patch models of the predetermined strip model based on at least one trail particle and an attribute value of a trailing particle attribute corresponding to the at least one trail particle, a step of distributing the adjusted plurality of patch models of the predetermined strip model to the extended trajectory, and a step of rendering the adjusted predetermined strip model based on the at least one trail particle texture to obtain the trail particle graphic model, wherein the plurality of trailing particle graphic models include a trail particle graphic model, and the trail portion is constituted by the trail particle graphic model.

[0211] According to one or more embodiments of the present disclosure, the texture group of the at least one tail particle further includes a second tail texture group, the second tail texture group including a plurality of second tail textures different from each other, and for each second tail particle, one second tail texture is randomly selected from the plurality of second tail textures to render each second tail particle, and a tail particle graphic model corresponding to each second tail particle is obtained.

[0212] According to one or more embodiments of the present disclosure, a life cycle of any firework particle in the collection of firework particles is shorter than a life cycle of any trailing particle in the collection of trailing particles.

[0213] According to one or more embodiments of the present disclosure, determining the visual trajectory points includes acquiring a video to be processed, detecting a target object in the video to be processed, and identifying feature points of the target object and setting the feature points as the visual trajectory points.

[0214] According to one or more embodiments of the present disclosure, the target object is a hand, the feature points are fingertips of the hand, and the firework visual effect is displayed along a movement trajectory of the fingertips.

[0215] According to one or more embodiments of the present disclosure, the method further includes a step of sequentially adjusting life cycles of at least some of the tailing particles corresponding to the at least some of the tailing particle graphic models according to an order of generating the plurality of tailing particles in response to the feature points being shifted from the video to be processed, or adjusting the transparency of the at least some of the tailing particle graphic models to be completely transparent, so that the tailing portions gradually disappear.

[0216] According to one or more embodiments of the present disclosure, the method further includes adding the firework visual effect to the processed video to generate a video having the firework visual effect.

[0217] According to one or more embodiments of the present disclosure, an electronic device includes a memory for non-transiently storing computer-readable instructions and a processor configured to execute the computer-executable instructions, which, when executed by the processor, implement a method for generating firework visual effects as described in any one of the embodiments of the present disclosure.

[0218] According to one or more embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided that stores computer-executable instructions that, when executed by a processor, implement a method for generating firework visual effects as described in any one of the embodiments of the present disclosure.

[0219] The above description is merely a description of the preferred embodiments of the present disclosure and the technical principles applied. Those skilled in the art should understand that the disclosure scope of the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but also covers other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, including the technical solutions formed by replacing the above features with technical features having similar functions disclosed in the present disclosure (but not limited to).

[0220] Additionally, although operations have been shown in a particular order, this should not be construed as requiring that these operations be performed in the particular order shown, or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, the above description includes several specific implementation details, which should not be construed as limiting the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.

[0221] Although the subject matter has been described in language specific to structural features and / or methodological acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

[0222] In this disclosure, the following points must be explained. (1) The drawings of the embodiments of the present disclosure relate only to the structures included in the embodiments of the present disclosure, and for other structures, reference may be made to the general design. (2) Unless there is a contradiction, the embodiments of the present disclosure may be combined with features of the embodiments to obtain new embodiments.

[0223] The above description is merely a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto, and should be based on the protection scope of the claims.

Claims

1. 1. A method for generating a visual effect of a firework including a center and a trailing portion of the firework, comprising: determining a trajectory of a visual effect; generating a set of firework particles for generating a center of the firework and a set of trailing particles for generating the trailing portion in a three-dimensional space for generating the visual effect of the firework based on the trajectory of the visual effect; rendering the set of firework particles to obtain a set of firework particle graphic models; Rendering the set of trailing particles to obtain a set of trailing particle graphic models including a plurality of trailing particle graphic models; and superimposing the set of firework particle graphic models and the set of trailing particle graphic models to generate the firework visual effect. At least a portion of the plurality of trailing particle graphic models are displayed at least for a preset time; The step of determining a trajectory of the visual effect comprises: determining visual trajectory points; determining a trajectory of the visual effect according to a movement of the visual trajectory points; The step of determining visual locus points comprises: obtaining a video to be processed; detecting a target object in the video to be processed; and identifying feature points of the target object and setting the feature points as the visual trajectory points. method.

2. the collection of firework particles includes a plurality of firework particles; generating a set of firework particles in a three-dimensional space for generating the firework visual effect based on a trajectory of the visual effect, mapping the visual trajectory points to spatial trajectory points in the three-dimensional space; determining an extended trajectory, which is a trajectory mapped from the trajectory of the visual effect to the three-dimensional space, based on a movement of the spatial trajectory points in the three-dimensional space; generating the plurality of firework particles along the extended trajectory during the movement of the spatial trajectory point; and setting attribute values ​​of firework particle attributes corresponding to each of the plurality of firework particles to obtain a plurality of firework particle attribute values, The firework particle attributes include any combination of a particle life cycle, a particle size, a particle color, a particle transparency, a particle orientation, a particle position, a particle velocity, or a particle rotation angle; The method of claim 1.

3. the collection of firework particles includes a plurality of firework particles, and the trajectory of the visual effect is a preset trajectory; generating a set of firework particles in a three-dimensional space for generating the firework visual effect based on a trajectory of the visual effect, mapping a trajectory of the visual effect onto an extended trajectory in the three-dimensional space; sequentially selecting any trajectory points on the extended trajectory as spatial trajectory points along the extended trajectory, and generating at least one of the plurality of firework particles within a first range of the positions of the spatial trajectory points according to a first generation speed; and setting attribute values ​​of firework particle attributes corresponding to each of the plurality of firework particles to obtain a plurality of firework particle attribute values, The firework particle attributes include any combination of a particle life cycle, a particle size, a particle color, a particle transparency, a particle orientation, a particle position, a particle velocity, or a particle rotation angle; The method of claim 1.

4. The method of claim 2 or 3, wherein the plurality of firework particles includes at least one center particle for generating a central portion of a center of the firework.

5. The method of claim 4 , wherein the plurality of firework particles further comprises at least one spark particle for generating a spark portion of a center of the firework that travels along a path away from the center portion.

6. the collection of trailing particles includes a plurality of trailing particles; generating a set of trailing particles in a three-dimensional space for obtaining the visual effect of the fireworks based on the trajectory of the visual effect, mapping the visual trajectory points to spatial trajectory points in the three-dimensional space; determining an extended trajectory, which is a trajectory mapped from the trajectory of the visual effect to the three-dimensional space, based on a movement of the spatial trajectory points in the three-dimensional space; generating at least one of the plurality of trailing particles within a second range of a location of the spatial trajectory point on the extended trajectory each time the spatial trajectory point moves a first distance along the extended trajectory during the movement of the spatial trajectory point; and setting attribute values ​​of trailing particle attributes corresponding to each of the plurality of trailing particles to obtain a plurality of trailing particle attribute values, The trailing particle attributes include any combination of a particle life cycle, a particle size, a particle color, a particle transparency, a particle orientation, a particle position, a particle velocity, or a particle rotation angle. The method according to claim 1, 2, 4 or 5.

7. the set of trailing particles includes a plurality of trailing particles, and the trajectory of the visual effect is a preset trajectory; generating a set of trailing particles in a three-dimensional space for generating the visual effect of the fireworks based on a trajectory of the visual effect, mapping the trajectory of the visual effect onto an extended trajectory in the three-dimensional space; generating a plurality of trailing particles at equal or random intervals along the extended trajectory, or generating the plurality of trailing particles at equal or random time intervals along the extended trajectory; and setting attribute values ​​of trailing particle attributes corresponding to each of the plurality of trailing particles to obtain a plurality of trailing particle attribute values, The method of any one of claims 1 and 3 to 5, wherein the trailing particle attributes include any combination of a particle life cycle, a particle size, a particle color, a particle transparency, a particle orientation, a particle position, a particle velocity, or a particle rotation angle.

8. the plurality of trailing particles includes at least one first trailing particle for generating a trailing spark portion in the trailing portion; the plurality of particles further includes at least one second particle for generating a debris portion of the trailing portion that travels along a path away from the trailing spark portion; generating a set of trailing particles in a three-dimensional space for generating the visual effect of the fireworks based on a trajectory of the visual effect, responsive to generating any first particle of the at least one first particle; determining an initial position of the first arbitrary trailing particle; generating a second trailing particle corresponding to any one of the first trailing particles among the at least one second trailing particle within a third range of the initial position within a preset generation period; The method according to claim 6 or 7.

9. Rendering the set of trailing particles to obtain a set of trailing particle graphic models includes: Rendering the plurality of trailing particles respectively according to the plurality of trailing particle attribute values ​​to obtain the plurality of trailing particle graphic models; The trailing portion is configured by overlapping the plurality of trailing particle graphic models. The method according to any one of claims 6 to 8.

10. The method of claim 1 , wherein the plurality of trailing particles further comprises at least one trail particle for generating a trail portion of the trailing portion.

11. The method of claim 1, further comprising the step of: sequentially adjusting the life cycles of at least some of the tailing particles corresponding to the at least some of the tailing particle graphic models according to an order of generating the plurality of tailing particles in response to the feature points being shifted from the video to be processed, or adjusting the transparency of the at least some of the tailing particle graphic models to be completely transparent, thereby causing the tailing portions to gradually disappear.

12. a memory for non-transiently storing computer-executable instructions; a processor configured to execute the computer-executable instructions; The computer executable instructions, when executed by the processor, perform the method of any one of claims 1 to 11. Electronic devices.

13. A non-transitory computer readable storage medium storing computer executable instructions which, when executed by a processor, implement the method of any one of claims 1 to 11.