Optimization method, system and equipment for particle system
By adopting quantum computing and particle multiplexing technology in particle systems, the problems of insufficient adaptability and rendering performance of particle systems in the prior art are solved, and a more realistic and vivid visual effect is achieved.
Patent Information
- Application Number
- CN202411730683.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-11-29
AI Technical Summary
The existing particle systems based on AI models and GPU acceleration have shortcomings in adapting to scene changes, resulting in deviations from actual needs and poor rendering performance.
Quantum computing is used to predict the behavior of particles in real time, and the special effect attributes are randomly initialized and dynamically adjusted, dynamic special effects are generated that are adapted to different scenarios, and the particle usage efficiency is optimized through particle multiplexing pools and multiplexing strategies.
It improves the adaptability and rendering performance of the particle system, generates more realistic and vivid visual effects, and can better match the needs of different game scenes.
Smart Images

Figure CN119672182A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to an optimization method, system and device for a particle system. Background Art
[0002] At present, in the field of game development, particle systems have become an indispensable tool for achieving complex special effects. By simulating the movement and interaction of particles, particle systems can generate vivid and realistic visual effects such as fire, smoke, and explosions, greatly enhancing the visual experience of the game and making the game scene more realistic and fascinating.
[0003] In the existing technology, particle systems based on AI models and GPU acceleration are usually used. Through the combination of intelligence and parallel computing, the expressiveness of particle special effects and system performance are effectively improved. For example, the AI model can predict the movement trajectory and interaction behavior of particles, thereby achieving more natural and realistic special effects, while GPU acceleration technology significantly improves the calculation and rendering speed of particles and reduces the consumption of system resources.
[0004] However, the particle system based on the AI model and GPU acceleration can improve the calculation and rendering speed of particles to a certain extent through intelligent parallel computing. However, the above system is difficult to adapt to scene changes quickly and has poor adaptability. Different game scenes have different requirements for particle special effects, resulting in a deviation between special effects and actual needs and poor rendering performance. Summary of the invention
[0005] The embodiments of the present application provide an optimization method, system and device for a particle system, which can solve the problems of poor adaptability and rendering performance in the particle system rendering process in the prior art.
[0006] In a first aspect, an embodiment of the present application provides an optimization method for a particle system, comprising:
[0007] Loading a particle system, and randomly initializing particle properties of particles in the particle system, wherein the particle properties include position, speed, and color;
[0008] Based on the movement and interaction laws of particles, quantum computing is used to predict the behavior of particles in real time and generate dynamic special effects for corresponding scenes;
[0009] Dynamically adjust the special effect properties of the particles according to the scene and state of the player, the special effect properties including transparency, color and texture of the particles;
[0010] The life state of each particle is tracked in real time, each particle is marked, a particle reuse pool is generated, and a particle reuse strategy is generated based on the particle reuse pool. The particle reuse strategy is used for dynamic allocation of reusable particles.
[0011] Furthermore, the loading of the particle system and the random initialization of the particle properties in the particle system include:
[0012] Using an asynchronous loading method, system resources required by the particle system are loaded, wherein the system resources include the number of particles, memory capacity, disk space, and network bandwidth;
[0013] According to the number of particles, randomly generating position coordinates, velocity components, rotation components and color components for each particle in three-dimensional space;
[0014] The position coordinates, the speed component, the rotation component and the color component are used as initial particle attribute values and assigned to corresponding particle attribute variables of each particle object.
[0015] Furthermore, based on the movement and interaction rules of particles, quantum computing is used to predict the behavior of particles in real time and generate dynamic special effects for corresponding scenes, including:
[0016] Obtaining initial particle attribute values of each particle, mapping the initial particle attribute values to quantum bits, and constructing a quantum state space of the particle;
[0017] According to the influence of wind and terrain on particle motion, a quantum Haddonian model of particle motion is established, and by solving the Schrödinger equation, the quantum state evolution law of particle motion is obtained. The quantum Haddonian model includes kinetic energy terms, potential energy terms and external field terms, and the external field terms are used to reflect the influence of wind and terrain on particle motion;
[0018] Introducing a temperature variable into the quantum state space, and simulating the effect of temperature change on the surrounding environment through quantum state superposition;
[0019] Based on the special effects requirements of different scenes, the particle attribute value of each particle is dynamically adjusted through quantum gate parameters and measurement basis;
[0020] Random sampling is performed in the quantum state space to obtain classical state information of particles, and the classical state information is input into a classical rendering pipeline to generate dynamic special effects.
[0021] Furthermore, the method of using quantum computing to predict the behavior of particles in real time based on the movement and interaction rules of particles and generate dynamic special effects for corresponding scenes also includes:
[0022] Using quantum entangled states, a correlation model between different particles is established. Based on the correlation model, a particle population evolution equation is constructed. By solving the particle population evolution equation, the quantum state evolution law of collision and interaction between different particles is obtained;
[0023] The specific formula of the particle population evolution equation is as follows:
[0024]
[0025] Among them, H represents the total Hamiltonian, H=H0+Hint, H0 is the Hamiltonian of free particles, Hint is the Hamiltonian of interacting particles, and |Ψ(t)> represents the quantum entangled state between interacting particles.
[0026] Furthermore, based on the movement and interaction laws of particles, quantum computing is used to predict the behavior of particles in real time and generate dynamic special effects for the corresponding scenes, including:
[0027] Acquire the particle parameters of each particle in the dynamic special effects in real time, wherein the particle parameters include particle attributes and scene parameters, wherein the scene parameters include wind force, terrain, lighting and temperature;
[0028] Encoding the particle parameters to obtain particle encoding data;
[0029] The particle encoding data is input into a quantum neural network, and the particle encoding data is optimized by the quantum neural network.
[0030] Further, the scenes include deserts, volcanoes and forests, and the states are the life cycle of the player;
[0031] The special effect properties of the particles are dynamically adjusted according to the scene and state of the player, and the special effect properties include transparency, color and texture of the particles, including:
[0032] By analyzing the scene parameters of the scene in real time, determining a particle parameter combination of each particle in the scene, wherein the particle parameter combination includes attribute values of all special effect attributes of the particle;
[0033] Based on the particle parameter combination, the plurality of particles are divided into multiple rendering levels for rendering;
[0034] Adopting a machine learning algorithm to iteratively update the particle parameter combination;
[0035] Using particle special effects enhancement technology based on image analysis, the particle movement trajectory and visual effects are dynamically adjusted according to changes in the player's scene.
[0036] Furthermore, the life state includes a visible state and an impact state, wherein the visible state indicates the proportion of the particle on the screen, and the impact state indicates the contribution of the particle to the overall brightness and color of the scene;
[0037] The real-time tracking of the life state of each particle, marking each particle, and generating a particle reuse pool include:
[0038] When the visible state or the influence state of a particle is lower than a preset state threshold, the particle is marked as a reusable particle, and a plurality of the reusable particles are allocated to a particle reuse pool;
[0039] Performing similarity analysis on the special effect attributes of the reusable particles to determine the particle type of the reusable particles;
[0040] According to the number of the particle types, the particle multiplexing pool is divided into a plurality of sub-multiplexing pools, one of the sub-multiplexing pools represents a reusable particle of one particle type, and the particle types include flame, smoke and water flow.
[0041] Furthermore, based on the particle reuse pool, a particle reuse strategy is generated, and the particle reuse strategy is used for dynamic allocation of reusable particles, including:
[0042] Using a particle reuse acceleration mechanism, the particle attributes of the reusable particles are reset and the states are converted;
[0043] Setting a preset number of reusable particle objects for each of the sub-reuse pools;
[0044] Real-time monitoring of the life cycle status of particles of different particle types in the scene, and dynamically adjusting the number of reusable particle objects in each of the sub-reuse pools based on the preset number of particles, wherein the life cycle status includes generation, activity, decay, and extinction;
[0045] The gradient boosting algorithm is used to evaluate the reuse effect of the reusable particles, and based on the evaluation result, the proportion of the reused particles is dynamically adjusted.
[0046] In a second aspect, an embodiment of the present application provides an optimization system for a particle system, comprising:
[0047] The first processing module is used to load the particle system and randomly initialize the particle properties of the particles in the particle system, wherein the particle properties include position, speed and color;
[0048] The second processing module is used to predict the behavior of particles in real time based on the movement and interaction laws of particles and generate dynamic special effects for the corresponding scenes by using quantum computing;
[0049] The third processing module is used to dynamically adjust the special effect properties of the particles according to the scene and state of the player, and the special effect properties include transparency, color and texture of the particles;
[0050] The fourth processing module is used to track the life state of each particle in real time, mark each particle, generate a particle reuse pool, and generate a particle reuse strategy based on the particle reuse pool, wherein the particle reuse strategy is used for dynamic allocation of reusable particles.
[0051] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned optimization method for a particle system when executing the computer program.
[0052] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0053] The present application discloses an optimization method for a particle system, which provides an initial state for each particle by loading the particle system and randomly initializing the particle properties, and uses quantum computing to predict the behavior of the particles in real time, so that dynamic special effects can adapt to scene changes. In addition, according to the scene and state of the player, the special effect properties of the particles are dynamically adjusted to effectively improve the expressiveness of the special effects. At the same time, by tracking the life state of the particles in real time, generating a particle reuse pool and formulating a reuse strategy, the efficiency of particle use can be optimized, thereby adapting to the differences in particle special effects caused by changes in multiple scenes, improving the overall adaptability and rendering performance of the particle system, and obtaining more realistic and vivid visual effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0055] Figure 1 is a flow chart of an optimization method for a particle system provided by an embodiment of the present invention;
[0056] Figure 2 is a schematic structural diagram of an optimization system for a particle system provided by an embodiment of the present invention;
[0057] Figure 3 It is a structural diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0059] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0060] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0061] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0062] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0063] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0064] See also Figure 1 As shown, the present invention is an optimization method for a particle system, comprising the following steps:
[0065] S100, loading a particle system, and randomly initializing particle properties of particles in the particle system, wherein the particle properties include position, speed, and color;
[0066] In some embodiments, the above step S100 includes:
[0067] Using an asynchronous loading method, system resources required by the particle system are loaded, wherein the system resources include the number of particles, memory capacity, disk space, and network bandwidth;
[0068] According to the number of particles, randomly generating position coordinates, velocity components, rotation components and color components for each particle in three-dimensional space;
[0069] The position coordinates, the speed component, the rotation component and the color component are used as initial particle attribute values and assigned to corresponding particle attribute variables of each particle object.
[0070] In this embodiment, the particle system is loaded, and the system resources required by the particle system are obtained through the resource management module. It can be understood that the system resources of the particle system are preset in the resource management module, and the preset configuration of the system resources is manually configured by the user according to the needs, or the resource management module is automatically configured based on the default mode. The resource management module can monitor the running status of the particle system in real time, and dynamically adjust the allocation of system resources according to the current load and performance requirements, which not only improves the utilization efficiency of resources, but also ensures the stability and smoothness of particle effects in different scenarios. In addition, through the preset configuration, the resource management module can reasonably control the upper limit of the resource usage of the particle system, avoiding performance bottlenecks and waste caused by excessive resource occupation.
[0071] In one embodiment, the memory space of the particle system is also efficiently managed through a memory pool management module and a memory optimization algorithm, so as to reduce memory fragmentation and improve memory utilization. Specifically, the required memory space is determined according to the preset configuration of the particle system, and the required memory space is applied for through the memory pool management module. The memory pool management module is responsible for maintaining one or more memory pools, which are composed of a series of fixed-size memory blocks to meet the memory requirements of the particle system of different sizes. The memory optimization algorithm is used to merge and reallocate the memory space applied for by the particle system, such as merging adjacent free memory blocks into larger memory blocks, and releasing unused memory blocks back to the memory pool, thereby reducing memory fragmentation and improving memory utilization. Specifically, according to the operation of the particle system, such as changes in the number of particles, adjustments to the complexity of special effects, etc., the parameters of the memory optimization algorithm are dynamically adjusted. For example, when the number of particles increases, the algorithm can be adjusted to merge and reallocate memory more frequently to ensure that there is enough memory space for the particle system to use.
[0072] In this embodiment, an asynchronous loading method is used during the system resource loading process to improve the efficiency of resource loading. In addition, in some embodiments, a callback function is provided to determine whether all system resources of the particle system have been loaded. Specifically, when the resource management module has loaded the required system resources, the callback function is triggered. The callback function is used to determine whether all required system resources have been loaded. If all have been loaded, the particle properties of the particles in the particle system are initialized.
[0073] In this embodiment, according to the preset number of particles, a Gaussian distribution algorithm is used to generate the initial position coordinates of each particle, and the position coordinate range is within a preset three-dimensional space. According to the preset speed distribution range, a uniform distribution algorithm is used to generate the initial speed component of each particle, and the speed component includes three directions of x, y, and z. According to the preset color value range, a random function is used to generate the initial RGB color component of each particle, and the color range is between 0-255. For each particle, a random function is used to generate its initial rotation component within a preset range, including the rotation angle around the x-axis, y-axis, and z-axis, and the rotation range is between 0-2π.
[0074] S200, based on the movement and interaction laws of particles, uses quantum computing to predict the behavior of particles in real time and generate dynamic special effects for corresponding scenes;
[0075] In this embodiment, the parallel computing capability of quantum computing is used to predict the motion trajectories, collisions, and interactions of a large number of particles in real time, thereby quickly generating more realistic dynamic effects, such as simulating the tumbling and collision of sand particles in a sandstorm, and the diffusion and sedimentation of volcanic ash in a volcanic eruption. In addition, through quantum computing, particles can also be finely controlled, such as simulating the rotation and deformation of sand particles in a sandstorm, or the impact of temperature changes of volcanic ash in a volcanic eruption on the surrounding environment, thereby enhancing the realism of special effects.
[0076] In some embodiments, the step S200 includes:
[0077] Obtaining initial particle attribute values of each particle, mapping the initial particle attribute values to quantum bits, and constructing a quantum state space of the particle;
[0078] According to the influence of wind and terrain on particle motion, a quantum Haddonian model of particle motion is established, and by solving the Schrödinger equation, the quantum state evolution law of particle motion is obtained. The quantum Haddonian model includes kinetic energy terms, potential energy terms and external field terms, and the external field terms are used to reflect the influence of wind and terrain on particle motion;
[0079] Introducing a temperature variable into the quantum state space, and simulating the effect of temperature change on the surrounding environment through quantum state superposition;
[0080] Using quantum entangled states, we establish a correlation model between different particles, and through the Schrödinger equation, we obtain the quantum state evolution law of collision and interaction between different particles;
[0081] Based on the special effects requirements of different scenes, the particle attribute value of each particle is dynamically adjusted through quantum gate parameters and measurement basis;
[0082] Random sampling is performed in the quantum state space to obtain classical state information of particles, and the classical state information is input into a classical rendering pipeline to generate dynamic special effects.
[0083] In this embodiment, by mapping the movement and interaction rules of particles onto quantum bits, quantum computing can complete the behavior prediction and simulation calculations of a large number of particles in a very short time. At the same time, quantum computing can also realize the interaction and correlation calculations between particles through superposition and entanglement states, thereby improving the adaptability of particles between different scenarios, thereby generating more realistic and natural particle effects.
[0084] Specifically, the particle attribute values such as the position coordinates, velocity component and rotation component of each particle are obtained, and the above particle attribute values are mapped to quantum bits to construct the quantum state space of the particle. Specifically, the position coordinates are mapped to the space quantum bit, the velocity component is mapped to the momentum quantum bit, and the rotation component is mapped to the spin quantum bit, thereby generating the quantum state space. In one embodiment, the initial coordinates of the particle are (x, y, z) = (2, 4, 6), the velocity component is: (v x , v y , v z )=(3,4,5), rotation component: θ=π / 6, map the above position coordinates (x,y,z) to 3 spatial quantum bits. Specifically, convert the position parameters into binary representation: x=2→010, y=4→100, z=6→110. Therefore, the spatial quantum state of the above particle |ψs> can be expressed as: It can be simplified as: |ψs>=|010100110>. For the momentum quantum state |ψp>, similarly, the velocity parameter is converted into binary representation: v x =3→011;v y =4→100;v z =5→101, therefore, the momentum quantum state |ψp> can be expressed as: Simplified expression: |ψp>=|011100101> For the spin quantum state |ψr>, the rotation angle θ=π / 6 is mapped to 1 spin quantum bit. Since θ is continuous, the encoding method is used to map the rotation angle parameter to the ground state |0> and |1> of the spin quantum bit. Specifically, if θ is less than 2π, the spin quantum bit is |0>, otherwise it is |1>. Therefore: the above |ψr>=|0>, finally the spatial quantum state, momentum quantum state and spin quantum state are tensor-producted to obtain the comprehensive quantum state of the particle: On this basis, each quantum state is regarded as an independent system and combined when necessary to simulate the movement and rotation behavior of particles in space. Specifically, the comprehensive quantum state space of particles is unitary transformed. Where H is the Hamiltonian of the particle, is the reduced Planck constant, and t is the time parameter. The Hamiltonian H usually includes kinetic energy and potential energy terms, and the unitary transformation U(t) changes the quantum state |ψ> according to the Hamiltonian H and time t.
[0085] In this embodiment, when constructing the quantum Haddonian model, the kinetic energy term and potential energy term of the particle are obtained through physical modeling. The kinetic energy term represents the motion state of the particle, while the potential energy term is related to the height of the terrain where the particle is located. For the modeling of the external field term, the wind force is added to the above physical model as a vector field to simulate the actual impact of the wind force on the particle path. In the above manner, the external field term can accurately reflect the combined effect of wind force and terrain on the motion of the particle. The Schrödinger equation is solved by numerical methods to obtain the evolution of the quantum state of the particle over time. Specifically, the kinetic energy term of the particle is calculated by the mass m and velocity v of the particle. In quantum mechanics, the kinetic energy term T = \frac{p^2}{2m}, where p is the momentum operator and m is the mass of the particle. For the potential energy term: in the simple harmonic oscillator model, it is expressed as V(x) = \frac{1}{2}kx^2, where k is the elastic constant and x is the position of the particle in the potential well. For the external field terms: the wind force is included in the model as a vector field F(x,y,z). Specifically, Where U is the wind potential energy function, which is related to the terrain and wind speed. Therefore, the external field term can accurately reflect the influence of wind and terrain on particle motion.
[0086] In this embodiment, by solving the Schrödinger equation, the value of the wave function on the discrete time and space grid is obtained, and then the behavior of the particle in the quantum system is understood. Specifically, when numerically solving the Schrödinger equation, a time-dependent method, such as the Crank-Nicolson algorithm, can be used to construct a discrete time and space grid and use the finite difference method to approximate the partial differential equation. When constructing the discrete grid, the time step is set to Δt and the space step is set to Δx. At this time, the wave function ψ(x, t) of the particle will evolve over time, and then the wave function is updated using an iterative formula, and its specific formula is:
[0087]
[0088] In the above formula, Used to represent the kinetic energy term, It is used to represent the potential energy term, and reflects the time evolution process by iterating the above formula.
[0089] In this embodiment, the particle temperature is introduced as a variable into the above quantum state space to simulate the impact of temperature changes on the particle system environment. Specifically, the temperature of each particle is randomly initialized, and based on the temperature distribution of each particle, a density matrix is used to represent the temperature quantum state of the particle. The principle of quantum state superposition is used to simulate the impact of particles of different temperatures on the surrounding environment. By calculating the trace of the density matrix, the probability of the environment being affected is obtained. In some embodiments, the introduction of temperature variables can simulate volcanic scenes. On this basis, the Schrödinger equation is used to simulate the process of volcanic ash diffusion. Specifically, a Hamiltonian operator is constructed, including gravitational potential energy, air resistance dissipation terms, and potential energy changes caused by thermal convection. The parameters in the Hamiltonian operator are set according to actual conditions. If the temperature changes dramatically, a temperature-related correction term is added to the Hamiltonian. By solving the time-dependent Schrödinger equation, the evolution of the quantum state of the volcanic ash particles over time is obtained. According to the quantum state evolution results, the probability density distribution of volcanic ash particles in space is calculated, which describes the diffusion process of volcanic ash in the air. In addition, the Monte Carlo method is used to simulate the process of volcanic ash settling. Specifically, the initial position, velocity and temperature of the volcanic ash particles are obtained. For each particle, the influence of gravity, air resistance and thermal convection is calculated to obtain its motion trajectory. If the particle temperature is higher than the ambient temperature, the thermal convection is upward and the air resistance is reduced. If the particle temperature is lower than the ambient temperature, the thermal convection is downward and the air resistance is increased. By simulating the motion trajectories of a large number of particles, the spatial distribution of volcanic ash particles at different time points is obtained, and the settling area and settling rate are determined.
[0090] In this embodiment, according to the special effects requirements of different scenes, the particle attribute value of each particle is dynamically adjusted through quantum gate parameters and measurement basis, thereby improving the adaptability of different particles in different scenes. Specifically, for the particle attribute value that needs to be adjusted, the corresponding quantum gate parameters are selected for setting, such as adjusting the particle direction through a revolving gate and adjusting the particle speed through a phase gate. After completing the particle attribute adjustment, according to the observation requirements, select a suitable measurement basis, such as selecting a position observation measurement basis for the position distribution of the particles that need to be observed; and selecting a momentum observation measurement basis for the momentum distribution of the particles that need to be observed. According to the measurement results and the adjustment of the particle attributes, quantum machine learning algorithms, such as quantum support vector machines, quantum neural networks, etc., are used to model and optimize the relationship between particle attributes and the special effects requirements of different scenes to achieve intelligent particle attribute control. Specifically, the relationship between particle attributes and scene requirements is modeled using a quantum support vector machine algorithm, and the training sample set {(x1, y1), (x2, y2), ... , (x n ,y n )}, where x i Represents particle attribute parameters, y i Represent the scenario requirement parameters and build the support vector machine model where a i is the Lagrange multiplier, b is the bias term, <x i ,x> means x i The inner product between y and x is calculated by training the above support vector machine model to realize the intelligent mapping of particle attribute parameters to scene requirement parameters. According to the mapping results, the particle attribute values of the particles are adjusted to meet the specific scene requirements, thereby realizing intelligent control.
[0091] In this embodiment, the Monte Carlo quantum algorithm is used to randomly sample the particle quantum state space, obtain the sampling value, convert it into classical state information through quantum state mapping, input the classical state information into the preset classical rendering pipeline, determine the parameter configuration of the rendering pipeline, and generate the initial state of the particle system. Among them, the classical state information refers to the state description of the particle under the framework of classical physics, including properties such as position, velocity, momentum, energy, etc. The above properties are key information for describing the movement and state of the particle in space, and are also the basic data for generating particle special effects animation. Specifically, for the sandstorm special effects animation, according to the initial state of the particle system, the randomness parameters of the particle movement are set to simulate the dynamic effect of the sandstorm. For the volcanic eruption special effects animation, according to the initial state of the particle system, the explosive force and diffusion range parameters of the particle movement are set to simulate the dynamic effect of the volcanic eruption. The particle system is rendered in real time through the rendering pipeline, the animation generation result is obtained, and the sandstorm and volcanic eruption particle special effects animation are output. If the generated animation effect does not meet the preset threshold, the rendering pipeline parameters are adjusted and the rendering is performed again until the preset threshold requirement is met.
[0092] In this embodiment, the classic state information is input into the classic rendering pipeline to generate dynamic special effects. The generation of particle dynamic special effects such as sandstorms and volcanic eruptions plays a fundamental and key role in the entire solution. To a certain extent, it provides physical reality and basic data to guide the generation of special effects, ultimately improving the quality of special effects and user experience.
[0093] In some embodiments, the above step S200 further includes:
[0094] Using quantum entangled states, a correlation model between different particles is established. Based on the correlation model, a particle population evolution equation is constructed. By solving the particle population evolution equation, the quantum state evolution law of collision and interaction between different particles is obtained;
[0095] The specific formula of the particle population evolution equation is as follows:
[0096]
[0097] Among them, H represents the total Hamiltonian, H=H0+Hint, H0 is the Hamiltonian of free particles, Hint is the Hamiltonian of interacting particles, and |Ψ(t)> represents the quantum entangled state between interacting particles.
[0098] In this embodiment, according to the theory of quantum mechanics, quantum entangled states are used to describe the interaction between particles, and a quantum correlation model of collision, attraction and repulsion between particles is established. For the established particle quantum correlation model, the quantum state evolution equation describing the motion of the particle group is obtained by solving the multi-body Schrödinger equation. The initial state of the particle is input into the quantum state evolution equation, and the collision and interaction process between particles is simulated by iterative solution to obtain the quantum state evolution result of the particle group motion. According to the quantum state evolution result, the position, speed and other information of the particle are extracted, and the motion trajectory and interaction of the particle group in the three-dimensional space are reconstructed. Using the Monte Carlo method, random perturbations are introduced on the basis of the particle motion trajectory to simulate the randomness and uncertainty of particle motion in the real environment, and improve the fidelity of the particle group motion effect. For the computational bottleneck in the simulation process, the parallelism of quantum computing is used to accelerate the solution of the multi-body Schrödinger equation and improve the computational efficiency of the particle group motion simulation. The simulation results are visualized and rendered to generate realistic particle group motion animations, intuitively displaying the interaction effects such as collision, attraction and repulsion between particles, and provide references for scientific research and applications in related fields.
[0099] Specifically, for two interacting particles, the Bell state is used as the quantum entangled state, such as |Ψ> = (|00> + |11>) / √2. By introducing the interaction Hamiltonian Hint = J (σ1xσ2x + σ1yσ2y + σ1zσ2z), a quantum correlation model of collision, attraction and repulsion between particles is established, where J is the coupling strength, and σ1 and σ2 represent the Pauli matrices of the two interacting particles. On this basis, a quantum state evolution equation for describing the motion of a particle group is constructed, namely the particle group evolution equation, and the quantum state evolution law of collision and interaction between different particles is obtained:
[0100]
[0101] Among them, H represents the total Hamiltonian, H=H0+Hint, H0 is the free particle Hamiltonian, Hint is the interaction Hamiltonian, and |Ψ(t)> represents the quantum entangled state between interacting particles.
[0102] In this embodiment, when solving the above particle population evolution equation, the initial state of the particle is substituted into the above evolution equation, and a numerical simulation method, such as the Runge-Kutta method, is used to iteratively solve the problem to simulate the collision and interaction process between particles. Specifically, the initial state of the particle is For the final state of evolution |Ψ(t)>, we can extract information such as the position and velocity of the particles, and based on the extracted information, reconstruct the motion trajectory and interaction of the particle group in three-dimensional space.
[0103] In some embodiments, after the above step S200, the following steps are included:
[0104] Acquire the particle parameters of each particle in the dynamic special effects in real time, wherein the particle parameters include particle attributes and scene parameters, wherein the scene parameters include wind force, terrain, lighting and temperature;
[0105] Encoding the particle parameters to obtain particle encoding data;
[0106] The particle encoding data is input into a quantum neural network, and the particle encoding data is optimized by the quantum neural network.
[0107] In this embodiment, the particle parameters acquired in real time are cleaned to remove invalid or redundant data, ensure the accuracy and consistency of the input data, and fill or interpolate the missing values to ensure the integrity of the data. Then, the processed data is normalized, which helps to reduce the gradient vanishing or gradient exploding problems in the quantum neural network training process, so as to better process the quantum neural network.
[0108] In this embodiment, the data input to the quantum neural network needs to be encoded into a form that the quantum neural network can process, such as mapping classical data to quantum bits. Specifically, the method for encoding particle parameters includes amplitude coding, ground state coding, and angle coding, wherein amplitude coding is used to encode classical data into the amplitude of the quantum state. For example, for one-dimensional data x, a quantum state |ψ> can be constructed, whose amplitude is √p(x), where p(x) is a probability distribution associated with x, and this method is applicable to data representing probability distributions or probability density functions. Ground state coding is used to map each bit or feature of classical data to a ground state of a quantum bit. For example, for binary data, 0 can be mapped to the |0> state and 1 can be mapped to the |1> state, and this method is applicable to representing discrete or binary data. Angle coding is used to encode classical data into the angle of rotation of the quantum bit. For example, a rotation gate such as an RY gate or an RZ gate can be used, and the input data is used as a parameter of the rotation angle. This method is applicable to the representation of continuous variables, and the accuracy of the encoding can be controlled by adjusting the accuracy of the rotation angle.
[0109] In this embodiment, the encoded particle encoding data is input into the input layer of the quantum neural network, the input layer is composed of multiple quantum bits, each quantum bit represents a feature of the input data, after the input layer, the data is quantum state evolved through the hidden layer in the quantum neural network, which is used to capture the interaction and dynamic changes between particles, as well as their interaction with scene parameters, after quantum state evolution, the data is output through the output layer, the output layer contains multiple quantum bits, each quantum bit represents a feature of the output data, by measuring the quantum bits of the output layer, the optimized particle parameters, such as adjusted position, speed, color, etc., are obtained, and by optimizing the particle parameters, a more realistic and vivid visual effect can be obtained.
[0110] S300, dynamically adjusting the special effect attributes of the particles according to the scene and state of the player, the special effect attributes including transparency, color and texture of the particles;
[0111] In some of these embodiments, the scene includes a desert, a volcano, and a forest, and the state is the life cycle of the player;
[0112] The above step S300 includes:
[0113] By analyzing the scene parameters of the scene in real time, determining a particle parameter combination of each particle in the scene, wherein the particle parameter combination includes attribute values of all special effect attributes of the particle;
[0114] Based on the particle parameter combination, the plurality of particles are divided into multiple rendering levels for rendering;
[0115] Adopting a machine learning algorithm to iteratively update the particle parameter combination;
[0116] Using particle special effects enhancement technology based on image analysis, the particle movement trajectory and visual effects are dynamically adjusted according to changes in the player's scene.
[0117] In this embodiment, a mapping model between scene features and special effect attributes is established using a machine learning algorithm based on the light intensity, weather conditions and terrain complexity of the scene in which the player is located. By obtaining real-time light, weather and terrain data of the scene around the player, it is input into the established mapping model to obtain attribute values such as transparency, color and texture suitable for each particle in the current scene, and encapsulate it into a particle parameter combination. Based on the above particle parameter combination, the particles in the above scene are divided into different levels, and different rendering strategies and effect control methods are adopted for each layer of particles to achieve a more refined and natural visual performance. Specifically, when rendering particle special effects, the transparency, color and texture of the particles are dynamically adjusted so that they can be coordinated with the light and weather conditions of the scene, thereby improving the integration of particle special effects with the scene. By smoothing the particle motion trajectory, the mutation and discontinuity caused by parameter changes are eliminated, making the particle special effects more natural and coherent visually. According to the changes in the player's perspective and the moving speed, the rendering range and number of particles are dynamically adjusted to reduce unnecessary performance overhead while ensuring the visual effect.
[0118] In this embodiment, scene depth information is used to classify each particle in the scene into near-view, mid-view or far-view levels. The visual influence of each particle is predicted by a deep learning model to determine the fineness of its rendering. If the particle has a large influence, high-precision rendering is used; if the influence is small, a simplified model is used. In this way, the rendering strategy is dynamically adjusted to optimize the rendering process. All particle data in the scene are obtained, and hierarchical classification is performed according to their position information and preset visual level thresholds. After classification, different rendering parameters are applied to particles at each level. The near-view particle set uses high-precision parameters, the far-view particle set uses simplified parameters, and the mid-view particles dynamically adjust the parameters according to their visual importance. A model is trained through a machine learning algorithm to predict the visual importance of particles. The model takes the size, color, brightness and position of the particles as input and outputs a visual importance score. According to the score, the rendering strategy of the particles is dynamically adjusted, and high-scoring particles use high-precision rendering, and low-scoring particles use simplified rendering. For mid-view particles, their rendering strategy is dynamically determined according to their visual importance score and the interaction with other elements in the scene. If the mid-ground particles have more interactions or overlaps with important visual elements, improve their rendering accuracy; otherwise, appropriately reduce the rendering accuracy to save computing resources. Using the classified particle data, optimize the rendering engine so that it can automatically adjust the rendering load according to the particle hierarchy and visual importance, and then dynamically allocate computing resources at different rendering stages to optimize the overall rendering efficiency. By monitoring the rendering effect and system performance in real time, adjust the rendering parameters to ensure the best balance between visual effect and system performance.
[0119] In this embodiment, the parameter search of the special effect properties of the particles is initialized by using a genetic algorithm, and the initial population is determined according to the preset thresholds of visual realism, rendering performance and memory usage. The results of the genetic algorithm are finely adjusted by the particle swarm optimization algorithm, and the information sharing mechanism in the particle swarm is used to quickly converge to the optimal solution. In each iteration, the fitness function is adjusted according to the needs of multi-objective optimization to ensure the balance between visual realism and system performance. Through the automatic optimization process, the particle special effect properties are continuously updated until the preset optimization goal is reached. During the optimization process, the parameter settings and corresponding effect evaluations of each iteration are recorded through the parameter optimization recording module to provide data support for subsequent optimization iterations. Finally, the particle parameter combination with the best effect is output as the final particle special effect configuration for further rendering and use.
[0120] In this embodiment, a video sequence of the scene in which the player is located is obtained, and each frame of the video sequence is analyzed and processed; the optical flow method is used to estimate the motion of the image to obtain the motion vector field information of the object in the image; the depth estimation technology is used to perform depth analysis on the image to obtain the depth map information of the image; a three-dimensional scene model is constructed based on the motion vector field information and the depth map information; a particle object is added to the three-dimensional scene model, and the position and movement speed of the particle are initialized according to the motion vector field information; based on the image analysis results, the movement trajectory of the object in the scene is tracked in real time, and the movement direction and speed of the particle are dynamically adjusted; the position, speed, movement trajectory and other parameters of the particle are integrated, combined with a preset rendering algorithm, to generate a realistic particle special effect picture.
[0121] S400: Track the life state of each particle in real time, mark each particle, generate a particle reuse pool, and generate a particle reuse strategy based on the particle reuse pool, wherein the particle reuse strategy is used for dynamic allocation of reusable particles.
[0122] In some embodiments, the life state includes a visible state and an influence state, wherein the visible state indicates the proportion of the particle on the screen, and the influence state indicates the contribution of the particle to the overall brightness and color of the scene;
[0123] The real-time tracking of the life state of each particle, marking each particle, and generating a particle reuse pool include:
[0124] When the visible state or the influence state of a particle is lower than a preset state threshold, the particle is marked as a reusable particle, and a plurality of the reusable particles are allocated to a particle reuse pool;
[0125] Performing similarity analysis on the special effect attributes of the reusable particles to determine the particle type of the reusable particles;
[0126] According to the number of the particle types, the particle multiplexing pool is divided into a plurality of sub-multiplexing pools, one of the sub-multiplexing pools represents a reusable particle of one particle type, and the particle types include flame, smoke and water flow.
[0127] In this embodiment, the visible state and influence state of each particle are tracked in real time, and the particle life cycle is dynamically adjusted according to a preset state threshold. The visible state is calculated by the proportion of the particle on the screen, and the influence state is quantified according to the contribution of the particle to the overall brightness and color of the scene. When the visible state of the particle decreases or the influence state weakens to a preset state threshold, it is marked as a reusable state instead of being directly destroyed, which can reduce calculation and memory consumption, thereby improving game performance.
[0128] In this embodiment, if the pixel ratio of a particle on the screen is lower than the visible threshold, or its color saturation and brightness value are lower than the impact threshold, the particle is marked as reusable. For particles marked as reusable, the consumption of their life cycle is suspended and they are added to the particle reuse pool. When a new particle needs to be generated, the particle is taken out of the reusable particle pool first, and its attributes and life state are reset, thereby reducing the overhead of creating and destroying new particles.
[0129] In one embodiment, the visible threshold and the influence threshold are dynamically adjusted according to the real-time changes of the scene to balance the number of particles and rendering performance. When the scene complexity increases, the visible threshold and the influence threshold are increased to reduce the number of active particles; when the scene is simple, the visible threshold and the influence threshold are lowered to improve the particle effect.
[0130] In this embodiment, for the judgment of the visible state, a space partitioning algorithm, such as an octree or a BSP tree, is used to organize each particle according to the spatial position to accelerate the visibility judgment of the particles. It can be understood that in this embodiment, visibility calculation is only performed on particles that may be visible to reduce useless calculations. For complex particle effects, particle simplification technology is used, such as merging adjacent particles, reducing the number of particles, and improving rendering performance, while satisfying the visual effect. At the same time, the simplification level is dynamically adjusted according to the importance of the particles to ensure the fineness of key particles.
[0131] In this embodiment, by adopting a feature extraction algorithm, the feature data of the special effect attributes of each reusable particle in the particle reuse pool is extracted, and the weighted Euclidean distance method is used to calculate the similarity between the special effect attributes of each reusable particle and the particles in each sub-reuse pool, and the reusable particles whose similarity exceeds the preset similarity threshold are classified into the corresponding sub-reuse pool. During the special effect switching process, the reusable particles with high similarity in the corresponding query sub-reuse pool are called to improve resource utilization efficiency. It can be understood that in order to optimize the selection process, a quick sorting algorithm is used to sort the particles in each sub-reuse pool to ensure that the required particles can be quickly found when the special effect is switched. Through this method, not only the reuse rate of particles is improved, but also the response time of special effect switching is optimized, thereby improving the overall visual effect and system performance.
[0132] In this embodiment, different sub-reuse pools correspond to different particle types, wherein the particle types include flames, smoke, and water flow. Specifically, each reusable particle is classified by calculating the similarity with the special effect attributes of different particle types, thereby improving the calling efficiency of the reusable particles.
[0133] In some embodiments, the generating a particle reuse strategy based on the particle reuse pool, wherein the particle reuse strategy is used for dynamic allocation of reusable particles, includes:
[0134] Using a particle reuse acceleration mechanism, the particle attributes of the reusable particles are reset and the states are converted;
[0135] Setting a preset number of reusable particle objects for each of the sub-reuse pools;
[0136] Real-time monitoring of the life cycle status of particles of different particle types in the scene, and dynamically adjusting the number of reusable particle objects in each of the sub-reuse pools based on the preset number of particles, wherein the life cycle status includes generation, activity, decay, and extinction;
[0137] The gradient boosting algorithm is used to evaluate the reuse effect of the reusable particles, and based on the evaluation result, the number of reusable particle objects in each of the sub-reuse pools is dynamically adjusted.
[0138] In the present application, before adding reusable particles to the particle reuse pool, the particle attributes of the reusable particles need to be reset and the state converted, thereby improving the particle reuse efficiency. Specifically, an idle particle list is used to store reusable particles, and an idle particle list is established in advance to store currently unused particle data. When new particles are needed, the particle data is obtained from the head of the idle particle list. If the idle particle list is empty, new particle memory is allocated.
[0139] In this embodiment, it is necessary to configure a reusable particle object with a preset number of particles for each sub-reuse pool in advance to balance memory usage and performance. Specifically, the required particle effect type, such as smoke, flame, water flow, etc., is determined according to the scene in which the player is located, and the properties such as the number of particles, density, speed, color, etc. required for each effect are analyzed. At the same time, the hardware resources of the target platform, such as CPU and memory, are evaluated to determine the maximum number of particles that the system can bear under the premise of ensuring smooth rendering. According to the above effect requirements and performance requirements, the number of particles required for each sub-reuse pool is preliminarily estimated, and a preliminary test is performed on the target platform to observe whether the particle effect meets the requirements, and the system performance is monitored to ensure that the system can run stably and maintain good rendering performance under the preset number of particles. According to the test results, the preset number of particles is adjusted. If too many particles lead to performance degradation, the number of particles can be appropriately reduced; if too few particles lead to poor effects, the number of particles can be appropriately increased. In actual applications, the number of particles in the sub-reuse pool is dynamically adjusted according to the load conditions during actual operation. For example, when the load is high, the number of particles is increased to meet the effect requirements; when the load is low, the number of particles is reduced to save resources. According to the final determined preset number of particles, set corresponding parameters for each sub-reuse pool.
[0140] In this embodiment, real-time generation and extinction data of particles corresponding to each particle type in the scene are obtained, and for each particle type, the number of generation and the number of extinction in unit time are counted; the statistical generation and extinction data of each type of particles are compared with a preset number threshold; if the generation number of a certain type of particles is continuously higher than the threshold, it is determined that the demand for particles of this type is large, and the number of particles of this type needs to be increased in the particle reuse pool; according to the adjustment requirements of each type of particles in the particle reuse pool, idle particle resources are dynamically allocated and converted into particle types with high demand, and redundant particles of other types are recycled to ensure that the total number of particles in the particle reuse pool is relatively stable.
[0141] In this embodiment, the particle data of the current frame of the special effects rendering interface is obtained, including information such as particle position, speed, color and size. According to the obtained particle data, feature vectors are extracted, such as the number of particles, the average speed of particles and the distribution range of particles. If the dimension of the extracted feature vector is too high, the principal component analysis (PCA) method is used to reduce the dimension of the feature vector to reduce the computational complexity and obtain the feature vector after dimension reduction. The pre-trained XGBoost model is used to predict the feature vector after dimension reduction to obtain the predicted value of rendering performance under different reuse strategies. The predicted value represents the degree of influence of different reuse strategies on rendering performance. According to the predicted value, it is judged whether the current rendering performance meets the preset performance threshold; if the preset threshold is met, the current reuse strategy is kept unchanged; if the predicted rendering performance does not meet the preset threshold, the reuse strategy is dynamically adjusted according to the output result of the XGBoost model, and then the reused particle ratio is adjusted, and the reused particle ratio is the ratio of reusable particles to the total number of particles in the current frame of the special effects rendering interface; the adjusted reused particle ratio is used for particle rendering to obtain a rendered image; the rendered image quality evaluation index and rendering frame rate are obtained; according to the image quality evaluation index and the rendering frame rate, it is judged whether a balance between visual effects and performance is achieved; if a balance is not achieved, the evaluation is repeated until the best reuse strategy is found, thereby improving the rendering performance of the particle system.
[0142] In some embodiments, in the process of dynamically adjusting the particle strategy, a visual balance evaluation algorithm is used to determine whether the current particle distribution meets the preset visual balance requirements by analyzing the visual features of the scene such as color, brightness and contrast; real-time rendering performance data is obtained, including indicators such as frame rate and latency, and compared with the performance data before and after particle reuse to evaluate the impact of the particle reuse mechanism on rendering performance; if particle reuse causes rendering performance to degrade, the preset performance optimization strategy is triggered to improve the rendering performance to the target level while ensuring the visual effect by reducing the number of particles and simplifying particle effects; based on the above analysis process, a closed-loop particle reuse optimization system is constructed to connect real-time monitoring, dynamic adjustment and performance evaluation to form an adaptive particle management mechanism to continuously monitor and optimize the particle reuse process to ensure the visual balance of the scene and the stability of rendering performance.
[0143] See also Figure 2 As shown, the present invention also provides an optimization system for a particle system, the system comprising:
[0144] The first processing module 201 is used to load a particle system and randomly initialize the particle properties of particles in the particle system, wherein the particle properties include position, speed and color;
[0145] The second processing module 202 is used to predict the behavior of particles in real time based on the movement and interaction rules of particles and generate dynamic special effects for corresponding scenes by using quantum computing;
[0146] The third processing module 203 is used to dynamically adjust the special effect properties of the particles according to the scene and state of the player, and the special effect properties include transparency, color and texture of the particles;
[0147] The fourth processing module 204 is used to track the life state of each particle in real time, mark each particle, generate a particle reuse pool, and generate a particle reuse strategy based on the particle reuse pool, wherein the particle reuse strategy is used for dynamic allocation of reusable particles.
[0148] It is understandable that if Figure 1 The contents of the optimization method embodiment for a particle system shown in the figure are all applicable to the optimization system embodiment for a particle system. The functions specifically implemented by the optimization system embodiment for a particle system are similar to those in the example shown in the figure. Figure 1 The optimization method embodiment for the particle system shown is the same as that shown in FIG. Figure 1 The beneficial effects achieved by the illustrated embodiment of the optimization method for the particle system are also the same.
[0149] It should be noted that the information interaction, execution process and other contents between the above-mentioned systems are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0150] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0151] See also Figure 3 As shown, an embodiment of the present invention further provides a computer device 3, comprising: a memory 302 and a processor 301 and a computer program 303 stored in the memory 302. When the computer program 303 is executed on the processor 301, an optimization method for a particle system as described in any one of the above methods is implemented.
[0152] The computer device 3 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 3 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3 It is only an example of computer device 3 and does not constitute a limitation on computer device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0153] The processor 301 may be a central processing unit (CPU), or 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. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0154] In some embodiments, the memory 302 may be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 302 may also be an external storage device of the computer device 3, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 3. Further, the memory 302 may also include both an internal storage unit of the computer device 3 and an external storage device. The memory 302 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 302 may also be used to temporarily store data that has been output or is to be output.
[0155] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the optimization method for a particle system as described in any one of the above methods is implemented.
[0156] In this embodiment, if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / computer device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, USB flash drive, mobile hard disk, disk or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0157] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. An optimization method for a particle system, characterized in that: include: Loading a particle system, and randomly initializing particle properties of particles in the particle system, wherein the particle properties include position, speed, and color; Based on the movement and interaction laws of particles, quantum computing is used to predict the behavior of particles in real time and generate dynamic special effects for corresponding scenes; Dynamically adjust the special effect properties of the particles according to the scene and state of the player, the special effect properties including transparency, color and texture of the particles; The life state of each particle is tracked in real time, each particle is marked, a particle reuse pool is generated, and a particle reuse strategy is generated based on the particle reuse pool. The particle reuse strategy is used for dynamic allocation of reusable particles.
2. The method according to claim 1, characterized in that The loading of the particle system and the random initialization of the particle properties in the particle system include: Using an asynchronous loading method, system resources required by the particle system are loaded, wherein the system resources include the number of particles, memory capacity, disk space, and network bandwidth; According to the number of particles, randomly generating position coordinates, velocity components, rotation components and color components for each particle in three-dimensional space; The position coordinates, the speed component, the rotation component and the color component are used as initial particle attribute values and assigned to corresponding particle attribute variables of each particle object.
3. The method according to claim 2, characterized in that Based on the movement and interaction rules of particles, quantum computing is used to predict the behavior of particles in real time and generate dynamic special effects for corresponding scenes, including: Obtaining initial particle attribute values of each particle, mapping the initial particle attribute values to quantum bits, and constructing a quantum state space of the particle; According to the influence of wind and terrain on particle motion, a quantum Haddonian model of particle motion is established, and by solving the Schrödinger equation, the quantum state evolution law of particle motion is obtained. The quantum Haddonian model includes kinetic energy terms, potential energy terms and external field terms, and the external field terms are used to reflect the influence of wind and terrain on particle motion; Introducing a temperature variable into the quantum state space, and simulating the effect of temperature change on the surrounding environment through quantum state superposition; Based on the special effects requirements of different scenes, the particle attribute value of each particle is dynamically adjusted through quantum gate parameters and measurement basis; Random sampling is performed in the quantum state space to obtain classical state information of particles, and the classical state information is input into a classical rendering pipeline to generate dynamic special effects.
4. The method according to claim 3, characterized in that The method of using quantum computing to predict the behavior of particles in real time based on the movement and interaction laws of particles and generate dynamic special effects for corresponding scenes also includes: Using quantum entangled states, a correlation model between different particles is established. Based on the correlation model, a particle population evolution equation is constructed. By solving the particle population evolution equation, the quantum state evolution law of collision and interaction between different particles is obtained; The specific formula of the particle population evolution equation is as follows: Among them, H represents the total Hamiltonian, H=H0+Hint, H0 is the Hamiltonian of free particles, Hint is the Hamiltonian of interacting particles, and |Ψ(t)> represents the quantum entangled state between interacting particles.
5. The method according to claim 3, characterized in that Based on the movement and interaction laws of particles, quantum computing is used to predict the behavior of particles in real time and generate dynamic special effects for the corresponding scenes, including: Acquire the particle parameters of each particle in the dynamic special effects in real time, wherein the particle parameters include particle attributes and scene parameters, wherein the scene parameters include wind force, terrain, lighting and temperature; Encoding the particle parameters to obtain particle encoding data; The particle encoding data is input into a quantum neural network, and the particle encoding data is optimized by the quantum neural network.
6. The method according to claim 1, characterized in that The scenes include deserts, volcanoes and forests, and the states are the life cycles of players; The special effect properties of the particles are dynamically adjusted according to the scene and state of the player, and the special effect properties include transparency, color and texture of the particles, including: By analyzing the scene parameters of the scene in real time, determining a particle parameter combination of each particle in the scene, wherein the particle parameter combination includes attribute values of all special effect attributes of the particle; Based on the particle parameter combination, the plurality of particles are divided into multiple rendering levels for rendering; Adopting a machine learning algorithm to iteratively update the particle parameter combination; Using particle special effects enhancement technology based on image analysis, the particle movement trajectory and visual effects are dynamically adjusted according to changes in the player's scene.
7. The method according to claim 1, characterized in that The life state includes a visible state and an influence state, wherein the visible state indicates the proportion of the particle on the screen, and the influence state indicates the contribution of the particle to the overall brightness and color of the scene; The real-time tracking of the life state of each particle, marking each particle, and generating a particle reuse pool include: When the visible state or the influence state of a particle is lower than a preset state threshold, the particle is marked as a reusable particle, and a plurality of the reusable particles are allocated to a particle reuse pool; Performing similarity analysis on the special effect attributes of the reusable particles to determine the particle type of the reusable particles; According to the number of the particle types, the particle multiplexing pool is divided into a plurality of sub-multiplexing pools, one of the sub-multiplexing pools represents a reusable particle of one particle type, and the particle types include flame, smoke and water flow.
8. The method according to claim 7, characterized in that The generating a particle reuse strategy based on the particle reuse pool, wherein the particle reuse strategy is used for dynamic allocation of reusable particles, includes: Using a particle reuse acceleration mechanism, the particle attributes of the reusable particles are reset and the states are converted; Setting a preset number of reusable particle objects for each of the sub-reuse pools; Real-time monitoring of the life cycle status of particles of different particle types in the scene, and dynamically adjusting the number of reusable particle objects in each of the sub-reuse pools based on the preset number of particles, wherein the life cycle status includes generation, activity, decay, and extinction; The gradient boosting algorithm is used to evaluate the reuse effect of the reusable particles, and based on the evaluation result, the proportion of the reused particles is dynamically adjusted.
9. An optimization system for a particle system, characterized in that: include: The first processing module is used to load the particle system and randomly initialize the particle properties of the particles in the particle system, wherein the particle properties include position, speed and color; The second processing module is used to predict the behavior of particles in real time based on the movement and interaction laws of particles and generate dynamic special effects for the corresponding scenes by using quantum computing; The third processing module is used to dynamically adjust the special effect properties of the particles according to the scene and state of the player, and the special effect properties include transparency, color and texture of the particles; The fourth processing module is used to track the life state of each particle in real time, mark each particle, generate a particle reuse pool, and generate a particle reuse strategy based on the particle reuse pool, wherein the particle reuse strategy is used for dynamic allocation of reusable particles.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Mobile terminal simulation particle system method
CN106056660A
Method and device for constructing three-dimensional scene animation in GIS system based on particle system
CN111292399A
Particle effect generation method and device, computer equipment and storage medium
CN117058304A
Particle rendering method and apparatus
US20240169650A1
Cited By
WebGL-based particle effect implementation method, system and device and storage medium
CN120182445A
Visual special effect processing method and device, storage medium and terminal
CN120279144A
Weather radar observation data quality control system and method based on multi-source consistency
CN120745862A