Animation generation method and device, electronic equipment and computer program product

By dividing the model patch into multiple blocks and into grid areas and gap areas, and combining random phase values ​​to generate real-time colors, the problems of complex generation of grid array animations in the existing technology are solved, and efficient and flexible animation generation effects are achieved.

CN119579745APending Publication Date: 2025-03-07NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411657876.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The prior art produces random light and dark animations of grid arrays, and the production process is complex, resulting in high cost and high rendering power consumption, and it is difficult to flexibly adjust the rendering effect.

Method used

By dividing the model patch into multiple blocks, the block is divided into a grid area and a gap area according to the distance between the pixel points in the block and the edge of the block. Then, the gap area is filled with a preset background color, and the real-time color corresponding to each lattice area at different time values ​​is determined based on the random phase value to generate a random light and dark animation of the lattice array.

Benefits of technology

It realizes the random light and dark animation of densely packed square arrays without the need for maps or complex model production, which saves model production time and cost, and reduces rendering memory usage and sampling energy consumption, achieving the purpose of saving rendering power consumption, and flexibly adjusting the rendering effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119579745A_ABST
    Figure CN119579745A_ABST
Patent Text Reader

Abstract

The invention relates to an animation generation method and device, electronic equipment and a computer program product, and belongs to the technical field of computers. The method comprises the following steps: dividing a model patch into a plurality of blocks according to a preset block density; dividing the block into a grid region and a gap region according to the distance from each pixel point in the block to the edge of the block; and filling the gap region with a preset ground color, and determining a real-time color corresponding to each grid region at different time values according to a random phase value so as to generate a random light and shade change animation of the grid array. According to the invention, the model patch is divided into the plurality of blocks, each block is divided into the grid region and the gap region, and the grid region and the gap region are filled with the color, so that the random light and shade change animation of the grid array is generated, and the purposes of saving the manufacturing cost and the rendering power consumption and realizing the flexible adjustment of the rendering effect can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to an animation generation method, an animation generation device, an electronic device, and a computer program product. Background Art

[0002] Procedural textures are computer-generated images that use specific algorithms to create personalized patterns or real natural elements, such as wood, stone, etc. Procedural textures can control the appearance of textures through various parameters, resulting in richer animations and visual effects.

[0003] In procedural textures, random light and dark changes in densely packed grid arrays are a common texture animation, often used in dynamic light source modeling schemes for interior decoration, and are also common design elements in various games and films. Currently, the production process of this type of animation is relatively complicated and requires a lot of production costs.

[0004] In view of this, there is an urgent need in the art for an animation generation method that can save production costs and rendering power consumption, and achieve the purpose of flexibly adjusting rendering effects while generating a random light and dark change animation of a grid array.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] The purpose of the present disclosure is to provide an animation generation method, an animation generation device, an electronic device and a computer program product, which can save production costs and rendering power consumption while generating a random light and dark change animation of a grid array to a certain extent, and achieve the purpose of flexibly adjusting the rendering effect.

[0007] According to a first aspect of the present disclosure, there is provided a method for generating an animation, comprising:

[0008] Divide the model surface into multiple blocks according to the preset block density;

[0009] Dividing the block into a grid area and a gap area according to the distance from each pixel in the block to the edge of the block;

[0010] The gap area is filled with a preset background color, and the real-time color corresponding to each of the square areas at different time values ​​is determined according to the random phase value, so as to generate a random light and dark change animation of the square array.

[0011] According to a second aspect of the present disclosure, there is provided an animation generation device, comprising:

[0012] A block division module is used to divide the model surface into multiple blocks according to a preset block density;

[0013] A region division module, used for dividing the block into a grid region and a gap region according to the distance from each pixel point in the block to the edge of the block;

[0014] The animation generation module is used to fill the gap area with a preset background color, and determine the real-time color corresponding to each of the square areas at different time values ​​according to the random phase value, so as to generate a random light and dark change animation of the square array.

[0015] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-described animation generation methods by executing the executable instructions.

[0016] According to a fourth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the above-mentioned animation generation methods.

[0017] The exemplary embodiments of the present disclosure may have the following beneficial effects:

