Particle grid-based dynamic special effect rendering method, device, equipment and medium

By constructing particle meshes and determining the correspondence between particles and mesh nodes, the problem of insufficient flexibility and realism in particle effects technology is solved, enabling flexible adjustment and efficient rendering of particle effects, and enhancing the diversity and vividness of visual effects.

CN119784910BActive Publication Date: 2025-10-24SHENZHEN RENDERBUS TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411665967.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-10-24
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

Existing particle effects technology has limitations in the connection and organization between particles, resulting in poor flexibility and an inability to realistically simulate the physical interaction between particles, leading to monotonous visual effects.

Method used

By constructing a particle mesh, determining the correspondence between particles and mesh nodes, calculating particle coordinates and connections in parallel, and using particle rendering technology for dynamic rendering, the flexibility and diversity of particle effects are achieved.

Benefits of technology

It enhances the flexibility and realism of particle effects, enabling dynamic adjustment of particle distribution and behavior according to effect requirements, achieving efficient and realistic dynamic effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784910B_ABST
    Figure CN119784910B_ABST
Patent Text Reader

Abstract

The application provides a particle grid-based dynamic special effect rendering method, device, equipment and medium, relating to the technical field of computers. The method constructs a particle grid and obtains the coordinates of the grid nodes, making the distribution and movement of particles more orderly and controllable. By determining the correspondence between special effect particles and grid nodes according to special effect requirements, the distribution and behavior of particles can be flexibly adjusted, making the special effect more in line with design requirements. By parallel computing the coordinates and connection relationships of particles, the computing efficiency can be improved, and the state of particles can be updated in real time, making the special effect more dynamic and smooth. By determining the rendering mode of particles, the appearance and effect of particles can be flexibly adjusted according to different time points and states, making the special effect more rich and diverse. By using particle rendering technology to render particles, efficient and realistic dynamic special effects can be achieved, making the special effect performance more lively and improving the flexibility of particle special effects.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a dynamic special effect rendering method and device based on particle grid, equipment and medium. BACKGROUND

[0002] Particle effect technology is a technique in computer graphics that simulates and renders a collection of small particles to create natural phenomena such as smoke, fire, explosions, rain, snow and other visual effects. This technology is widely used in movies, games, simulation software and visual effects production.

[0003] The current particle effect technology has certain limitations in the connection and organization between particles. Traditional particle effects are achieved through predefined connection methods, which limits the creativity and flexibility of the effects. In addition, the existing technology simulates the interaction between particles simply, which cannot realistically simulate the physical interaction between particles, making the particle effect rigid, the visual effect single, and the flexibility poor.

[0004] Therefore, how to improve the flexibility of particle effects has become a technical problem to be solved at present. SUMMARY

[0005] The present application provides a dynamic special effect rendering method and device based on particle grid, equipment and medium, which aims to improve the flexibility of particle effects.

[0006] In a first aspect, the present application provides a dynamic special effect rendering method based on particle grid, which comprises the following steps:

[0007] Constructing a particle grid, obtaining the grid coordinates of at least one grid node in the particle grid coordinate system in the particle grid;

[0008] Based on the special effect demand, determining the corresponding relationship between at least one special effect particle and each grid node in the particle grid;

[0009] Based on the corresponding relationship and the network coordinates of each grid node, the particle coordinates corresponding to each special effect particle at at least one rendering time are calculated in parallel, and the particle connection relationship corresponding to each special effect particle at each particle coordinate is calculated;

[0010] Based on the particle coordinates corresponding to each special effect particle at each rendering time and the particle connection relationship corresponding to each particle coordinate, the particle rendering mode corresponding to each special effect particle at each rendering time is determined;

[0011] The particle effect particles are rendered based on a particle rendering technology and the particle rendering mode corresponding to each of the rendering time points of each of the particle effect particles, so as to achieve dynamic special effect rendering.

[0012] In a second aspect, the present application further provides a particle grid based dynamic special effect rendering device, which comprises:

[0013] A particle grid construction module is configured to construct a particle grid and obtain grid coordinates of at least one grid node in the particle grid in a particle grid coordinate system.

[0014] A corresponding relationship determination module is configured to determine a corresponding relationship between at least one particle effect particle and each of the grid nodes in the particle grid based on special effect requirements.

[0015] A particle coordinate calculation module is configured to calculate, in parallel, particle coordinates corresponding to each of the particle effect particles at at least one rendering time point and particle connection relationships corresponding to each of the particle effect particles at each of the particle coordinates based on the corresponding relationship and network coordinates of each of the grid nodes.

[0016] A rendering mode determination module is configured to determine a particle rendering mode corresponding to each of the particle effect particles at each of the rendering time points based on the particle coordinates corresponding to each of the particle effect particles at each of the rendering time points and the particle connection relationships at each of the particle coordinates.

[0017] A particle special effect rendering module is configured to render each of the particle effect particles based on a particle rendering technology and the particle rendering mode corresponding to each of the particle effect particles at each of the rendering time points, so as to achieve dynamic special effect rendering.

