A method for dissipating edge-emitting particles

By using the mesh dissipation algorithm and Niagara Module Script, the problems of uneven particle distribution and unnatural edge dissipation effects in particle systems are solved, achieving realistic edge dissipation effects and dynamic changes, improving computation and rendering efficiency, and making it suitable for real-time applications such as games and movies.

CN120726187BActive Publication Date: 2025-11-28四川易方智慧科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511150460.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2025-11-28
Estimated Expiration
2045-08-18

AI Technical Summary

Technical Problem

Traditional particle systems suffer from uneven particle distribution, unnatural edge dissipation, poor dynamic changes, and low computational efficiency, which negatively impacts the performance of real-time applications.

Method used

We employ a particle emission method based on dissipation edges. We create an edge dissipation shader using a mesh dissipation algorithm, initialize the particle system, introduce dissipation functions and create a Niagara Module Script, update and render particles, and use the dissipation functions to calculate particle transparency, thereby achieving dynamic changes in the particle lifecycle.

Benefits of technology

It achieves a realistic visual effect where the edges of objects gradually fade away. The particle system can present diverse effects as needed, enhancing the visual realism and the vividness of dynamic changes, and improving computational and rendering efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120726187B_ABST
    Figure CN120726187B_ABST
Patent Text Reader

Abstract

The application discloses a method for dissipating edge emitting particles. The steps are as follows: an edge dissipation shader is made by using a mesh dissipation algorithm to realize a realistic visual effect of gradual dissipation of object edges, and when simulating scenes such as object breaking and smoke diffusion, the realistic feeling and visual impact of a picture can be improved. A particle system is initialized, the number, position, color and speed of particles are defined, particles can present various effects according to different requirements, different state particle groups are created, and phenomena such as flame jumping and snowflakes falling are simulated. A dissipation function is introduced to make a Niagara Module Script. The characteristics changed frame by frame in the life cycle of particles are defined. After S5 particle updating, the particle system sends the information of surviving particles to a rendering engine to complete drawing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer graphics technology, specifically a method for emitting particles based on dissipation edges. Background Technology

[0002] With the development of the digital twin industry, people have higher and higher demands for visual effects. Excellent special effects can often catch people's eye. Particle systems perform exceptionally well in this regard, so there is an increasing demand for particles in projects.

[0003] Particle systems are widely used in games, movies, virtual reality, digital twins and other fields, and are often used to simulate natural phenomena such as flames, smoke and water flow.

[0004] In traditional particle systems, particles are typically emitted from a point or region and then move according to predefined rules. This results in uneven particle distribution, unnatural edge dissipation effects, poor dynamic changes, and an inability to adjust the emission area in real time. Furthermore, it leads to low computational efficiency, impacting the performance of real-time applications. Summary of the Invention

[0005] The purpose of this invention is to provide a method for emitting particles based on the dissipation edge, in order to solve the problems of uneven particle distribution, unnatural edge dissipation effect, poor dynamic change effect and low computational efficiency in the prior art.