[0018] In the animation generation method of the example implementation mode of the present disclosure, the model face is divided into multiple blocks, and then the blocks are divided into grid areas and gap areas according to the distance from each pixel point in the block to the edge of the block. The gap areas are then filled with a preset background color, and the real-time color corresponding to each grid area at different time values ​​is determined according to the random phase value, so as to generate a random light and dark change animation of the grid array. The animation generation method in the example implementation of the present disclosure can render a random light and dark change animation of a densely packed grid array without the need for textures or complex model production. On the one hand, the effect can be achieved with only one model face, avoiding the use of more model faces, and the size of the grids and gaps of the model can be arbitrarily divided according to parameters during rendering, thus avoiding the arrangement and size adjustment of complex model faces, thereby saving model production time and production costs; on the other hand, since no texture frame sampling is involved, the game package occupancy is reduced, the rendering video memory occupancy and sampling energy consumption are saved, thereby achieving the purpose of saving rendering power consumption; on the other hand, the various detail effects required by the solution can be easily achieved through parameter adjustment, thereby achieving the purpose of flexibly adjusting the rendering effect and saving the production and adjustment efforts related to various materials.

[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0021] Figure 1 A schematic diagram showing a flow chart of a method for generating an animation according to an exemplary embodiment of the present disclosure;

[0022] Figure 2 A schematic diagram of a process of dividing a block into a grid area and a gap area according to an exemplary embodiment of the present disclosure is shown;

[0023] Figure 3 A schematic diagram showing a process of determining a random phase value according to an exemplary embodiment of the present disclosure is shown;

[0024] Figure 4 A schematic diagram showing a process of determining the real-time color of a grid area according to an exemplary embodiment of the present disclosure;

[0025] Figure 5 A schematic diagram showing a random light and dark change animation of a grid array according to a specific embodiment of the present disclosure is shown;

[0026] Figure 6 A schematic diagram showing a random light and dark change animation of a grid array according to another specific embodiment of the present disclosure is shown;

[0027] Figure 7 A block diagram showing an animation generating device according to an exemplary embodiment of the present disclosure;

[0028] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0030] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0031] In some related embodiments, for the random light and dark change animation of the grid array, since the texture animation of each grid area has a phase difference, the production process that can be used is as follows:

[0032] 1) Write a shader that supports periodic color changes in brightness and darkness. It needs to support loop playback with different periods and different start frames (that is, different periods and phases of brightness and darkness changes);

[0033] 2) Make a model of multiple quadrilaterals forming an array grid on the background color, which is used to render the entire array (this step can also be achieved using the particle system of some game engines, which is convenient for subsequent material random effect settings);

[0034] 3) For each quadrilateral, set different light and dark change start frames and appropriate change speeds to achieve the effect of random light and dark change animation;

[0035] 4) Provide a fixed background color environment, which can be the background color of the scene or another patch model as a substrate.

[0036] However, the process of generating the random light and dark change animation of the grid array in the above-mentioned related embodiments may involve the following problems:

[0037] 1) Each square in the array requires a quadrilateral, so the number of model faces is high;

[0038] 2) The spatial positions of the particles must be carefully arranged into an array, which will consume the workload of the art production staff;

[0039] 3) If there is no suitable particle system to automatically and randomly set material parameters, setting the material square by square will also consume a lot of energy of art production personnel.

[0040] Based on the above problems, this example implementation first provides an animation generation method, which is applied to the pixel shader stage. Figure 1 As shown, the above animation generation method may include the following steps:

[0041] Step S110: Divide the model face into a plurality of blocks according to a preset block density.

[0042] Step S120: Divide the block into a grid area and a gap area according to the distance from each pixel in the block to the edge of the block.

[0043] Step S130: Fill the gap area with a preset background color, and determine the real-time color corresponding to each square area at different time values ​​according to the random phase value, so as to generate a random light and dark change animation of the square array.

[0044] The animation generation method in the example implementation of the present disclosure can render a random light and dark change animation of a densely packed grid array without the need for textures or complex model production. On the one hand, the effect can be achieved with only one model face, avoiding the use of more model faces, and the size of the grids and gaps of the model can be arbitrarily divided according to parameters during rendering, thus avoiding the arrangement and size adjustment of complex model faces, thereby saving model production time and production costs; on the other hand, since no texture frame sampling is involved, the game package occupancy is reduced, the rendering video memory occupancy and sampling energy consumption are saved, thereby achieving the purpose of saving rendering power consumption; on the other hand, the various detail effects required by the solution can be easily achieved through parameter adjustment, thereby achieving the purpose of flexibly adjusting the rendering effect and saving the production and adjustment efforts related to various materials.

[0045] Next, combine Figures 2 to 6 The above steps of this exemplary embodiment are described in more detail.

