Embodiments of the present disclosure provide an effect processing method and apparatus, an electronic device, a computer readable storage medium, a computer program, and a computer program product. The method comprises: during processing of a first particle, writing a particle identifier of a first particle into at least one first list of events; obtaining an effect screen by processing a corresponding second particle according to each first list of events, wherein the second particle has an association relationship with the first particle in the first list of events, association relationships corresponding to different first lists of events are different, and the particles are display objects of geometries. In embodiments of the present disclosure, an association relationship between particles may be established through at least one first list of events.
Legal claims defining the scope of protection, as filed with the USPTO.
. An effect processing method, comprising:
. The method according to, wherein the association relationship comprises: an association relationship between a second attribute of the second particle and a first attribute of the first particle,
. The method according to, wherein writing the particle identifier of the first particle into the first list of events comprises:
. The method according to, wherein the attribute of the first particle meeting the preset attribute condition comprises at least one of: a current display duration of the first particle reaching a maximum display duration of the first particle, a position of the first particle reaching a target position, a speed of the first particle reaching a target speed, color of the first particle being target color, or a size of the first particle reaching a target size.
. The method according to, wherein in response to the first attribute and second attribute both being positions, obtaining the effect screen by processing the corresponding second particle according to each first list of events comprises:
. The method according to, wherein a relative position between the second particle and the first particle changes over time by a change amount that is less than or equal to a first threshold.
. The method according to, wherein the first attribute comprises a current display duration, a maximum display duration, and a position, the second attribute comprises a position, and obtaining the effect screen by processing the corresponding second particle according to each first list of events comprises:
. The method according to, wherein the at least one second particle forms a target shape, the position of the first particle being last displayed is a central position of the target shape, a size of the target shape gradually increases, and the at least one second particle is no longer displayed in the case that the size of the target shape increases to a target size.
. The method according to, wherein a maximum display duration of the second particle is less than or equal to a second threshold.
. The method according to, wherein the method further comprises:
. An electronic device, comprising: at least one processor and a memory;
. A non-transitory computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions therein, the computer-executable instructions, when executed by a processor, causing a computing device to:
. The device according to, wherein the association relationship comprises: an association relationship between a second attribute of the second particle and a first attribute of the first particle, and wherein a plurality of second attributes corresponding to a plurality of first lists of events are different from each other, or a plurality of first attributes corresponding to a plurality of first lists of events are different from each other.
. The device according to, wherein the instructions to write the particle identifier of the first particle into the first list of events comprises instructions to:
. The device according to, wherein the attribute of the first particle meeting the preset attribute condition comprises at least one of: a current display duration of the first particle reaching a maximum display duration of the first particle, a position of the first particle reaching a target position, a speed of the first particle reaching a target speed, color of the first particle being target color, or a size of the first particle reaching a target size.
. The device according to, wherein in response to the first attribute and second attribute both being positions, the instructions to obtain the effect screen by processing the corresponding second particle according to each first list of events comprises instructions to:
. The device according to, wherein a relative position between the second particle and the first particle changes over time by a change amount that is less than or equal to a first threshold.
. The device according to, wherein the first attribute comprises a current display duration, a maximum display duration, and a position, the second attribute comprises a position, and the instructions to obtain the effect screen by processing the corresponding second particle according to each first list of events comprises instructions to:
. The device according to, wherein the at least one second particle forms a target shape, the position of the first particle being last displayed is a central position of the target shape, a size of the target shape gradually increases, and the at least one second particle is no longer displayed in response to the size of the target shape increasing to a target size.
. The device according to, wherein a maximum display duration of the second particle is less than or equal to a second threshold.
Complete technical specification and implementation details from the patent document.
The present disclosure is a national stage application filed under 35 U.S.C. 371 based on International Patent Application No. PCT/CN2022/120335, filed on Sep. 21, 2022, which claims a priority right to the Chinese patent application No. 202111209138.9 entitled “Effect Processing Method and Apparatus” filed on Oct. 18, 2021. The full disclosures of these applications are incorporated in the present application by reference.
Embodiments of the present disclosure relate to the field of computer processing technologies, and particularly to an effect processing method and apparatus, an electronic device, a computer readable storage medium, a computer program, and a computer program product.
An effect screen refers to a picture with a special visual effect added to an image, video, text, etc. A typical effect screen may be made up of a large number of particles, each particle being a unit in an arbitrary shape. Each particle is independent and moving and changing constantly. The movement is regular or irregular, and the change may be a change in color, transparency, size, etc. For example, a fireworks effect may be simulated by a large number of particles. An upward movement of a large number of particles may simulate the rising of fireworks, each particle disappears after rising to a certain height and meanwhile more particles are displayed at the disappearing position of the particle to simulate an explosion effect of fireworks.
It can be seen that the process of generating the above-mentioned effect screen may be a process of generating particles, updating particles and rendering particles. The more diversified the number of particles, the colors of particles, the size of particles, the relationship between particles, etc. included in an effect screen, the better the richness of the effect screen. Therefore, how to improve the richness of the effect screen becomes an urgent problem to be solved.
The present disclosure provides an effect processing method and apparatus, an electronic device, a computer readable storage medium, a computer program, and a computer program product, which may improve the richness of the effect screen.
In a first aspect, embodiments of the present disclosure provide an effect processing method comprising:
In a second aspect, embodiments of the present disclosure provide an effect processing apparatus, comprising:
In a third aspect, embodiments of the present disclosure provide an electronic device comprising: at least one processor and a memory;
In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions therein, the computer-executable instructions, when executed by a processor, causing a computing device to implement the method according to the first aspect.
In a fifth aspect, embodiments of the present disclosure provide a computer program for implementing the method according to the first aspect.
In a sixth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the method according to the first aspect.
Embodiments of the present disclosure provide an effect processing method and apparatus, an electronic device, a computer readable storage medium, a computer program, and a computer program product. The method comprises: during processing of a first particle, writing a particle identifier of a first particle into at least one first list of events; obtaining an effect screen by processing a corresponding second particle according to each first list of events, wherein the second particle has an association relationship with the first particle in the first list of events, association relationships corresponding to different first lists of events are different, and the particles are display objects of geometries. In embodiments of the present disclosure, an association relationship between particles may be established through the at least one first list of events.
To make objectives, technical solutions and advantages of embodiments of the present disclosure more apparent, the technical solutions in embodiments in the disclosure will be described below clearly and completely with reference to figures in the embodiments of the disclosure. Obviously, the described embodiments are only partial embodiments in the disclosure rather than all embodiments. All other embodiments obtained by those skilled in the art without making inventive efforts based on the embodiments in the disclosure should fall within the scope of protection of the present disclosure.
Embodiments of the present disclosure may be applied to a process of simulating an effect screen by particles.is a schematic view showing a specific effect picture of simulating an explosion effect of fireworks by particles, wherein one particle may be constituted by one or more adjacent pixel points. Certainly, the effects picture that may be simulated by particles may include, but is not limited to: a cloud and fog effect, a volcanic explosion effect and a flame effect.
The above-mentioned effect screen may be implemented and performed by an electronic device provided with a processor that may perform a lot of computing and a screen that may display particles. The processor may be a Central Processing Unit (CPU) or a Graphics Processing Unit (GPU).
Since the effect screen is formed by the movement of a large number of particles, the processor is required to have a powerful computing capability. As compared with the CPU, the GPU has a better parallel computing capability, so the computing performance of particles may be improved effectively by using the GPU to simulate the effect screen.
In the prior art, when the effect screen is simulated by the GPU, attributes of the particle is updated in a fixed manner, thereby causing a poor diversity of the effect screen.
To address the above-described problem, in embodiments of the present disclosure, an association relationship between particles may be established through at least one first list of events. Since association relationships corresponding to different first lists of events are different, at least one type of second particles may be generated based on one type of first particles, so that the effect screen comprises multiple types of second particles based on the first particles. Thus, the richness of the effect screen is improved.
The technical solutions of the embodiments of the present disclosure and how the technical solutions of the present disclosure solve the above-mentioned technical problems will be described in detail in the following specific embodiments. The following specific embodiments may be combined with one another, and the same or similar concepts or processes might not be repeated in some embodiments. Embodiments of the present disclosure will now be described with reference to the accompanying drawings.
illustrates a flow chart of steps of an effect processing method provided by an embodiment of the present disclosure. The method shown inmay be applied to an electronic device. Referring to, the effect processing method comprises:
S: during processing of a first particle, a particle identifier of a first particle is written into at least one first list of events.
In an embodiment of the present disclosure, processing the particles comprises: generating the particle, updating attributes of the particle, and rendering the particle according to the attributes of the particle.
When the particle is generated, the attributes of the particle need to be initialized, and the attributes of the particle is stored in a separate memory. The attributes of the particle includes, but are not limited to: a position, a color, a movement direction, a speed, a current display duration, a maximum display duration and a size.
The current display duration refers to a duration in which the particle exists, and increases progressively along with the elapse of time after the particle is generated. The maximum display time is used to limit the display duration of the particle. The current display duration and the maximum display duration determine whether to display the state of the particle. When the current display duration of the particle reaches the maximum display duration, the particle is no longer displayed, which indicates that the particle is in a display-stopped state; when the current display duration of the particle does not reach the maximum display duration, the particle continues to be displayed, which indicates that the particle is in an active state.
When the particle is initialized, the position, color, movement direction, speed, maximum display duration and size of the particle may all be set according to actual needs, and the current display duration needs to be set as 0. The initial attributes of the particle may also be specified in effect resource data.
Updating the attributes of the particle may include, but not limited to: updating the position, speed, color, movement direction, size, etc. of the particle.
It needs to be appreciated that each time the particle is updated, the particle need to be rendered to display the particle on the screen. In this way, visual particle movement is achieved. In embodiments of the present disclosure, the particle may be rendered using a vertex/pixel shader.
The particle may have a geometry constituted by at least one pixel point. Thus, upon rendering the particle, the vertex/pixel shader may render the particle according to the geometry. The geometry may include, but not limited to: points, lines, faces and cubes. The faces may be squares, triangles, strips, meshes, etc. The embodiments of the present disclosure do not limit the geometry of the particle.
In the above processing procedure of the first particle, the first particle may be written into the first list of events, wherein the first list of events is a list of events storing the first particle.
is a structural schematic diagram of a list of events provided by an embodiment of the present disclosure. Referring to, the list of events comprises ten first storage units FSUto FSUstoring then particle identifiers IDto IDof the first particle, respectively. These particle identifiers are usually written in a chronological order.
Optionally, before writing the particle identifiers of the first particle to the first list of events, it is also necessary to determine whether to write the particle identifiers of the first particle according to a preset condition. If the preset condition is met, the particle identifiers of the first particle are written into the first list of events; if the preset condition is not met, the particle identifiers of the first particle are not written into the first list of events.
The preset condition may be a condition for the first particle, or may be a condition for remaining information.
The condition for the first particle may be that an attribute of the first particle meets a preset attribute condition. The attribute may be any attribute of the first particle. Specifically, the attribute of the first particle meeting the preset attribute condition comprises at least one of: a current display duration of the first particle reaching a maximum display duration of the first particle, a position of the first particle reaching a target position, a speed of the first particle reaching a target speed, color of the first particle being target color, or a size of the first particle reaching a target size.
Wherein the current display duration of the first particle reaching the maximum display duration of the first particle means that the first particle is in a display-stopped state and the first particle is no longer displayed. Thus, an effect of displaying the second particle after the displaying of the first particle is stopped is achieved.
The target speed may be zero, i.e., the second particle is displayed when the first particle is no longer moving.
The condition for the remaining information may be that the current time has reached a preset time period. That is, the second particle is periodically displayed according to the first particle.
S: obtaining an effect screen by processing a corresponding second particle according to each first list of events, wherein the second particle has an association relationship with the first particle in the first list of events, association relationships corresponding to different first lists of events are different, and the particles are display objects of geometries. Since association relationships corresponding to different first lists of events are different, at least one type of second particles may be generated based on one type of first particles, so that the effect screen comprises multiple types of second particles based on the first particles. Thus, the richness of the effect screen is improved.
The display objects are displayed on one or more pixel points, the pixel points constitute the geometry, and positions, coolers, brightness etc. of the pixel points may change over time.
Specifically, when the first list of events is created, the second particle corresponding to the first list of events may be determined. In turn, the first list of events determines an association between the first particle and the second particle because the particle identifiers of the first particle in the first list of events determine an association relationship between the first list of events and the first particle.
The above association relationship is used to control the logic of displaying the second particle according to the first particle; if the association relationship is different, the logic of displaying the second particle is different.
The association relationship comprises: an association relationship between a second attribute of the second particle and a first attribute of the first particle, the second attributes corresponding to different first lists of events are different, and/or the first attributes corresponding to different first lists of events are different.
The second attribute is any attribute of the second particle, the first attribute is any attribute of the first particle, the first attribute and the second attribute may be the same or different, the first attribute may comprise one or more first attributes, and the second attribute may also comprise one or more second attributes. For example, the first attribute and the second attribute may both be a position, such that the position of the second particle is associated with the position of the first particle. As another example, the first attribute may be a position and the second attribute may be a size, such that the size of the second particle is associated with the position of the first particle. As another example, the first attribute may be a position and the second attribute may be a position and a size such that both the size and the position of the second particle are associated with the position of the first particle, thereby enabling a richer effect screen.
A process of processing the second particle for each first list of events is described in detail below.
When the first attribute and the second attribute are both a position, obtaining an effect screen by processing a corresponding second particle according to each first list of events may comprise the following: first, reading a particle identifier of the first particle from the first list of events; then, obtaining the effect screen by determining a position of the first particle according to the particle identifier of the first particle and displaying the second particle after the position of the first particle during a movement of the first particle.
The position of the first particle belong to the attributes of the first particle, and the attributes of the first particle may be stored in a preset attribute list.is a structural schematic diagram of a list of preset attributes provided by an embodiment of the present disclosure. Corresponding to the ten first storage units included in the list of events shown in, a list of preset attributes shown incomprise ten second storage units SSUto SSUstoring then attributes of the first particle, respectively: ACto ACare attributes of the first particle corresponding to IDto ID, respectively.
It needs to be appreciated that each first particle described above corresponds to one or more attributes which constitute a set of attributes of the first particle, so that each of the second storage units instores a set of attributes of the first particle.
The position of the first particle may be determined based on the first list of events and the list of preset attributes. Specifically, first, the particle identifiers of the first particle are read from the first list of events; then a set of attributes corresponding to the particle identifiers is acquired from the list of preset attributes; finally, the position of the first particle is extracted from the set of attributes, and a plurality of attributes in the set of attributes are usually arranged in an inherent order.
After the position of the first particle is obtained, the second particle may be displayed after the position of the first particle. A position after the position of the first particle is determined relative to the movement direction of the first particle: a direction opposite to the movement direction of the first particle is a position after the position of the first particle.
is a schematic diagram of a positional relationship between a first particle and a second particle provided by an embodiment of the present disclosure. Referring to, Lrepresents the first particle, and Lrepresents second particles; Lmoves upward, and Lis located after the position of Lwith the direction of upward movement being taken as a reference.
It can be seen that the Lcomprises a plurality of second particles and decreases in size as the distance from the first particle increases, thereby visually forming a trailing effect of the first particle in the ascending process.
Unknown
May 19, 2026
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.