WO2023071579A1 - 物理特效渲染方法、装置、计算机设备和存储介质 - Google Patents

物理特效渲染方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2023071579A1
WO2023071579A1 PCT/CN2022/118750 CN2022118750W WO2023071579A1 WO 2023071579 A1 WO2023071579 A1 WO 2023071579A1 CN 2022118750 W CN2022118750 W CN 2022118750W WO 2023071579 A1 WO2023071579 A1 WO 2023071579A1
Authority
WO
WIPO (PCT)
Prior art keywords
particle
special effect
target
physical
scene
Prior art date
Application number
PCT/CN2022/118750
Other languages
English (en)
French (fr)
Inventor
魏琛棣
黄立
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to JP2023555759A priority Critical patent/JP2024513325A/ja
Publication of WO2023071579A1 publication Critical patent/WO2023071579A1/zh
Priority to US18/198,168 priority patent/US20230290032A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/603D [Three Dimensional] animation of natural phenomena, e.g. rain, snow, water or plants
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/246Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2215/00Indexing scheme for image rendering
    • G06T2215/16Using real world measurements to influence rendering

Definitions

  • the present application relates to the field of computer technology, in particular to a physical special effect rendering method, device, computer equipment, storage medium and computer program product.
  • the particle emission plug-in can emit particles in three-dimensional space, and can obtain physical effects by rendering the emitted particles.
  • the particle emission plug-in cannot physically simulate the movement of particles, and the simulation results obtained from offline physical simulation need to be obtained from the outside to cooperate with the rendering of physical special effects, resulting in low efficiency of the particle emission plug-in in rendering physical special effects.
  • a physical special effect rendering method is provided.
  • a method for rendering physical special effects executed by a computer device, the method comprising: obtaining physical special effect data of physical special effect particles emitted by a particle emission plug-in in a previous frame; obtaining the first object obtained by instantiating a scene management class instance; the scene management class inherits from the target base class provided by the particle emission plug-in; the scene management interface of the particle simulation tool integrated in the particle emission plug-in is invoked through the first target instance to generate In the scene manager of the simulation tool, calculate the motion state information of the physical special effect particles in the current frame based on the physical special effect data in the previous frame; and update the motion state information in the previous frame based on the motion state information of the current frame
  • the physical effect data of the current frame is obtained by rendering.
  • a physical special effect rendering device comprising: a data acquisition module, which acquires physical special effect data of physical special effect particles emitted by a particle emission plug-in in a previous frame; an instance acquisition module, which is used to obtain and instantiate a scene management class The obtained first target instance; the scene management class inherits from the target base class provided by the particle emission plug-in; the data calculation module is used to call the particle simulation integrated in the particle emission plug-in through the first target instance
  • the scene management interface of the tool is used to calculate the motion state information of the physical special effect particles in the current frame based on the physical special effect data in the previous frame in the scene manager of the particle simulation tool; and the data update module uses The physical effect data in the last frame is updated based on the motion state information of the current frame, so as to obtain the physical effect in the current frame by rendering.
  • a computer device includes a memory and a processor, where computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the processor is made to execute the steps of the above-mentioned method for rendering physical effects.
  • One or more non-volatile readable storage media store computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the processors are made to execute the steps of the above-mentioned method for rendering physical effects.
  • a computer program product includes computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the above-mentioned method for rendering physical effects are implemented.
  • Fig. 1 is an application environment diagram of a method for rendering physical effects in an embodiment
  • Fig. 2 is a schematic flow chart of a method for rendering physical effects in an embodiment
  • FIG. 3 is a schematic diagram of a configuration interface when configuring an attribute parameter of a first attribute in an embodiment
  • Fig. 4 is a schematic diagram of a configuration interface when configuring an attribute parameter of a second attribute in an embodiment
  • FIG. 5 is a schematic diagram of a configuration interface when configuring an attribute parameter of a third attribute in an embodiment
  • Figure 6 is a schematic diagram of a preset model in an embodiment
  • Fig. 7 is a schematic diagram of particles obtained by sampling in an embodiment
  • Figure 8 is a schematic diagram of calculating motion state information in an embodiment
  • Fig. 9 is a class relationship diagram provided by the particle emission plug-in in one embodiment.
  • Fig. 10 is a schematic diagram of displaying each module on the configuration interface in one embodiment
  • Figure 11 is an effect diagram of particle rotation in an embodiment
  • Fig. 12 is a call flowchart of the simulation process in one embodiment
  • Fig. 13 is a structural block diagram of a physical special effect rendering device in an embodiment
  • Figure 14 is a diagram of the internal structure of a computer device in one embodiment.
  • the computer device 102 may be a terminal or a server.
  • Terminals include but are not limited to various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices
  • the server can be an independent server or a server cluster composed of multiple servers.
  • the computer device 102 is equipped with a particle emission plug-in, and the computer device can obtain the physical special effect data of the physical special effect particles emitted by the particle emission plug-in in the previous frame, and further obtain the first target instance obtained by instantiating the scene management class, wherein the scene The management class inherits from the target base class provided by the particle emission plug-in, and then calls the scene management interface of the particle simulation tool integrated in the particle emission plug-in through the first target instance, so that in the scene manager of the particle simulation tool, based on the previous frame Calculate the motion state information of the physical special effect particles in the current frame based on the physical special effect data in the current frame, and update the physical special effect data in the previous frame based on the motion state information of the current frame. According to the updated physical special effect data, the computer device 102 can render the current frame. physical effects, and the rendered physical effects can be displayed on the interface of the computer device.
  • a physical special effect rendering method is provided, and the method is applied to the computer device in FIG. 1 as an example for illustration, including the following steps:
  • Step 202 acquiring the physical effect data of the physical effect particles emitted by the particle emission plug-in in the last frame.
  • the particle emission plug-in refers to a plug-in that can emit physical special effect particles.
  • the particle emission plug-in can be, for example, a Niagara plug-in in the game engine Unreal Engine (UE), which also integrates a particle simulation tool to simulate physical effects.
  • UE Unreal Engine
  • Physical special effects can be the effects of physical processes expressed in animations, for example, the physical processes of wind blowing, swaying leaves, and debris splashes generated when objects explode, etc., can be expressed in animations .
  • Animations include but are not limited to game animations or film and television animations. The use of physical special effects can bring a more realistic game experience, make animations look more real and shocking, and achieve an immersive feeling.
  • Physical effect particles refer to a small piece of material that cannot be further divided in the simulation of physical effects, such as snow particles, sand particles, oil particles, water particles, etc., and more widely such as a small piece of hair, a small piece of cloth, collectively referred to as particles.
  • the physical special effect data refers to the relevant data of the particles generated during the simulation of the physical special effect.
  • the physical special effect data includes at least the attribute information and the motion state information of the physical special effect particle, and the attribute information of the physical special effect particle may include the physical special effect particle.
  • Basic information such as quality, particle number, life cycle, etc.
  • motion state information can refer to the state information of physical special effect particles when they are moving, for example, it can include information such as speed, deformation gradient, shaping state, and position information of physical special effect particles.
  • the physical special effect data also includes the force value of the physical special effect particle, and the force value is used to represent the force of the physical special effect particle, wherein the force representing the physical special effect particle can refer to all possible
  • the force received for example, the physical special effect particle is subjected to the force, friction, gravity, etc. of other physical special effect particles on it.
  • the computer device can read the physical effect data of the physical effect particles emitted by the particle emission plug-in in the last frame from the video memory allocated for the particle emission plug-in.
  • the physical special effect particles emitted by the particle emission plug-in have a life cycle. In different animation frames, as the life cycle of the particles ends, the particles will die. Therefore, when the computer device obtains the physical special effect data, it obtains It is the physical effect data corresponding to the currently surviving particles.
  • the physical effect data in the previous frame can be obtained by initializing the value set by the user; and when the previous frame is an intermediate frame, the physical effect data in the previous frame The special effect data is obtained by updating the physical special effect data in the previous frame.
  • Step 204 obtain the first target instance obtained by instantiating the scene management class; the scene management class inherits from the target base class provided by the particle emission plug-in.
  • the target base class is the base class set provided by the particle emission plug-in, which is used to define the base class of the data interface.
  • the target base class is an abstract data interface class, which includes the abstract method.
  • the target base class can be used as a parent class to derive multiple subclasses. When each subclass implements the data interface defined by the target base class, it calls the specific data interface of the particle simulation tool by rewriting the abstract method in the data interface.
  • the scene management class inherits from the target base class, that is, the scene management class is a subclass derived from the target base class.
  • the scene management class calls the scene management interface of the particle simulation tool by implementing the data interface defined by the target base class.
  • the particle simulation tool refers to a program module that can realize particle simulation.
  • the particle simulation tool can calculate the motion state information of particles during the simulation process.
  • the first target instance is obtained by instantiating the scene management class, and the method of the scene management class can be implemented to call the scene management interface of the particle simulation tool.
  • the particle simulation tool can be a physision tool, for example, and the algorithm used by Physion is MPM (Material Point Method, material point method), which can simulate a variety of different physical materials under a unified algorithm framework, such as snow, Smoke, water, oil, muscle, hair, etc.
  • MPM Media Point Method, material point method
  • Physion implements all MPMs with CUDA (Compute Unified Device Architecture, unified computing device architecture), and performs parallel computing on GPU (graphics processing unit, graphics processing unit), which greatly improves the efficiency of solving calculations.
  • CUDA Computer Unified Device Architecture, unified computing device architecture
  • GPU graphics processing unit, graphics processing unit
  • the computer device can acquire the first target instance in the particle emission plug-in, the first target instance is generated after the scene management class is instantiated during the production of physical effects, and the scene management class is instantiated in the particle
  • the scene management interface of the particle simulation tool can be called in the running process of the particle emission plug-in to realize the simulation and calculation of particles with physical effects.
  • the first target instance is generated through the following steps: first, from the base class set provided by the particle emission plug-in, determine the base class used to call the data interface provided by the particle simulation tool, obtain the target base class, and then create inheritance From the scene management class of the target base class, the scene management class is finally instantiated to obtain the first target instance.
  • Step 206 call the scene management interface of the particle simulation tool integrated in the particle emission plug-in through the first target instance, so that in the scene manager of the particle simulation tool, calculate the physical special effect particle based on the physical special effect data in the previous frame. Frame motion state information.
  • the integration of the particle simulation tool in the particle emission plug-in refers to the dll (Dynamic Link Library, dynamic link library) file and lib (library, static data link library) file obtained by compiling the underlying library corresponding to the particle simulation tool, and All header files are integrated into the particle emission plug-in, so that the functions of the particle simulation tool can be directly called in the particle emission plug-in.
  • the scene management interface refers to the data interface corresponding to the scene manager of the particle simulation tool, and the scene manager can be called through the scene management interface. The scene manager is used to manage the physical special effect scene in the particle simulation tool, so as to realize the simulation calculation of the physical special effect particles in the scene.
  • the computer device can call the scene management interface of the particle simulation tool integrated in the particle emission plug-in through the first target instance, so as to calculate the physical special effect particle in the scene manager of the particle simulation tool
  • the motion state information of the current frame can be calculated based on the physical effect data in the previous frame during the calculation process.
  • the computer device calculates the motion state information of the physical special effect particles in the current frame based on the physical special effect data in the previous frame in the scene manager of the particle simulation tool.
  • a material point method material point method, MPM
  • the material point method is a new calculation method that combines the Euler method and the Lagrangian method, which not only avoids the problem of solving the convection term in the Euler method, but also solves the problem of the Lagrange
  • the Langer method deals with mesh distortion and negative volume problems when dealing with large deformations.
  • particles exist in a group of background grids as simulation objects.
  • the current motion state information of the particles is mapped to the background grid, and through the network in the background grid After the calculation is completed, all the information will be sent back to the particle, and then the current motion state information of the particle will be updated.
  • the calculation of the current frame can be divided into multiple time steps, and the first time step is based on The physical special effect data in the previous frame calculates the motion state information of the physical special effect particles in the current time step, and at each subsequent time step, calculates the physical special effect particle motion state information in the current time step based on the physical special effect particle motion state information in the previous time step Motion state information, until the calculation of the last time step is completed, the motion state information of the physical special effect particles in the last time step is used as the motion state information of the physical special effect particles in the current frame.
  • the time step refers to the minimum time unit when calculating the motion state information of the physical effect particles in the current frame
  • the time difference between the end time of the current time step and the end time of the previous time step is the current time step Step size
  • the step size of the time step can be set in advance according to needs. For example, the time interval between the previous frame and the current frame is t1, t1 can be divided into 30 time steps, and the step size of each time step is t1/30.
  • Step 208 based on the motion state information of the current frame, update the physical effect data in the previous frame to render the physical effect in the current frame.
  • the physical special effect data in the previous frame includes motion state information of the physical special effect particles in the previous frame.
  • the physical effect in the current frame refers to the physical effect formed by the particle simulation of the physical effect in the current frame.
  • the computer device replaces the motion state information in the physical special effect data in the previous frame with the motion state information in the current frame to update the physical special effect data in the previous frame to obtain updated physical special effect data, based on the updated
  • the physical effects data of can be rendered to obtain the physical effects in the current frame.
  • the computer device can further display the rendered physical effects in the current frame to complete the simulation of the physical effects.
  • updating the physical special effect data further includes updating the life state of the physical special effect particles in the physical special effect data, canceling the dead particles, updating the stress of the living particles, and so on.
  • the computer device can render the physical special effect particles with texture-mapped quadrilateral sprites.
  • the particles may only be rendered into one pixel, and rendered offline Even rendered as a sphere, the isosurface calculated from the particle sphere can get a very nice liquid surface.
  • particles can be rendered with a 3D mesh.
  • four particle renderers can be provided, using Sprite, Mesh, Ribbon, and Light to render particles.
  • the first target instance obtained by instantiating the scene management class is obtained; the scene management class inherits from the particle emission
  • the target base class provided by the plug-in calls the scene management interface of the particle simulation tool integrated in the particle emission plug-in through the first target instance to calculate the physics based on the physical special effect data in the previous frame in the scene manager of the particle simulation tool
  • the motion state information of special effect particles in the current frame based on the motion state information of the current frame, updates the physical special effect data in the previous frame to render the physical special effects in the current frame.
  • the particle simulation tool Since the particle simulation tool is integrated in the particle emission plug-in, it can
  • the first target instance obtained by instantiating the scene management class calls the scene management interface of the particle simulation tool to calculate the motion state information in the scene manager of the particle simulation tool, so as to render physical effects and avoid external acquisition Simulation results improve the efficiency of rendering physical effects.
  • the particle simulation tool is integrated into the particle emission plug-in, the physical simulation of the particles can be performed in real time in the animation frame, and interact with the objects in the scene, which improves the accuracy of the physical special effect simulation and makes the rendered physical Special effects are more accurate and realistic.
  • the first target instance is generated through the following steps: from the base class set provided by the particle emission plug-in, determine the base class used to call the data interface provided by the particle simulation tool to obtain the target base class; create a base class inherited from the target The scene management class of the base class is used to call the scene management interface of the particle simulation tool; the scene management class is instantiated to obtain the first target instance.
  • the base class set includes at least one base class, and the base class refers to a class from which subclasses can be derived.
  • the base class used to call the data interface provided by the particle simulation tool means that the base class can be used as a parent class to derive a subclass that calls the data interface provided by the particle simulation tool.
  • the data interface provided by the particle simulation tool can access various functions in the particle simulation tool.
  • the particle simulation tool can provide multiple data interfaces. When different data interfaces are called, they can access different functions in the particle simulation tool. , for example, you can access the scene manager in the particle simulation tool by calling the scene management interface provided by the particle simulation tool.
  • the particle simulation tool is Physion
  • the target base class can be NiagaraDataInterface
  • the member functions contained in the target base class can be shown in Table 1
  • the target base class can be Define the member function "IsPhysionDataInterface()" to implement the addition of Physion-related interfaces
  • PostInitProperties() is used to initialize variables
  • GetFunctions is used to register custom functions in NiagaraDataInterface
  • GetVMExternalFunctio is used to return representatives of registered functions
  • CanExecuteOnTarget Used to set particle simulations to run on the GPU.
  • the computer device can determine the base class used to call the data interface provided by the particle simulation tool from the base class set provided by the particle emission plug-in, obtain the target base class, and then create a A subclass of the target base class, in which a call to the scene management interface of the particle simulation tool is added to rewrite the abstract method in the target base class to obtain the scene management class, and finally the scene management class is instantiated into the particle
  • the emission plug-in obtains the first target instance in the particle emission plug-in, so that the first target instance can be obtained during the physical effect rendering process of the particle emission plug-in to call the scene management interface of the particle simulation tool to realize the motion state of the particle solution of information.
  • the particle emission plug-in provides a base class that can call the data interface provided by the particle simulation tool
  • the scene management class can be extended through the base class, and then the scene management class is instantiated in the particle emission plug-in to realize the The call of the scene manager enables the particle simulation tool to be better integrated in the particle emission plug-in.
  • instantiating the scene management class to obtain the first target instance includes: creating an object corresponding to the scene management class to obtain the scene management object; encapsulating the scene management object to obtain the first target object;
  • the target object is configured as the first property of the particle emission plugin, resulting in the first target instance.
  • the object is abstracted by the class, and the object can operate the basic properties and methods of the class to solve the corresponding problems.
  • Encapsulation refers to hiding the attributes and implementation details of an object, and only providing public access to the outside world. Encapsulation can isolate changes, facilitate use, improve reusability, and improve security. The principle of encapsulation is to hide all content that does not need to be provided externally, hide all attributes, and provide public methods to access them.
  • the computer device can create an object corresponding to the scene management class through the new operator to obtain the scene management object, and then use a preset encapsulation method to encapsulate the code of the scene management object to obtain the first target object, and finally the first target object
  • the object is configured as the first attribute of the particle emission plug-in, so as to realize the instantiation of the scene management class in the particle emission plug-in.
  • the preset encapsulation method may be, for example, privatizing attributes, setting public get and set methods, setting functions with no parameters and parameters, and finally rewriting the tostring method.
  • the new operator is an operator used to create objects, and its grammatical structure is: new constructor(), where constructor refers to the class corresponding to the object to be created.
  • constructor refers to the class corresponding to the object to be created.
  • the object corresponding to the creation of the scene management class can be new NiagaraDataInterfaceScenario ().
  • the particle emission plug-in when the particle emission plug-in is a Niagara plug-in, the Niagara plug-in includes a system (system) manager and an emitter (emitter) manager, and the computer device can configure the scene management class as a Niagara system (system) attribute.
  • system system
  • emitter emitter
  • the created scene management object is encapsulated and configured as a property of the particle emission plug-in
  • the first target instance is obtained, and the scene management function of the particle simulation tool can be called to generate animation through the configuration interface, improving The security and availability of the first target instance are guaranteed.
  • the method further includes: obtaining the property parameters of the first attribute through the configuration interface of the particle emission plug-in Configure the first attribute value obtained; use the first attribute value as the variable value corresponding to the first target instance; configure the parameters of the scene manager corresponding to the scene management interface through the variable value corresponding to the first target instance, and obtain the configured Scene Manager for scene management in particle simulation tools.
  • the configuration interface of the particle emission plug-in refers to the interface provided by the particle emission plug-in that can configure the attribute parameters of each attribute of the particle emission plug-in, through which various functions encapsulated in the particle simulation tool can be called.
  • the variable value corresponding to the first target instance refers to the specific value of the member variable in the first target instance.
  • the attribute parameter of the first attribute refers to a parameter value related to the scene, such as scene stability, frame rate and so on.
  • the computer device can obtain the attribute values of each attribute parameter configured through the configuration interface, and use the first attribute value to configure the first target instance Assign values to the corresponding member variables in , get the variable value corresponding to the first target instance, pass the variable value corresponding to the first target instance into the scene management interface to configure the scene manager corresponding to the scene management interface, and get the configuration
  • the scene manager is used for scene management in the particle simulation tool, including calculating the physical special effect data in the scene combined with the configured attribute values, that is, calculating the current physical special effect data based on the physical special effect particles in the previous frame. Motion state information in frames.
  • FIG. 3 it is a configuration interface provided by the particle emission plug-in for configuring the first attribute in an embodiment.
  • the first attribute corresponds to the scene manager, and various parameters of the first attribute can be configured in the configuration interface of the particle emission plug-in, such as frame rate, flip rate, stability, etc. in Figure 3.
  • the first attribute value obtained by configuring the attribute parameters of the first attribute can be obtained through the configuration interface of the particle emission plug-in, only a simple configuration operation is required on the configuration interface to implement the scene management interface
  • the parameters of the corresponding scene manager are configured, and the configured scene manager for scene management in the particle simulation tool is obtained.
  • the operation is simple and convenient, and the configuration efficiency is improved because there is no need to understand the underlying configuration process.
  • updating the physical effect data in the previous frame based on the motion state information of the current frame to render the physical effect data in the current frame includes: obtaining the second target instance obtained by instantiating the geometry management class; The management class is inherited from the target base class provided by the particle emission plug-in; call the geometry management interface of the particle simulation tool through the second target instance, so as to write the motion state information of the current frame into the target video memory through the geometry manager in the particle simulation tool, Update the physical effect data in the previous frame based on the motion state information of the current frame in the target video memory to render the physical effect in the current frame.
  • the geometry management class is a subclass inherited from the target base class, and the geometry management class calls the geometry management interface of the particle simulation tool by implementing the data interface defined by the target base class.
  • the geometry management interface refers to the data interface provided by the geometry manager of the particle simulation tool, and the geometry manager can be called through the geometry management interface.
  • the geometry manager is used to manage the properties of objects in physical effects in particle simulation tools, including physical properties and physical effect data of particles that make up objects, physical properties such as material, density, brittleness, etc. of objects.
  • the second target instance is obtained by instantiating the geometry management class, then the geometry management interface of the geometry manager can be invoked by implementing the method of the geometry management class through the second target instance.
  • the target video memory refers to the data buffer area allocated for the rendering data of the particle emission plugin.
  • the obtained motion state information is stored in a data buffer different from that of the target video memory, and the geometry manager can manage the physical effect data of the particles , so the motion state information can be written into the target video memory by means of the geometry manager.
  • the computer device updates the physical effect data in the previous frame based on the motion state information of the current frame to render the For physical effects
  • the second target instance obtained by instantiating the geometry management class can be obtained, and the geometry management interface of the particle simulation tool can be called through the second target instance, so that the motion of the current frame can be transferred through the geometry manager corresponding to the geometry management interface.
  • the state information is written into the target video memory, which stores the physical effect data in the previous frame.
  • the corresponding data of the previous frame in the target video memory can be The physical special effect data is updated to obtain the updated physical special effect data, and the updated physical special effect data can be used for rendering to obtain the physical special effect in the current frame.
  • the motion state information of the current frame can be written into the target video memory through the geometry manager in the particle simulation tool, and the Get the required rendering data from the tool to improve rendering efficiency.
  • the second target instance is generated through the following steps: creating a geometry management class inherited from the target base class to call the geometry management interface of the particle simulation tool; creating an object corresponding to the geometry management class to obtain the geometry management object ;Encapsulate the geometry management object to obtain the second target object; configure the second target object as the second attribute of the particle emission plug-in to obtain the second target instance.
  • the computer device can determine the base class used to call the data interface provided by the particle simulation tool from the base class set provided by the particle emission plug-in, obtain the target base class, and then create a A subclass of the target base class, in which a call to the geometry management interface of the particle simulation tool is added to rewrite the abstract method in the target base class to obtain the geometry management class, and finally the geometry management class is instantiated to the particle
  • the emission plug-in obtains the second target instance in the particle emission plug-in, so that in the process of rendering the physical effects of the particle emission plug-in, the second target instance can be obtained to call the geometry management interface of the particle simulation tool to realize the physical effects.
  • Object properties are managed.
  • the computer device can create the object corresponding to the geometry management class through the new operator to obtain the geometry management object, and then use the preset encapsulation method to encapsulate the code of the geometry management object to obtain the second target object, and finally Configure the second target object as the second attribute of the particle emission plug-in, so as to instantiate the geometry management class in the particle emission plug-in.
  • the particle emission plug-in when the particle emission plug-in is a Niagara plug-in, the Niagara plug-in includes a system (system) manager and an emitter (emitter) manager, and the computer device can configure the geometry management class as the emitter (emitter) attribute of Niagara .
  • system system
  • emitter emitter
  • the particle launch plug-in provides a base class that can call the data interface provided by the particle simulation tool
  • the base class can be extended to obtain the geometry management class, and then instantiate the geometry management class in the particle launch plug-in to realize the
  • the call of the geometry manager enables the particle simulation tool to be better integrated in the particle emission plug-in, and because the created geometry management object is encapsulated and configured as the property of the particle emission plug-in, the second target instance is obtained, so that the artist
  • the geometry management function of the particle simulation tool can be called directly through the configuration interface to create animation without the assistance of the programmer, improving the safety and usability of the second target instance.
  • the method further includes: obtaining the property parameters of the second attribute through the configuration interface of the particle emission plug-in Configure the obtained second attribute value; use the second attribute value as the variable value corresponding to the second target instance; configure the geometry manager corresponding to the geometry management interface through the variable value corresponding to the second target instance, and obtain the configured, Geometry manager for geometry management in particle simulation tools.
  • the configuration interface of the particle emission plug-in refers to the interface provided by the particle emission plug-in that can configure the attribute parameters of each attribute of the particle emission plug-in, through which various functions of the particle simulation tool can be encapsulated and called.
  • the variable value corresponding to the second target instance refers to the specific value of the member variable in the second target instance.
  • the attribute parameter of the second attribute refers to the parameter value related to the attribute of the object in the physical effect, for example, it may be the material, density and so on of the object.
  • the computer device can obtain the attribute values of each attribute parameter configured through the configuration interface, and use the second attribute value to configure the second attribute in the second target instance. Assign the corresponding member variable to obtain the variable value corresponding to the second target instance, and pass the variable value corresponding to the second target instance into the geometry management interface to configure the geometry manager corresponding to the geometry management interface. After the configuration is obtained Geometry Manager, which is used to manage the properties of objects in physical effects in particle simulation tools.
  • FIG. 4 it is a configuration interface for configuring the second attribute by the particle emission plug-in in one embodiment.
  • the second attribute corresponds to the geometry manager.
  • Various parameters of the second attribute can be configured in the configuration interface of the particle emission plug-in, such as density, material, material model, hardness, etc. in Figure 4.
  • the second attribute value obtained by configuring the attribute parameters of the second attribute can be obtained through the configuration interface of the particle emission plug-in, only a simple configuration operation is required on the configuration interface to implement the geometry management interface
  • the parameters of the corresponding geometry manager are configured, and the configured geometry manager for geometry management in the particle simulation tool is obtained.
  • the operation is simple and convenient, and the configuration efficiency is improved because there is no need to understand the underlying configuration process.
  • the above method further includes: obtaining a third target instance obtained by instantiating the boundary condition management class; the boundary condition management class inherits from the target base class provided by the particle emission plug-in; and calls particle simulation through the third target instance
  • the boundary condition management interface of the tool to obtain the target boundary condition in the boundary condition manager of the particle simulation tool; in the scene manager of the particle simulation tool, calculate the physical effect particle in the current frame based on the physical effect data in the previous frame
  • the motion state information includes: in the scene manager of the particle simulation tool, calculate the motion state information of the physical special effect particles in the current frame based on the physical special effect data and target boundary conditions in the previous frame.
  • the boundary condition management class is a subclass inherited from the target base class, and the boundary condition management class calls the boundary condition management interface of the particle simulation tool by implementing the data interface defined by the target base class.
  • the boundary condition management interface refers to the interface provided by the boundary condition manager of the particle simulation tool, and the boundary condition manager can be called through the boundary condition management interface.
  • the Boundary Condition Manager is used to manage the boundary conditions in the scene in the particle simulation tool.
  • Boundary conditions that is, signed distance fields (Signed Distance Fields, SDF), are objects that participate in the simulation and can collide with particles in particle simulation tools.
  • Boundary conditions include three types: ground, static objects, and skeletal animation. Among them, the ground and static objects are static, while skeletal animation is dynamic.
  • the difference from particles is that the position change of SDF is not calculated by dynamics. Rather just pre-fixed (static) or driven by the FBX model (dynamic).
  • the target boundary condition refers to the boundary condition corresponding to the pre-configured boundary condition parameters.
  • the third target instance is obtained by instantiating the boundary condition management class, then the boundary condition management interface can be invoked by implementing the method of the boundary condition management class through the third target instance, so as to realize the management of the boundary conditions.
  • the parameters corresponding to the target boundary conditions can be pre-configured, so that the computer device can obtain the third target instance obtained by instantiating the boundary condition management class during the animation running process, through the first
  • the three-target instance calls the boundary condition management interface of the particle simulation tool to obtain the target boundary condition in the boundary condition manager according to the parameters corresponding to the target boundary condition. Since the target boundary conditions are obtained, when calculating the motion state information of the physical special effect particles in the current frame, the target boundary conditions can be registered in the scene manager. In the scene manager, based on the physical special effect data and The target boundary condition calculates the motion state information of the physical effect particles in the current frame.
  • the target boundary condition is the ground
  • the boundary condition management interface of the particle simulation tool is invoked through the third target instance to obtain the boundary condition of the target in the boundary condition manager, so that the calculation of the collision process can be simulated in the scene manager, so that the simulation obtained Physical effects can be varied.
  • the third target instance is generated through the following steps: create a boundary condition management class inherited from the target base class to call the boundary condition management interface of the particle simulation tool; create a boundary condition management class inherited from the boundary condition management class, and The target derived class corresponding to the type configuration parameter is instantiated to obtain the third target instance; the type configuration parameter is the parameter obtained by configuring the type of the boundary condition manager obtained through the configuration interface of the particle emission plug-in .
  • the data interface provided by the particle simulation tool when the data interface provided by the particle simulation tool is called, it can access various functions in the particle simulation tool.
  • the particle simulation tool can provide multiple data interfaces, and when different data interfaces are called, access to the particle simulation Different functions in the tool, for example, when it is necessary to access the boundary condition manager in the particle simulation tool, can be realized by calling the boundary condition management interface provided by the particle simulation tool.
  • the boundary condition manager is used to manage boundary conditions, including generating boundary conditions corresponding to configuration parameters.
  • Type configuration data is data characterizing the type of the boundary condition manager. Different boundary conditions correspond to different boundary condition managers, for example, ground boundary conditions are managed through the ground boundary condition manager. When multiple different types of boundary condition managers are required, multiple types of configuration parameters can be configured to obtain different target derived classes for different types of configuration parameters. Take Niagara as an example for the particle emission plug-in. In Niagara System, Sdf can only be used as an external input. Therefore, if users want to add Sdf as a collision body, they need to add the corresponding type of NiagaraDataInterfaceSdf in User Exposed. For example, it can be configured to get three different Type configuration parameters are ground boundary condition (GroudSdf), skeleton animation boundary condition (SkeletalMeshSdf) and static object boundary condition (StaticMeshSdf).
  • GroudSdf ground boundary condition
  • SketalMeshSdf skeleton animation boundary condition
  • StaticMeshSdf static object boundary condition
  • the computer device can determine the base class used to call the data interface provided by the particle simulation tool from the base class set provided by the particle emission plug-in, obtain the target base class, and then create a A subclass of the base class. Add a call to the boundary condition management interface of the particle simulation tool in the subclass to rewrite the abstract method in the target base class to obtain the boundary condition management class.
  • the boundary condition manager Since the boundary condition manager has different type, so it is necessary to create a target derived class corresponding to the type configuration parameters based on the boundary condition management class, and finally instantiate the target derived class to the particle emission plug-in, and obtain the third target instance in the particle emission plug-in, so as to perform physics in the particle emission plug-in
  • the third target instance can be obtained to call the boundary condition management interface corresponding to the third target instance type in the particle simulation tool to realize the calculation of the motion state information during the particle collision process.
  • the particle emission plug-in provides a base class that can call the data interface provided by the particle simulation tool
  • the base class can be extended to obtain the boundary condition management class, and then based on the boundary condition management class, different derived classes can be derived and Instantiate in the particle emission plug-in to realize the call of different types of boundary condition managers, so that the particle simulation tool can be better integrated in the particle emission plug-in.
  • instantiating the target derived class to obtain the third target instance includes: creating an object corresponding to the target derived class to obtain the target boundary condition management object; encapsulating the target boundary condition management object to obtain the third target object ; Configure the third target object as the third attribute of the particle emission plug-in to get the third target instance.
  • the computer device can create the object corresponding to the target derived class through the new operator to obtain the target boundary condition management object, and then use the preset encapsulation method to encapsulate the code of the target boundary condition management object, Get the third target object, and finally configure the third target object as the third attribute of the particle emission plug-in, so as to realize the instantiation of the target derived class in the particle emission plug-in.
  • the particle emission plug-in when the particle emission plug-in is a Niagara plug-in, the Niagara plug-in includes a system (system) manager and an emitter (emitter) manager, and the computer device can configure the target derived class as the system (system) property of Niagara.
  • system system
  • emitter emitter
  • the created target boundary condition management object is encapsulated and configured as a property of the particle emission plug-in, the third target instance is obtained, so that the artist can directly implement the boundary condition management function of the particle simulation tool through the configuration interface Invoked without programmer assistance, improving the security and availability of third-target instances.
  • the method further includes: obtaining the property parameters of the third attribute through the configuration interface of the particle emission plug-in Configure the third attribute value obtained; use the third attribute value as the variable value corresponding to the third target instance; configure the parameters of the boundary condition manager corresponding to the boundary condition management interface through the variable value corresponding to the third target instance, and obtain Configured boundary condition manager for boundary condition management in particle simulation tools.
  • the attribute parameter of the third attribute refers to the parameter related to the boundary condition in the physical effect, and is used to specify the object corresponding to the boundary condition.
  • the computer device can obtain the attribute values of each attribute parameter configured through the configuration interface, and use the third attribute value to configure the third attribute in the third target instance.
  • the corresponding member variable is assigned to obtain the variable value corresponding to the third target instance, and the variable value corresponding to the third target instance is passed into the boundary condition management interface corresponding to the third target instance, so as to obtain the variable value corresponding to the boundary condition management interface.
  • the corresponding boundary condition manager is configured to obtain the configured boundary condition manager, and the boundary condition manager is used to manage corresponding types of boundary conditions in the particle simulation tool.
  • the third attribute obtained by configuring the attribute parameters of each third attribute is obtained through the configuration interface of the particle emission plug-in.
  • the attribute value it can be obtained through the same configuration interface.
  • FIG. 5 it is a configuration interface for configuring the third attribute by the particle emission plug-in in an embodiment.
  • the parameter configuration items of the ground, skeletal animation, and static objects are included in the same interface, through which the property values of the ground, skeletal animation, and static objects under three different types of boundary conditions can be obtained simultaneously.
  • the third attribute value obtained by configuring the attribute parameters of the third attribute can be obtained through the configuration interface of the particle emission plug-in, only a simple configuration operation is required on the configuration interface to realize the geometry management interface The parameters of the corresponding geometry manager are configured, and the operation is simple and convenient. Since there is no need to understand the underlying configuration process, the configuration efficiency is improved.
  • calculating the motion state information of the physical special effect particles in the current frame based on the physical special effect data in the previous frame includes: in the scene manager of the particle simulation tool, based on the above
  • the physical special effect data in one frame calculates the motion state information of the physical special effect particles in the current frame, and writes the motion state information into the first video memory; based on the motion state information of the current frame, the physical special effect data in the previous frame is updated to render
  • the physical effects in the current frame include: reading the motion state information of the current frame from the first video memory, copying the motion state information of the current frame; writing the copied motion state information into the second video memory, and
  • the physical effect data in the previous frame is updated in the video memory based on the motion state information of the current frame; among them, the first video memory is the data buffer area allocated for the particle simulation tool in the target video memory of the particle emission plug-in; the second video memory is the variable in the target video memory. In the data buffer area of the first video memory, it is used to store
  • the particle emission plug-in is a Niagara plug-in
  • the particle simulation tool integrated in the plug-in is physion.
  • Niagara uses a high-level shader language (High Level Shader Language, referred to as HLSL) for GPU Buffer (the data buffer corresponding to the GPU), and Physion uses Cuda (Compute Unified Device Architecture, unified computing device architecture) to operate the GPU Buffer, but HLSL and CUDA cannot call each other, so CUDA is used in the embodiment of this application Interoperate with Compute Shader to achieve indirect interaction.
  • HLSL High Level Shader Language
  • Physion uses Cuda (Compute Unified Device Architecture, unified computing device architecture) to operate the GPU Buffer, but HLSL and CUDA cannot call each other, so CUDA is used in the embodiment of this application Interoperate with Compute Shader to achieve indirect interaction.
  • the first video memory can be allocated for physision, the first video memory is operated by CUDA, the second video memory is allocated for Niagara, the second video memory is operated by Compute Shader, the data in the first video memory and the second video memory can be used
  • the copy method realizes the data transfer from GPU to GPU.
  • the first video memory is mainly used to store particle emission data and particle rendering data, wherein the particle emission data refers to the particle attribute data stored when Niagara’s particle emitter (emitter) emits particles, and the particle rendering data refers to Niagara’s particle
  • the physics data of the particles stored during the rendering step are examples of the particles stored during the rendering step.
  • the computer device can read the motion state information of the current frame from the first video memory, copy the motion state information of the current frame, write the copied motion state information into the second video memory, and store it in the second video memory Update the physical effect data in the previous frame based on the motion state information of the current frame.
  • the above method further includes: emitting a preset number of initial particles at the position where the preset model is located, and writing the attribute information of the initial particles into the second video memory; reading the information of the initial particles from the second video memory Attribute information, to copy the attribute information of the initial particles; write the attribute information of the copied initial particles into the first video memory, and use the particle simulation tool based on the attribute information of the initial particles in the first video memory on the surface and inside of the preset model Sampling is performed to obtain physical special effect particles for physical special effect simulation.
  • the preset model is used to control the generation position of the particles, and the preset model may be a geometry of regular or irregular shape, such as a model of a ring, a sphere, a cone, and the like.
  • the preset model can also be a grid asset (mesh), such as Static Mesh (static mesh asset) or Skeletal Mesh (skeletal mesh asset), as shown in Figure 6, which is a schematic diagram of a preset model in an embodiment, 602 in FIG. 6 is a preset model.
  • Niagara can only sample the surface of the grid asset when generating particles at the grid asset, for example, based on the surface of the static mesh shown in 602 in Figure 6. Particles are shown in (a) in Figure 7. It can be seen that the sampled particles are only on the surface of the human head, and there are no sampled particles inside. This generation method does not necessarily meet the needs of use. In actual use, It is likely that the particles will be generated inside the Mesh.
  • the particle sampling function in Physion is connected, and particle sampling can be performed on the surface and interior of the Mesh, for example, based on the surface and interior of the static mesh shown in 602 in Figure 6.
  • the obtained particles are shown in the panel (b) of FIG. 7 .
  • the Niagara plug-in emits a preset number of initial particles at the location of the preset model, and writes the attribute information of the initial particles into the second video memory and writes it into the second video memory allocated for Niagara. Sampling is performed in Physion. Therefore, it is necessary to read the attribute information of the initial particle from the second video memory, copy the attribute information of the initial particle, and write the attribute information of the copied initial particle into the first video memory allocated for Physion. In this way, Physion is used to sample the surface and interior of the preset model to obtain physical special effect particles for physical special effect simulation.
  • the attribute information of the initial particles is copied, and the attribute information of the copied initial particles is written into the first video memory through the particle simulation tool based on the first
  • the attribute information of the initial particles in the video memory is sampled on the surface and inside of the preset model, so that the sampled physical special effect particles can better meet the needs of special effect simulation.
  • calculating the motion state information of the physical special effect particles in the current frame based on the physical special effect data in the previous frame includes: in the scene manager of the particle simulation tool, based on the above The physical effect data in one frame is mapped to the preset background grid; the background grid includes multiple grid nodes; in the background grid, the mesh corresponding to each physical effect particle in the current frame is calculated based on the physical effect data The motion state information of the grid node; the motion state information of each grid node is mapped to the corresponding physical effect particle, and the motion state information of each physical effect particle in the current frame is obtained.
  • the background grid refers to the simulation space used to place the physical effect particles during the calculation process
  • the background grid includes at least a plurality of grid nodes, and the plurality refers to at least two.
  • the background grid can be divided into at least one grid block, each grid block includes at least one grid for placing physical effect particles, and each grid corresponds to at least one grid node.
  • a data structure can be used to sparsely store the grid blocks, that is, only the grid blocks where the physical effect particles will fall will be allocated the corresponding memory.
  • the computer device can interpolate the physical special effect data of the physical special effect particle in the previous frame into the preset background grid through the shape function.
  • the interpolated physical special effect data of the physical special effect particle The grid node is the grid node corresponding to the physical effect particle in the background grid.
  • the computer device further calculates the motion state information of the grid node based on these interpolation information in the background grid, and passes the calculated motion state information through
  • the shape function is mapped back to the physical special effect particles corresponding to the grid nodes, and the motion state information of each physical special effect particle in the current frame is obtained.
  • interpolation may refer to interpolating a continuous function on the basis of discrete data, so that this continuous curve passes through all given discrete data points.
  • Interpolation is an important method of discrete function approximation, which can be used to estimate the approximate value of the function at other points through the value of the function at a limited number of points.
  • FIG. 8 it is a schematic flow chart of calculating motion state information through a background grid in a specific embodiment. With reference to Figure 8, it specifically includes the following steps:
  • each physical special effect particle saves its own attribute values such as mass, position, velocity, deformation gradient, elastic-plastic physical parameters, etc., while the grid node needs to calculate the force and acceleration Situations, velocity increments, and handling of boundary conditions (i.e. colliders), etc.
  • the current frame in order to ensure the calculation accuracy, can be divided into multiple time steps, and each time step calculates the motion state information once.
  • each time step calculates the motion state information once.
  • the physical special effects The particle's new individual property values are output as a result for the current frame.
  • the movement state information of the particles is calculated by mapping the physical effect data into the background grid. Since the background grid is greatly reduced compared to the number of particles, the overhead in the calculation process is saved.
  • the present application also provides an application scenario, where the above-mentioned physical special effect rendering method is applied to realize the rendering of physical special effects in games through the above physical special effect rendering method.
  • the particle emission plug-in is Niagara, which integrates the particle simulation tool Physion, in which Niagara is UE's main next-generation particle system, using Niagara, TA (Technical Artist, technical artist) You can create additional functions by yourself without the assistance of programmers.
  • Niagara is easy to use and easy to understand. Through Niagara, artists can fully control the effects, programmable, customizable, and provide better debugging, display and performance tools , Support data from other parts of the UE or external sources, without hindering user operations.
  • the particle emission plug-in provided by the embodiment of the present application provides a variety of classes inherited from the data interface class (NiagaraDataInterface), which can be accessed in Niagara and instantiated in Niagara System and Niagara Emitter, so as to realize the Niagara DataInterface in Niagara Physion is called in the running process of the system to realize the dynamic calculation function of particles.
  • the data interface class (NiagaraDataInterface) is the target base class, and the scene management is derived from the target base class.
  • the NiagaraDataInterfaceScenario class corresponds to the Scenario in Physion, that is, the currently simulated scene manager.
  • a Niagara System corresponds to a NiagaraDataInterfaceScenario, that is, NiagaraDataInterfaceScenario is the only attribute of a Niagara System. All particles in a Niagara System (even if they belong to different Emitters) can collide and interact with each other, while particles of different Niagara Systems are isolated from each other. , cannot interact with each other.
  • the class NiagaraDataInterfaceGeometry corresponds to the geometry manager Geometry in Physion.
  • a Niagara Emitter corresponds to a NiagaraDataInterfaceGeometry, that is, NiagaraDataInterfaceGeometry is the only attribute of a Niagara Emitter, and the same Emitter Particles are initialized with the same set of parameters.
  • a System can include multiple Emitters, that is, multiple Geometries.
  • NiagaraDataInterfaceSdf is used as the base class of boundary conditions, and multiple subclasses for different purposes are derived, including:
  • This subclass can realize the Actor containing the Static Mesh Component in the scene as input, and Physion samples its Static Mesh to obtain SDF format data that can participate in the collision calculation, and input it into the Scenario, as a static during simulation Boundary conditions.
  • This subclass can take the Actor that contains the Skeletal Mesh Component in the scene as input, and Physion samples the Skeletal Mesh in the current frame state in each frame to obtain the SDF format data that can participate in the collision calculation, and input it into the Scenario.
  • Skeletal Mesh Sdf needs to be updated every frame, which is used as the boundary condition in the motion state during simulation.
  • Plane Actor The boundary conditions obtained by this subclass are generally designated as Plane Actor in the scene. As an infinitely extended plane, particles cannot pass through this plane, and can generally be used as a ground.
  • Sdf can only be used as an external input during simulation, and the Actor in the scene is mounted to the Niagara Component in the scene. In Niagara System, only particles can be compiled, and Sdf cannot be imported to collide with particles.
  • each function in Physion is encapsulated, and the corresponding properties that can be added are added to the configuration interface of Niagara, and the module script that has been written is called in the corresponding Niagara way to realize Niagara's integration of Physion.
  • the configuration interface mainly includes two modules, NiagaraSystem (system) and NiagaraEmitter (emitter).
  • NiagaraSystem is the manager of the current system
  • NiagaraEmitter As an emitter in the current System, the NiagaraSystem module mainly includes two modules: system spawn and system update, and the NiagaraEmitter module mainly includes emitter production, emitter update, particle production and particle update modules
  • the NiagaraSystem module mainly includes two modules: system spawn and system update
  • the NiagaraEmitter module mainly includes emitter production, emitter update, particle production and particle update modules
  • emitter production, emitter update, particle production and particle update modules There are four modules, and different modules are used to perform steps in different stages. These modules are introduced below.
  • This module includes the following modules:
  • Reset Scenario Manager (NM Reset Scenario). The function of this module is to clear the data of the previous simulation at the beginning of each Niagara cycle, reset Physion to the initial state, and prepare for the next simulation.
  • Sdf can only be used as an external input, so if users want to add Sdf as a collision body, they need to add the corresponding type of NiagaraDataInterfaceSdf in User Exposed.
  • You can specify the corresponding parameters in the attribute for example, refer to the Static Mesh in the scene as the object that collides with the particles, refer to Figure 5, PhysionGroundSdf in Figure 5 specifies the plane in the scene as the ground, and PhysionSkeletalMeshSdf specifies the scene The reptile in as an object with skeletal animation assigned.
  • the main function is to reset the parameters in the Scenario, and then initialize Sdf, but other content is not initialized in the System Spawn stage, because the initialization of other parts needs to rely on particle information, and in In the System Spawn stage, the particles have not been generated yet, and the particles are generated in the Particle Spawn stage. Therefore, in the System Spawn stage, only the Sdf that does not depend on the particles can be initialized, while other parts need to be completed later.
  • this module mainly includes the following modules:
  • NM Init Scenario including calling the initialization function of the scene manager, using the data initialized by the geometry manager and boundary condition manager, transferring all the data to the GPU side, and completing other lower-level data Preparation.
  • Update Physion (NM Update Physion). This module is used to drive Scenario to solve the particle physics state of the current frame, update the position of all particles and other information, which needs to be called every frame, including updating the force value of each physical effect particle in the physision data buffer, Life cycle, etc., and drive the particle to simulate the motion state of the next frame.
  • this module includes the following modules:
  • this module mainly includes the following parts:
  • the emitter state (Emitter State) and the number of production particles (Spawn Burst Instantaneous), these two modules are Niagara's original modules, where the Emitter State can specify some Emitter attribute parameters, and the Spawn Burst Instantaneous is specified in a certain The number of particles generated at a time.
  • NM Init Geometry This module is used to initialize Geometry. The main process is to obtain the position and quality of the particles through Niagara's data buffer for storing particle data, and then according to the arrangement of particle attributes. , serial number, life cycle and other attributes, copy these attributes, transfer GPU to GPU data, transfer to the scene manager, and prepare data for the subsequent initialization of the Scenario.
  • this module is mainly used to update the relevant information of the corresponding physical effect particles in the current geometry manager in each frame, including: 1), read the data in the data buffer of Niagara The force value of the physical effect particle; 2), write the particle position, velocity and other information of the current frame solved in Physion into the data buffer of Niagara, and prepare the data for rendering; 3), update the value of each particle Life state, real-time statistics of dead particles.
  • this module mainly includes the following parts:
  • Particle initialization this module is a native module of Niagara, its function is to set some attribute values of each particle, such as life cycle, color, quality, rendering radius, etc.
  • this module is a Niagara native module, it can also indirectly control the Physion simulation. Take the quality as an example.
  • the data of each particle quality stored in the data buffer of Niagara will be copied when Physion is initialized, and the operation of using GPU to GPU is used to initialize each particle in Physion.
  • the quality of the particles in order to achieve the purpose of setting the particle quality in Physion.
  • the emission position control module whose function is to control the generation of particles in the preset model.
  • the preset model can be a regular or irregular geometry, such as a ring, sphere, cone and other shapes.
  • the preset model can also be a mesh asset (mesh), such as Static Mesh (static mesh asset) or Skeletal Mesh (skeletal mesh asset)
  • this module mainly includes the following parts:
  • Particle state setting (Particle State)
  • this module is a Niagara native module, which is mainly used to set the state of the particle, such as setting the life cycle of the particle, setting the death of the particle at the end of the life cycle, and so on.
  • the gravity module (Gravity Force), which is a native module of Niagara, adds a gravity effect to each particle, similarly there are other control force modules, which can realize a variety of particles by adding multiple different control forces motion effect. As shown in Figure 11, the effect of particle rotation can be achieved by adding gravity, line attraction, curl noise, and vortex force.
  • the external force is added to the particles to control the particle movement, which is better integrated with Niagara, and at the same time conforms to the usage habits of artists, and is convenient Reuse of some effects.
  • Particle logout module (NM Set Deleted Particle Index), its role is to obtain the survival status of each particle in the current Emitter in real time at runtime, obtain the survival information of each particle in each frame, and write the information to the geometry In a data buffer corresponding to the manager, the Physion side can obtain the real particle survival status in each frame, and synchronize the dead particle information.
  • FIG 12 it is a call flowchart of the particle emission plug-in in an embodiment during motion.
  • Niagara needs to execute native scripts at various stages (that is, the original script in Niagara Script), there are some additional steps, the following diagrams illustrate the additional steps performed during the running process and the important steps in the native script:
  • Reset Geometry Manager Reset all content in the Geometry Manager, delete previous results, and prepare for a new simulation.
  • Emitter update Execute the native script, that is, determine the number of particles generated according to Niagara's native module Spawn Burst Instantaneous.
  • Particle production Execute the native script, that is, generate particles according to the number of generated particles specified in the update stage of the emitter, specify the attribute values of the new particles, including position, speed, etc., and write the attribute data of the particles into the allocated video memory.
  • Emitter update Since the particles have been generated in the first frame, at this stage, the geometry manager reads the attribute data in the video memory corresponding to the emitter, and performs a GPU-to-GPU transfer of the data that saves the relevant attributes of each particle. Copy, copy to the video memory corresponding to the geometry manager, and initialize the geometry manager.
  • the geometry manager reads the calculated data stored in the corresponding video memory of the scene manager, obtains the particle position, speed and other data, and performs a GPU-to-GPU copy, and transfers the new position and speed Wait for the data to be copied to the corresponding video memory of Niagara to complete the update of the particles.
  • the geometry manager can also read the force value of the particles in the video memory corresponding to Niagara, and perform a GPU-to-GPU copy, and write it into the video memory corresponding to the geometry manager.
  • System update simulate the next frame, and calculate the new position and velocity of the particles.
  • Emitter update repeat the operation of the third frame, perform a GPU-to-GPU copy, copy the new position, speed and other data to the corresponding video memory of Niagara, and complete the particle update.
  • a physical special effect rendering device 1300 is provided.
  • the device may use software modules or hardware modules, or a combination of the two to become a part of computer equipment.
  • the device specifically includes:
  • the data acquisition module 1302 acquires the physical special effect data of the physical special effect particles emitted by the particle emission plug-in in the last frame;
  • the instance obtaining module 1304 is used to obtain the first target instance obtained by instantiating the scene management class; the scene management class inherits from the target base class provided by the particle emission plug-in;
  • the data calculation module 1306 is used to call the scene management interface of the particle simulation tool integrated in the particle emission plug-in through the first target instance, so as to calculate the physical effect based on the physical special effect data in the previous frame in the scene manager of the particle simulation tool The motion state information of special effect particles in the current frame;
  • the data update module 1308 is configured to update the physical effect data in the previous frame based on the motion state information of the current frame, so as to render the physical effect in the current frame.
  • the first target instance obtained by instantiating the scene management class is obtained; the scene management class inherits from the particle emission
  • the target base class provided by the plug-in calls the scene management interface of the particle simulation tool integrated in the particle emission plug-in through the first target instance to calculate the physics based on the physical special effect data in the previous frame in the scene manager of the particle simulation tool
  • the motion state information of special effect particles in the current frame based on the motion state information of the current frame, updates the physical special effect data in the previous frame to render the physical special effects in the current frame.
  • the particle simulation tool Since the particle simulation tool is integrated in the particle emission plug-in, it can
  • the first target instance obtained by instantiating the scene management class calls the scene management interface of the particle simulation tool to calculate the motion state information in the scene manager of the particle simulation tool, so as to render physical effects and avoid external acquisition Simulation results improve the efficiency of rendering physical effects.
  • the above device further includes: a first target instance generation module, configured to determine the base class used to call the data interface provided by the particle simulation tool from the base class set provided by the particle emission plug-in, and obtain the target base class ; Create a scene management class inherited from the target base class to call the scene management interface of the particle simulation tool; instantiate the scene management class to obtain the first target instance.
  • a first target instance generation module configured to determine the base class used to call the data interface provided by the particle simulation tool from the base class set provided by the particle emission plug-in, and obtain the target base class ; Create a scene management class inherited from the target base class to call the scene management interface of the particle simulation tool; instantiate the scene management class to obtain the first target instance.
  • the first target instance generation module is also used to create the object corresponding to the scene management class to obtain the scene management object; encapsulate the scene management object to obtain the first target object; configure the first target object as a particle Emits the first property of the plugin to get the first target instance.
  • the above device further includes a scene manager configuration module, configured to obtain the first attribute value obtained by configuring the attribute parameter of the first attribute through the configuration interface of the particle emission plug-in; use the first attribute value as The variable value corresponding to the first target instance; configure the parameters of the scene manager corresponding to the scene management interface through the variable value corresponding to the first target instance, and obtain the configured scene for scene management in the particle simulation tool manager.
  • a scene manager configuration module configured to obtain the first attribute value obtained by configuring the attribute parameter of the first attribute through the configuration interface of the particle emission plug-in; use the first attribute value as The variable value corresponding to the first target instance; configure the parameters of the scene manager corresponding to the scene management interface through the variable value corresponding to the first target instance, and obtain the configured scene for scene management in the particle simulation tool manager.
  • the data update module is also used to obtain the second target instance obtained by instantiating the geometry management class; the geometry management class inherits from the target base class provided by the particle emission plug-in; the particle simulation is invoked through the second target instance
  • the geometry management interface of the tool is used to write the motion state information of the current frame into the target video memory through the geometry manager in the particle simulation tool, and update the physical special effect data in the previous frame based on the motion state information of the current frame in the target video memory. Get the physical effects in the current frame by rendering.
  • the above-mentioned device further includes: a second target instance generation module, configured to create a geometry management class inherited from the target base class, so as to call the geometry management interface of the particle simulation tool; create an object corresponding to the geometry management class , to obtain the geometry management object. Encapsulate the geometry management object to obtain the second target object; configure the second target object as the second attribute of the particle emission plug-in to obtain the second target instance.
  • a second target instance generation module configured to create a geometry management class inherited from the target base class, so as to call the geometry management interface of the particle simulation tool
  • create an object corresponding to the geometry management class to obtain the geometry management object.
  • Encapsulate the geometry management object to obtain the second target object configure the second target object as the second attribute of the particle emission plug-in to obtain the second target instance.
  • the above-mentioned device further includes: a geometry manager configuration module, configured to obtain the second attribute value obtained by configuring the attribute parameter of the second attribute through the configuration interface of the particle emission plug-in; use the second attribute value as The variable value corresponding to the second target instance; configure the geometry manager corresponding to the geometry management interface through the variable value corresponding to the second target instance, and obtain the configured geometry manager for geometry management in the particle simulation tool .
  • a geometry manager configuration module configured to obtain the second attribute value obtained by configuring the attribute parameter of the second attribute through the configuration interface of the particle emission plug-in; use the second attribute value as The variable value corresponding to the second target instance; configure the geometry manager corresponding to the geometry management interface through the variable value corresponding to the second target instance, and obtain the configured geometry manager for geometry management in the particle simulation tool .
  • the above-mentioned device further includes a boundary condition generating module, configured to obtain a third target instance obtained by instantiating the boundary condition management class; the boundary condition management class inherits from the target base class provided by the particle emission plug-in; through the second The three-target instance calls the boundary condition management interface of the particle simulation tool to obtain the target boundary conditions in the boundary condition manager of the particle simulation tool; the data calculation module is also used in the scene manager of the particle simulation tool, based on the previous frame The physical special effect data and target boundary conditions in calculate the motion state information of the physical special effect particles in the current frame.
  • the above device further includes: a third target instance generation module, configured to create a boundary condition management class inherited from the target base class, to call the boundary condition management interface of the particle simulation tool; create a boundary condition management class inherited from the boundary condition The target derived class corresponding to the type configuration parameter of the management class is instantiated to obtain the third target instance; where the type configuration parameter is the type of the boundary condition manager obtained through the configuration interface of the particle emission plug-in Parameters obtained through configuration.
  • the third target instance generation module is also used to create the object corresponding to the target derived class to obtain the target boundary condition management object; encapsulate the target boundary condition management object to obtain the third target object;
  • the object is configured as a third property of the Particle Emitter plugin, resulting in a third target instance.
  • the above device further includes a boundary condition manager configuration module, configured to obtain the third attribute value obtained by configuring the attribute parameter of the third attribute through the configuration interface of the particle emission plug-in; use the third attribute value as The variable value corresponding to the third target instance; configure the parameters of the boundary condition manager corresponding to the boundary condition management interface through the variable value corresponding to the third target instance, and obtain the configured boundary condition used in the particle simulation tool Managed Boundary Condition Manager.
  • a boundary condition manager configuration module configured to obtain the third attribute value obtained by configuring the attribute parameter of the third attribute through the configuration interface of the particle emission plug-in; use the third attribute value as The variable value corresponding to the third target instance; configure the parameters of the boundary condition manager corresponding to the boundary condition management interface through the variable value corresponding to the third target instance, and obtain the configured boundary condition used in the particle simulation tool Managed Boundary Condition Manager.
  • the data calculation module is also used in the scene manager of the particle simulation tool to calculate the motion state information of the physical special effect particles in the current frame based on the physical special effect data in the previous frame, and write the motion state information into In the first video memory;
  • the data update module is also used to read the motion state information of the current frame from the first video memory, and copy the motion state information of the current frame; the motion state information obtained by copying is written in the second video memory, And in the second video memory, based on the motion state information of the current frame, the physical special effect data in the previous frame is updated;
  • the first video memory is the data buffer area allocated for the particle simulation tool in the target video memory of the particle emission plug-in;
  • the second video memory is The data buffer area in the target video memory that is different from the first video memory is used to store particle emission data and particle rendering data.
  • the above device further includes a sampling module, configured to emit a preset number of initial particles at the position of the preset model, and write the attribute information of the initial particles into the second video memory; read from the second video memory Take the attribute information of the initial particle, and copy the attribute information of the initial particle; write the attribute information of the copied initial particle into the first video memory, and use the particle simulation tool based on the attribute information of the initial particle in the first video memory in the preset model Sampling the surface and interior of the object to obtain physical special effect particles for physical special effect simulation.
  • a sampling module configured to emit a preset number of initial particles at the position of the preset model, and write the attribute information of the initial particles into the second video memory
  • read from the second video memory Take the attribute information of the initial particle, and copy the attribute information of the initial particle
  • write the attribute information of the copied initial particle into the first video memory and use the particle simulation tool based on the attribute information of the initial particle in the first video memory in the preset model Sampling the surface and interior of the object to obtain physical
  • the data update module is also used in the scene manager of the particle simulation tool to map to the preset background grid based on the physical special effect data in the previous frame;
  • the background grid includes multiple grids grid node; in the background grid, calculate the motion state information of the grid node corresponding to each physical effect particle in the current frame based on the physical special effect data; map the motion state information of each grid node to the corresponding physical special effect particle, and obtain The motion state information of each physical effect particle in the current frame.
  • Each module in the above-mentioned physical special effect rendering device may be implemented in whole or in part by software, hardware or a combination thereof.
  • the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
  • a computer device is provided.
  • the computer device may be a terminal, and its internal structure may be as shown in FIG. 14 .
  • the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and computer readable instructions.
  • the internal memory provides an environment for the execution of the operating system and computer readable instructions in the non-volatile storage medium.
  • the communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, operator network, NFC (Near Field Communication) or other technologies.
  • a physical special effect rendering method is realized.
  • the display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen
  • the input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball or a touch pad provided on the casing of the computer device , and can also be an external keyboard, touchpad or mouse.
  • Figure 14 is only a block diagram of a partial structure related to the solution of this application, and does not constitute a limitation on the computer equipment on which the solution of this application is applied.
  • the specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
  • a computer device including a memory and a processor, where computer-readable instructions are stored in the memory, and the processor implements the steps in the foregoing method embodiments when executing the computer-readable instructions.
  • a computer-readable storage medium which stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps in the foregoing method embodiments are implemented.
  • a computer program product or computer readable instructions comprising computer instructions stored in a computer readable storage medium.
  • the processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the steps in the foregoing method embodiments.
  • Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory or optical memory, etc.
  • Volatile memory can include Random Access Memory (RAM) or external cache memory.
  • RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Processing Or Creating Images (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本申请涉及一种物理特效渲染方法、装置、计算机设备、存储介质和计算机程序产品。所述方法包括:获取由粒子发射插件发射的物理特效粒子在上一帧中的物理特效数据(202);获取对场景管理类进行实例化得到的第一目标实例,所述场景管理类继承自所述粒子发射插件提供的目标基类(204);通过所述第一目标实例调用集成于所述粒子发射插件中的粒子模拟工具的场景管理接口,以在所述粒子模拟工具的场景管理器中,基于所述上一帧中的物理特效数据计算所述物理特效粒子在当前帧的运动状态信息(206);基于所述当前帧的运动状态信息更新所述上一帧中的物理特效数据,以渲染得到当前帧中的物理特效(208)。

Description

物理特效渲染方法、装置、计算机设备和存储介质
本申请要求2021年10月25日申请的,申请号为202111237498X,名称为“物理特效渲染方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别是涉及一种物理特效渲染方法、装置、计算机设备、存储介质和计算机程序产品。
背景技术
随着计算机技术的发展,粒子发射插件越来越广泛地被应用于游戏、动画等的开发中。粒子发射插件可以在三维空间中发射粒子,并可以通过对发射的粒子进行渲染得到物理特效。
传统技术中,粒子发射插件无法对粒子的运动进行物理仿真,需要从外部获取离线物理仿真得到的模拟结果来配合实现物理特效的渲染,导致粒子发射插件在进行物理特效渲染时效率低。
发明内容
根据本申请提供的各种实施例,提供一种物理特效渲染方法、装置、计算机设备、存储介质和计算机程序产品。
一种物理特效渲染方法,由计算机设备执行,所述方法包括:获取由粒子发射插件发射的物理特效粒子在上一帧中的物理特效数据;获取对场景管理类进行实例化得到的第一目标实例;所述场景管理类继承自所述粒子发射插件提供的目标基类;通过所述第一目标实例调用集成于所述粒子发射插件中的粒子模拟工具的场景管理接口,以在所述粒子模拟工具的场景管理器中,基于所述上一帧中的物理特效数据计算所述物理特效粒子在当前帧的运动状态信息;及基于所述当前帧的运动状态信息更新所述上一帧中的物理特效数据,以渲染得到当前帧中的物理特效。
一种物理特效渲染装置,所述装置包括:数据获取模块,获取由粒子发射插件发射的物理特效粒子在上一帧中的物理特效数据;实例获取模块,用于获取对场景管理类进行实例化得到的第一目标实例;所述场景管理类继承自所述粒子发射插件提供的目标基类;数据计算模块,用于通过所述第一目标实例调用集成于所述粒子发射插件中的粒子模拟工具的场景管理接口,以在所述粒子模拟工具的场景管理器中,基于所述上一帧中的物理特效数据计算所述物理特效粒子在当前帧的运动状态信息;及数据更新模块,用于基于所述当 前帧的运动状态信息更新所述上一帧中的物理特效数据,以渲染得到当前帧中的物理特效。
一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行上述物理特效渲染方法的步骤。
一个或多个非易失性可读存储介质,存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时,使得所述处理器执行上述物理特效渲染方法的步骤。
一种计算机程序产品,包括计算机可读指令,所述计算机可读指令被处理器执行时实现上述物理特效渲染方法的步骤。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例或传统技术中的技术方案,下面将对实施例或传统技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据公开的附图获得其他的附图。
图1为一个实施例中物理特效渲染方法的应用环境图;
图2为一个实施例中物理特效渲染方法的流程示意图;
图3为一个实施例中配置第一属性的属性参数时的配置界面示意图;
图4为一个实施例中配置第二属性的属性参数时的配置界面示意图;
图5为一个实施例中配置第三属性的属性参数时的配置界面示意图;
图6为一个实施例中预设模型的示意图;
图7为一个实施例中采样得到的粒子示意图;
图8为一个实施例中计算运动状态信息的示意图;
图9为一个实施例中粒子发射插件提供的类关系图;
图10为一个实施例中在配置界面显示各个模块的示意图;
图11为一个实施例中粒子旋转效果图;
图12为一个实施例中模拟过程的调用流程图;
图13为一个实施例中物理特效渲染装置的结构框图;
图14为一个实施例中计算机设备的内部结构图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本 申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请提供的物理特效渲染方法,可以应用于如图1所示的应用环境中。其中,计算机设备102可以是终端或者服务器。终端包括但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,服务器可以是独立的服务器或者是多个服务器组成的服务器集群。计算机设备102安装有粒子发射插件,计算机设备可以获取由粒子发射插件发射的物理特效粒子在上一帧中的物理特效数据,进一步获取对场景管理类进行实例化得到的第一目标实例,其中场景管理类继承自粒子发射插件提供的目标基类,然后通过第一目标实例调用集成于粒子发射插件中的粒子模拟工具的场景管理接口,以在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据计算物理特效粒子在当前帧的运动状态信息,基于当前帧的运动状态信息更新上一帧中的物理特效数据,根据更新后的物理特效数据计算机设备102可以渲染得到当前帧中的物理特效,并且可以在计算机设备的界面上展示渲染得到的物理特效。
在一个实施例中,如图2所示,提供了一种物理特效渲染方法,以该方法应用于图1中的计算机设备为例进行说明,包括以下步骤:
步骤202,获取由粒子发射插件发射的物理特效粒子在上一帧中的物理特效数据。
其中,粒子发射插件指的是可以发射物理特效粒子的插件。粒子发射插件例如可以是游戏引擎Unreal Engine(UE)中的Niagara插件,该插件中同时集成了粒子模拟工具,可以对物理特效进行模拟。物理特效可以是物理过程表现到动画中形成的效果,例如可以是将生活中感觉到的风的吹动、树叶的摇摆、以及物体爆炸时所产生的碎片飞溅等等的物理过程表现到动画中。其中动画包括但不限于是游戏动画或者影视动画。采用物理特效可以带来更真实的游戏感受,使动画看起来更加真实更加震撼,实现身临其境的感觉。物理特效粒子指的是模拟物理特效中不可再继续分割的一小块物质,例如可以是雪粒子、沙粒子、石油粒子、水粒子等等,更广泛的如一小段头发、一小块布料,也统称为粒子。物理特效数据指的是在进行物理特效模拟的过程中产生的粒子的相关数据,物理特效数据至少包括物理特效粒子的属性信息、运动状态信息,其中物理特效粒子的属性信息可以包括物理特效粒子的质量、粒子编号、生命周期等基本信息,运动状态信息可以指的是物理特效粒子运动时的状态信息,比如,可以包括物理特效粒子的速度、形变梯度、塑形状态、位置信息等信息。
在一个实施例中,物理特效数据还包括物理特效粒子的受力数值,受力数值用于表征物理特效粒子的受力大小,其中表征物理特效粒子的受力可以指的是物理特效粒子所有可 能受到的作用力,比如,物理特效粒子受到其他物理特效粒子对它的作用力、摩擦力、重力等等。
具体地,计算机设备可以从为粒子发射插件分配的显存中读取粒子发射插件发射的物理特效粒子在上一帧中的物理特效数据。
可以理解的是,由粒子发射插件发射的物理特效粒子是有生命周期的,在不同的动画帧中,随着粒子生命周期的结束,粒子会消亡,因此计算机设备在获取物理特效数据时,获取是当前存活的粒子所对应的物理特效数据。
还可以理解的是,当上一帧为第一帧时,上一帧中的物理特效数据可以通过用户设定的数值初始化得到;而当上一帧为中间帧时,上一帧中的物理特效数据是通过对上上一帧中的物理特效数据进行更新得到。
步骤204,获取对场景管理类进行实例化得到的第一目标实例;场景管理类继承自粒子发射插件提供的目标基类。
其中,目标基类是粒子发射插件所提供的基类集合中,用于定义数据接口的基类,目标基类是一个抽象的数据接口类,该数据接口类中包括用于调用粒子模拟工具的抽象方法。目标基类可以作为父类派生出多个子类,各个子类在实现目标基类所定义的数据接口时,通过重写该数据接口中的抽象方法来调用粒子模拟工具的具体数据接口。场景管理类继承自目标基类,即场景管理类是目标基类派生出的子类,场景管理类通过实现目标基类所定义的数据接口,来对粒子模拟工具的场景管理接口进行调用。粒子模拟工具指的是可以实现粒子模拟的程序模块,粒子模拟工具可以在模拟的过程解算粒子的运动状态信息。第一目标实例为对场景管理类进行实例化得到的,可以实现场景管理类的方法对粒子模拟工具的场景管理接口进行调用。
在一个实施例中,粒子模拟工具例如可以是physion工具,Physion使用的算法是MPM(Material Point Method,物质点法),可以在统一的算法框架下进行多种不同物理材质的模拟,例如雪、烟、水、石油、肌肉、头发等。同时,Physion将MPM全部用CUDA(Compute Unified Device Architecture,统一计算设备架构)线实现,在GPU(graphics processing unit,图形处理器)上进行并行计算,极大地提升了解算效率。
具体地,计算机设备可以获取粒子发射插件中的第一目标实例,该第一目标实例是在物理特效的制作过程中对场景管理类进行实例化后生成的,通过将场景管理类实例化在粒子发射插件中,可以在粒子发射插件的运行流程中调用粒子模拟工具的场景管理接口,实现物理特效粒子的模拟解算。
在一个实施例中,第一目标实例通过以下步骤生成:首先从粒子发射插件提供的基类 集合中,确定用于调用粒子模拟工具提供的数据接口的基类,得到目标基类,接着创建继承自目标基类的场景管理类,最后对场景管理类进行实例化,得到第一目标实例。
步骤206,通过第一目标实例调用集成于粒子发射插件中的粒子模拟工具的场景管理接口,以在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据计算物理特效粒子在当前帧的运动状态信息。
其中,粒子模拟工具集成于粒子发射插件中指的是将对粒子模拟工具对应的底层库进行编译得到的dll(Dynamic Link Library,动态链接库)文件和lib(library,静态数据连接库)文件,以及所有头文件都集成到粒子发射插件中,从而可以在粒子发射插件中直接调用粒子模拟工具的功能。场景管理接口指的是粒子模拟工具的场景管理器所对应的数据接口,通过场景管理接口可以调用场景管理器。场景管理器用于在粒子模拟工具中对物理特效的场景进行管理,以实现对场景中物理特效粒子的模拟解算。
具体地,计算机设备在获取到第一目标实例后,可以通过第一目标实例调用集成于粒子发射插件中的粒子模拟工具的场景管理接口,以在粒子模拟工具的场景管理器中计算物理特效粒子在当前帧的运动状态信息,计算的过程中可以基于上一帧中的物理特效数据计算。
在一个实施例中,计算机设备在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据计算物理特效粒子在当前帧的运动状态信息具体可以采用物质点法(material point method,MPM)进行计算,其中,物质点法是一种将欧拉法和拉格朗日法结合起来的一种新的计算方法,既避免了欧拉法要求解对流项的难题,又解决了拉格朗日法在处理大变形时的网格畸变和负体积问题。在物质点法中,粒子作为模拟对象存在于一组背景网格(background grid)中,每一帧模拟开始时将粒子的当前运动状态信息映射到背景网格上,通过背景网格中的网格节点进行解算,解算完成后将所有信息传递回粒子,再更新粒子的当前运动状态信息。
在一个实施例中,计算机设备基于上一帧中的物理特效数据计算物理特效粒子在当前帧的运动状态信息时,可以将当前帧的计算分为多个时间步,第一个时间步中基于上一帧中的物理特效数据计算当前时间步中物理特效粒子的运动状态信息,此后的每一个时间步,基于上一个时间步中物理特效粒子的运动状态信息计算当前时间步中物理特效粒子的运动状态信息,直到最后一个时间步计算完成后,将最后一个时间步中物理特效粒子的运动状态信息作为物理特效粒子在当前帧的运动状态信息。其中,时间步指的是计算物理特效粒子在当前帧的运动状态信息时的最小时间单元,当前时间步的结束时间与上一个时间步的结束时间之间的时间差值即为当前时间步的步长,时间步的步长可以是根据需要预先进 行设置的。例如,上一帧和当前帧之间的时间间隔为t1,可以将t1等分为30个时间步,每个时间步的步长为t1/30。
步骤208,基于当前帧的运动状态信息更新上一帧中的物理特效数据,以渲染得到当前帧中的物理特效。
其中,上一帧中的物理特效数据中包括了上一帧中物理特效粒子的运动状态信息。当前帧中的物理特效指的是当前帧中的物理特效粒子模拟形成的物理特效。
具体地,计算机设备将当前帧中的运动状态信息替换上一帧中的物理特效数据中的运动状态信息,以更新上一帧中的物理特效数据,得到更新后的物理特效数据,基于更新后的物理特效数据可以渲染得到当前帧中的物理特效。计算机设备可以进一步在当前帧中展示渲染后的物理特效,完成对物理特效的模拟。
在一个实施例中,更新物理特效数据还包括更新物理特效数据中物理特效粒子的生命状态,注销死亡粒子,更新存活粒子的受力情况等等。
在一个实施例中,在渲染过程中,计算机设备可以对物理特效粒子用经过纹理映射的四边形sprite进行渲染,在一些低分辨率或者处理能力有限的场合粒子可能仅仅渲染成一个像素,在离线渲染中甚至渲染成一个圆球,从粒子圆球计算出的等值面可以得到非常好的液体表面。另外,也可以用三维网格渲染粒子。在具体应用中,当粒子发射插件为Niagara插件时,可以提供四种粒子渲染器,分别使用Sprite、Mesh、Ribbon、Light来渲染粒子。
上述物理特效渲染方法中,通过获取由粒子发射插件发射的物理特效粒子在上一帧中的物理特效数据,获取对场景管理类进行实例化得到的第一目标实例;场景管理类继承自粒子发射插件提供的目标基类,通过第一目标实例调用集成于粒子发射插件中的粒子模拟工具的场景管理接口,以在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据计算物理特效粒子在当前帧的运动状态信息,基于当前帧的运动状态信息更新上一帧中的物理特效数据,以渲染得到当前帧中的物理特效,由于将粒子模拟工具集成于粒子发射插件中,可以通过对场景管理类进行实例化得到的第一目标实例调用粒子模拟工具的场景管理接口,以在粒子模拟工具的场景管理器中计算得到运动状态信息,从而渲染得到物理特效,避免了从外部获取模拟结果,提高了物理特效渲染时的效率。
进一步,由于将粒子模拟工具集成到了粒子发射插件中,可以在动画帧中实时地进行粒子的物理仿真,并与场景中的物体进行交互,提高了物理特效模拟的准确性,使得渲染得到的物理特效更加准确逼真。
在一个实施例中,第一目标实例通过以下步骤生成:从粒子发射插件提供的基类集合中,确定用于调用粒子模拟工具提供的数据接口的基类,得到目标基类;创建继承自目标 基类的场景管理类,以对粒子模拟工具的场景管理接口进行调用;对场景管理类进行实例化,得到第一目标实例。
其中,基类集合中包括至少一个基类,基类指的是可以派生出子类的类。用于调用粒子模拟工具提供的数据接口的基类指的是,该基类可以作为父类派生出对粒子模拟工具提供的数据接口进行调用的子类。粒子模拟工具提供的数据接口被调用时,可以接入粒子模拟工具中的各项功能,粒子模拟工具可以提供多个数据接口,不同的数据接口被调用时接入粒子模拟工具中的不同的功能,例如,可以通过调用粒子模拟工具提供的场景管理接口,接入粒子模拟工具中的场景管理器。
在具体的一个实施例中,当粒子发射插件为Niagara插件,粒子模拟工具为Physion,目标基类例如可以是NiagaraDataInterface,该目标基类所包含的成员函数可以表1所示,目标基类中可以定义成员函数“IsPhysionDataInterface()”以实现对Physion相关接口的增加,PostInitProperties()用于对变量进行初始化,GetFunctions用于注册NiagaraDataInterface中的自定义函数,GetVMExternalFunctio用于返回已经注册的函数的代表,CanExecuteOnTarget用于设置粒子模拟在GPU上运行。
表1
Figure PCTCN2022118750-appb-000001
具体地,在动画的运行流程开始之前,计算机设备可以从粒子发射插件提供的基类集合中,确定用于调用粒子模拟工具提供的数据接口的基类,得到目标基类,进而创建继承自该目标基类的子类,在该子类中增加对粒子模拟工具的场景管理接口的调用以对目标基类中的抽象方法进行重写,得到场景管理类,最后将场景管理类实例化至粒子发射插件,在粒子发射插件中得到第一目标实例,从而在粒子发射插件进行物理特效渲染的过程中,可以获取该第一目标实例,来调用粒子模拟工具的场景管理接口,实现粒子的运动状态信息的解算。
上述实施例中,由于粒子发射插件提供了可以调用粒子模拟工具提供的数据接口的基类,通过该基类可以扩展得到场景管理类,进而将场景管理类实例化在粒子发射插件中,实现对场景管理器的调用,使得粒子模拟工具可以更好地集成在粒子发射插件中。
在一个实施例中,对场景管理类进行实例化,得到第一目标实例包括:创建场景管理类对应的对象,得到场景管理对象;将场景管理对象进行封装,得到第一目标对象;将第一目标对象配置为粒子发射插件的第一属性,得到第一目标实例。
其中,对象是由类抽象出来的,对象可以操作类的基本属性和方法解决相应的问题。封装是指隐藏对象的属性和实现细节,仅对外提供公共访问方式。通过封装可以将变化隔离、便于使用、提高重用性、提高安全性。封装的原则是将不需要对外提供的内容都隐藏起来、把属性都隐藏,提供公共方法对其访问。
具体地,计算机设备可以通过new操作符创建场景管理类对应的对象,得到场景管理对象,然后采用预设的封装方式将场景管理对象的代码进行封装,得到第一目标对象,最后将第一目标对象配置为粒子发射插件的第一属性,从而实现将场景管理类实例化在粒子发射插件中。在一个实施例中,预设的封装方式例如可以是将属性私有化,设置公有的get、set方法,设置无参有参函数,最后重写tostring方法。其中,new操作符是用来创建对象的运算符,其语法结构为:new constructor(),其中,constructor指的是待创建对象对应的类,例如,创建场景管理类对应的对象可以是new NiagaraDataInterfaceScenario()。
在一个实施例中,当粒子发射插件为Niagara插件时,Niagara插件包括系统(system)管理器和发射器(emitter)管理器,计算机设备可以将场景管理类配置为Niagara的系统(system)属性。
上述实施例中,由于对创建的场景管理对象进行了封装,并配置为粒子发射插件的属性,得到第一目标实例,通过配置界面可以对粒子模拟工具的场景管理功能进行调用来生成动画,提高了第一目标实例的安全性和可用性。
在一个实施例中,在将第一目标对象配置为粒子发射插件的第一属性,得到第一目标实例之后,方法还包括:通过粒子发射插件的配置界面,获取对第一属性的属性参数进行配置得到的第一属性值;将第一属性值作为第一目标实例对应的变量值;通过第一目标实例对应的变量值对场景管理接口所对应的场景管理器的参数进行配置,得到配置后的、用于在粒子模拟工具中进行场景管理的场景管理器。
其中,粒子发射插件的配置界面指的是粒子发射插件提供的可以对粒子发射插件各个属性的属性参数进行配置的界面,通过该界面可以对粒子模拟工具中被封装的各个功能进行调用。第一目标实例对应的变量值指的是第一目标实例中的成员变量的具体数值。第一属性的属性参数指的是与场景有关的参数值,例如可以是场景稳定性、帧率等等。
具体地,在通过粒子发射插件的配置界面对第一属性的属性参数进行配置时,计算机设备可以获取通过该配置界面配置得到的各个属性参数的属性值,通过第一属性值对第一 目标实例中对应的成员变量进行赋值,得到第一目标实例对应的变量值,将第一目标实例对应的变量值传入场景管理接口中,以对场景管理接口所对应的场景管理器进行配置,得到配置后的场景管理器,该场景管理器用于在粒子模拟工具中进行场景管理,包括结合配置的属性值在场景中进行物理特效数据计算,即基于上一帧中物理特效粒子的物理特效数据计算当前帧中的运动状态信息。
举例说明,如图3所示,为一个实施例中,粒子发射插件提供的对第一属性进行配置的配置界面。参考图3,第一属性是与场景管理器对应的,在粒子发射插件的配置界面可以配置第一属性的各种属参数,例如图3中的帧率、翻转率、稳定性等等。
上述实施例中,由于可以通过粒子发射插件的配置界面,获取对第一属性的属性参数进行配置得到的第一属性值,只需要在配置界面进行简单的配置操作,即可实现对场景管理接口所对应的场景管理器的参数进行配置,得到配置后的、用于在粒子模拟工具中进行场景管理的场景管理器,操作简单方便,由于不需要了解底层的配置流程,提高了配置效率。
在一个实施例中,基于当前帧的运动状态信息更新上一帧中的物理特效数据,以渲染得到当前帧中的物理特效包括:获取对几何体管理类进行实例化得到的第二目标实例;几何体管理类继承自粒子发射插件提供的目标基类;通过第二目标实例调用粒子模拟工具的几何体管理接口,以通过粒子模拟工具中的几何体管理器将当前帧的运动状态信息写入目标显存中,在目标显存中基于当前帧的运动状态信息更新上一帧中的物理特效数据,以渲染得到当前帧中的物理特效。
其中,几何体管理类是继承自目标基类的子类,几何体管理类通过实现目标基类定义的数据接口,对粒子模拟工具的几何体管理接口进行调用。几何体管理接口指的是粒子模拟工具的几何体管理器所提供的数据接口,通过几何体管理接口可以调用几何体管理器。几何体管理器用于在粒子模拟工具中对物理特效中物体的属性进行管理,包括物理属性以及组成物体的粒子的物理特效数据,物理属性比如物体的材料、密度、脆度等等。第二目标实例通过对几何体管理类进行实例化得到,那么可以通过第二目标实例实现几何体管理类的方法来调用几何体管理器的几何体管理接口。目标显存指的是为粒子发射插件的渲染数据分配的数据缓冲区域。
具体地,由于当前帧的运动状态信息是在粒子模拟工具中计算得到的,得到的运动状态信息存储在与目标显存不相同的数据缓冲区,而几何体管理器可以对粒子的物理特效数据进行管理,因此可以借助于几何体管理器将运动状态信息写入目标显存中,具体来说,当计算机设备在基于当前帧的运动状态信息更新上一帧中的物理特效数据,以渲染得到当 前帧中的物理特效时,可以获取对几何体管理类进行实例化得到的第二目标实例,通过第二目标实例调用粒子模拟工具的几何体管理接口,从而通过该几何体管理接口对应的几何体管理器将当前帧的运动状态信息写入目标显存中,目标显存中存储了上一帧中的物理特效数据,通过几何体管理器将当前帧的运动状态信息写入目标显存中后,可以对目标显存中上一帧对应的物理特效数据进行更新,得到更新后的物理特效数据,该更新后的物理特效数据可以用于渲染得到当前帧中的物理特效。
上述实施例中,通过调用通过第二目标实例调用粒子模拟工具的几何体管理接口,以通过粒子模拟工具中的几何体管理器将当前帧的运动状态信息写入目标显存中,可以快速地从粒子模拟工具中获得所要的渲染数据,提高渲染效率。
在一个实施例中,第二目标实例通过以下步骤生成:创建继承自目标基类的几何体管理类,以对粒子模拟工具的几何体管理接口进行调用;创建几何体管理类对应的对象,得到几何体管理对象;将几何体管理对象进行封装,得到第二目标对象;将第二目标对象配置为粒子发射插件的第二属性,得到第二目标实例。
具体地,在动画的运行流程开始之前,计算机设备可以从粒子发射插件提供的基类集合中,确定用于调用粒子模拟工具提供的数据接口的基类,得到目标基类,进而创建继承自该目标基类的子类,在该子类中增加对粒子模拟工具的几何体管理接口的调用以对目标基类中的抽象方法进行重写,得到几何体管理类,最后将几何体管理类实例化至粒子发射插件,在粒子发射插件中得到第二目标实例,从而在粒子发射插件进行物理特效渲染的过程中,可以获取该第二目标实例,来调用粒子模拟工具的几何体管理接口,实现对物理特效中物体的属性进行管理。
在实例化的过程中,计算机设备可以通过new操作符创建几何体管理类对应的对象,得到几何体管理对象,然后采用预设的封装方式将几何体管理对象的代码进行封装,得到第二目标对象,最后将第二目标对象配置为粒子发射插件的第二属性,从而实现将几何体管理类实例化在粒子发射插件中。
在一个实施例中,当粒子发射插件为Niagara插件时,Niagara插件包括系统(system)管理器和发射器(emitter)管理器,计算机设备可以将几何体管理类配置为Niagara的发射器(emitter)属性。
上述实施例中,由于粒子发射插件提供了可以调用粒子模拟工具提供的数据接口的基类,通过该基类可以扩展得到几何体管理类,进而将几何体管理类实例化在粒子发射插件中,实现对几何体管理器的调用,使得粒子模拟工具可以更好地集成在粒子发射插件中,并且由于对创建的几何体管理对象进行了封装,并配置为粒子发射插件的属性,得到第二 目标实例,从而美工可以直接通过配置界面对粒子模拟工具的几何体管理功能进行调用来制作动画而无需程序员的协助,提高了第二目标实例的安全性和可用性。
在一个实施例中,在将第二目标对象配置为粒子发射插件的第二属性,得到第二目标实例之后,方法还包括:通过粒子发射插件的配置界面,获取对第二属性的属性参数进行配置得到的第二属性值;将第二属性值作为第二目标实例对应的变量值;通过第二目标实例对应的变量值对几何体管理接口所对应的几何体管理器进行配置,得到配置后的、用于在粒子模拟工具中进行几何体管理的几何体管理器。
其中,粒子发射插件的配置界面指的是粒子发射插件提供的可以对粒子发射插件各个属性的属性参数进行配置的界面,通过该界面可以对粒子模拟工具的各个功能进行封装和调用。第二目标实例对应的变量值指的是第二目标实例中的成员变量的具体数值。第二属性的属性参数指的是物理特效中物体的属性有关的参数值,例如可以是物体的材质、密度等等。
具体地,通过粒子发射插件的配置界面对第二属性的属性参数进行配置时,计算机设备可以获取通过该配置界面配置得到的各个属性参数的属性值,通过第二属性值对第二目标实例中对应的成员变量进行赋值,得到第二目标实例对应的变量值,将第二目标实例对应的变量值传入几何体管理接口中,以对几何体管理接口所对应的几何体管理器进行配置,得到配置后的几何体管理器,该几何体管理器用于在粒子模拟工具中对物理特效中物体的属性进行管理。
举例说明,如图4所示,为一个实施例中粒子发射插件对第二属性进行配置的配置界面。参考图4,第二属性是与几何管理器对应的,在粒子发射插件的配置界面可以配置第二属性的各种属参数,例如图4中的密度、材质、材料模型、硬度等等。
上述实施例中,由于可以通过粒子发射插件的配置界面,获取对第二属性的属性参数进行配置得到的第二属性值,只需要在配置界面进行简单的配置操作,即可实现对几何体管理接口所对应的几何体管理器的参数进行配置,得到配置后的、用于在粒子模拟工具中进行几何体管理的几何体管理器,操作简单方便,由于不需要了解底层的配置流程,提高了配置效率。
在一个实施例中,上述方法还包括:获取对边界条件管理类进行实例化得到的第三目标实例;边界条件管理类继承自粒子发射插件提供的目标基类;通过第三目标实例调用粒子模拟工具的边界条件管理接口,以在粒子模拟工具的边界条件管理器中获得目标边界条件;在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据计算物理特效粒子在当前帧的运动状态信息包括:在粒子模拟工具的场景管理器中,基于上一帧中的物理特效 数据及目标边界条件计算物理特效粒子在当前帧的运动状态信息。
其中,边界条件管理类是继承自目标基类的子类,边界条件管理类通过实现目标基类所定义的数据接口,对粒子模拟工具的边界条件管理接口进行调用。边界条件管理接口指的是粒子模拟工具的边界条件管理器所提供的接口,通过边界条件管理接口可以调用边界条件管理器。边界条件管理器用于在粒子模拟工具中对场景中的边界条件进行管理。边界条件,即有符号的距离场(Signed Distance Fields,SDF),在粒子模拟工具中是参与模拟的、可以与粒子发生碰撞的物体。边界条件包括三种类型:地面、静态物体以及骨骼动画,其中,地面、静态物体为静态的,而骨骼动画为动态的,与粒子的不同在于,SDF的位置变化并不由动力学解算出来,而只是预先固定好(静态)或通过FBX模型驱动(动态)。目标边界条件指的是预先配置的边界条件参数对应的边界条件。第三目标实例通过对边界条件管理类进行实例化得到,那么可以通过第三目标实例实现边界条件管理类的方法来调用边界条件管理接口,从而实现对边界条件的管理。
具体地,在需要模拟碰撞效果的物理特效中,可以预先配置目标边界条件对应的参数,从而在动画运行过程中计算机设备可以获取对边界条件管理类进行实例化得到的第三目标实例,通过第三目标实例调用粒子模拟工具的边界条件管理接口,以在边界条件管理器中根据目标边界条件对应的参数获得目标边界条件。由于获得了目标边界条件,那么在计算物理特效粒子在当前帧的运动状态信息时,可以将目标边界条件注册到场景管理器中,在场景管理器中,基于上一帧中的物理特效数据及目标边界条件计算物理特效粒子在当前帧的运动状态信息。举个例子,假设目标边界条件为地面,则可以在配置的时候指定该边界条件的来源参数为“plane actor(平面物体)”,则边界条件管理器中可以将场景中的“plane actor(平面物体)作为地面。
上述实施例中,通过第三目标实例调用粒子模拟工具的边界条件管理接口,以在边界条件管理器中获得目标边界条件,从而可以在场景管理器中模拟碰撞过程的解算,使得模拟得到的物理特效可以多样化。
在一个实施例中,第三目标实例通过以下步骤生成:创建继承自目标基类的边界条件管理类,以对粒子模拟工具的边界条件管理接口进行调用;创建继承自边界条件管理类的、与类型配置参数相应的目标派生类,对目标派生类进行实例化,得到第三目标实例;其中,类型配置参数是通过粒子发射插件的配置界面获取的对边界条件管理器的类型进行配置得到的参数。
本申请实施例中,粒子模拟工具提供的数据接口被调用时,可以接入粒子模拟工具中的各项功能,粒子模拟工具可以提供多个数据接口,不同的数据接口被调用时接入粒子模 拟工具中的不同的功能,例如,当需要接入粒子模拟工具中的边界条件管理器时,可以通过调用粒子模拟工具提供的边界条件管理接口实现。边界条件管理器用于管理边界条件,包括生成与配置参数对应的边界条件。
类型配置数据为用于表征边界条件管理器的类型的数据。不同的边界条件对应不同的边界条件管理器,例如,地面边界条件通过地面边界条件管理器进行管理。当需要多个不同类型的边界条件管理器时,可以配置得到多个类型配置参数,从而针对不同的类型配置参数得到不同的目标派生类。以粒子发射插件为Niagara为例,在Niagara System中,Sdf只能作为外部输入,因此用户如果想要增加Sdf作为碰撞体,需要在User Exposed中添加对应类型的NiagaraDataInterfaceSdf,例如可以配置得到三种不同类型的类型配置参数分别为地面边界条件(GroudSdf),骨骼动画边界条件(SkeletalMeshSdf)以及静态物体边界条件(StaticMeshSdf)。
具体地,在动画的运行流程开始之前,计算机设备可以从粒子发射插件提供的基类集合中,确定用于调用粒子模拟工具提供的数据接口的基类,得到目标基类,进而创建继承自目标基类的子类,在该子类中增加对粒子模拟工具的边界条件管理接口的调用以对目标基类中的抽象方法进行重写,得到边界条件管理类,由于边界条件管理器有不同的类型,因此需要基于边界条件管理类创建与类型配置参数相应的目标派生类,最后将目标派生类实例化至粒子发射插件,在粒子发射插件中得到第三目标实例,从而在粒子发射插件进行物理特效渲染的过程中,可以获取该第三目标实例来调用粒子模拟工具中对该第三目标实例类型对应的边界条件管理接口,实现粒子的碰撞过程中的运动状态信息的解算。
上述实施例中,由于粒子发射插件提供了可以调用粒子模拟工具提供的数据接口的基类,通过该基类可以扩展得到边界条件管理类,进而基于边界条件管理类可以派生出不同的派生类并实例化在粒子发射插件中,实现对不同类型的边界条件管理器的调用,使得粒子模拟工具可以更好地集成在粒子发射插件中。
在一个实施例中,对目标派生类进行实例化,得到第三目标实例包括:创建目标派生类对应的对象,得到目标边界条件管理对象;将目标边界条件管理对象进行封装,得到第三目标对象;将第三目标对象配置为粒子发射插件的第三属性,得到第三目标实例。
具体地,在实例化的过程中,计算机设备可以通过new操作符创建目标派生类对应的对象,得到目标边界条件管理对象,然后采用预设的封装方式将目标边界条件管理对象的代码进行封装,得到第三目标对象,最后将第三目标对象配置为粒子发射插件的第三属性,从而实现将目标派生类实例化在粒子发射插件中。
在一个实施例中,当粒子发射插件为Niagara插件时,Niagara插件包括系统(system) 管理器和发射器(emitter)管理器,计算机设备可以将目标派生类配置为Niagara的系统(system)属性。
上述实施例中,由于对创建的目标边界条件管理对象进行了封装,并配置为粒子发射插件的属性,得到第三目标实例,从而美工可以通过配置界面直接对粒子模拟工具的边界条件管理功能进行调用而无需程序员的协助,提高第三目标实例的安全性和可用性。
在一个实施例中,在将第三目标对象配置为粒子发射插件的第三属性,得到第三目标实例之后,方法还包括:通过粒子发射插件的配置界面,获取对第三属性的属性参数进行配置得到的第三属性值;将第三属性值作为第三目标实例对应的变量值;通过第三目标实例对应的变量值对边界条件管理接口所对应的边界条件管理器的参数进行配置,得到配置后的、用于在粒子模拟工具中进行边界条件管理的边界条件管理器。
其中,第三属性的属性参数指的是物理特效中与边界条件有关的参数,用于指定边界条件对应的物体。
具体地,通过粒子发射插件的配置界面对第三属性的属性参数进行配置时,计算机设备可以获取通过该配置界面配置得到的各个属性参数的属性值,通过第三属性值对第三目标实例中对应的成员变量进行赋值,得到第三目标实例对应的变量值,将第三目标实例对应的变量值传入与该第三目标实例对应的边界条件管理接口中,以对该边界条件管理接口所对应的边界条件管理器进行配置,得到配置后的边界条件管理器,该边界条件管理器用于在粒子模拟工具中对对应类型的边界条件进行管理。
需要说明的是,当预先配置了多种类型的场景管理器时,对于每一个场景管理器,创建继承自边界条件管理类的目标派生类,从而得到多个目标派生类,
对于每一个目标派生类,创建对应的对象,得到对应的目标边界条件管理对象,将每一个目标边界条件管理对象都进行封装,得到多个第三目标对象,分别将每一个第三目标对象配置为粒子发射插件的第三属性,从而得到多个第三目标实例,为了方便配置,提高配置效率,在通过粒子发射插件的配置界面,获取对各个第三属性的属性参数进行配置得到的第三属性值时,可以通过同一个配置界面进行获取。举例说明,如图5所示,为一个实施例中粒子发射插件对第三属性进行配置的配置界面。参考图5,在同一个界面中包括地面、骨骼动画及静态物体的参数配置项,可通过该界面同时获取地面、骨骼动画及静态物体这三种不同类型的边界条件下的属性值。
上述实施例中,由于可以通过粒子发射插件的配置界面,获取对第三属性的属性参数进行配置得到的第三属性值,只需要在配置界面进行简单的配置操作,即可实现对几何体管理接口所对应的几何体管理器的参数进行配置,操作简单方便,由于不需要了解底层的 配置流程,提高了配置效率。
在一个实施例中,在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据计算物理特效粒子在当前帧的运动状态信息包括:在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据计算物理特效粒子在当前帧的运动状态信息,将运动状态信息写入第一显存中;基于当前帧的运动状态信息更新上一帧中的物理特效数据,以渲染得到当前帧中的物理特效包括:从第一显存中读取当前帧的运动状态信息,将当前帧的运动状态信息进行拷贝;将拷贝得到的运动状态信息写入第二显存中,并在第二显存中基于当前帧的运动状态信息更新上一帧中的物理特效数据;其中,第一显存为粒子发射插件的目标显存中为粒子模拟工具分配的数据缓冲区域;第二显存为目标显存中异于第一显存的数据缓冲区域,用于存储粒子发射数据和粒子渲染数据。
本实施例中,粒子发射插件为Niagara插件,该插件中集成的粒子模拟工具为physion,在Niagara的GPU Sim模式下,Niagara使用高阶着色器语言(High Level Shader Language,简称HLSL)进行GPU Buffer(GPU对应的数据缓冲区)的操作,同时Physion使用Cuda(Compute Unified Device Architecture,统一计算设备架构)进行GPU Buffer的操作,但是HLSL与CUDA之间无法相互调用,因此本申请实施例中采用CUDA与Compute Shader互操作的方式,实现间接的交互。
具体来说,可以为physion分配第一显存,该第一显存采用CUDA进行操作,为Niagara分配第二显存,该第二显存采用Compute Shader进行操作,第一显存和第二显存中的数据可以采用拷贝的方式实现GPU to GPU的数据传递。其中,第一显存主要用于存储粒子发射数据和粒子渲染数据,其中粒子发射数据指的是Niagara的粒子发射器(emitter)所在发射粒子时存储的粒子属性数据,粒子渲染数据指的是Niagara在进行渲染步骤时存储的粒子的物理特效数据。
由于当前帧中的运动状态信息是由粒子模拟工具的场景管理器解算出来的,解算出的运动状态信息会写入为Physion分配的第一显存中,而物理特效的渲染是在Niagara中进行的,因此计算机设备可以从第一显存中读取当前帧的运动状态信息,将当前帧的运动状态信息进行拷贝,将拷贝得到的运动状态信息写入第二显存中,并在第二显存中基于当前帧的运动状态信息更新上一帧中的物理特效数据。
上述实施例中,通过分配不同的显存,采用数据拷贝的方式实现不同编程语言之间的互操作,使得Physion可以方便、快捷地集成于Niagara中而不需要进行大量的代码修改,提高了开发效率。
在一个实施例中,上述方法还包括:在预设模型所在位置处发射预设数量的初始粒子, 并将初始粒子的属性信息写入第二显存中;从第二显存中读取初始粒子的属性信息,对初始粒子的属性信息进行拷贝;将拷贝得到的初始粒子的属性信息写入第一显存中,通过粒子模拟工具基于第一显存中初始粒子的属性信息在预设模型的表面及内部进行采样,得到用于物理特效模拟的物理特效粒子。
其中,预设模型用于控制粒子的生成位置,预设模型可以是规则或不规则形状的几何体,例如圆环、球体、圆锥体等形状的模型。预设模型也可以是网格资产(mesh),例如Static Mesh(静态网格资产)或者Skeletal Mesh(骨骼类网格资产),如图6所示,为一个实施例中预设模型的示意图,图6中的602为预设模型。
需要说明的是,传统技术中,Niagara对于在网格资产处生成粒子时,往往只能在网格资产的表面进行采样,例如,基于图6中602所示的static mesh的表面进行采样得到的粒子如图7中的(a)图所示,可以看到,采样的粒子只在了人头的表面,而内部是没有采样粒子的,这样的生成方式不一定满足使用需求,在实际使用时,很可能会需要让粒子生成在Mesh内部,例如,当需要模拟一个雪球破碎的效果,并且要求雪球的不同部分物理参数不同,就需要将一个球体进行分割,分割成多个mesh,然后每一个mesh作为一个采样体进行采样,将一个球分为多个Emitter,然后每个Emitter设置不同的物理参数。基于此,本申请实施例中将Physion中的粒子采样功能进行了接入,可以对Mesh的表面及内部均进行粒子采样,例如,基于图6中602所示的static mesh的表面及内部进行采样得到的粒子如图7中的(b)图所示。
本实施例中,由Niagara插件在预设模型所在位置处发射预设数量的初始粒子,将初始粒子的属性信息写入第二显存中写入为Niagara分配的第二显存中,由于粒子要在Physion中进行采样,因此,需要从第二显存中读取初始粒子的属性信息,对初始粒子的属性信息进行拷贝,将拷贝得到的初始粒子的属性信息写入为Physion分配的第一显存中,从而通过Physion在预设模型的表面及内部进行采样,得到用于物理特效模拟的物理特效粒子。
上述实施例中,通过从第二显存中读取初始粒子的属性信息,对初始粒子的属性信息进行拷贝,将拷贝得到的初始粒子的属性信息写入第一显存中通过粒子模拟工具基于第一显存中初始粒子的属性信息在预设模型的表面及内部进行采样,使得采样得到的物理特效粒子更好地满足特效模拟需求。
在一个实施例中,在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据计算物理特效粒子在当前帧的运动状态信息包括:在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据映射至预设的背景网格中;背景网格中包括多个网格节点;在背景 网格中,基于物理特效数据计算与当前帧中各个物理特效粒子对应的网格节点的运动状态信息;将各个网格节点的运动状态信息映射至对应的物理特效粒子,得到当前帧中各个物理特效粒子的运动状态信息。
其中,背景网格(background grid)指的是在计算的过程中用于放置物理特效粒子的模拟空间,背景网格中包括至少多个格子节点,多个指至少两个。在一个实施例中,可以将背景网格划分为至少一个格子块,每个格子块包括至少一个用于放置物理特效粒子的格子,每个格子对应至少一个格子节点。为了减少内存的使用,可以用一个数据结构来稀疏地存储格子块,即只有物理特效粒子会落在的格子块,才会被分配相应的内存。
具体地,计算机设备可以通过形函数将物理特效粒子在上一帧中的物理特效数据插值到预设的背景网格中,对于某个物理特效粒子,该物理特效粒子的物理特效数据所插值的网格节点即为该物理特效粒子在背景网格中对应的网格节点,计算机设备进一步在背景网格中基于这些插值信息计算网格节点的运动状态信息,将计算得到的运动状态信息再次通过形函数映射回与网格节点对应的物理特效粒子,得到当前帧中各个物理特效粒子的运动状态信息。其中,插值可以指的是在离散数据的基础上补插连续函数,使得这条连续曲线通过全部给定的离散数据点。插值是离散函数逼近的重要方法,利用它可通过函数在有限个点处的取值状况,估算出函数在其他点处的近似值。
如图8所示,为一个具体的实施例中,通过背景网格计算运动状态信息的流程示意图。参考图8,具体包括以下步骤:
1、将物理特效粒子的质量和速度插值到背景网格中。
2、计算物理特效粒子的体积。
3、根据计算得到的体积计算网格节点受力数值。
4、根据计算得到的受力数值计算网格节点的速度、位移等信息。
5、对网格节点进行与边界条件的碰撞检测。
6、碰撞检测后,对网格节点的速度、位移等信息进行隐式解算。
7、将解算得到的信息映射至对应的物理特效粒子更新物理特效粒子的形变梯度。
8、根据形变梯度更新物理特效粒子的速度。
9、对粒子进行与边界条件的碰撞检测。
10、根据新的粒子速度更新物理特效粒子的速度、位置等运动状态信息。
由图8的流程可以看出,在进行模拟时,每个物理特效粒子保存自身的质量、位置、速度、变形梯度、弹性塑性物理参数等自身属性值,而格子节点需要计算受力情况、加速度情况、速度增量,以及对边界条件(即碰撞体)的处理等。
在具体实施时,为保证计算准确性,可以将当前帧分为多个时间步,每一个时间步计算一次运动状态信息,当多个时间步的累计时长达到当前帧的时长后,将物理特效粒子的新的各个属性值作为当前帧的结果输出。
上述实施例中,通过将物理特效数据映射至背景网格中来计算粒子的运动状态信息,由于背景网格相对于粒子数量大大减少,因此节省了计算过程中的开销。
本申请还提供一种应用场景,该应用场景应用上述的物理特效渲染方法,通过上述的物理特效渲染方法实现游戏中物理特效的渲染。具体地,在该应用场景中,粒子发射插件为Niagara,该粒子发射插件中集成了粒子模拟工具Physion,其中Niagara是UE主打的次世代粒子系统,利用Niagara,TA(Technical Artist,技术美术家)可以自行创建额外的功能,而无需程序员的协助,Niagara具有易用、易理解的特点,通过Niagara,艺术家可全权掌控效果、可编程、可自定义、提供更好的调试、显示和性能工具、支持UE其他部分或外部源的数据、不妨碍用户操作。
本申请实施例提供的粒子发射插件提供了多种继承自数据接口类(NiagaraDataInterface)的类,在Niagara中可以访问这些类,并将其实例化在Niagara System、Niagara Emitter中,以此实现在Niagara的运行流程中调用Physion,进而实现对粒子的动力学解算功能。如图9所示,为该粒子发射插件的类关系图,该类关系图中包括了主要的类,其中,数据接口类(NiagaraDataInterface)为目标基类,由该目标基类派生出了场景管理类(NiagaraDataInterfaceScenario)、几何体管理类(NiagaraDataInterfaceGeometry)以及边界条件管理类(NiagaraDataInterfaceSdf)三个子类,由边界条件管理类(NiagaraDataInterfaceSdf)又派生出与静态物体对应的第一派生类(NiagaraDataInterfaceStaticMeshSdf)、与骨骼动画对应的第二派生类(NiagaraDataInterfaceSkeletalMeshSdf)以及与地面对应的第三派生类(NiagaraDataInterfaceGroundSdf)三个子类,以下分别进行解释:
1、NiagaraDataInterfaceScenario
在本申请实施例提供的粒子发射插件中,类NiagaraDataInterfaceScenario对应于Physion中的Scenario,即当前模拟的场景管理器。在Niagara中,一个Niagara System对应于一个NiagaraDataInterfaceScenario,即将NiagaraDataInterfaceScenario作为一个Niagara System的唯一属性,一个Niagara System中的所有粒子(即使属于不同的Emitter)可以相互碰撞交互,而不同Niagara System的粒子是相互隔离的,无法相互影响。
2、NiagaraDataInterfaceGeometry
在本申请实施例提供的粒子发射插件中,类NiagaraDataInterfaceGeometry对应于 Physion中的几何体管理器Geometry,在Niagara中,一个Niagara Emitter对应于一个NiagaraDataInterfaceGeometry,即将NiagaraDataInterfaceGeometry作为一个Niagara Emitter的唯一属性,同一个Emitter的粒子使用同一套参数进行初始化,一个System中可以包括多个Emitter,即多个Geometry,模拟开始时,在Scenario的初始化阶段,会获得每一个Emitter的数据,并完成对System的Scenario的初始化。
3、NiagaraDataInterfaceSdf
在本申请实施例提供的粒子发射插件中,NiagaraDataInterfaceSdf作为边界条件的基类,派生出多个不同用途的子类,包括:
1)NiagaraDataInterfaceStaticMeshSdf
该子类可以实现将场景中的包含Static Mesh Component的Actor作为输入,Physion对其Static Mesh进行采样,得到可以参与到碰撞计算中的SDF格式数据,并输入到Scenario中,在模拟时作为静态的边界条件。
2)NiagaraDataInterfaceSkeletalMeshSdf
该子类可以将场景中包含Skeletal Mesh Component的Actor作为输入,Physion在每一帧对当前帧状态下的Skeletal Mesh进行采样,得到可以参与到碰撞计算中的SDF格式数据,并输入到Scenario中,与Static Mesh Sdf相比,Skeletal Mesh Sdf每一帧都需要进行更新,在模拟时作为运动状态下的边界条件。
3)NiagaraDataInterfaceGroundSdf
该子类所获得的边界条件在场景中一般指定为Plane Actor,作为一个无限延展的平面,粒子无法穿过这一平面,一般可以作为地面使用。
另外,Sdf在模拟时只能作为外部输入,将场景中的Actor挂载到场景中的Niagara Component中,在Niagara System中只能对粒子进行编译,无法导入Sdf与粒子发生碰撞。
进一步,在该应用场景中,对Physion中的各个功能进行了封装,在Niagara的配置界面中增加了对应的可以添加的属性,并通过将已经编写好的模块脚本在对应的Niagara中进行调用的方式,来实现Niagara对Physion的集成。如图10所示,为Niagara在配置界面显示各个模块的示意图,该配置界面中图中主要包括了NiagaraSystem(系统)和NiagaraEmitter(发射器)两个模块,NiagaraSystem作为当前系统的管理器,而NiagaraEmitter作为当前System中的一个发射器,其中,NiagaraSystem模块主要包括系统生产(system spawn)及系统更新(system update)两个模块,NiagaraEmitter模块主要包括发射器生产、发射器更新、粒子生产及粒子更新模块四个模块,不同的模块用于执行不同阶段的步骤,以下分别对这些模块进行介绍。
1、系统生产(system spawn),该模块包括以下几个模块:
1)设置场景管理器(Set PhysionScenario)。在该模块中,可以设置系统的属性PhysionScenario,即NiagaraDataInterfaceScenario的作为System属性的实例,可以在这一模块中设置PhysionScenario的属性参数,具体可以参考图3。
2)重置场景管理器(NM Reset Scenario)。该模块的作用为,在每一次Niagara的循环开始时,清除上一次模拟的数据,将Physion重置为初始状态,为下一次模拟做准备。
3)初始化地面(NM Init Ground Sdf)、初始化骨骼动画(NM Init Skeletal Mesh Sdf)以及初始化静态物体(NM Init Static Mesh Sdf),这三个模块分别用于初始化不同类型的边界条件。具体参考上文实施例中的描述。
需要说明的是,在Niagara System中,Sdf只能作为外部输入,因此用户如果想要增加Sdf作为碰撞体,需要在User Exposed中添加对应类型的NiagaraDataInterfaceSdf,在User Exposed中添加了NiagaraDataInterfaceSdf后,在场景中就可以指定属性中的对应参数,例如引用场景中的Static Mesh,作为与粒子发生碰撞交互的物体,参考图5,图5中的PhysionGroundSdf指定了场景中的平面作为地面,而PhysionSkeletalMeshSdf指定了场景中的爬行动物作为指定了骨骼动画的物体。
总之,在System Spawn阶段,主要作用就是重置Scenario中的各个参数,然后初始化Sdf,但是其他的内容并没有在System Spawn阶段初始化,原因在于,其他部分的初始化需要对粒子信息产生依赖,而在System Spawn阶段,粒子还没有生成,粒子是在Particle Spawn阶段生成的,因此在System Spawn阶段,只能把对粒子没有依赖的Sdf完成初始化,而其他部分需要后续完成。
2、系统更新(System Update),该模块主要包括以下几个模块:
1)初始化场景管理器(NM Init Scenario),包括调用场景管理器的初始化函数,利用几何体管理器和边界条件管理器初始化的数据,将全部数据传输到GPU端,并完成另外的更底层的数据准备工作。
2)更新骨骼动画(NM Update Skeletal Mesh Sdf),由于Skeletal Mesh在动画播放的过程中会不断运动,每一帧需要更新Skeletal Mesh的Sdf信息,因此需要在System Update阶段调用这一模块,更新场景中的Skeletal Mesh Sdf,场景中有几个Skeletal Mesh Sdf参与计算,就需要添加几个NM Update Skeletal Mesh Sdf,并且分别指定为对应的Skeletal Mesh。
3)更新Physion(NM Update Physion)。该模块是用于驱动Scenario解算当前帧的粒子物理状态,更新所有粒子的位置等信息,需要每一帧进行调用,包括更新physion的数据缓冲区中的每个物理特效粒子的受力数值、生命周期等等,并驱动粒子模拟下一帧的运 动状态。
3、发射器生产(Emitter Spawn),该模块包括以下几个模块:
1)设置几何体管理器(Set PhysionGeometry)。在该模块中,可以设置发射器的属性PhysionGeometry,即NiagaraDataInterfaceGeometry的作为Emitter属性的实例,可以在这一模块中设置PhysionGeometry的属性参数,具体可以参考图4。
2)重置几何体管理器(NM Reset Geometry)。该模块的作用为,在每一次Niagara的循环开始时,清除之前模拟时Geometry中的数据,将Geometry重置为初始状态,为下一次模拟做准备。
4、发射器更新(Emitter Update),该模块主要包括以下几个部分:
1)发射器状态(Emitter State)及生产粒子数量设定(Spawn Burst Instantaneous),这两个模块为Niagara原生的模块,其中Emitter State可以指定一些Emitter的属性参数,而Spawn Burst Instantaneous是指定在某一时刻生成的粒子数。
2)初始化几何体管理器(NM Init Geometry),该模块用于初始化Geometry,主要流程为,通过Niagara的存储粒子数据的数据缓冲区中,然后根据粒子属性的排布情况,获得粒子的位置、质量、编号、生命周期等属性,将这些属性进行拷贝,进行GPU to GPU的数据传递,传递到场景管理器中,为Scenario的后续初始化工作准备数据。
3)更新几何体管理器(NM Update Geometry),该模块主要用于在每一帧更新当前几何体管理器中对应的物理特效粒子的相关信息,包括:1)、读取Niagara的数据缓冲区中的物理特效粒子的受力数值;2)、将Physion中解算完成的当前帧的粒子位置、速度等信息写入到Niagara的数据缓冲区中,为渲染准备数据;3)、更新每个粒子的生命状态,实时统计已死亡粒子。
5、粒子生产(Particle Spawn),该模块主要包括以下几个部分:
1)粒子初始化(Initialize Particle),该模块是Niagara的原生模块,其作用为可以设置每个粒子的一些属性值,例如生命周期、颜色、质量、渲染半径等。
虽然这一模块为Niagara原生模块,但是同样可以间接达到控制Physion模拟的作用。以质量为例,当粒子按照Niagara的质量设置后,在Physion初始化时会去将Niagara的数据缓冲区中储存每个粒子质量的数据进行拷贝,使用GPU to GPU的操作用于初始化Physion中每一个粒子的质量,以此达到设置Physion中粒子质量的目的。
2)发射位置控制模块,其作用为控制粒子生成在预设模型内。预设模型可以是规则或不规则形状的几何体,例如圆环、球体、圆锥体等形状的模型。预设模型也可以是网格资产(mesh),例如Static Mesh(静态网格资产)或者Skeletal Mesh(骨骼类网格资产)
6、粒子更新(Particle update),该模块主要包括以下几个部分:
1)粒子状态设置(Particle State),该模块为Niagara原生模块,主要用于对粒子的状态进行设置,例如设置粒子的生命周期、设置粒子在生命周期结束时消亡等等。
2)重力模块(Gravity Force),该模块为Niagara原生模块,为每个粒子添加重力效果,类似的还有其他控制力模块,可以通过添加多个不同的控制力,来实现多种多样的粒子运动效果。如图11所示,可以通过添加重力、线条吸引力、卷曲噪声、涡流力,实现粒子旋转效果。
在本申请实施例提供的粒子发射插件中,通过复用Niagara原生的控制力模块的模块脚本,来为粒子增加外力控制粒子运动,更好地和Niagara进行融合,同时符合美工的使用习惯,便于一些效果的复用。
3)受力解算模块(NM Physion Solve Forces and Velocity)。由于在运行时只能从保存了粒子属性值的Buffer中获取Niagara的GPU Buffer内容,因此在NM Physion Solve Forces and Velocity这一模块中,我们将解算得到的合力数值保存在了粒子属性中,以便于在Physion模拟时可以进行读取。
4)粒子注销模块(NM Set Deleted Particle Index),其作用为在运行时实时获取当前Emitter中每个粒子的存活状态,在每一帧获得每个粒子的存活信息,并将信息写入到几何体管理器对应的一个数据缓冲区中,因此Physion侧可以在每一帧获得真实的粒子存活状态,对已经死亡的粒子信息进行同步。
如图12所示,为一个实施例中粒子发射插件在运动过程中的调用流程图,参考图12,由于集成了Physion的粒子发射插件,Niagara在各个阶段除了需要执行原生脚本(即Niagara中原有的脚本),还多了一些额外的步骤,以下结合图对运行过程中执行的额外步骤以及原生脚本中的重要步骤进行说明:
一、第1帧
1、执行系统和所有发射器的生产阶段逻辑:
1.1、系统生产阶段
1)、初始化每个发射器,并进行显存分配,同时设置场景管理器,即设置Scenario的所有的输入参数。
2)、重置场景管理器:重置场景管理器中的所有内容,删除之前模拟的结果,为一次新的模拟做准备。
3)、初始化边界条件:初始化当前系统中所有的边界条件。
1.2、发射器生产阶段
1)、设置几何体管理器:设置几何体管理器的所有的输入参数。
2)、重置几何体管理器:重置几何体管理器中的所有内容,删除之前的结果,为一次新的模拟做准备。
2、生成粒子:
2.1、发射器更新:执行原生脚本,即根据Niagara的原生模块Spawn Burst Instantaneous决定生成的粒子数。
2.2、粒子生产:执行原生脚本,即根据发射器更新阶段指定的生成的粒子数,生成粒子,指定新生粒子的各个属性值,包括位置、速度等,将粒子的属性数据写入分配的显存。
二、第2帧:
发射器更新:由于第1帧已经生成了粒子,因此在本阶段,几何体管理器读取发射器对应的显存中的属性数据,将保存了每个粒子的相关属性的数据进行一次GPU to GPU的拷贝,拷贝到几何体管理器对应的显存中,对几何体管理器进行初始化。
三、第3帧:
1、系统更新:由于几何体管理器中的显存已经在第2帧进行了初始化,因此在第三帧中场景管理器读取所有几何体管理器中的数据,对场景管理器进行初始化,并开始模拟,解算粒子的新的位置、速度等数据。
2、发射器更新:几何体管理器读取保存在场景管理器对应显存中的解算得到的数据,获取粒子的位置、速度等数据,并进行一次GPU to GPU的拷贝,将新的位置、速度等数据拷贝到Niagara对应的显存中,完成粒子的更新。
3、发射器更新:几何体管理器还可以读取Niagara对应的显存中粒子的受力数值,并进行一次GPU to GPU的拷贝,写入几何体管理器对应的显存中。
4、系统更新:场景管理器读取受力数值,更新Physion。
四、第4帧:
系统更新:模拟下一帧,解算粒子的新的位置、速度等。
发射器更新:重复第3帧操作,进行一次GPU to GPU的拷贝,将新的位置、速度等数据拷贝到Niagara对应的显存中,完成粒子的更新。
五、重复第4帧的步骤直至物理特效的最后一帧。
应该理解的是,虽然上文的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,这些流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执 行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,如图13所示,提供了一种物理特效渲染装置1300,该装置可以采用软件模块或硬件模块,或者是二者的结合成为计算机设备的一部分,该装置具体包括:
数据获取模块1302,获取由粒子发射插件发射的物理特效粒子在上一帧中的物理特效数据;
实例获取模块1304,用于获取对场景管理类进行实例化得到的第一目标实例;场景管理类继承自粒子发射插件提供的目标基类;
数据计算模块1306,用于通过第一目标实例调用集成于粒子发射插件中的粒子模拟工具的场景管理接口,以在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据计算物理特效粒子在当前帧的运动状态信息;
数据更新模块1308,用于基于当前帧的运动状态信息更新上一帧中的物理特效数据,以渲染得到当前帧中的物理特效。
上述物理特效渲染装置中,通过获取由粒子发射插件发射的物理特效粒子在上一帧中的物理特效数据,获取对场景管理类进行实例化得到的第一目标实例;场景管理类继承自粒子发射插件提供的目标基类,通过第一目标实例调用集成于粒子发射插件中的粒子模拟工具的场景管理接口,以在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据计算物理特效粒子在当前帧的运动状态信息,基于当前帧的运动状态信息更新上一帧中的物理特效数据,以渲染得到当前帧中的物理特效,由于将粒子模拟工具集成于粒子发射插件中,可以通过对场景管理类进行实例化得到的第一目标实例调用粒子模拟工具的场景管理接口,以在粒子模拟工具的场景管理器中计算得到运动状态信息,从而渲染得到物理特效,避免了从外部获取模拟结果,提高了物理特效渲染时的效率。
在一个实施例中,上述装置还包括:第一目标实例生成模块,用于从粒子发射插件提供的基类集合中,确定用于调用粒子模拟工具提供的数据接口的基类,得到目标基类;创建继承自目标基类的场景管理类,以对粒子模拟工具的场景管理接口进行调用;对场景管理类进行实例化,得到第一目标实例。
在一个实施例中,第一目标实例生成模块,还用于创建场景管理类对应的对象,得到场景管理对象;将场景管理对象进行封装,得到第一目标对象;将第一目标对象配置为粒子发射插件的第一属性,得到第一目标实例。
在一个实施例中,上述装置还包括,场景管理器配置模块,用于通过粒子发射插件的配置界面,获取对第一属性的属性参数进行配置得到的第一属性值;将第一属性值作为第 一目标实例对应的变量值;通过第一目标实例对应的变量值对场景管理接口所对应的场景管理器的参数进行配置,得到配置后的、用于在粒子模拟工具中进行场景管理的场景管理器。
在一个实施例中,数据更新模块,还用于获取对几何体管理类进行实例化得到的第二目标实例;几何体管理类继承自粒子发射插件提供的目标基类;通过第二目标实例调用粒子模拟工具的几何体管理接口,以通过粒子模拟工具中的几何体管理器将当前帧的运动状态信息写入目标显存中,在目标显存中基于当前帧的运动状态信息更新上一帧中的物理特效数据,以渲染得到当前帧中的物理特效。
在一个实施例中,上述装置还包括:第二目标实例生成模块,用于创建继承自目标基类的几何体管理类,以对粒子模拟工具的几何体管理接口进行调用;创建几何体管理类对应的对象,得到几何体管理对象将几何体管理对象进行封装,得到第二目标对象;将第二目标对象配置为粒子发射插件的第二属性,得到第二目标实例。
在一个实施例中,上述装置还包括:几何体管理器配置模块,用于通过粒子发射插件的配置界面,获取对第二属性的属性参数进行配置得到的第二属性值;将第二属性值作为第二目标实例对应的变量值;通过第二目标实例对应的变量值对几何体管理接口所对应的几何体管理器进行配置,得到配置后的、用于在粒子模拟工具中进行几何体管理的几何体管理器。
在一个实施例中,上述装置还包括边界条件生成模块,用于获取对边界条件管理类进行实例化得到的第三目标实例;边界条件管理类继承自粒子发射插件提供的目标基类;通过第三目标实例调用粒子模拟工具的边界条件管理接口,以在粒子模拟工具的边界条件管理器中获得目标边界条件;数据计算模块,还用于在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据及目标边界条件计算物理特效粒子在当前帧的运动状态信息。
在一个实施例中,上述装置还包括:第三目标实例生成模块,用于创建继承自目标基类的边界条件管理类,以对粒子模拟工具的边界条件管理接口进行调用;创建继承自边界条件管理类的、与类型配置参数相应的目标派生类,对目标派生类进行实例化,得到第三目标实例;其中,类型配置参数是通过粒子发射插件的配置界面获取的对边界条件管理器的类型进行配置得到的参数。
在一个实施例中,第三目标实例生成模块,还用于创建目标派生类对应的对象,得到目标边界条件管理对象;将目标边界条件管理对象进行封装,得到第三目标对象;将第三目标对象配置为粒子发射插件的第三属性,得到第三目标实例。
在一个实施例中,上述装置还包括边界条件管理器配置模块,用于通过粒子发射插件 的配置界面,获取对第三属性的属性参数进行配置得到的第三属性值;将第三属性值作为第三目标实例对应的变量值;通过第三目标实例对应的变量值对边界条件管理接口所对应的边界条件管理器的参数进行配置,得到配置后的、用于在粒子模拟工具中进行边界条件管理的边界条件管理器。
在一个实施例中,数据计算模块,还用于在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据计算物理特效粒子在当前帧的运动状态信息,将运动状态信息写入第一显存中;数据更新模块,还用于从第一显存中读取当前帧的运动状态信息,将当前帧的运动状态信息进行拷贝;将拷贝得到的运动状态信息写入第二显存中,并在第二显存中基于当前帧的运动状态信息更新上一帧中的物理特效数据;其中,第一显存为粒子发射插件的目标显存中为粒子模拟工具分配的数据缓冲区域;第二显存为目标显存中异于第一显存的数据缓冲区域,用于存储粒子发射数据和粒子渲染数据。
在一个实施例中,上述装置还包括采样模块,用于在预设模型所在位置处发射预设数量的初始粒子,并将初始粒子的属性信息写入第二显存中;从第二显存中读取初始粒子的属性信息,对初始粒子的属性信息进行拷贝;将拷贝得到的初始粒子的属性信息写入第一显存中,通过粒子模拟工具基于第一显存中初始粒子的属性信息在预设模型的表面及内部进行采样,得到用于物理特效模拟的物理特效粒子。
在一个实施例中,数据更新模块,还用于在粒子模拟工具的场景管理器中,基于上一帧中的物理特效数据映射至预设的背景网格中;背景网格中包括多个网格节点;在背景网格中,基于物理特效数据计算与当前帧中各个物理特效粒子对应的网格节点的运动状态信息;将各个网格节点的运动状态信息映射至对应的物理特效粒子,得到当前帧中各个物理特效粒子的运动状态信息。
关于物理特效渲染装置的具体限定可以参见上文中对于物理特效渲染方法的限定,在此不再赘述。上述物理特效渲染装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图14所示。该计算机设备包括通过系统总线连接的处理器、存储器、通信接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机可读指令。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式 可通过WIFI、运营商网络、NFC(近场通信)或其他技术实现。该计算机可读指令被处理器执行时以实现一种物理特效渲染方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图14中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,还提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机可读指令,该处理器执行计算机可读指令时实现上述各方法实施例中的步骤。
在一个实施例中,提供了一种计算机可读存储介质,存储有计算机可读指令,该计算机可读指令被处理器执行时实现上述各方法实施例中的步骤。
在一个实施例中,提供了一种计算机程序产品或计算机可读指令,该计算机程序产品或计算机可读指令包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述各方法实施例中的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种物理特效渲染方法,由计算机设备执行,所述方法包括:
    获取由粒子发射插件发射的物理特效粒子在上一帧中的物理特效数据;
    获取对场景管理类进行实例化得到的第一目标实例;所述场景管理类继承自所述粒子发射插件提供的目标基类;
    通过所述第一目标实例调用集成于所述粒子发射插件中的粒子模拟工具的场景管理接口,以在所述粒子模拟工具的场景管理器中,基于所述上一帧中的物理特效数据计算所述物理特效粒子在当前帧的运动状态信息;及
    基于所述当前帧的运动状态信息更新所述上一帧中的物理特效数据,以渲染得到当前帧中的物理特效。
  2. 根据权利要求1所述的方法,其特征在于,所述第一目标实例通过以下步骤生成:
    从所述粒子发射插件提供的基类集合中,确定用于调用所述粒子模拟工具提供的数据接口的基类,得到所述目标基类;
    创建继承自所述目标基类的场景管理类,以对所述粒子模拟工具的场景管理接口进行调用;及
    对所述场景管理类进行实例化,得到所述第一目标实例。
  3. 根据权利要求2所述的方法,其特征在于,所述对所述场景管理类进行实例化,得到所述第一目标实例包括:
    创建所述场景管理类对应的对象,得到场景管理对象;
    将所述场景管理对象进行封装,得到第一目标对象;及
    将所述第一目标对象配置为所述粒子发射插件的第一属性,得到所述第一目标实例。
  4. 根据权利要求3所述的方法,其特征在于,在所述将所述第一目标对象配置为所述粒子发射插件的第一属性,得到所述第一目标实例之后,所述方法还包括:
    通过所述粒子发射插件的配置界面,获取对所述第一属性的属性参数进行配置得到的第一属性值;
    将所述第一属性值作为所述第一目标实例对应的变量值;及
    通过所述第一目标实例对应的变量值对所述场景管理接口所对应的场景管理器的参数进行配置,得到配置后的、用于在粒子模拟工具中进行场景管理的场景管理器。
  5. 根据权利要求1所述的方法,其特征在于,所述基于所述当前帧的运动状态信息更新所述上一帧中的物理特效数据,以渲染得到当前帧中的物理特效包括:
    获取对几何体管理类进行实例化得到的第二目标实例;所述几何体管理类继承自所述 粒子发射插件提供的目标基类;及
    通过所述第二目标实例调用所述粒子模拟工具的几何体管理接口,以通过所述粒子模拟工具中的几何体管理器将所述当前帧的运动状态信息写入目标显存中,在所述目标显存中基于所述当前帧的运动状态信息更新所述上一帧中的物理特效数据,以渲染得到当前帧中的物理特效。
  6. 根据权利要求5所述的方法,其特征在于,所述第二目标实例通过以下步骤生成:
    创建继承自所述目标基类的几何体管理类,以对所述粒子模拟工具的几何体管理接口进行调用;
    创建所述几何体管理类对应的对象,得到几何体管理对象;
    将所述几何体管理对象进行封装,得到第二目标对象;及
    将所述第二目标对象配置为所述粒子发射插件的第二属性,得到所述第二目标实例。
  7. 根据权利要求6所述的方法,其特征在于,在所述将所述第二目标对象配置为所述粒子发射插件的第二属性,得到所述第二目标实例之后,所述方法还包括:
    通过所述粒子发射插件的配置界面,获取对所述第二属性的属性参数进行配置得到的第二属性值;
    将所述第二属性值作为所述第二目标实例对应的变量值;及
    通过所述第二目标实例对应的变量值对所述几何体管理接口所对应的几何体管理器进行配置,得到配置后的、用于在粒子模拟工具中进行几何体管理的几何体管理器。
  8. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    获取对边界条件管理类进行实例化得到的第三目标实例;所述边界条件管理类继承自所述粒子发射插件提供的目标基类;
    通过所述第三目标实例调用所述粒子模拟工具的边界条件管理接口,以在所述粒子模拟工具的边界条件管理器中获得目标边界条件;
    所述在所述粒子模拟工具的场景管理器中,基于所述上一帧中的物理特效数据计算所述物理特效粒子在当前帧的运动状态信息包括:及
    在所述粒子模拟工具的场景管理器中,基于所述上一帧中的物理特效数据及所述目标边界条件计算所述物理特效粒子在当前帧的运动状态信息。
  9. 根据权利要求8所述的方法,其特征在于,所述第三目标实例通过以下步骤生成:
    创建继承自所述目标基类的边界条件管理类,以对所述粒子模拟工具的边界条件管理接口进行调用;及
    创建继承自所述边界条件管理类的、与类型配置参数相应的目标派生类,对所述目标 派生类进行实例化,得到所述第三目标实例;
    其中,所述类型配置参数是通过所述粒子发射插件的配置界面获取的对所述边界条件管理器的类型进行配置得到的参数。
  10. 根据权利要求9所述的方法,其特征在于,所述类型配置参数包括地面边界条件、骨骼动画边界条件或者静态物体边界条件中的至少一种。
  11. 根据权利要求9所述的方法,其特征在于,所述对所述目标派生类进行实例化,得到所述第三目标实例包括:
    创建所述目标派生类对应的对象,得到目标边界条件管理对象;
    将所述目标边界条件管理对象进行封装,得到第三目标对象;及
    将所述第三目标对象配置为所述粒子发射插件的第三属性,得到所述第三目标实例。
  12. 根据权利要求11所述的方法,其特征在于,在所述将所述第三目标对象配置为所述粒子发射插件的第三属性,得到所述第三目标实例之后,所述方法还包括:
    通过所述粒子发射插件的配置界面,获取对所述第三属性的属性参数进行配置得到的第三属性值;
    将所述第三属性值作为所述第三目标实例对应的变量值;及
    通过所述第三目标实例对应的变量值对所述边界条件管理接口所对应的边界条件管理器的参数进行配置,得到配置后的、用于在粒子模拟工具中进行边界条件管理的边界条件管理器。
  13. 根据权利要求1所述的方法,其特征在于,所述在所述粒子模拟工具的场景管理器中,基于所述上一帧中的物理特效数据计算所述物理特效粒子在当前帧的运动状态信息包括:
    在所述粒子模拟工具的场景管理器中,基于所述上一帧中的物理特效数据计算所述物理特效粒子在当前帧的运动状态信息,将所述运动状态信息写入第一显存中;
    所述基于所述当前帧的运动状态信息更新所述上一帧中的物理特效数据,以渲染得到当前帧中的物理特效包括:
    从所述第一显存中读取所述当前帧的运动状态信息,将所述当前帧的运动状态信息进行拷贝;及
    将拷贝得到的所述运动状态信息写入第二显存中,并在所述第二显存中基于所述当前帧的运动状态信息更新所述上一帧中的物理特效数据;
    其中,所述第一显存为所述粒子发射插件的目标显存中为所述粒子模拟工具分配的数据缓冲区域;所述第二显存为所述目标显存中异于所述第一显存的数据缓冲区域,用于存 储粒子发射数据和粒子渲染数据。
  14. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在预设模型所在位置处发射预设数量的初始粒子,并将所述初始粒子的属性信息写入第二显存中;
    从所述第二显存中读取所述初始粒子的属性信息,对所述初始粒子的属性信息进行拷贝;及
    将拷贝得到的所述初始粒子的属性信息写入为所述粒子模拟工具分配的第一显存中,通过所述粒子模拟工具基于所述第一显存中所述初始粒子的属性信息在所述预设模型的表面及内部进行采样,得到用于物理特效模拟的物理特效粒子。
  15. 根据权利要求1至14中任意一项所述的方法,其特征在于,所述在所述粒子模拟工具的场景管理器中,基于所述上一帧中的物理特效数据计算所述物理特效粒子在当前帧的运动状态信息包括:
    在所述粒子模拟工具的场景管理器中,基于所述上一帧中的物理特效数据映射至预设的背景网格中;所述背景网格中包括多个网格节点;
    在所述背景网格中,基于所述物理特效数据计算与当前帧中各个物理特效粒子对应的网格节点的运动状态信息;及
    将各个所述网格节点的运动状态信息映射至对应的物理特效粒子,得到当前帧中各个所述物理特效粒子的运动状态信息。
  16. 根据权利要求1至14中任意一项所述的方法,其特征在于,所述基于所述上一帧中的物理特效数据计算所述物理特效粒子在当前帧的运动状态信息,包括:
    将当前帧分为多个时间步;
    从所述多个时间步中按照时间从先到后依次确定当前时间步,对于每一个当前时间步,基于当前时间步的上一个时间步中物理特效粒子的物理特效数据计算当前时间步中物理特效粒子的运动状态信息;
    将末尾时间步中物理特效粒子的运动状态信息确定为所述物理特效粒子在当前帧的运动状态信息。
  17. 一种物理特效渲染装置,其特征在于,所述装置包括:
    数据获取模块,获取由粒子发射插件发射的物理特效粒子在上一帧中的物理特效数据;
    实例获取模块,用于获取对场景管理类进行实例化得到的第一目标实例;所述场景管理类继承自所述粒子发射插件提供的目标基类;
    数据计算模块,用于通过所述第一目标实例调用集成于所述粒子发射插件中的粒子模 拟工具的场景管理接口,以在所述粒子模拟工具的场景管理器中,基于所述上一帧中的物理特效数据计算所述物理特效粒子在当前帧的运动状态信息;及
    数据更新模块,用于基于所述当前帧的运动状态信息更新所述上一帧中的物理特效数据,以渲染得到当前帧中的物理特效。
  18. 一种计算机设备,包括存储器和一个或者多个处理器,所述存储器存储有计算机可读指令,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述一个或者多个处理器实现如权利要求1至16中任一项所述的方法。
  19. 一个或多个非易失性可读存储介质,存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器实现如权利要1至16中任一项所述的方法。
  20. 一种计算机程序产品,包括计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如权利要1至16中任一项所述的方法。