[0046] In step S110, the model face is divided into a plurality of blocks according to a preset block density.

[0047] In this example implementation, the model UV can be block mapped according to the preset block density, so as to divide the model face into multiple blocks. The model UV can be multiplied according to the preset block density PatternDensity, and the calculation method is as follows:

[0048] float2 UVF=UV*PatternDensity

[0049] Among them, PatternDensity is a two-dimensional vector used to control the grid density in the horizontal and vertical directions. UV is the coordinate of each pixel point before blocking, and UVF is the coordinate of each pixel point after blocking.

[0050] For example, assuming that the model patch is divided into 4×4 blocks, then in order from left to right or from top to bottom, the UV coordinates of the pixels in the first block are 0 to 1, the UV coordinates of the pixels in the second block are 1 to 2, the UV coordinates of the pixels in the third block are 2 to 3, and the UV coordinates of the pixels in the fourth block are 3 to 4.

[0051] In step S120 , the block is divided into a grid area and a gap area according to the distance from each pixel in the block to the edge of the block.

[0052] For each block in the model patch, the block can be divided into a grid area in the middle of the block and a gap area around the grid area according to the distance from each pixel in the block to the edge of the block.

[0053] In this example implementation, Figure 2 As shown, according to the distance from each pixel point in the block to the edge of the block, the block is divided into a grid area and a gap area, which may specifically include the following steps:

[0054] Step S210: Obtain the second coordinate value of each pixel in the block according to the decimal part of the coordinate of each pixel in the block.

[0055] In this example implementation, the decimal part of the coordinates of each pixel point can be taken as the second coordinate value. The calculation method of the second coordinate value UV2 of the pixel point is as follows:

[0056] float2 UV2=frac(UVF)

[0057] The frac function represents taking the decimal part of a number, which is equivalent to mapping an independent horizontal and vertical linearly varying UV2 to each pixel of each block, and the second coordinate value UV2 of the pixel point is between 0 and 1. Using the independent horizontal and vertical linearly varying UV2 mapped by each block, the grid area and the gap area with light and dark changes can be divided.

[0058] Step S220: Calculate the distance field information from the pixel point to the edge of the block according to the second coordinate value of the pixel point.

[0059] In this example implementation, the absolute value of the coordinate difference between the pixel and the block center may be calculated based on the second coordinate value of the pixel, and then the distance field information from the pixel to the block edge may be calculated based on the absolute value of the coordinate difference between the pixel and the block center.

[0060] The absolute value UVDis of the UV difference from the pixel to the center of the block is calculated as follows:

[0061] float2 UVDis=abs(UV2–float2(0.5,0.5))

[0062] Among them, the abs function means taking the absolute value.

[0063] Then, the distance field information SDF from the pixel to the edge of the block is calculated using the absolute value UVDis of the coordinate difference between the pixel and the center of the block:

[0064] float SDF=max(UVDis.x,UVDis.y)*2

[0065] Among them, the max function is used to map the maximum values ​​of the above-mentioned horizontal and vertical values. Multiplying the horizontal and vertical coordinate values ​​by 2 can map the final result to 0 to 1, otherwise it is 0 to 0.5.

[0066] Step S230 : Generate a marking mask for distinguishing between a grid area and a gap area according to the distance field information, and divide the block into a grid area and a gap area according to the marking mask.

[0067] In this example implementation, a marking mask for distinguishing between a grid area and a gap area may be generated according to distance field information and a preset gap width, wherein the marking value of the marking mask in the gap area is a first marking value, and the marking value in the grid area is a second marking value.

[0068] Using the above distance field information SDF, we can calculate the marker mask latticeMask of the grid area and the gap area:

[0069] float latticeMask=step(SDF,1-gapWidth)

[0070] For the marker mask latticeMask, the value of this value in the gap area is the first marker value, for example, the value can be 0, and the value in the grid area is the second marker value, for example, the value can be 1. This value can be used as a marker to map the color of the gap and the grid. gapWidth is the preset gap width, which is used to control the width of the gap area. It can be set according to requirements. The value range of gapWidth is 0≤gapWidth≤1. The step function can be used to segment the image to achieve a certain gradient effect or simulate the lighting effect.

[0071] In this example implementation, the texture is divided into blocks, and then the distance from the pixels of each block to the edge of the block is calculated, so that the grid areas with varying brightness and the gap areas between the grids can be flexibly set.

[0072] In step S130, the gap area is filled with a preset background color, and the real-time color corresponding to each square area at different time values ​​is determined according to the random phase value, so as to generate a random light and dark change animation of the square array.