[0018] In a third aspect, the present application further provides a computer device, which comprises a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the steps of the particle grid based dynamic special effect rendering method as described above.

[0019] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the particle grid based dynamic special effect rendering method as described above.

[0020] The application provides a particle grid-based dynamic special effect rendering method and device, a computer device and a storage medium. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0022] Figure 1 The flowchart of the first embodiment of the particle grid-based dynamic special effect rendering method provided by the present application is shown in the figure.

[0023] Figure 2 The flowchart of the second embodiment of the particle grid-based dynamic special effect rendering method provided by the present application is shown in the figure.

[0024] Figure 3 The structure diagram of the first embodiment of the particle grid-based dynamic special effect rendering device provided by the present application is shown in the figure.

[0025] Figure 4 The structure diagram of the computer device provided by the embodiment of the present application is shown in the figure.

[0026] The implementation, functional characteristics and advantages of the present application will be further described with reference to the embodiments and the drawings. DETAILED DESCRIPTION

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

[0028] The flowchart shown in the drawing is only an example and does not necessarily include all the contents and operations / steps, nor does it have to be executed in the order described. For example, some operations / steps can also be decomposed, combined or partially merged, so the actual execution order can be changed according to the actual situation.

[0029] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The following examples and features in the examples can be combined with each other without conflict.

[0030] Please refer to Figure 1 , Figure 1 A flowchart of a first embodiment of a particle grid-based dynamic special effect rendering method provided by the present application is shown.

[0031] As Figure 1 shown, the particle grid-based dynamic special effect rendering method includes steps S101 to S105.

[0032] S101, constructing a particle grid, obtaining the grid coordinates of at least one grid node in the particle grid coordinate system in the particle grid;

[0033] In an embodiment, in a particle effect scene, a particle grid is first established, which contains a series of grid nodes. These nodes can be set to square, triangular or other shapes according to requirements. Each node can be represented by a coordinate position through a coordinate system. The particle grid can be used to simulate and render complex physical phenomena such as smoke, flame, water flow, etc.

[0034] Further, at least one preset special effect shape is obtained; based on at least one group of grid nodes corresponding to the special effect shape, the grid coordinates of the special effect shape in the particle grid coordinate system and the particle connection relationship between each special effect particle are obtained.

[0035] Specifically, when constructing a particle grid, the size of the grid needs to be determined first, i.e. the width and height of the particle grid; then the shape of the grid node is determined, which can be square, triangular or other shapes. A coordinate system is established, which is usually two-dimensional or three-dimensional, for positioning the grid nodes, and the position of the origin (0, 0) can be the center or a corner of the particle grid.

[0036] In an embodiment, the position of each node is calculated according to the size and shape of the grid.

[0037] For example, for a square grid, the coordinates of each node can be calculated by simple row and column indices. For triangular or other shapes, geometric algorithms can be used to determine the node positions.

[0038] In an embodiment, for each node, its coordinates in the particle grid coordinate system are calculated.

[0039] For example, for a square grid, the coordinates of a node can be represented as (i*cell width ,j*cell height ), where i and j are the row and column indices of the node, and cell width and cell height are the width and height of each grid cell. With the coordinate system, each node can be represented with a coordinate position, for example, in a two-dimensional space, the coordinates of a node can be (x, y). In a particle effect scene, these grid nodes can be used to simulate the behavior of particles, such as particle generation, motion, collision, and disappearance.

[0040] Generally, each node can contain the properties of a particle, such as velocity, color, life cycle, etc.

[0041] S102, based on the effect requirement, determine the correspondence relationship between at least one effect particle and each grid node in the particle grid;

[0042] For example, the effect requirement can include the type and behavior of the effect, such as smoke, flame, explosion, etc. It can also include the physical properties of the effect, such as diffusion speed, temperature, density, etc.

[0043] Further, based on the effect requirement, configure the particle properties of at least one effect particle; generate a preset number of effect particles based on the particle properties; and establish the correspondence relationship between the effect particles and the grid nodes closest to them based on the distribution information of the effect particles in the particle grid.

[0044] The particle properties include initial position, movement speed, and particle size, etc.

[0045] In an embodiment, according to the effect requirement, initialize the particle grid, including the size of the grid, the shape and spacing of the nodes. Determine the boundary conditions of the grid, such as periodic boundary, reflective boundary, etc. Define the initial properties of the effect particles, such as position, velocity, color, size, life cycle, etc.

[0046] In an embodiment, in a particle effect, a certain number of particles are generated by a particle generator and randomly distributed on the grid nodes. During the particle generation process, the properties of the particles can be set according to the effect requirement, such as initial position, velocity, mass, etc. At the same time, during the particle generation process, the particles are connected with the particles on the adjacent nodes to form a connection relationship in the grid.