PCT/CN2022/118750 2021-10-25 2022-09-14 物理特效渲染方法、装置、计算机设备和存储介质 WO2023071579A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2023555759A JP2024513325A (ja) 2021-10-25 2022-09-14 物理的な特殊効果のレンダリング方法及び装置、コンピュータ機器、並びに、コンピュータプログラム
US18/198,168 US20230290032A1 (en) 2021-10-25 2023-05-16 Physical special effect rendering method and apparatus, computer device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111237498.XA CN113689534B (zh) 2021-10-25 2021-10-25 物理特效渲染方法、装置、计算机设备和存储介质
CN202111237498.X 2021-10-25

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/198,168 Continuation US20230290032A1 (en) 2021-10-25 2023-05-16 Physical special effect rendering method and apparatus, computer device, and storage medium

Publications (1)

Publication Number Publication Date
WO2023071579A1 true WO2023071579A1 (zh) 2023-05-04

Family

ID=78587743

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/118750 WO2023071579A1 (zh) 2021-10-25 2022-09-14 物理特效渲染方法、装置、计算机设备和存储介质

Country Status (4)

Country Link
US (1) US20230290032A1 (zh)
JP (1) JP2024513325A (zh)
CN (1) CN113689534B (zh)
WO (1) WO2023071579A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113689534B (zh) * 2021-10-25 2022-03-01 腾讯科技(深圳)有限公司 物理特效渲染方法、装置、计算机设备和存储介质
CN116051351B (zh) * 2022-08-22 2023-10-13 荣耀终端有限公司 一种特效处理方法和电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090083015A1 (en) * 2007-09-24 2009-03-26 Siemens Corporate Research, Inc Particle System Architecture in a Multi-Body Physics Simulation
CN112270732A (zh) * 2020-11-17 2021-01-26 Oppo广东移动通信有限公司 粒子动画的生成方法、处理装置、电子设备和存储介质
CN112446942A (zh) * 2020-11-09 2021-03-05 北京达佳互联信息技术有限公司 特效渲染方法、装置、电子设备及存储介质
CN113223122A (zh) * 2021-05-13 2021-08-06 广州光锥元信息科技有限公司 通过粒子实现进出场动画的方法及装置
CN113689534A (zh) * 2021-10-25 2021-11-23 腾讯科技(深圳)有限公司 物理特效渲染方法、装置、计算机设备和存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10019827B2 (en) * 2013-12-31 2018-07-10 Disney Enterprises, Inc. Material point method for simulation of granular materials
CN104778737B (zh) * 2015-03-23 2017-10-13 浙江大学 基于gpu的大规模落叶实时渲染方法
US20190114819A1 (en) * 2017-10-13 2019-04-18 Microsoft Technology Licensing, Llc Dimensional content surface rendering
CN110049371A (zh) * 2019-05-14 2019-07-23 北京比特星光科技有限公司 视频合成、播放和修改方法、视频合成系统及设备
CN111741332B (zh) * 2020-06-22 2022-08-26 稿定(厦门)科技有限公司 粒子群旋转视频制作方法及介质
CN112862942B (zh) * 2021-02-08 2024-04-09 腾讯科技(深圳)有限公司 物理特效模拟方法、装置、电子设备和存储介质
CN113487474A (zh) * 2021-07-02 2021-10-08 杭州小影创新科技股份有限公司 一种内容相关的gpu实时粒子特效方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090083015A1 (en) * 2007-09-24 2009-03-26 Siemens Corporate Research, Inc Particle System Architecture in a Multi-Body Physics Simulation
CN112446942A (zh) * 2020-11-09 2021-03-05 北京达佳互联信息技术有限公司 特效渲染方法、装置、电子设备及存储介质
CN112270732A (zh) * 2020-11-17 2021-01-26 Oppo广东移动通信有限公司 粒子动画的生成方法、处理装置、电子设备和存储介质
CN113223122A (zh) * 2021-05-13 2021-08-06 广州光锥元信息科技有限公司 通过粒子实现进出场动画的方法及装置
CN113689534A (zh) * 2021-10-25 2021-11-23 腾讯科技(深圳)有限公司 物理特效渲染方法、装置、计算机设备和存储介质