[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:

[0007] A method for emitting particles based on the dissipation edge includes the following steps:

[0008] Step S1: Create an edge fading shader; use the mesh fading algorithm to create an edge fading shader.

[0009] Step S2, initialize the particle system; initializing the particle system includes defining the number, position, color, and velocity of the particles;

[0010] Step S3: Introduce the dissipation function and create the Niagara Module Script;

[0011] Step S4, Particle Update: Define all features that will change frame by frame during the particle's lifecycle;

[0012] Step S5, Render Particles; After the update is complete, the particle system will send the position, color, and size information of all surviving particles to the rendering engine, which will then draw the particles onto the screen.

[0013] According to the above technical solution, in step S1, the specific steps of creating the edge dissipation shader using the mesh dissipation algorithm are as follows:

[0014] First, define the key variables and parameters; the key parameters include:

[0015] O: Indicates the opacity index of the texture itself;

[0016] A: Animation parameters used to adjust the dissipation effect;

[0017] V: Represents a variable used to adjust the degree of influence of the dissipation value;

[0018] Odissolve: The value that dissipates;

[0019] Ofinal: The dissipation value after processing by the saturate function;

[0020] Ooffset: Dispersion offset value, used to divide the region;

[0021] RegionRaw is used to locate the edge region of the model, and the positive intervals correspond to the edge range that needs to be dissipated.

[0022] After defining the parameters, calculate the mesh dissipation.

[0023] Based on the above technical solution, the specific calculation of mesh dissipation is as follows:

[0024] First, divide the area:

[0025] The two regions are divided using the dissipation value Odissolve minus the dissipation offset value Ooffset:

[0026] RegionRaw=Odissolve−Ooffset

[0027] Then, based on the value of RegionRaw, determine its region:

[0028] If RegionRaw < 0, then it belongs to Region 1, which is the negative number interval;

[0029] If RegionRaw≥0, then it belongs to Region 2, which is the positive number interval;

[0030] For region one (the negative number interval), the ceil function rounds up to the next integer. Since the range is [−1,0), the ceil function will round it to 0.

[0031] For region two (positive number interval), the ceil function is used to round up to the next integer. Since the range is [0,1], the ceil function will round it to 1.

[0032] The required dissipation edge range is ultimately determined using RegionRaw.

[0033] According to the above technical solution, in step S2, initializing the particle system specifically involves:

[0034] This includes defining the maximum number of particles, defining particle color, defining particle period, defining particle velocity, and defining particle size.

[0035] According to the above technical solution, step S3 involves introducing a dissipation function and creating a Niagara Module Script, specifically including the following steps:

[0036] Step S301: Obtain the position and UV information of the triangles on the mesh, specifically:

[0037] First, obtain the texture mapping value of the Skeletal Mesh and assign a random value to it; then, obtain the UV coordinate information of the triangle face of the current Skeletal Mesh, assign random coordinate information to the obtained triangle face, and output it to the texture coordinate; by randomizing the UV coordinate, the particle emission position is more naturally dispersed in the edge area.

[0038] Step S302: Map the information on the sampled texture onto the model;

[0039] Step S303 introduces the calculation of emitting particles at the dissipation edge.

[0040] According to the above technical solution, step S4, particle updating specifically includes the following steps:

[0041] Step S401, Initialize particles; In the initial stage of the particle system, a number of particles will be generated and initial attributes will be assigned to them;

[0042] Step S402, update particle properties; before each frame is rendered, the particle system will traverse all particles and update their properties according to preset rules or physical laws.

[0043] Step S403: Process particle death and rebirth; During the update process, the particle system checks the life cycle of each particle; When a particle's life cycle ends, it is marked as dead and removed from the particle queue; At the same time, new particles are generated to replenish the particle count and maintain dynamic balance.

[0044] According to the above technical solution, in step S403, the position of the particle is updated according to the particle's speed and the time since the last update, so that the particle's movement speed remains consistent at different frame rates.

[0045] The function CalculateDistanceToEdge is used to calculate the distance from the particle's position to the boundary, and the particle's transparency is calculated based on the particle's distance from the edge and the maximum distance. The function CalculateDistanceToEdge is used to calculate the position of the particle as it dissipates with the model.

[0046] According to the above technical solution, in step S5, rendering particles specifically involves:

[0047] Given a distance and a maximum distance, calculate and return an alpha value representing the transparency; specifically:

[0048]

[0049] The alpha value is calculated as follows: starting from completely opaque, the alpha value decreases linearly to completely transparent as the given distance approaches the maximum distance (maxDistance).

[0050] Compared with the prior art, the present invention has the following beneficial effects:

[0051] The method described in this invention utilizes a mesh dissipation algorithm to create an edge dissipation shader, achieving a realistic visual effect where object edges gradually fade away. For example, in simulating scenes such as object breakage, smoke diffusion, or the dissipation of magical energy, this edge dissipation effect can make special effects look more natural, enhancing the realism and visual impact of the image.

[0052] When initializing the particle system, parameters such as particle quantity, position, color, and velocity are defined, allowing the particles to exhibit diverse effects according to different needs. It is possible to create dense or sparse particle swarms with varying colors and speeds to simulate various phenomena, such as flickering flames, falling snowflakes, and exploding fireworks.

[0053] Changing all characteristics, such as position, color, and size, frame by frame throughout a particle's lifecycle allows for a dynamic change effect. Particles may gradually shrink, fade in color, or change their trajectory over time, further enhancing the vividness and interest of the visual effect. For example, when simulating a meteor streaking across the night sky, meteor particles can gradually shrink and change color during their flight before finally disappearing, making the scene more realistic. Attached Figure Description

[0054] Figure 1 This is a flowchart of the method for emitting particles in this invention;

[0055] Figure 2This is a schematic diagram of the mesh dissipation algorithm calculation in this invention. Detailed Implementation

[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0057] Example 1

[0058] like Figure 1 As shown, a method for emitting particles based on the dissipation edge specifically includes the following steps:

[0059] Step 1: Create an edge fading shader. The key to creating an edge fading shader is calculating the mesh fading algorithm.

[0060] First, define several key variables and parameters:

[0061] O: The opacity index of the texture itself (line segment 1), with a value range of [0,1].

[0062] A: Animation parameters used to adjust the dissipation effect.

[0063] V: A variable used to adjust the degree of influence of the dissipation value.

[0064] Odissolve: The value of the dissipated segment (segment two) is calculated as O−A.

[0065] Ofinal: The dissipation value after processing by the saturate function (segment three).

[0066] Ooffset: Dissipation offset value, used to divide region one and region two.

[0067] Region1 and Region2: These represent the values ​​of the two intervals, respectively.

[0068] like Figure 2 As shown, the calculation process is as follows:

[0069] Calculate the dissipation value (segment two):

[0070]

[0071] Apply variables and limit them to between 0 and 1 (segment three): Use the saturate function (usually defined as...). To process the dissipated value, multiply it by the variable V:

[0072]

[0073] Calculate Region 1 and Region 2: Divide the two regions by subtracting the dissipation offset value Ooffset from the dissipation value Odissolve.

[0074] RegionRaw=Odissolve−Ooffset

[0075] Then, based on the RegionRaw value, it can be determined which region it belongs to:

[0076] If RegionRaw < 0, then it belongs to Region 1 (the negative number interval).

[0077] If RegionRaw≥0, then it belongs to Region 2 (positive number interval).

[0078] Apply the ceil function and determine the final output:

[0079] For region one (the negative number interval), the ceil function rounds up to the next integer. Since the range is [−1,0), the ceil function will round it to 0.

[0080] For region two (the positive number interval), the ceil function is used to round up to the next integer. Since the range is [0,1], the ceil function will round it to 1.

[0081] Determine the final required dissipation edge range: The final required dissipation edge range is Region 2, namely:

[0082]

[0083] Saturate: Limits the output value to between 0 and 1. Values ​​less than 0 are boosted to 0, values ​​greater than 1 are downgraded to 1, and values ​​between 0 and 1 (inclusive) remain unchanged.

[0084] Ceil: Rounds the output value up to the next integer. For any given floating-point number, it returns the smallest double-precision floating-point number greater than or equal to that number, and that number is an integer. This means that for positive numbers, it returns the smallest integer greater than or equal to that number; for negative numbers, it returns the largest integer less than or equal to that number (i.e., it rounds towards zero, but because it returns the smallest integer greater than or equal to the original number, for negative numbers it actually rounds down to a larger integer boundary, but still towards zero).

[0085] For example, consider several values ​​in the test data:

[0086] The ceil result of 1 is 1 (because 1 is already an integer, and there is no smaller integer greater than or equal to it).

[0087] The ceil result of 1.3 is 2 (because 2 is the smallest integer greater than or equal to 1.3).

[0088] The ceil result of 1.6 is 2 (again, 2 is the smallest integer greater than or equal to 1.6).

[0089] The ceil result of 0 is 0 (0 is already an integer, and there is no smaller integer greater than or equal to it).

[0090] The ceil result of -1 is -1 (although -1 is a negative number, -1 is an integer and the largest integer less than or equal to -1).

[0091] The ceil result of -1.3 is -1 (because -1 is the largest integer less than or equal to -1.3).

[0092] The ceil result of -1.6 is -1 (again, -1 is the largest integer less than or equal to -1.6).

[0093] Step 2: Initialize the particle system, including the following parameters:

[0094] particleSystem.MaxParticles = 1000; Maximum number of particles: 1000.

[0095] particleSystem.StartColor = Color.yellow; The initial color of the particles is yellow.

[0096] particleSystem.StartLifetime = 3.0S; The particle lifespan is 3 seconds.

[0097] particleSystem.StartSpeed ​​= Random.Range(1.0S, 3.0S); The emitted particle speed is randomized within the range of 1-3 seconds.

[0098] particleSystem.StartSize =Random.Size(0.1f, 0.2f); The particle size is random in the range of 0.1-0.2.

[0099] Step 3: Introduce the dissipation function and create the Niagara Module Script;

[0100] Creating a Niagara Module Script can be divided into three steps:

[0101] 1. Obtain the position and UV information of the triangles on the mesh:

[0102] First, use the "Map Get" node to obtain the texture mapping value of the Skeletal Mesh (which can also be a Static Mesh), and then use the "Get Random info" node to assign random values ​​to the texture mapping value. Next, use the "GetTri UV" node to obtain the UV coordinate information of the current Skeletal Mesh's triangles, assign random coordinate information to the obtained triangles, and then output them to the texture coordinates. Because it is necessary to modify the particle generation position, the "Get Skinned Triangle Data WS" node needs to be used to expose the Skeletal Mesh's coordinates in the world before outputting them.

[0103] 2. Mapping information from sampled textures onto the model: The displayed 3D objects are actually the surfaces of 3D objects, and these surfaces are essentially 2D. These object surfaces are composed of triangles; by simply tearing some openings in them, they can be unfolded into a 2D surface, much like a globe and its surface. Figure 1 Similarly, any point on a three-dimensional globe can be mapped to the same point on a two-dimensional map.

[0104] Using the principles described above, it is possible to cleverly... Figure 1 The noise texture in the model is mapped onto the mesh, which greatly enhances the randomness and naturalness of the model's edge fading.

[0105] 3. Introduce the calculation of emitting particles at the dissipation edge. This step uses the same principle as the dissipation shader in step one.

[0106] Step 4: Particle Update. Define all features that will change frame by frame during the particle's lifecycle.

[0107] Particle updates consist of the following three steps:

[0108] 1. Initialize particles: At the beginning of the particle system, a number of particles are generated and initial attributes are assigned to them, such as position, velocity, acceleration, color, size, lifespan, etc.

[0109] 2. Update Particle Properties: Before each frame is rendered, the particle system iterates through all particles and updates their properties according to preset rules or physical laws. This includes dynamic properties such as position, velocity, and acceleration, as well as static properties such as color and size that may change over time.

[0110] 3. Handling Particle Death and Regeneration: During the update process, the system checks the lifecycle of each particle. When a particle's lifecycle ends, it is marked as dead and removed from the particle queue. Simultaneously, the system may generate new particles as needed to replenish the particle count and maintain a dynamic balance.

[0111] The particle positions are updated based on their velocity and the time since the last update, ensuring consistent particle movement speed across different frame rates. The function `CalculateDistanceToEdge` calculates the distance from the particle's position to a given boundary, and the particle's opacity is calculated based on the particle's distance to the edge and its maximum distance.

[0112] Step 5: Rendering Particles: After the update is complete, the particle system will send the position, color, size and other information of all surviving particles to the rendering engine, which will then draw the particles onto the screen.

[0113] Given a distance and a maximum distance, calculate and return an alpha value representing the transparency.

[0114]

[0115] The alpha value is calculated as follows: starting from 1.0 (completely opaque), the alpha value decreases linearly to 0.0 (completely transparent) as the given distance approaches the maximum distance (maxDistance).

[0116] Specifically, the alpha value is calculated by subtracting the result (given distance divided by maximum distance) from 1.0.

[0117] That is, if the given distance is equal to the maximum distance, the alpha value is 0.0 (completely transparent); if the given distance is 0, the alpha value is 1.0 (completely opaque); when the given distance is between 0 and the maximum distance, the alpha value changes linearly.

[0118] The method described in this invention utilizes a mesh dissipation algorithm to create an edge dissipation shader, achieving a realistic visual effect where object edges gradually fade away. For example, in simulating scenes such as object breakage, smoke diffusion, or the dissipation of magical energy, this edge dissipation effect can make special effects look more natural, enhancing the realism and visual impact of the image.

[0119] When initializing the particle system, parameters such as particle quantity, position, color, and velocity are defined, allowing the particles to exhibit diverse effects according to different needs. It is possible to create dense or sparse particle swarms with varying colors and speeds to simulate various phenomena, such as flickering flames, falling snowflakes, and exploding fireworks.

[0120] Changing all characteristics, such as position, color, and size, frame by frame throughout a particle's lifecycle allows for a dynamic change effect. Particles may gradually shrink, fade in color, or change their trajectory over time, further enhancing the vividness and interest of the visual effect. For example, when simulating a meteor streaking across the night sky, meteor particles can gradually shrink and change color during their flight before finally disappearing, making the scene more realistic.

[0121] In this invention, by introducing a dissipation function and creating a Niagara Module Script, great flexibility is provided for customizing special effects. Developers can adjust the parameters and logic of the dissipation function according to specific needs to achieve different dissipation speeds, dissipation methods, etc., to meet the special effects requirements of various scenarios.

[0122] The particle system sends the position, color, and size information of surviving particles to the rendering engine for drawing, which helps improve rendering efficiency. By properly managing the data transmission between the particle system and the rendering engine, unnecessary computation and resource consumption can be avoided, maintaining good system performance while ensuring the quality of special effects. This approach is suitable for scenarios such as game and film production where real-time performance is critical.

[0123] The particle effects in this invention can create specific atmospheres for a scene. In horror games, using edge-dissipating particles can enhance the atmosphere of horror and mystery; in romantic scenes, using soft colors and slowly dissipating particles can create a warm and dreamy atmosphere.

[0124] By controlling the emission and dissipation of particles, the viewer's eye can be guided, highlighting key elements or actions in the scene. For example, when a character unleashes an important skill, using a large number of particles to fire and dissipate from the edge of the skill's release point can attract the player's attention and emphasize the skill's importance and power.

[0125] Explanation of technical terms:

[0126] Creating an edge-dissipating shader refers to writing a program (usually GLSL, HLSL, or a similar shader language) that makes the edges of a 3D model or 2D image appear to gradually disappear or emerge.

[0127] Niagara Module Script: Niagara Module Script is a module with customizable functions. The subsequent algorithms for calculating particle dissipation will be integrated into this module.

[0128] Skeletal Mesh is a term in computer graphics, game development, and animation that refers to a technique that combines mesh models and skeleton systems to achieve realistic animation of characters or objects.

[0129] CalculateDistanceToEdge is a function used to calculate the distance from a pixel to the edge of a model. In graphics rendering, especially in edge fading shaders, this distance is a key parameter for achieving the desired effect; pixels that are closer to the edge (i.e., closer to the edge) will begin to fade first.

[0130] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0131] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method of dissipating edge-emitting particles, comprising: The method comprises the following steps: Step S1, making an edge dissipation shader; making an edge dissipation shader by using a mesh dissipation algorithm; and the making of the edge dissipation shader by using the mesh dissipation algorithm specifically comprises: First, defining key variables and parameters; wherein the key parameters include: O: representing the opacity index of the map itself; A: an animation parameter, used to adjust the dissipation effect; V: representing a variable, used to adjust the influence degree of the dissipation value; Odissolve: the value of dissipation; Ofinal: the dissipation value processed by the saturate function; Ooffset: the dissipation offset value, used to divide the regions; RegionRaw is used to locate the edge region of the model, and the positive interval corresponds to the edge range that needs to be dissipated; After completing the parameter definition, the mesh dissipation is calculated, and the calculation of the mesh dissipation specifically comprises: Calculate the dissipation value: Odissolve=O−A Apply the variable and limit it between 0-1: use the saturate function to process the dissipation value and multiply it by the variable V: Ofinal=saturate(V×Odissolve) Calculate region one and region two: Use the dissipation value Odissolve to subtract the dissipation offset value Ooffset to divide the two regions: RegionRaw=Odissolve−Ooffset Then, according to the value of RegionRaw, determine the region it belongs to: If RegionRaw<0, it belongs to region one, i.e. the negative interval; If RegionRaw≥0, it belongs to region two, i.e. the positive interval; For region one, use the ceil function to round up to the next integer, since the range is [−1,0), the ceil function will round it to 0: For region two, use the ceil function to round up to the next integer, since the range is [0,1], the ceil function will round it to 1; Finally determine the required dissipation edge range through RegionRaw; Step S2, initializing the particle system; initializing the particle system includes defining the number of particles, position, color and speed; when initializing the particle system, the number of particles, position, color and speed parameters are defined, which can create a particle group with different particle densities, colors and motion speeds; Step S3, introducing a dissipation function to make a Niagara Module Script; introducing a dissipation function to make a Niagara Module Script, specifically including the following steps: Step S301, obtaining the position and UV information of the triangular face on the mesh, specifically: First, obtain the texture mapping value of the Skeletal Mesh, and give the texture mapping value a random value; then obtain the UV coordinate information of the triangular face of the current Skeletal Mesh, assign random coordinate information to the obtained triangular face, and output to the texture coordinate; by randomizing the UV coordinates, the particle emission position is more naturally dispersed in the edge region; Step S302, map the information on the sampling texture to the model; Step S303, introduce the calculation of the particle emission at the dissipation edge; Step S4, particle update, define all the characteristics that will change frame by frame in the particle life cycle; Step S5, render the particle; after the update is completed, the particle system sends the position, color, and size information of all surviving particles to the rendering engine, which draws the particles onto the screen.