[0047] Specifically, the positions of special effect particles are mapped to nodes of the particle grid by converting the continuous spatial coordinates of the particles into discrete grid node indices. For each particle, the nearest grid node is found, or particles are assigned to specific grid nodes based on some rules (such as the direction of the particle velocity).

[0048] For example, for each particle, an interpolation method or the like can be used to determine the weight of the particle between two or more grid nodes, and then calculate the correspondence between the particle and the grid nodes. This may involve. Alternatively, a mathematical formula or algorithm (such as nearest neighbor search, quadtree, spatial hashing, etc.) can be used to determine the correspondence between the particle and the grid node.

[0049] S103, based on the corresponding relationship and the network coordinates of each grid node, concurrently calculating the particle coordinates corresponding to each special effect particle at at least one rendering moment, and the particle connection relationship corresponding to each special effect particle at each particle coordinate;

[0050] In one embodiment, since the positions and connections of particles change dynamically, they can be adjusted based on special effects requirements. By dynamically adjusting the positions of particles, particle movement, rotation, and other behaviors can be simulated. For example, particle positions can be updated based on particle speed and time difference.

[0051] In one embodiment, necessary data can be prepared for each particle, including position, velocity, acceleration, color, size, rotation, etc. This data is dynamically updated based on the particle's lifecycle and behavior rules. At each rendering moment, particle interactions, such as collisions and connections, are considered, and particle positions are updated according to physical rules (such as gravity and wind speed).

[0052] For example, we can leverage the parallel computing capabilities of GPUs to process each grid node in the particle grid. Because GPUs excel at processing large numbers of small, parallel tasks, we can distribute the calculation of particle coordinates across multiple GPU cores. For each grid node, we perform mathematical transformations based on its grid coordinates, such as matrix multiplication, to calculate the particle coordinates in the particle grid coordinate system.

[0053] Furthermore, the connections between particles can be adjusted based on the desired special effects. For example, factors like distance and speed between particles can be used to determine whether to disconnect or reconnect. By dynamically adjusting particle positions and connections, more realistic and complex particle behavior can be simulated, increasing the realism and variability of special effects.

[0054] For example, the connection relationship between particles can be determined based on the physical rules of the particles and the special effects requirements. For example, data structures such as spatial hashing or quadtrees can be used to quickly find adjacent particles. For each particle, the relative position and distance to surrounding particles can be calculated by calculating the distance and angle between the particles to determine whether they should be connected.

[0055] In one embodiment, in a particle system, once a collision is detected, the particle velocity vector can be calculated and adjusted according to physical rules to respond to the collision. For example, the elastic coefficient can be used to adjust the velocity of the particle after the collision to simulate different physical behaviors. Furthermore, when the state of the special effect particle changes (such as movement), the particle state, such as velocity and position, can be updated based on the correspondence between the particle and the grid node. The behavior of the particle is updated by applying physical rules and special effect requirements, such as fluid dynamics and particle collisions.

[0056] In one embodiment, to improve the efficiency of neighbor particle search, a parallel sorting algorithm can be used to reduce the number of elements to be sorted and improve overall computing performance. For example, by performing Z-index sorting on grid cells instead of sorting all particles, repeated sorting operations can be avoided, saving computing overhead.

[0057] S104, determining a particle rendering mode corresponding to each special effect particle at each rendering moment based on the particle coordinates corresponding to each special effect particle at each rendering moment and the particle connection relationship corresponding to each particle coordinate;

[0058] In one embodiment, in particle effects, the behavior and appearance of particles need to be calculated and rendered using computing and rendering techniques. Advanced computing and rendering techniques can be used to efficiently calculate and render the behavior and appearance of a large number of particles.

[0059] In terms of computation, parallel computing technologies, such as those based on graphics processing units (GPUs), can be used to distribute the calculation of particle behavior across multiple computing units, improving computational efficiency. For example, technologies such as CUDA or OpenCL can be used to leverage the parallel computing capabilities of multi-core processors and GPUs to calculate and update particle positions and connectivity in parallel.

[0060] In terms of rendering, advanced rendering techniques, such as volume rendering or fluid simulation, can be used to enhance the appearance of particles. For example, volume rendering can be used to render particles with lighting, shadows, and material effects, enhancing the visual quality of special effects. By applying computing and rendering techniques, more accurate and realistic particle effects can be achieved.

[0061] In an embodiment, according to the particle coordinates of the special effect particles at each rendering time and the particle connection relationship, the particle rendering mode of each special effect particle at each rendering time is determined, including different shapes formed by the special effect particles at different rendering times, and the rendering state of the special effect particles forming the same shape at different rendering times.

[0062] For example, assuming that the special effect requirement is to render the burning effect of a flame in the particle space, the number of special effect particles required to form the shape of the flame is first determined, the shape and distribution of the flame are constructed by setting the position coordinates of each special effect particle in the particle grid, and then the flow and diffusion of the flame are simulated according to the connection relationship between the flame special effect particles. According to the actual special effect requirement of the flame flow and diffusion, the semi-transparent particle material can be used to simulate the irregular edges of the flame in combination with the color gradient (such as from yellow to red) and noise texture, and the particle blending mode can be used to achieve the glowing effect of the flame.