[0073] After dividing the gap area and grid area in each block, these two areas are filled with colors respectively, where the gap area is a fixed background color, and the grid area is filled with a color that changes light and dark over time, thereby generating a random light and dark change animation of the grid array.

[0074] In this example implementation, Figure 3 As shown, before determining the real-time color corresponding to each grid area at different time values ​​according to the random phase value, the following steps may also be included:

[0075] Step S310: Obtain the first coordinate value of each pixel point in the block according to the integer part of the coordinate of each pixel point in the block.

[0076] In this exemplary implementation, the integer part can be taken from the coordinates of each pixel point as the first coordinate value. The calculation method of the first coordinate value UV1 of the pixel point is as follows:

[0077] float2 UV1=floor(UVF)

[0078] The floor function represents rounding of numbers, that is, a uniform two-dimensional integer vector UV1 is mapped to each pixel in each block.

[0079] For example, assuming that the model patch is divided into 4×4 blocks, then in order from left to right or from top to bottom, the first coordinate value UV1 of the pixel points in the first block is 0, the first coordinate value UV1 of the pixel points in the second block is 1, and so on.

[0080] Step S320: Determine the random scalar value corresponding to the block according to the first coordinate value of each pixel point in the block.

[0081] The independent two-dimensional values ​​UV1 mapped from the above blocks are mapped again to a random scalar value rand, which is used for random control of the brightness and darkness of the grid. The calculation method of the random scalar value is as follows:

[0082] float rand=random01(UV1)

[0083] The random01 function represents randomly mapping a two-dimensional vector to a decimal rand between 0 and 1. There are many specific random mapping algorithms, which are not specifically limited in this example implementation.

[0084] Step S330: Determine the random phase value corresponding to the grid area in the block according to the random scalar value corresponding to the block.

[0085] The random scalar value rand can be used to obtain the random phase value corresponding to the grid area, and the color latticeColor that controls the real-time change of each grid can be mapped with the time value.

[0086] In this example implementation, Figure 4 As shown, the real-time color corresponding to each grid area at different time values ​​is determined according to the random phase value, which may specifically include the following steps:

[0087] Step S410: Obtain the color change function corresponding to the grid area according to the random phase value, and the preset grid color change rate and phase random degree parameters.

[0088] The color change function latticeChange corresponding to the grid area is calculated as follows:

[0089] float latticeChange=sin(changeSpeed*Time+rand*randAmount)

[0090] Among them, Time is the current running time of the program, the square color change rate changeSpeed ​​and the phase randomness parameter randAmount are pre-set values, changeSpeed ​​represents the speed of the change of the brightness of each block, and randAmount represents the randomness of the phase difference of the color change of each block (when this value is 0, the diffusion of each block is completely in phase). After the sine function sin calculation, the final result latticeChange is used to map the color of the square.

[0091] Step S420: Determine the real-time color corresponding to the grid area at different time values ​​according to the color change function corresponding to the grid area.

[0092] In this example implementation, the real-time colors of the grid area corresponding to different time values ​​may be determined according to the color change function corresponding to the grid area, and the preset first grid color value and second grid color value.

[0093] In this example implementation, latticeChange linear interpolation can be used to control the real-time changing lattice color latticeColor:

[0094] float3 latticeColor=lerp(latticeColorSet01,latticeColorSet02,latticeChange)

[0095] Among them, lerp is a linear interpolation function, latticeColorSet01 and latticeColorSet02 are the preset color values ​​of the first square and the second square, which represent the specific RGB colors of each square at the brightest and darkest moments respectively.

[0096] Finally, use the latticeMask information obtained above to distinguish the colors of the gaps and squares, and get the final color output output:

[0097] float3 output=lerp(gapColorSet,latticeColor,latticeMask)

[0098] Among them, the gap background color preset by gapColorSet represents the RGB color of the gap area.

[0099] In this example implementation, the gap areas of the grid are uniformly colored and the light and dark changes of the grid areas are mapped using time changes to generate a dynamic change effect. Random number mapping can also be used to create a time difference in the light and dark effects of each block to achieve a more random effect.

[0100] Figure 5 A schematic diagram of a random light and dark change animation of a grid array according to a specific embodiment of the present disclosure is shown, and the left and right figures respectively show the color display of the grid array corresponding to different moments.