Also Published As

Publication number Publication date
CN113689534B (zh) 2022-03-01
US20230290032A1 (en) 2023-09-14
JP2024513325A (ja) 2024-03-25
CN113689534A (zh) 2021-11-23

Similar Documents

Publication Publication Date Title
WO2023071579A1 (zh) 物理特效渲染方法、装置、计算机设备和存储介质
US10592238B2 (en) Application system that enables a plurality of runtime versions of an application
CN112070871B (zh) 一种跨平台三维可视化引擎构建系统、方法、终端及储存介质
Tecchia et al. A Flexible Framework for Wide‐Spectrum VR Development
KR100938036B1 (ko) 그래픽 표시 애니메이션 시스템, 표시 요소 애니메이션화 방법, 애니메이션 동작 적용 방법, 및 컴퓨터 판독가능 매체
KR101087427B1 (ko) 3차원 장면 계층구조를 2차원 합성 시스템으로 통합하기 위한 컴퓨터로 구현된 방법 및 컴퓨터 판독가능 기록 매체
KR100928192B1 (ko) 내장형 디바이스에서의 3d 콘텐츠에 대한 오프라인 최적화파이프라인
KR20040086043A (ko) 비주얼 및 장면 그래프 인터페이스
CN103413343B (zh) 一种3d图像动画引擎
US11094036B2 (en) Task execution on a graphics processor using indirect argument buffers
US8902234B1 (en) Simulation primitives
Malizia Java™ Mobile 3D Graphics
WO2024011733A1 (zh) 3d图像实现方法及系统
CN115170707B (zh) 基于应用程序框架的3d图像实现系统及方法
US20240111496A1 (en) Method for running instance, computer device, and storage medium
CN117974862A (zh) 流体模型渲染方法及装置
Xiong et al. 3D graphics rendering engine introduction and application in choreography
CN115205430A (zh) 针对3d文件的导入导出方法及装置
ALBERS et al. Physically-Based Animation of Fire for Android
Luo Interactive Ray Tracing Infrastructure
Dennett et al. 3D Java Game Development with Homura
Pokorný Using Irrlicht engine to create a real-time application
CN117274551A (zh) 三维综合集成展示系统、方法、计算机设备
Tarlton A declarative representation system for dynamic visualization
Samuels Declarative Computer Graphics using Functional Reactive Programming

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22885466

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023555759

Country of ref document: JP