[0063] For example, assuming that the special effect requirement is to simulate the diffusion and drift of smoke. Then the continuity and density change of the smoke can be simulated according to the connection relationship of the smoke particles. Then according to the characteristics of the smoke diffusion and drift, the special effect rendering mode is determined as follows: using a semi-transparent particle material, combining a color gradient (from white to gray) and a blur effect to simulate the soft edges of the smoke. The particle blending mode (such as Alpha Blending) is used to achieve the transparent effect of the smoke.

[0064] For example, assuming that the special effect requirement is to simulate the explosion effect, and the explosion process has shock wave and debris distribution, then the diffusion of the explosion and the interaction of the debris can be simulated through the connection relationship between the explosion particles. The special effect rendering mode can be determined as follows: using a particle material with highlight and glowing effect, combining a color gradient (from white to black) and an explosion texture to simulate the intense light and shock wave of the explosion. The particle blending mode is used to achieve the glowing effect of the explosion.

[0065] Similarly, according to the special effect requirement, the particle coordinates and particle connection relationship of the special effect particles at different rendering times are determined to simulate the special effect effect in the special effect requirement, and then the rendering mode of the special effect particles at different rendering times is determined according to the required special effect effect. For example, the particles need to move at high speed during the explosion process, and the color will gradually change from highlight to weak effect.

[0066] S105, rendering each special effect particle based on the particle rendering technology and the particle rendering mode of each special effect particle at each rendering time to achieve dynamic special effect rendering.

[0067] Generally, particle rendering techniques include point sprite rendering, geometry rendering, and instancing rendering. Point sprite rendering is suitable for simple particle effects such as sparks or small raindrops. Geometry rendering can be used to create more complex particle shapes such as flames and smoke. Instancing rendering is an efficient technique that can render a large number of identical particles at once, reducing the number of rendering calls. One or more particle rendering techniques can be used to render special effect particles according to actual needs.

[0068] In an embodiment, the initial speed, size, rotation, and color of the particles are set according to the requirements of the particle special effect. At the same time, the emission rate and burst state of the particles are controlled through the Emission attribute.

[0069] For example, the rendering direction of the particles can be adjusted according to the direction in which the particle billboard is facing. For example, in Unity, the direction in which the particles are facing can be controlled by setting the Render Alignment, such as View (facing the camera plane), World (aligned with the world axis), etc.

[0070] For example, to add visual effects to the particles, materials and shaders can be applied. Materials define the appearance of particles, such as color, texture, and transparency, while shaders define the lighting and rendering effects of particles, such as glow, reflection, and refraction. These effects can change dynamically according to the properties of the particles and the scene environment, and the color of the particles can be dynamically adjusted through code to increase the diversity and realism of the special effects.

[0071] For example, the shape and size of the emitter can be set through the Shape attribute, such as Sphere (sphere), Cone (cone), Box (box), etc., to adapt to different special effect requirements.

[0072] For example, the rendering method of the special effect particles can be dynamically adjusted according to changes in the scene. For example, when the particles are close to the camera, the details and complexity of the particles can be increased to improve the visual effect; when the particles are far from the camera, the details can be reduced to save computing resources.

[0073] For example, the interaction between the particles and the collision panel can be set, such as Dampen (damping), Bounce (bouncing), and Lifetime Loss (lifetime loss), as well as Sub Emitters (reproduction effect), to control the collision and reproduction behavior of the particles.

[0074] Optionally, the particles can be rendered in order according to their depth information to achieve correct depth testing and rendering order. For transparent or semi-transparent particles, a blending mode can be used and rendered according to the order of the particles.

[0075] In an embodiment, various rendering techniques such as particle shadow, particle halo, particle reflection, etc. can be applied to enhance the realism of special effects. Post-processing effects such as blur, color correction, etc. can be used to further enhance the visual effect.

[0076] In an embodiment, the particle special effect can be adjusted according to feedback by monitoring the rendering effect and performance. The particle system parameters such as emission rate, particle lifetime, particle size, etc. are optimized to achieve the best visual effect and performance balance.

[0077] The embodiment provides a dynamic special effect rendering method based on particle grid. The method constructs a particle grid and obtains the coordinates of the grid nodes, so that the distribution and motion of particles are more orderly and controllable. By determining the correspondence between special effect particles and grid nodes according to the special effect requirements, the distribution and behavior of particles can be flexibly adjusted, so that the special effect is more in line with the design requirements. By parallel computing the coordinates and connection relationship of particles, the computing efficiency can be improved, and the state of particles can be updated in real time, so that the special effect is more dynamic and smooth. By determining the rendering mode of particles, the appearance and effect of particles can be flexibly adjusted according to different time points and states, so that the special effect is more rich and diverse. By using particle rendering technology to render particles, efficient and realistic dynamic special effects can be realized, so that the special effect performance is more vivid, and the flexibility of particle special effects is improved.