[0101] Figure 6 A schematic diagram showing a random light and dark change animation of a grid array in another specific embodiment of the present disclosure is shown in FIG. Figure 5The schematic diagram after modifying the grid spacing parameters based on is shown on the left and right. The two figures on the left and right are the color displays of the grid array corresponding to different moments.

[0102] In this example implementation, after the shader of the above algorithm is loaded into the model material, the above parameters can be flexibly controlled in the application stage to adjust the final effect. The adjustable parameters are as follows:

[0103] 1) Use patternDensity to adjust the distribution density of the grid (that is, the size of each grid);

[0104] 2) Use gapWidth to control the relative size of the grid and the gap;

[0105] 3) Use latticeColorSet01 and latticeColorSet02 to control the brightest and darkest colors of each grid when the color changes;

[0106] 4) Use gapColorSet to control the color of the gaps between squares;

[0107] 5) Use changeSpeed ​​to control the speed of the grid color cycle;

[0108] 6) Use randAmount to control the size of the random phase difference of each square color cycle, that is, the degree of randomness of the change.

[0109] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0110] Furthermore, the present disclosure also provides an animation generation device. Figure 7 As shown, the animation generation device may include a block division module 710, a region division module 720 and an animation generation module 730. Among them:

[0111] The block division module 710 may be used to divide the model surface into a plurality of blocks according to a preset block density;

[0112] The region division module 720 may be used to divide the block into a grid region and a gap region according to the distance from each pixel point in the block to the edge of the block;

[0113] The animation generation module 730 can be used to fill the gap area with a preset background color, and determine the real-time color corresponding to each square area at different time values ​​according to the random phase value, so as to generate a random light and dark change animation of the square array.

[0114] In some exemplary embodiments of the present disclosure, an animation generation device provided by the present disclosure may further include a random phase value determination module, which may include a first coordinate value determination unit, a random scalar value determination unit, and a random phase value determination unit. Wherein:

[0115] The first coordinate value determining unit may be used to obtain the first coordinate value of each pixel point in the block according to the integer part of the coordinate of each pixel point in the block;

[0116] The random scalar value determination unit may be used to determine the random scalar value corresponding to the block according to the first coordinate value of each pixel point in the block;

[0117] The random phase value determination unit may be used to determine the random phase value corresponding to the grid area in the block according to the random scalar value corresponding to the block.

[0118] In some exemplary embodiments of the present disclosure, the region division module 720 may include a second coordinate value determination unit, a distance field information determination unit, and a mark mask division unit.

[0119] The second coordinate value determination unit may be used to obtain the second coordinate value of each pixel point in the block according to the decimal part of the coordinate of each pixel point in the block;

[0120] The distance field information determination unit may be used to calculate the distance field information from the pixel point to the edge of the block according to the second coordinate value of the pixel point;

[0121] The mark mask division unit may be used to generate a mark mask for distinguishing between a grid area and a gap area according to the distance field information, and divide the block into the grid area and the gap area according to the mark mask.

[0122] In some exemplary embodiments of the present disclosure, the distance field information determining unit may include a coordinate difference absolute value calculating unit and a distance field information calculating unit.

[0123] The coordinate difference absolute value calculation unit may be used to calculate the coordinate difference absolute value between the pixel point and the center point of the block according to the second coordinate value of the pixel point;

[0124] The distance field information calculation unit may be used to calculate the distance field information from the pixel point to the edge of the block according to the absolute value of the coordinate difference between the pixel point and the center point of the block.

[0125] In some exemplary embodiments of the present disclosure, the mark mask division unit may include a mark mask generation unit, which can be used to generate a mark mask for distinguishing a grid area and a gap area based on distance field information and a preset gap width, wherein the mark value of the mark mask in the gap area is a first mark value, and the mark value in the grid area is a second mark value.

[0126] In some exemplary embodiments of the present disclosure, the animation generation module 730 may include a color change function determination unit and a grid real-time color determination unit.

[0127] The color change function determination unit can be used to obtain the color change function corresponding to the grid area according to the random phase value, and the preset grid color change rate and phase random degree parameters;

[0128] The grid real-time color determination unit can be used to determine the real-time colors corresponding to the grid area at different time values ​​according to the color change function corresponding to the grid area.

[0129] In some exemplary embodiments of the present disclosure, the grid real-time color determination unit may include a grid color value determination unit, which can be used to determine the real-time color corresponding to the grid area at different time values ​​based on the color change function corresponding to the grid area, and the preset first grid color value and second grid color value.