2. The method of claim 1, wherein: In step S2, the initialization of the particle system includes: Defining the maximum number of particles, defining the particle color, defining the particle period, defining the particle speed, and defining the particle size.

3. The method of claim 2, wherein: In step S4, the particle update includes the following steps: Step S401, initialize the particle; at the beginning of the particle system, a certain number of particles are generated and assigned initial attributes; Step S402, update the particle attributes; before each frame rendering, the particle system will iterate through all the particles and update their attributes according to the pre-set rules or physical laws; Step S403, handle particle death and rebirth; during the update process, the particle system checks the life cycle of each particle; when the life cycle of a particle ends, it is marked as dead and removed from the particle queue; at the same time, new particles are generated to supplement the number of particles, maintaining a dynamic balance.

4. The method of claim 3, wherein: In step S403, the particle's position is updated according to its speed and the time since the last update, so that the particle's movement speed remains consistent under different frame rates; Use the function CalculateDistanceToEdge to calculate the distance from the particle's position to the edge, and calculate the particle's transparency according to the distance from the particle to the edge and the maximum distance, the function CalculateDistanceToEdge is used to calculate the particle's position as the model dissipates.

5. The method of claim 4, wherein: In step S5, the rendering of the particle is as follows: Given a distance (distance) and a maximum distance (maxDistance), calculate and return an alpha value representing transparency; specifically: The alpha value is calculated as follows: starting from completely opaque, as the given distance (distance) approaches the maximum distance (maxDistance), the alpha value decreases linearly to completely transparent.

Citation Information

Patent Citations

  • Physical special effect rendering method and device, computer equipment and storage medium

    CN113689534A