[0078] Please refer to Figure 2 , Figure 2 for a flowchart of a second embodiment of a dynamic special effect rendering method based on particle grid provided by the present application.

[0079] In the embodiment, as shown in Figure 2 based on the above Figure 1 embodiment, the step S103 further comprises:

[0080] S201, based on the correspondence and the network coordinates of each grid node, calculating the particle coordinates corresponding to each special effect particle at at least one rendering time, obtaining the moving speed and direction of the special effect particle;

[0081] In an embodiment, the position of a particle can be updated according to its initial position, velocity and acceleration, and external forces (such as gravity, wind force) it receives. This process is usually performed in each rendering frame to ensure that the dynamic changes of particles can be reflected in the rendering result in real time.

[0082] Exemplarily, the speed of a particle can be calculated by dividing the change of its position by the time interval (Delta Time). The direction is the direction of the particle speed vector. In Unity, the initial speed of a particle can be controlled by setting the Start Speed parameter, and the speed change over the lifetime of the particle can be controlled by the Velocity Over LifeTime and Limit Velocity Over LifeTime parameters.

[0083] In an embodiment, in some special effects, there can be interactions between particles, such as connection, collision, etc. These relationships will affect the moving track and speed of the particles. For example, the effect of particles rotating around a center point can be simulated by using Vortex Velocity, at this time, the relative position between the particle and the center point can be calculated, and the speed and direction of the particle can be updated accordingly.

[0084] S202, based on the moving speed, the moving direction, and the current particle coordinate of the special effect particle at the current rendering time, calculating the next particle coordinate of the special effect particle at the next rendering time;

[0085] In an embodiment, the current particle coordinate refers to the position of the special effect particle in the particle space at the current rendering time. The moving speed represents the speed of the special effect particle, which can be a vector, each component vector representing the speed in the corresponding axis direction, such as the moving speed of the special effect particle in the X, Y, Z three axis directions in a three-dimensional space. The moving direction can be a unit vector, which represents the direction of the particle movement, and determines the moving path of the particle.

[0086] Exemplarily, considering the distance of the particle movement in a given time, the speed vector can be multiplied by the time interval (usually the time difference between two frames, called Delta Time) to calculate the next particle coordinate. If the moving direction of the particle is changing, the speed vector needs to be decomposed into components consistent with the moving direction, which can be achieved by dot product and cross product, to ensure that the speed vector is aligned with the moving direction of the particle.

[0087] Exemplarily, in some cases, such as explosion effects, vortex effects, etc., the speed of the special effect particle is closer to the center position, the speed changes greatly, at this time, interpolation methods can be used to smooth the movement of the particle, such as linear interpolation, quadratic interpolation or cubic interpolation, etc.

[0088] S203, based on the next particle coordinate of each special effect particle at the next rendering time, determining the particle connection relationship of each special effect particle at the next rendering time.

[0089] It is understandable that in the particle special effect system, the connection relationship between special effect particles is crucial for simulating complex physical phenomena (such as flame, water flow, smoke, etc.). The connection relationship between particles can help simulate the continuity in physical phenomena. For example, in a flame, particles exhibit the continuity and dynamic changes of the flame through the connection relationship; in water flow, the connection relationship simulates the continuous flow and wave pattern of the water flow. Through the connection between particles, a more rich and detailed visual effect can be created. For example, the particles in the smoke form the outline and flow path of the smoke through the connection relationship, enhancing the realism of the visual effect.

[0090] Further, based on the next particle coordinates of each of the special effect particles at the next rendering time, the relative distance of each of the special effect particles at the next rendering time is calculated; for the special effect particles whose relative distance is less than or equal to a preset relative distance, the particle connection relationship is constructed.

[0091] In an embodiment, the predicted coordinates of each particle at the next rendering time are calculated according to the current coordinates, velocity and moving direction of the particle. The Euclidean distance between any two particles is calculated using the distance formula.

[0092] For example, for two special effect particles P1 (x1, y1, z1) and P2 (x2, y2, z2) in the particle space, the distance between them can be expressed as:

[0093]

[0094] In an embodiment, a preset relative distance threshold Δd can be set to determine whether the particles are close enough to form a connection relationship.

[0095] For each pair of particles, if their relative distance at the next rendering time is less than or equal to Δd, it is considered that there is a connection relationship between them, which is used to simulate the physical interaction between particles, such as adhesion, attraction or repulsion.

[0096] Further, when the special effect particle pair has the particle connection relationship at the current rendering time, and the corresponding relative distance at the next rendering time is greater than the preset relative distance, the particle connection relationship is disconnected at the next rendering time.

[0097] For the particle connection relationship that already exists at the current rendering time, if the relative distance at the next rendering time is greater than Δd, it is considered that the connection relationship between these particles should be disconnected, which is used to simulate the physical phenomenon of particles separating due to movement.