[0130] The specific details of each module / unit in the above-mentioned animation generation device have been described in detail in the corresponding method embodiment part, and will not be repeated here.

[0131] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0132] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure is shown.

[0133] It should be noted that Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0134] like Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803. In the RAM 803, various programs and data required for system operation are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0135] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.

[0136] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 809, and / or installed from a removable medium 811. When the computer program is executed by a central processing unit (CPU) 801, various functions defined in the system of the present disclosure are executed.

[0137] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above-mentioned animation generation method is implemented.

[0138] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.

[0139] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.

[0140] The code of the computer program can be written in one or more programming languages. Programming languages ​​such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).

[0141] The computer program may be carried or transmitted via electrical, magnetic, optical, electromagnetic, infrared, or other signals. The electronic device may convert the signal carrying the computer program into a digital signal, thereby running the computer program. When the computer program is run on an electronic device, its code is used to enable the electronic device to execute (more specifically, the processor of the electronic device may execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned animation generation method.

[0142] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0143] It should be noted that, although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules described above can be concretized in one module. Conversely, the features and functions of one module described above can be further divided into multiple modules to be concretized.

[0144] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.

[0145] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for generating an animation, characterized in that: include: Divide the model surface into multiple blocks according to the preset block density; Dividing the block into a grid area and a gap area according to the distance from each pixel in the block to the edge of the block; The gap area is filled with a preset background color, and the real-time color corresponding to each of the square areas at different time values ​​is determined according to the random phase value, so as to generate a random light and dark change animation of the square array.

2. The method for generating an animation according to claim 1, characterized in that: Before determining the real-time color corresponding to each of the grid areas at different time values ​​according to the random phase value, the method further includes: Obtaining a first coordinate value of each pixel point in the block according to the integer part of the coordinate of each pixel point in the block; Determine a random scalar value corresponding to the block according to the first coordinate value of each pixel point in the block; The random phase value corresponding to the grid area in the block is determined according to the random scalar value corresponding to the block.

3. The method for generating an animation according to claim 1, characterized in that: The step of dividing the block into a grid area and a gap area according to the distance between each pixel point in the block and the edge of the block includes: Obtaining a second coordinate value of each pixel point in the block according to a decimal part of the coordinate of each pixel point in the block; Calculating distance field information from the pixel point to the edge of the block according to the second coordinate value of the pixel point; A mark mask for distinguishing the square area and the gap area is generated according to the distance field information, and the block is divided into the square area and the gap area according to the mark mask.

4. The method for generating an animation according to claim 3, characterized in that: The calculating the distance field information from the pixel point to the edge of the block according to the second coordinate value of the pixel point includes: Calculate the absolute value of the coordinate difference between the pixel point and the center point of the block according to the second coordinate value of the pixel point; The distance field information from the pixel point to the edge of the block is calculated according to the absolute value of the coordinate difference between the pixel point and the center point of the block.

5. The method for generating an animation according to claim 3, characterized in that: The step of generating a mark mask for distinguishing the grid area from the gap area according to the distance field information comprises: A marking mask for distinguishing the grid area and the gap area is generated according to the distance field information and a preset gap width, wherein the marking value of the marking mask in the gap area is a first marking value, and the marking value in the grid area is a second marking value.

6. The method for generating an animation according to claim 1, characterized in that: Determining the real-time color corresponding to each of the grid areas at different time values ​​according to the random phase value includes: According to the random phase value, and the preset square color change rate and phase random degree parameters, a color change function corresponding to the square area is obtained; The real-time colors corresponding to the square area at different time values ​​are determined according to the color change function corresponding to the square area.

7. The method for generating an animation according to claim 6, characterized in that: Determining the real-time color corresponding to the square area at different time values ​​according to the color change function corresponding to the square area includes: According to the color change function corresponding to the square area, and the preset first square color value and second square color value, the real-time color corresponding to the square area at different time values ​​is determined.

8. An animation generating device, characterized in that: include: A block division module is used to divide the model surface into multiple blocks according to a preset block density; A region division module, used for dividing the block into a grid region and a gap region according to the distance from each pixel point in the block to the edge of the block; The animation generation module is used to fill the gap area with a preset background color, and determine the real-time color corresponding to each square area at different time values ​​according to the random phase value, so as to generate a random light and dark change animation of the square array.

9. An electronic device, characterized in that: include: processor; as well as A memory for storing one or more programs, which, when executed by the processor, enables the processor to implement the animation generation method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for generating an animation according to any one of claims 1 to 7 is implemented.