Particle animation generation method and device
By determining the vertex coordinates and frame numbers of particles based on pixel points in the color picture, and framing the image and frame numbers, the problem of increasing CPU computing time caused by the large number of special-effect objects in the particle is solved, and efficient rendering and accurate animation generation are achieved, reducing the CPU load.
Patent Information
- Application Number
- CN202411286639.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-03
AI Technical Summary
The large number of particle special-effect objects leads to an increase in CPU calculation time, resulting in CPU heating and screen stuttering.
By determining the vertex coordinates and frame numbers of particles based on pixel points in the color picture, pre-frame the image and frame numbers, avoiding the CPU calculating the particle position in real time, and directly generating target particle animation based on the color picture.
Improve rendering efficiency and improve the accuracy of target particle animation, reduce CPU load, and avoid screen lag.
Smart Images

Figure CN119068088A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, specifically to the field of particle special effects technology, and in particular to a particle animation generation method and device. Background Art
[0002] Particle effects are usually composed of a large number of particles moving in an orderly manner to simulate effects such as falling leaves and snow. The rendering of particle effects first requires the CPU to calculate the position of each particle and the rendering content in each frame, and then send it to the GPU for rendering. Due to the large number of particle effect objects, calculating the position of all objects in each frame will increase the CPU calculation time, causing the CPU to heat up, and easily cause the screen to freeze.
[0003] To solve the above problems, the main existing technologies are: 1. Control the number of particles in particle effects: match the number of particles in particle effects according to different hardware environments. 2. Distance control particle activation: determine whether the particle effect is turned on based on the user's distance from the particle effect in the metaverse environment. 3. Control the number of particle effects on the same screen: sort the particles according to their importance and give priority to displaying high-priority particles. Summary of the invention
[0004] The embodiments of the present disclosure provide a particle animation generation method, apparatus, device and storage medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a particle animation generation method, the method comprising: determining the vertex coordinates of the particles and the frame number corresponding to the particles based on the pixel points in the color image; rendering based on the vertex coordinates to generate a frame image; and generating a target particle animation based on the frame image and the frame number.
[0006] In a second aspect, an embodiment of the present disclosure provides a particle animation generating device, which includes: a determination module, a rendering module and a generation module, wherein the determination module can be configured to determine the vertex coordinates of the particles and the frame number corresponding to the particles based on the pixel points in the color picture; the rendering module can be configured to render based on the vertex coordinates to generate a frame image; the generation module can be configured to generate a target particle animation based on the frame image and the frame number.
[0007] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement a particle animation generation method as in any embodiment of the first aspect.
[0008] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements a particle animation generation method as in any embodiment of the first aspect.
[0009] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements a particle animation generation method as in any embodiment of the first aspect.
[0010] The present disclosure improves the accuracy of generated target particle animation while effectively improving rendering efficiency.
[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 is an exemplary system architecture diagram in which the present disclosure may be applied;
[0013] Figure 2a is a flow chart of an embodiment of a particle animation generation method according to the present disclosure;
[0014] Figure 2b is a schematic diagram of another embodiment of a particle animation generation method according to the present disclosure;
[0015] Figure 3 is a schematic diagram of an application scenario of the particle animation generation method according to the present disclosure;
[0016] Figure 4 is a flow chart of another embodiment of a particle animation generation method according to the present disclosure;
[0017] Figure 5 is a schematic diagram of an embodiment of a particle animation generating device according to the present disclosure;
[0018] Figure 6 It is a schematic diagram of the structure of a computer system suitable for implementing the electronic device of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0020] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0021] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of the particle animation generation method of the present disclosure may be applied.
[0022] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0023] Users can use terminal devices 101 , 102 , 103 to interact with server 105 via network 104 to receive or send messages, etc.
[0024] The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are software, they may be installed in the electronic devices listed above. They may be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made here.
[0025] Server 105 can be a server that provides various services, for example, determining a target process in a process set according to a process scheduling identifier, and determining a target web page according to a process scheduling parameter corresponding to the process scheduling identifier; in the process of executing the target process on the target web page, in response to detecting a specified instruction, based on an instruction sequence preceding the specified instruction and an operation intention of the target process, updating the specified instruction and the instruction sequence following the specified instruction, and obtaining and executing the updated target process.
[0026] It should be noted that the server 105 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, for providing particle animation generation services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0027] It should be noted that the particle animation generation method provided in the embodiments of the present disclosure is usually executed by the server 105. Accordingly, the various parts (eg, various units, sub-units, modules, sub-modules) included in the particle animation generation device can be arranged in the server 105.
[0028] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0029] Fig. 2 shows a process 200 of an embodiment of a particle animation generation method. The particle animation generation method may specifically include the following steps:
[0030] Step 201, based on the pixel points in the color image, determine the vertex coordinates of the particle and the frame number corresponding to the particle.
[0031] In this embodiment, the execution subject (for example, Figure 1 The server 105 or the GPU in the terminal devices 101, 102, 103 can detect the rendering instruction in real time or periodically. In response to detecting the rendering instruction, the vertex coordinates of the particle and the frame number corresponding to the particle can be determined according to the pixel points in the pre-generated color picture.
[0032] Among them, the color image can be generated in the following ways: generate particle geometry through DCC (Digital Content Creation) software in existing technology or future development technology, such as Maya, 3D Max, etc., create an unrendered particle animation based on the particle geometry, and generate a color image based on the vertex coordinates of the particles in the frame image included in the unrendered particle animation and the frame number to which the particles belong.
[0033] Here, particles are the most basic units in the particle system, usually composed of polygonal planes. The particle system can simulate various effects by controlling particles, i.e., polygonal planes, to move in space. A frame image can usually include multiple particles, each of which has multiple vertices.
[0034] Among them, the pixel points in the color image can have multi-element color values under various color modes, for example, ternary color values, quaternary color values, quinary color values, etc., which are not limited in this application.
[0035] Step 202: Rendering is performed based on vertex coordinates to generate a frame image.
[0036] In this embodiment, after determining the vertex coordinates of the particles and the frame number corresponding to the particles, the execution body may perform rendering according to a preset rendering effect based on the vertex coordinates of the particles corresponding to the same frame number to generate a frame image.
[0037] Step 203: Generate target particle animation based on the frame image and frame number.
[0038] In this embodiment, the execution subject can generate the target particle animation according to the frame image, frame number and preset frame rate.
[0039] Among them, the preset frame rate, that is, the time interval between adjacent frame images, can be set according to experience and actual needs, for example, 15 frames / second, 20 frames / second, etc., and this application does not limit this.
[0040] The particle animation generation method provided by the embodiment of the present disclosure determines the vertex coordinates of the particles and the frame number corresponding to the particles based on the pixel points in the color picture; performs rendering based on the vertex coordinates to generate a frame image; and generates a target particle animation based on the frame image and the frame number, thereby pre-storing the frame number and vertex coordinates of the unrendered particles as a color picture, and directly generating the target particle animation based on the color picture during rendering, thereby avoiding the CPU from calculating the particle position and rendering content in real time, thereby reducing the rendering efficiency, and further refining the particle position into the vertex coordinates of the particle, thereby effectively improving the rendering efficiency and improving the accuracy of the generated target particle animation.
[0041] In some optional methods, the vertex coordinates of the particles and the frame number corresponding to the particles are determined based on the pixels in the color image, including: determining the frame number of the frame image to which the particles corresponding to the pixels belong based on the arrangement position of the pixels in the color image; determining the vertex coordinates of the particles corresponding to the pixels based on the color value of the pixels and the correspondence between the preset coordinates and the color value.
[0042] In this implementation, the execution entity may first determine the frame number of the frame image to which the particle corresponding to the pixel belongs based on the arrangement position of the pixel in the color image and the correspondence between the preset position and the frame number; further, determine the vertex coordinates of the particle corresponding to the pixel based on the color value of the pixel and the correspondence between the preset coordinates and the color value.
[0043] Among them, the pixel points in the color image may have ternary color values, and the ternary color values may be values of any ternary color mode (eg, RGB mode, Lab color mode, etc.) in the existing technology or future development technology.
[0044] Here, the correspondence between the preset position and the frame number can be set according to actual needs. For example, the row number of the row where the pixel point is located is positively or negatively correlated with the frame number, the column number of the column where the pixel point is located is positively or negatively correlated with the frame number, the sum of the row number and the column number of the pixel point is positively or negatively correlated with the frame number, etc. This application does not limit this.
[0045] This implementation method determines the frame number of the frame image to which the particle corresponding to the pixel belongs based on the arrangement position of the pixel in the color image; determines the vertex coordinates of the particle corresponding to the pixel based on the color value of the pixel and the correspondence between the preset coordinates and the color value, thereby realizing the determination of the vertex coordinates of the particle and the frame number corresponding to the particle based on the pixel with a ternary color value.
[0046] In some optional methods, the vertex coordinates of the particle corresponding to the pixel point are determined based on the color value of the pixel point and the correspondence between the preset coordinates and the color value, including: determining the vertex coordinates of the particle corresponding to the pixel point based on the color value of the pixel point and the correspondence between the preset XYZ coordinates and the RGB mode color value.
[0047] In this implementation, the ternary color value is the RGB mode color value, the coordinate is the XYZ coordinate, and the execution subject can determine the vertex coordinates of the particle corresponding to the pixel point based on the color value of the pixel point and the correspondence between the preset XYZ coordinate and the RGB mode color value.
[0048] The X coordinate, Y coordinate and Z coordinate included in the vertex coordinates may respectively correspond to a color value of a color in the RGB mode color value, and the colors corresponding to the X coordinate, Y coordinate and Z coordinate are different.
[0049] Specifically, the X coordinate corresponds to the color value of the R channel in the RGB mode, the Y coordinate corresponds to the color value of the G channel in the RGB mode, and the Z coordinate corresponds to the color value of the B channel in the RGB mode.
[0050] This implementation method determines the vertex coordinates of the particle corresponding to the pixel point based on the color value of the pixel point and the correspondence between the preset XYZ coordinates and the RGB mode color value. Since the XYZ coordinates correspond to the RGB mode color value one by one, the matching algorithm is simple and the efficiency of determining the vertex coordinates is high.
[0051] In some optional methods, the frame number of the frame image to which the particle corresponding to the pixel belongs is determined based on the arrangement position of the pixel in the color image, including: determining the frame number of the frame image to which the particle corresponding to the pixel belongs based on the row number of the row where the pixel is located in the color image.
[0052] In this implementation, the pixels corresponding to different frame numbers in the color image are arranged in sequence according to the frame number, the pixels corresponding to different frame numbers are in different rows, and the pixels corresponding to the same frame number are in the same row. The execution subject can directly determine the frame number of the frame image to which the particle corresponding to the pixel belongs based on the row number of the row where the pixel is located in the color image and the preset correspondence between the row number and the frame number.
[0053] The correspondence between the row number and the frame number can be set according to experience and actual needs.
[0054] Specifically, if the pixel is located in the first row of the color image, it can be determined that the frame number of the frame image to which the particle corresponding to the pixel is located is frame number 1; if the pixel is located in the third row of the color image, it can be determined that the frame number of the frame image to which the particle corresponding to the pixel is located is frame number 3.
[0055] This implementation method determines the frame number of the frame image to which the particle corresponding to the pixel belongs based on the row number of the row where the pixel is located in the color image, so that the particle information of the frame image with the highest sorting can be read and rendered in advance, effectively improving the generation efficiency of the target particle animation.
[0056] In some optional methods, based on the arrangement position of the pixel points in the color image, the frame number of the frame image to which the particle corresponding to the pixel points belongs is determined, including: based on the column number of the column where the pixel points are located in the color image, determining the frame number of the frame image to which the particle corresponding to the pixel points belongs.
[0057] In this implementation, the pixels corresponding to different frame numbers in the color image are arranged in sequence according to the frame number, the pixels corresponding to different frame numbers are in different columns, and the pixels corresponding to the same frame number are in the same column. The execution subject can directly determine the frame number of the frame image to which the particle corresponding to the pixel belongs based on the column number of the column where the pixel is located in the color image and the preset correspondence between the column number and the frame number.
[0058] The correspondence between the column number and the frame number can be set according to experience and actual needs.
[0059] Specifically, if the pixel is located in the first column of the color image, it can be determined that the frame number of the frame image to which the particle corresponding to the pixel corresponds is frame number 1; if the pixel is located in the second column of the color image, it can be determined that the frame number of the frame image to which the particle corresponding to the pixel corresponds is frame number 2.
[0060] This implementation method determines the frame number of the frame image to which the particle corresponding to the pixel belongs based on the column number of the column where the pixel is located in the color image, so that the particle information of the frame image with the highest sorting can be read and rendered in advance, effectively improving the generation efficiency of the target particle animation.
[0061] In some optional methods, rendering is performed based on vertex coordinates to generate a frame image, including: rendering a particle geometry of an unrendered particle animation corresponding to the particle vertex coordinates and the color image to generate a frame image.
[0062] In this implementation, after obtaining the vertex coordinates of the particles included in each frame image, the execution subject may render the particle geometry of the unrendered particle animation according to the vertex coordinates of the particles and the color image to generate a frame image.
[0063] Among them, particle geometry can be generated by DCC in existing technology or future development technology, and is usually used in particle systems to create various dynamic effects, such as explosions, flames, smoke, etc. Particle geometry defines the initial position and speed of particles in various dynamic effects, as well as how they move and change in the scene.
[0064] Specifically, Figure 2b As shown, the execution entity can generate a particle geometry 2021 according to the DCC software, create an unrendered particle animation 2022 based on the particle geometry, and generate a color image 2023 based on the unrendered particle animation; further, the execution entity can render in a game engine 2025 based on the color image 2023 and the particle geometry 2024, generate a target particle animation, and play the target particle animation 2026, wherein the rendering process can include determining the vertex coordinates of the particles and the frame number corresponding to the particles based on the pixel points in the color image, and rendering to generate the target particle animation based on the vertex coordinates, frame number and particle geometry.
[0065] This implementation generates a frame image by rendering the particle geometry of the unrendered particle animation based on the particle vertex coordinates and the color image, taking into account the position information and change information of the particles in the particle geometry, thereby further improving the accuracy of the generated frame image.
[0066] In some optional embodiments, the method further includes: determining a first time interval based on the number of rows between rows where pixels corresponding to adjacent frame numbers are located; and generating a target particle animation based on the frame image and the frame number, including: generating a target particle animation based on the frame image, the frame number and the first time interval.
[0067] In this implementation, pixels corresponding to different frame numbers are arranged in sequence according to the frame number order, pixels corresponding to different frame numbers are in different rows, and pixels corresponding to the same frame number are in the same row. The execution entity can determine the first time interval based on the number of rows between the rows where pixels corresponding to adjacent frame numbers are located, the correspondence between the preset number of rows and the time interval, and generate the target particle animation based on the frame image, the frame number and the first time interval.
[0068] The corresponding relationship between the preset number of rows and the time interval can be set according to experience and actual needs. For example, the time interval corresponding to 4 rows is 0.066s, the time interval corresponding to 2 rows is 0.033s, and so on.
[0069] This implementation method determines the first time interval based on the number of rows between the rows where the pixels corresponding to adjacent frame numbers are located; and generates the target particle animation based on the frame image, the frame number and the first time interval, that is, directly determines the frame rate based on the color image, and generates the target particle animation according to the frame image, the frame number and the frame rate, so that the pixels are arranged in sequence according to the frame numbers. When the pixels corresponding to the same frame number are in the same row, the particle information with the front order can be read in advance and rendered based on the preset frame rate, which effectively improves the generation efficiency of the target particle animation.
[0070] In some optional embodiments, the method further includes: determining a second time interval based on the number of columns between rows of pixels corresponding to adjacent frame numbers; and generating a target particle animation based on the frame image and the frame number, including: generating a target particle animation based on the frame image, the frame number and the second time interval.
[0071] In this implementation, pixels corresponding to different frame numbers are arranged in sequence according to the frame number order, and pixels corresponding to different frame numbers are in different columns, and pixels corresponding to the same frame number are in the same column. The execution entity can determine the second time interval based on the number of columns between the columns where pixels corresponding to adjacent frame numbers are located and the correspondence between the preset number of columns and the time interval, and generate the target particle animation based on the frame image, frame number and the second time interval.
[0072] The corresponding relationship between the preset number of columns and the time interval can be set according to experience and actual needs. For example, the time interval corresponding to 4 columns is 0.066s, the time interval corresponding to 2 columns is 0.033s, and so on.
[0073] This implementation method determines the second time interval based on the number of columns between the columns where the pixels corresponding to adjacent frame numbers are located; and generates the target particle animation based on the frame image, the frame number and the second time interval, that is, the frame rate is directly determined based on the color image, and the target particle animation is generated according to the frame image, the frame number and the frame rate, so that the pixels are arranged in sequence according to the frame numbers, and when the pixels corresponding to the same frame number are in the same column, the particle information that is ranked first can be read in advance and rendered based on the preset frame rate, which effectively improves the generation efficiency of the target particle animation.
[0074] In some optional methods, target particle animation is generated based on frame images and frame numbers, including: generating target particle animation in a metaverse scene based on frame images and frame numbers.
[0075] In this implementation, the execution subject can generate target particle animation in the metaverse scene according to the frame image, frame number and preset frame rate.
[0076] Among them, the metaverse points to the ultimate form of the Internet. The metaverse is a virtual world that is highly interconnected with the real world. It has four core attributes: synchronization and simulation, open source and creativity, sustainability, and a closed-loop economic system.
[0077] By adding various particle effects, namely particle animations, to Metaverse products, we can effectively enrich the environmental effects and enhance the user experience.
[0078] Continue to see Figure 3 , Figure 3 It is a schematic diagram of an application scenario of the particle animation generation method according to this embodiment.
[0079] Generate particle geometry in advance through DCC software, create an unrendered particle animation based on the particle geometry, and generate a color picture based on the vertex coordinates of the particles in the frame images included in the unrendered particle animation (for example, the vertex coordinates of vertex 1 to vertex N in each frame image) and the frame number to which the particles belong (for example, the first frame to the Nth frame).
[0080] Among them, the pixel points may have ternary color values, such as values in RGB mode, and the pixels corresponding to different frame numbers in the color image are arranged in sequence according to the frame number order, the pixels corresponding to different frame numbers are in different rows, and the pixels corresponding to the same frame number are in the same row.
[0081] Further, in response to detecting the rendering instruction, the execution body 301 may receive the color image 302 submitted by the CPU, and determine the vertex coordinates 303 of the particle and the frame number 304 corresponding to the particle based on the pixel points in the color image 302. Specifically, the execution body may directly determine the frame number of the frame image to which the particle corresponding to the pixel point belongs based on the row number of the row where the pixel point is located in the color image and the preset correspondence between the row number and the frame number; and determine the vertex coordinates of the particle corresponding to the pixel point based on the color value of the pixel point and the preset correspondence between the coordinates and the color value.
[0082] Furthermore, the execution subject may perform rendering based on the vertex coordinates 303 to generate a frame image 305 ; and generate a target particle animation 306 based on the frame image 305 and the frame number 304 .
[0083] Further references Figure 4 , which shows Figure 2a The process 400 of another embodiment of the particle animation generation method is shown. In this embodiment, the process 400 of the particle animation generation method may include the following steps:
[0084] Step 401, based on a first color value of a pixel and a preset correspondence relationship between the first color value and the frame number, determine the frame number of the frame image to which the particle corresponding to the pixel belongs.
[0085] In this embodiment, the pixel points in the color image have four-element color values, that is, color values of four colors. The execution entity can first determine the frame number of the frame image to which the particle corresponding to the pixel point belongs based on a first color value in the four-element color value of the pixel point, the correspondence between the preset first color value and the frame number.
[0086] Here, the four-element color value may be a value of any four-element color mode (eg, CMYK mode, etc.) in the existing technology or future development technology.
[0087] Among them, the CMYK mode refers to a color mode formed by the subtractive color method of four colors: cyan, magenta, yellow and black.
[0088] Here, the corresponding relationship between the preset first color value and the frame number can be set according to experience and actual needs.
[0089] Step 402 : determining the vertex coordinates of the particle corresponding to the pixel point based on the three second color values of the pixel point and the preset correspondence between the three second color values and the vertex coordinates.
[0090] In this embodiment, the execution entity may determine the vertex coordinates of a vertex of a particle corresponding to the pixel point according to the three second color values in the quaternary color value of the pixel point and the preset correspondence between the three second color values and the vertex coordinates.
[0091] The three second color values of the pixel points and the corresponding relationship between the three preset second color values and the vertex coordinates can be set according to experience and actual needs.
[0092] Specifically, the first color value of the pixel is the value of cyan, and the three second color values are respectively the value of magenta, the value of yellow and the value of black. The execution can determine the frame number of the frame image to which the particle corresponding to the pixel belongs based on the correspondence between the first color value, the preset first color value and the frame number; and determine the vertex coordinates of the particle corresponding to the pixel based on the three second color values of the pixel and the correspondence between the preset three second color values and the vertex coordinates.
[0093] In some optional embodiments, the method further includes: determining a third time interval based on the number of pixels between a first pixel and a second pixel in pixels corresponding to adjacent frame numbers, and generating a target particle animation based on the frame image and the frame number, including: generating a target particle animation based on the frame image, the frame number and the third time interval.
[0094] In this implementation, the pixels corresponding to different frame numbers in the color image are arranged in sequence according to the frame number order, and the execution entity can determine the third time interval based on the number of pixels between the first pixel and the second pixel in the pixels corresponding to adjacent frame numbers and the correspondence between the preset number of pixels and the time interval.
[0095] The first pixel point is the last pixel point in the pixel points corresponding to the previous frame number in the adjacent frame numbers, and the second pixel point is the first pixel point in the pixel points corresponding to the frame number that is later in the adjacent frame numbers.
[0096] Specifically, the adjacent frame numbers are frame number 1 and frame number 2, and the color picture has a total of 10*20 pixels, where 10 is the number of rows and 20 is the number of columns. If the last-ranked pixel (i.e., the first pixel) among the pixels corresponding to frame number 1 is in the first row and 15th column of the color picture, and the first-ranked pixel (i.e., the second pixel) among the pixels corresponding to frame number 2 is in the first row and 20th column, then the number of pixels between the first pixel and the second pixel is 4, and the execution entity can determine the third time interval based on the correspondence between the number of pixels, the preset number of pixels and the time interval.
[0097] Furthermore, the execution entity may generate a target particle animation according to the frame image, the frame number and the third time interval.
[0098] This implementation method determines the third time interval based on the number of pixels between the first pixel and the second pixel in the pixels corresponding to adjacent frame numbers, and generates the target particle animation based on the frame image, the frame number and the third time interval, so that when the pixels are arranged in sequence according to the frame numbers, the information of the particles that are ranked first can be read in advance and rendered based on the preset frame rate, which effectively improves the generation efficiency of the target particle animation.
[0099] Step 403: Rendering is performed based on the vertex coordinates to generate a frame image.
[0100] In this embodiment, the implementation details and technical effects of step 403 can refer to the description of step 202 and will not be repeated here.
[0101] Step 404: Generate target particle animation based on the frame image and frame number.
[0102] In this embodiment, the implementation details and technical effects of step 404 can refer to the description of step 203 and will not be repeated here.
[0103] The above embodiments of the present disclosure, Figure 2aCompared with the illustrated embodiment, the frame number of the frame image to which the particle corresponding to the pixel belongs is determined based on a first color value of the pixel and the correspondence between the preset first color value and the frame number; the vertex coordinates of the particle corresponding to the pixel are determined based on the three second color values of the pixel and the correspondence between the preset three second color values and the vertex coordinates, and then rendering is performed based on the vertex coordinates to generate a frame image, and a target particle animation is generated based on the frame image and the frame number, so that the frame number to which the particle belongs and the vertex coordinates of the particle are directly determined based on the color value of the pixel in the color image, and then the target particle animation is generated based on the vertex coordinates and the frame number, which further improves the efficiency of generating the target particle animation.
[0104] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a particle animation generating device. Figure 2a Corresponding to the method embodiment shown, the device can be specifically applied in a cloud server.
[0105] like Figure 5 As shown, the particle animation generating device 500 of this embodiment includes: a determining module 501 , a rendering module 502 and a generating module 503 .
[0106] Wherein, the determination module 501 may be configured to determine the vertex coordinates of the particle and the frame number corresponding to the particle based on the pixel points in the color image;
[0107] The rendering module 502 may be configured to perform rendering based on vertex coordinates to generate a frame image;
[0108] The generating module 503 may be configured to generate a target particle animation based on the frame image and the frame number.
[0109] In some optional aspects of this embodiment, the update module is further configured to update the specified instruction and the instruction sequence subsequent to the specified instruction based on the page elements of the web page corresponding to the specified instruction, the instruction sequence preceding the specified instruction, and the operation intention of the target process.
[0110] In some optional embodiments of this embodiment, the update module is further configured to: update the specified instruction and the instruction sequence subsequent to the specified instruction based on the page elements of the web page corresponding to the specified instruction, the layout of the page elements, the instruction sequence preceding the specified instruction, and the operational intention of the target process.
[0111] In some optional embodiments of this embodiment, the determination module is further configured to: determine the frame number of the frame image to which the particle corresponding to the pixel belongs based on the arrangement position of the pixel in the color image; determine the vertex coordinates of the particle corresponding to the pixel based on the color value of the pixel and the correspondence between the preset coordinates and the color value.
[0112] In some optional methods of this embodiment, the frame number of the frame image to which the particle corresponding to the pixel belongs is determined based on the arrangement position of the pixel in the color image, including determining the frame number of the frame image to which the particle corresponding to the pixel belongs based on the row number of the row in which the pixel is located in the color image.
[0113] In some optional embodiments of this embodiment, the device also includes: a first interval module, which is configured to determine a first time interval based on the number of rows between rows where pixel points corresponding to adjacent frame numbers are located; and a generation module, which is further configured to generate a target particle animation based on the frame image, frame number and the first time interval.
[0114] In some optional methods of this embodiment, the frame number of the frame image to which the particle corresponding to the pixel belongs is determined based on the arrangement position of the pixel in the color image, including: determining the frame number of the frame image to which the particle corresponding to the pixel belongs based on the column number of the column in which the pixel is located in the color image.
[0115] In some optional embodiments of this embodiment, the device also includes: a second interval module, which is configured to determine a second time interval based on the number of columns between columns where pixel points corresponding to adjacent frame numbers are located; and a generation module, which is further configured to generate a target particle animation based on the frame image, frame number and the second time interval.
[0116] In some optional methods of this embodiment, the vertex coordinates of the particle corresponding to the pixel point are determined based on the color value of the pixel point and the correspondence between the preset coordinates and the color value, including: determining the vertex coordinates of the particle corresponding to the pixel point based on the color value of the pixel point and the correspondence between the preset XYZ coordinates and the RGB mode color value.
[0117] In some optional embodiments of this embodiment, the determination module is further configured to determine the frame number of the frame image to which the particle corresponding to the pixel belongs based on a first color value of the pixel and the correspondence between the preset first color value and the frame number; and determine the vertex coordinates of the particle corresponding to the pixel based on three second color values of the pixel and the correspondence between the preset three second color values and the vertex coordinates.
[0118] In some optional embodiments of this embodiment, the device also includes a third interval module, which is configured to determine a third time interval based on the number of pixels between the first pixel and the second pixel in the pixels corresponding to adjacent frame numbers, and the generation module is further configured to generate a target particle animation based on the frame image, frame number and the third time interval.
[0119] In some optional aspects of this embodiment, the rendering module is further configured to render particle geometry of an unrendered particle animation based on particle vertex coordinates and a color image to generate a frame image.
[0120] In some optional embodiments of this embodiment, the generation module is further configured to generate target particle animation in the metaverse scene based on the frame image and frame number.
[0121] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0122] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0123] like Figure 6 , which is a block diagram of an electronic device according to the particle animation generating method of an embodiment of the present disclosure.
[0124] 600 is a block diagram of an electronic device according to a particle animation generation method according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0125] like Figure 6As shown, the electronic device includes: one or more processors 601, a memory 602, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 601 is taken as an example.
[0126] The memory 602 is a non-transitory computer-readable storage medium provided by the present disclosure. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the particle animation generation method provided by the present disclosure. The non-transitory computer-readable storage medium of the present disclosure stores computer instructions, which are used to enable a computer to perform the particle animation generation method provided by the present disclosure.
[0127] The memory 602 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the particle animation generation method in the embodiment of the present disclosure (for example, the attached Figure 5 The processor 601 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 602, that is, the particle animation generation method in the above method embodiment is realized.
[0128] The memory 602 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created by the use of the electronic device for face tracking, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 602 may optionally include a memory remotely disposed relative to the processor 601, and these remote memories may be connected to the electronic device for lane line detection via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0129] The electronic device of the particle animation generation method may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0130] The input device 603 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device for lane line detection, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 604 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
[0131] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0132] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0133] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0134] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0135] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0136] According to the technical solution of the embodiment of the present disclosure, the accuracy of the generated target particle animation is improved while the rendering efficiency is effectively improved.
[0137] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in this disclosure can be achieved, and this document is not limited here.
[0138] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A particle animation generation method, comprising: Based on the pixel points in the color image, determine the vertex coordinates of the particle and the frame number corresponding to the particle; Rendering is performed based on the vertex coordinates to generate a frame image; A target particle animation is generated based on the frame image and the frame number.
2. The method according to claim 1, wherein: The pixel points in the color picture have ternary color values, and determining the vertex coordinates of the particles and the frame numbers corresponding to the particles based on the pixel points in the color picture includes: Based on the arrangement position of the pixel point in the color image, determining the frame number of the frame image to which the particle corresponding to the pixel point belongs; Based on the color value of the pixel point and the preset correspondence between the coordinates and the color value, the vertex coordinates of the particle corresponding to the pixel point are determined.
3. The method according to claim 2, wherein: The pixel points corresponding to different frame numbers in the color image are arranged in sequence according to the frame number order, the pixel points corresponding to different frame numbers are in different rows, and the pixel points corresponding to the same frame number are in the same row, and the frame number of the frame image to which the particle corresponding to the pixel point belongs is determined based on the arrangement position of the pixel point in the color image, including: Based on the row number of the row where the pixel point is located in the color image, the frame number of the frame image to which the particle corresponding to the pixel point belongs is determined.
4. The method according to claim 3, further comprising: Determine a first time interval based on the number of rows between rows where pixels corresponding to adjacent frame numbers are located; as well as The generating target particle animation based on the frame image and the frame number comprises: A target particle animation is generated based on the frame image, the frame number and the first time interval.
5. The method according to claim 2, wherein: The pixel points corresponding to different frame numbers in the color image are arranged in sequence according to the frame number order, the pixel points corresponding to different frame numbers are in different columns, and the pixel points corresponding to the same frame number are in the same column, and the frame number of the frame image to which the particle corresponding to the pixel point belongs is determined based on the arrangement position of the pixel point in the color image, including: Based on the column number of the column where the pixel point is located in the color image, the frame number of the frame image to which the particle corresponding to the pixel point belongs is determined.
6. The method according to claim 5, further comprising: Determine a second time interval based on the number of columns between the columns where the pixels corresponding to the adjacent frame numbers are located; as well as The generating target particle animation based on the frame image and the frame number comprises: A target particle animation is generated based on the frame image, the frame number and the second time interval.
7. The method according to claim 2, wherein: The ternary color value is an RGB mode color value, the coordinate is an XYZ coordinate, and the vertex coordinates of the particle corresponding to the pixel point are determined based on the color value of the pixel point and the preset correspondence between the coordinate and the color value, including: Based on the color value of the pixel point and the correspondence between the preset XYZ coordinates and the RGB mode color value, the vertex coordinates of the particle corresponding to the pixel point are determined.
8. The method according to claim 1, wherein: The pixel points in the color picture have four-element color values, and determining the vertex coordinates of the particles and the frame number corresponding to the particles based on the pixel points in the color picture includes: Based on a first color value of the pixel point and a preset correspondence between the first color value and the frame number, determining the frame number of the frame image to which the particle corresponding to the pixel point belongs; Based on the three second color values of the pixel point and the corresponding relationship between the three preset second color values and the vertex coordinates, the vertex coordinates of the particle corresponding to the pixel point are determined.
9. The method according to claim 8, wherein: The pixel points corresponding to different frame numbers in the color picture are arranged in sequence according to the frame number order, and the method further includes: Determining a third time interval based on the number of pixels between a first pixel and a second pixel among the pixels corresponding to the adjacent frame numbers, wherein the first pixel is the last pixel in the pixel points corresponding to the previous frame number among the adjacent frame numbers, and the second pixel is the first pixel in the pixel points corresponding to the later frame number among the adjacent frame numbers; and The generating target particle animation based on the frame image and the frame number comprises: A target particle animation is generated based on the frame image, the frame number and the third time interval.
10. The method according to claim 1, wherein: The rendering based on the vertex coordinates to generate a frame image includes: Rendering is performed based on the particle vertex coordinates and the particle geometry of the unrendered particle animation corresponding to the color image to generate a frame image.
11. The method according to any one of claims 1 to 10, wherein: The generating target particle animation based on the frame image and the frame number comprises: Based on the frame image and the frame number, a target particle animation in a metaverse scene is generated.
12. A particle animation generating device, comprising: A determination module is configured to determine vertex coordinates of particles and frame numbers corresponding to the particles based on pixels in the color image; A rendering module, configured to perform rendering based on the vertex coordinates to generate a frame image; The generating module is configured to generate a target particle animation based on the frame image and the frame number.
13. The device according to claim 12, wherein: The pixels in the color image have ternary color values, and the determining module is further configured to: Based on the arrangement position of the pixel point in the color image, determining the frame number of the frame image to which the particle corresponding to the pixel point belongs; Based on the color value of the pixel point and the preset correspondence between the coordinates and the color value, the vertex coordinates of the particle corresponding to the pixel point are determined.
14. The device according to claim 13, wherein: in, The pixel points corresponding to different frame numbers in the color image are arranged in sequence according to the frame number order, the pixel points corresponding to different frame numbers are in different rows, and the pixel points corresponding to the same frame number are in the same row, and the frame number of the frame image to which the particle corresponding to the pixel point belongs is determined based on the arrangement position of the pixel point in the color image, including: Based on the row number of the row where the pixel point is located in the color image, the frame number of the frame image to which the particle corresponding to the pixel point belongs is determined.
15. The device according to claim 14, further comprising: A first interval module, the first interval module is configured to determine a first time interval based on the number of rows between rows where pixels corresponding to adjacent frame numbers are located; as well as The generating module is configured to generate a target particle animation based on the frame image, the frame number and the first time interval.
16. The device according to claim 13, wherein: The pixel points corresponding to different frame numbers in the color image are arranged in sequence according to the frame number order, the pixel points corresponding to different frame numbers are in different columns, and the pixel points corresponding to the same frame number are in the same column, and the frame number of the frame image to which the particle corresponding to the pixel point belongs is determined based on the arrangement position of the pixel point in the color image, including: Based on the column number of the column where the pixel point is located in the color image, the frame number of the frame image to which the particle corresponding to the pixel point belongs is determined.
17. The apparatus according to claim 16, further comprising: A second interval module, the second interval module is configured to determine a second time interval based on the number of columns between columns where pixels corresponding to adjacent frame numbers are located; as well as The generating module is configured to generate a target particle animation based on the frame image, the frame number and the second time interval.
18. The device according to claim 13, wherein: The ternary color value is an RGB mode color value, the coordinate is an XYZ coordinate, and the vertex coordinates of the particle corresponding to the pixel point are determined based on the color value of the pixel point and the preset correspondence between the coordinate and the color value, including: Based on the color value of the pixel point and the correspondence between the preset XYZ coordinates and the RGB mode color value, the vertex coordinates of the particle corresponding to the pixel point are determined.
19. The device according to claim 12, wherein: The pixels in the color image have four-element color values, and the determining module is further configured to: Based on a first color value of the pixel point and a preset correspondence between the first color value and the frame number, determining the frame number of the frame image to which the particle corresponding to the pixel point belongs; Based on the three second color values of the pixel point and the corresponding relationship between the three preset second color values and the vertex coordinates, the vertex coordinates of the particle corresponding to the pixel point are determined.
20. The device according to claim 19, wherein The pixels corresponding to different frame numbers in the color image are arranged in sequence according to the frame number order, and the device further includes: a third interval module, the third interval module being configured to determine a third time interval based on the number of pixels between a first pixel and a second pixel in the pixels corresponding to adjacent frame numbers, wherein the first pixel is the last pixel in the pixel points corresponding to the previous frame number in the adjacent frame numbers, and the second pixel is the first pixel in the pixel points corresponding to the frame number that is later in the adjacent frame numbers; and The generating module is further configured to generate a target particle animation based on the frame image, the frame number and the third time interval.
21. The device according to claim 12, wherein: The rendering module is further configured to: Rendering is performed based on the particle vertex coordinates and the particle geometry of the unrendered particle animation corresponding to the color image to generate a frame image.
22. The method according to any one of claims 12 to 21, wherein: The generation module is further configured to: Based on the frame image and the frame number, a target particle animation in a metaverse scene is generated.
23. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 11.
24. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 11.
25. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 11.
Citation Information
Cited By
Method, device and equipment for making animation sequence frame by using particle time recombination
CN119693509A
Method, device and equipment for producing animation sequence frames using particle time recombination
CN119693509B
Particle animation generation method, device and equipment and readable storage medium
CN119963695A
Particle animation generation method, apparatus, device and readable storage medium
CN119963695B