[0098] In an embodiment, since the particle system can contain a large number of particles, calculating the distance between all pairs of particles can result in a huge amount of computation. Therefore, a spatial partitioning technique such as quadtree, octree or grid is used to reduce the distance pairs that need to be calculated. At the same time, using techniques such as CUDA or OpenCL, the parallel computing power of multi-core processors and graphics processors is used to calculate and update the positions and connection relationships of particles in parallel, thereby improving efficiency.

[0099] This embodiment dynamically simulates and renders the complex interactions between particles by calculating the positions and connection relationships of special effect particles at different rendering moments, thereby creating realistic visual effects. It is suitable for static special effect scenes, but also for dynamic changing environments such as wind, explosion or other external force affected particle behavior.

[0100] Please refer to Figure 3 , Figure 3 is a structure diagram of a first embodiment of a dynamic special effect rendering device based on a particle grid provided by the present application. The dynamic special effect rendering device based on a particle grid is used to execute the aforementioned dynamic special effect rendering method based on a particle grid.

[0101] As Figure 3 shown, the dynamic special effect rendering device based on a particle grid 300 includes a particle grid construction module 301, a corresponding relationship determination module 302, a particle coordinate calculation module 303, a rendering mode determination module 304, and a particle special effect rendering module 305.

[0102] The particle grid construction module 301 is configured to construct a particle grid and obtain a grid coordinate of at least one grid node in the particle grid in a particle grid coordinate system.

[0103] The corresponding relationship determination module 302 is configured to determine a corresponding relationship between at least one special effect particle and each grid node in the particle grid based on special effect requirements.

[0104] The particle coordinate calculation module 303 is configured to calculate, in parallel, a particle coordinate corresponding to each special effect particle at at least one rendering moment and a particle connection relationship corresponding to each special effect particle at each particle coordinate based on the corresponding relationship and the network coordinates of each grid node.

[0105] The rendering mode determination module 304 is configured to determine a particle rendering mode corresponding to each special effect particle at each rendering moment based on the particle coordinate corresponding to each special effect particle at each rendering moment and the particle connection relationship corresponding to each special effect particle at each particle coordinate.

[0106] The particle special effect rendering module 305 is configured to render each of the special effect particles based on the particle rendering technology and the particle rendering mode corresponding to each of the special effect particles at each of the rendering time points, so as to realize dynamic special effect rendering.

[0107] In an embodiment, the particle coordinate calculation module 303 comprises:

[0108] The particle movement parameter calculation unit is configured to calculate the particle coordinate corresponding to each of the special effect particles at at least one of the rendering time points based on the correspondence and the network coordinates of each of the grid nodes, so as to obtain the movement speed and the movement direction of the special effect particles.

[0109] The next particle coordinate calculation unit is configured to calculate the next particle coordinate of the special effect particle at the next rendering time point based on the movement speed, the movement direction and the current particle coordinate of the special effect particle at the current rendering time point.

[0110] The particle connection relationship calculation unit is configured to determine the particle connection relationship of each of the special effect particles at the next rendering time point based on the next particle coordinate of each of the special effect particles at the next rendering time point.

[0111] In an embodiment, the particle connection relationship calculation unit comprises:

[0112] The relative distance calculation sub-unit is configured to calculate the relative distance of each of the special effect particles at the next rendering time point based on the next particle coordinate of each of the special effect particles at the next rendering time point.

[0113] The connection relationship construction sub-unit is configured to construct the particle connection relationship for the special effect particles with the relative distance less than or equal to the preset relative distance.

[0114] In an embodiment, the particle connection relationship calculation unit further comprises:

[0115] The connection relationship breaking sub-unit is configured to break the particle connection relationship at the next rendering time point when the particle connection relationship exists between the pair of special effect particles at the current rendering time point and the relative distance corresponding to the pair of special effect particles at the next rendering time point is greater than the preset relative distance.

[0116] In an embodiment, the correspondence determination module 302 comprises:

[0117] The particle attribute configuration unit is configured to configure the particle attribute of at least one of the special effect particles based on the special effect requirement.

[0118] The particle generation unit is configured to generate a preset number of the special effect particles based on the particle attribute.

[0119] The correspondence establishing unit is configured to establish the correspondence between the special effect particle and the grid node closest to the special effect particle based on the distribution information of the special effect particle in the particle grid.

[0120] In an embodiment, the particle attribute includes an initial position, a moving speed, and a particle size.

[0121] In an embodiment, the particle grid based dynamic special effect rendering apparatus 300 further includes a special effect shape coordinate generation module, which includes:

[0122] The special effect shape obtaining unit is configured to obtain at least one preset special effect shape.

[0123] The special effect shape coordinate obtaining unit is configured to obtain the grid coordinates of the special effect shape in the particle grid coordinate system and the particle connection relationship among the special effect particles based on at least one group of the grid nodes corresponding to the special effect shape.

[0124] It should be noted that, for the convenience and brevity of description, the specific working processes of the above-described apparatus and modules can refer to the corresponding processes in the foregoing particle grid based dynamic special effect rendering method embodiments, which will not be described herein.

[0125] The apparatus provided in the foregoing embodiments can be implemented as a computer program in the form of a program product, which can run on a computer device such as the computer device 1000 shown in FIG. 10. Figure 4

[0126] Please refer to Figure 4 , Figure 4 is a structural schematic block diagram of a computer device provided in an embodiment of the present application. The computer device can be a server.

[0127] Please refer to Figure 4 , the computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory can include a non-volatile storage medium and an internal memory.

[0128] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, which, when executed, can cause the processor to perform any kind of particle grid based dynamic special effect rendering method.

[0129] The processor is configured to provide computing and control capabilities to support the operation of the entire computer device.

[0130] The internal memory provides an environment for the running of the computer program in the non-volatile storage medium, which, when executed by the processor, can cause the processor to perform any kind of particle grid based dynamic special effect rendering method. ​

[0131] The network interface is configured to perform network communication, such as sending the assigned task, etc. Those skilled in the art can understand that, Figure 4 The structure shown in FIG. 1 is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0132] It should be understood that the processor can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0133] In one embodiment, the processor is configured to run a computer program stored in the memory to perform the following steps:

[0134] constructing a particle grid to obtain a grid coordinate of at least one grid node in the particle grid coordinate system in the particle grid;

[0135] determining a corresponding relationship between at least one special effect particle and each grid node in the particle grid based on special effect requirements;

[0136] based on the corresponding relationship and the network coordinates of each grid node, calculating particle coordinates corresponding to each special effect particle at at least one rendering time, and particle connection relationships corresponding to each special effect particle at each particle coordinate in parallel;

[0137] determining particle rendering modes corresponding to each special effect particle at each rendering time based on the particle coordinates corresponding to each special effect particle at each rendering time and the particle connection relationships corresponding to each special effect particle at each particle coordinate;

[0138] based on the particle rendering technology and the particle rendering modes corresponding to each special effect particle at each rendering time, rendering each special effect particle to achieve dynamic special effect rendering.

[0139] In one embodiment, the processor, when implementing the determining the correspondence between each of the special effect particles and each of the grid nodes based on the special effect requirement, is configured to:

[0140] calculating the particle coordinate corresponding to each of the special effect particles at at least one rendering time based on the correspondence and the network coordinates of each of the grid nodes, and obtaining the moving speed and the moving direction of the special effect particle;

[0141] calculating the next particle coordinate of the special effect particle at the next rendering time based on the moving speed, the moving direction and the current particle coordinate of the special effect particle at the current rendering time;

[0142] determining the particle connection relationship of each of the special effect particles at the next rendering time based on the next particle coordinate of each of the special effect particles at the next rendering time.

[0143] In one embodiment, the processor, when implementing the determining the particle connection relationship of each of the special effect particles at the next rendering time based on the next particle coordinate of each of the special effect particles at the next rendering time, is configured to:

[0144] calculating the relative distance of each of the special effect particles at the next rendering time based on the next particle coordinate of each of the special effect particles at the next rendering time;

[0145] constructing the particle connection relationship for the special effect particle with the relative distance less than or equal to the preset relative distance.

[0146] In one embodiment, the processor, after implementing the calculating the relative distance of each of the special effect particles at the next rendering time based on the next particle coordinate of each of the special effect particles at the next rendering time, is further configured to:

[0147] disconnecting the particle connection relationship at the next rendering time when the particle connection relationship exists between the special effect particles at the current rendering time and the relative distance corresponding to the next rendering time is greater than the preset relative distance.

[0148] In one embodiment, the processor, when implementing the determining the correspondence between each of the special effect particles and each of the grid nodes based on the special effect requirement, is configured to:

[0149] configuring the particle attribute of at least one of the special effect particles based on the special effect requirement;

[0150] generating a preset number of the special effect particles based on the particle attribute;

[0151] Based on the distribution information of the special effect particles in the particle grid, the special effect particles and the grid nodes closest to them establish the correspondence.

[0152] In one embodiment, the particle attributes include initial positions, moving speeds, and particle sizes.

[0153] In one embodiment, after implementing the constructing a particle grid and obtaining the grid coordinates of at least one grid node in the particle grid in a particle grid coordinate system, the processor is further configured to implement:

[0154] Obtaining at least one preset special effect shape;

[0155] Based on the at least one group of grid nodes corresponding to the special effect shape, obtaining the grid coordinates of the special effect shape in the particle grid coordinate system and the particle connection relationship among the special effect particles.

[0156] Embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program includes program instructions. The processor executes the program instructions to implement any of the particle grid based dynamic special effect rendering methods provided by the embodiments of the present application.

[0157] The computer readable storage medium can be an internal storage unit of the computer device, for example, a hard disk or a memory of the computer device. The computer readable storage medium can also be an external storage device of the computer device, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc.

[0158] The above merely describes the specific embodiments of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A particle grid based dynamic effect rendering method, characterized in that, The method comprises: constructing a particle grid, obtaining grid coordinates of at least one grid node in the particle grid coordinate system in the particle grid; determining the correspondence between at least one special effect particle and each grid node in the particle grid based on special effect requirements; based on the correspondence and the network coordinates of each grid node, calculating the particle coordinates corresponding to each special effect particle at at least one rendering time, and the particle connection relationship corresponding to each special effect particle at each particle coordinate; the particle connection relationship corresponding to each special effect particle at each particle coordinate includes establishing a connection relationship or disconnecting a connection relationship between each special effect particle and other special effect particles at each particle coordinate; based on the particle coordinates corresponding to each special effect particle at each rendering time and the particle connection relationship at each particle coordinate, determining the particle rendering mode corresponding to each special effect particle at each rendering time; based on the particle rendering technology and the particle rendering mode corresponding to each special effect particle at each rendering time, rendering each special effect particle to realize dynamic special effect rendering; wherein, based on the special effect requirements, determining the correspondence between at least one special effect particle and each grid node in the particle grid comprises: configuring the particle attributes of at least one special effect particle based on the special effect requirements; generating a preset number of special effect particles based on the particle attributes; based on the distribution information of the special effect particles in the particle grid, establishing the correspondence between the special effect particles and the grid nodes closest to them.

2. The particle-mesh-based dynamic special effect rendering method of claim 1, wherein, based on the correspondence and the network coordinates of each grid node, calculating the particle coordinates corresponding to each special effect particle at at least one rendering time, obtaining the moving speed and direction of the special effect particles; based on the moving speed, the moving direction and the current particle coordinates of the special effect particle at the current rendering time, calculating the next particle coordinates of the special effect particle at the next rendering time; based on the next particle coordinates of each special effect particle at the next rendering time, determining the particle connection relationship of each special effect particle at the next rendering time. based on the next particle coordinates of each special effect particle at the next rendering time, calculating the relative distance of each special effect particle at the next rendering time; 3. The particle-mesh-based dynamic special effect rendering method of claim 2, wherein, for special effect particles with a relative distance less than or equal to a preset relative distance, constructing the particle connection relationship. after calculating the relative distance of each special effect particle at the next rendering time based on the next particle coordinates of each special effect particle at the next rendering time, the method further comprises: ​ 4. The particle-mesh-based dynamic special effect rendering method of claim 3, wherein, ​ When the particle connection relationship exists at a current rendering moment and the relative distance corresponding to a next rendering moment is greater than the preset relative distance, the particle connection relationship is disconnected at the next rendering moment.

5. The particle-mesh-based dynamic special effect rendering method of claim 1, wherein, The particle attributes include initial positions, moving speeds, and particle sizes.

6. The particle-mesh based dynamic special effect rendering method of claim 1, wherein, The particle grid construction module further comprises: acquiring at least one preset special effect shape; based on at least one group of the grid nodes corresponding to the special effect shape, obtaining the grid coordinates of the special effect shape in the particle grid coordinate system and the particle connection relationship between the special effect particles.

7. A particle grid based dynamic effect rendering apparatus, characterized by, The particle grid construction module further comprises: a particle grid construction module for constructing a particle grid and obtaining the grid coordinates of at least one grid node in the particle grid coordinate system; a corresponding relationship determination module for determining the corresponding relationship between at least one special effect particle and each grid node in the particle grid based on special effect requirements; wherein the corresponding relationship determination module is further configured to configure the particle attributes of at least one special effect particle based on the special effect requirements, generate a preset number of special effect particles based on the particle attributes, and establish the corresponding relationship between the special effect particles and the grid nodes closest to them based on the distribution information of the special effect particles in the particle grid; a particle coordinate calculation module for calculating the particle coordinates of each special effect particle at at least one rendering moment and the particle connection relationship between each special effect particle at each particle coordinate based on the corresponding relationship and the network coordinates of each grid node in parallel; the particle connection relationship between each special effect particle at each particle coordinate includes the connection relationship or disconnection relationship between each special effect particle at each particle coordinate and other special effect particles; a rendering mode determination module for determining the particle rendering mode of each special effect particle at each rendering moment based on the particle coordinates of each special effect particle at each rendering moment and the particle connection relationship at each particle coordinate; a particle special effect rendering module for rendering each special effect particle based on particle rendering technology and the particle rendering mode of each special effect particle at each rendering moment to achieve dynamic special effect rendering.

8. A computer device, comprising: The computer device comprises a processor, a memory, and a computer program stored on the memory and executed by the processor, wherein the computer program is executed by the processor to implement the steps of the particle grid-based dynamic special effect rendering method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is executed by the processor to implement the steps of the particle grid-based dynamic special effect rendering method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Smoke modeling method in large-scene environment

    CN109977431A

  • Particle special effect rendering method, device and equipment and storage medium

    CN112652044A