Animation generation method and device, computer equipment and computer readable storage medium
Through the animation generation method, the animation parameters of the target patch are obtained and processed, the target distance of the block is divided and calculated, and the animation coverage area is determined and displayed. The complex problem of sequence frame animation production is solved, and the animation generation without texture maps is realized, which reduces the difficulty of animation generation and rendering resource consumption.
Patent Information
- Application Number
- CN202411491663.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-03-14
AI Technical Summary
The production of sequence frame animation is complicated, and it requires pre-made texture maps and texture sampling, which makes it difficult to generate animations.
By obtaining the animation parameters of the target patch, dividing the target patch into blocks, calculating the target distance of each block, determining the coverage area of the target shape pattern in the block based on the display change control parameters, and displaying these areas with different display parameters to generate an animation.
Generate animation effects without using texture maps, reducing the difficulty of animation generation and the consumption of computing resources for rendering.
Smart Images

Figure CN119625141A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of animation rendering, and specifically to an animation generation method, apparatus, computer equipment, and computer-readable storage medium, wherein the storage medium is a computer-readable storage medium and the product is a computer program product. Background Art
[0002] Sequence frame animation achieves animation effects by playing a series of key frame images in sequence. To produce sequence frame animation, you need to first create a texture map that contains the textures required for all key frames, and you need to offset the texture coordinates for each key frame to sample textures at different positions in the texture map sequence so that the image content of different key frames is different. Since sequence frame animation has multiple frames, the corresponding texture map production is complicated, which makes animation production difficult. Summary of the Invention
[0003] The embodiments of the present application provide an animation generation method, apparatus, computer device, and computer-readable storage medium, which can generate animation effects without using texture mapping, thereby reducing the difficulty of animation generation.
[0004] An embodiment of the present application provides an animation generation method, comprising:
[0005] Obtaining animation parameters corresponding to a target surface, wherein the animation parameters include division parameters of the target surface for a target shape pattern and display change control parameters corresponding to the target shape pattern;
[0006] Dividing the target surface into at least one block according to the division parameter;
[0007] Calculating the target distance between each pixel point of each block and the center point of the block;
[0008] For each of the blocks, determining, based on the display change control parameter and the target distance between each pixel in the block, a first area covered by the target shape pattern and a second area not covered by the target shape pattern in the block at different times;
[0009] The first area and the second area in the same block are controlled to be displayed with different display parameters to generate a target animation.
[0010] Accordingly, an embodiment of the present application further provides an animation generating device, comprising:
[0011] an acquiring unit, configured to acquire animation parameters corresponding to a target surface, wherein the animation parameters include division parameters of the target surface for a target shape pattern and display change control parameters corresponding to the target shape pattern;
[0012] a partitioning unit, configured to partition the target surface into at least one block according to the partitioning parameter;
[0013] a calculation unit, configured to calculate a target distance between each pixel point of each block and a center point of the block;
[0014] a determining unit configured to determine, for each of the blocks, a first area covered by the target shape pattern and a second area not covered by the target shape pattern in the block at different times based on the display change control parameter and the target distance between pixels of the block;
[0015] The generating unit is used for controlling the first area and the second area in the same block to be displayed with different display parameters to generate a target animation.
[0016] Correspondingly, an embodiment of the present application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any animation generation method provided in the embodiment of the present application.
[0017] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program, and the computer program is loaded by a processor to execute any animation generation method provided in the embodiment of the present application.
[0018] The embodiment of the present application obtains animation parameters corresponding to the target surface, the animation parameters including division parameters of the target surface for the target shape pattern and display change control parameters corresponding to the target shape pattern; divides the target surface into at least one block according to the division parameters; calculates the target distance between each pixel point of each block and the center point of the block; for each block, based on the display change control parameters and the target distance of each pixel point of the block, determines the first area covered by the target shape pattern in the block at different times, and the second area not covered by the target shape pattern; controls the first area and the second area in the same block to be displayed with different display parameters, generates the target animation, and realizes the generation of animation effects without using texture mapping. Since there is no need to pre-make texture mapping, the difficulty of generating animation can be reduced, and since there is no need to perform texture sampling, the rendering power consumption of the animation can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 is a flowchart of the animation generation method provided in an embodiment of the present application;
[0021] Figure 2 This is a schematic diagram showing the effect of the target shape pattern changing over time provided by an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of target shape patterns with different border widths provided in an embodiment of the present application;
[0023] Figure 4 is a schematic diagram of target shape patterns displayed between different blocks provided in an embodiment of the present application;
[0024] Figure 5 is a schematic diagram of an animation generating device provided in an embodiment of the present application;
[0025] Figure 6 It is a structural diagram of the computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0027] The embodiments of the present application provide an animation generation method, apparatus, computer device, and computer-readable storage medium. The animation generation apparatus can be integrated into a computer device, which can be a server or a terminal.
[0028] The terminal may include a mobile phone, a wearable smart device, a tablet computer, a laptop computer, a personal computer (PC), and a vehicle-mounted computer.
[0029] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.
[0030] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.
[0031] This embodiment will be described from the perspective of an animation generating apparatus. The animation generating apparatus may be integrated into a computer device, which may be a server or a terminal.
[0032] An animation generation method provided in an embodiment of the present application is as follows: Figure 1 As shown, the specific process of the animation generation method can be as follows:
[0033] 101. Obtain animation parameters corresponding to a target patch, where the animation parameters include division parameters of a target shape pattern on the target patch and display change control parameters corresponding to the target shape pattern.
[0034] The target patch may be a patch model, which may include a mesh. The target patch may also be one of the patches on a model composed of multiple patches. The target patch may be a rectangle, a triangle or other shapes.
[0035] Among them, the target shape pattern can be a positive direction, a circle or other shapes, and there can be one or more target shape patterns. The division parameter can be used to divide the target surface into one or more blocks, each block is used to present a target shape pattern. If there is only one target shape pattern, then the blocks of the target surface present the same shape pattern. If there are multiple target shape patterns, then the blocks of the target surface can present different shape patterns. The display change control parameter is used to control the change of the target shape pattern in each block, such as size change, color change, etc. The display change control parameter can be used to control the user's target shape pattern to continuously diffuse outward in the block over time, or to continuously shrink inward over time.
[0036] 102. Divide the target surface into at least one block according to a division parameter.
[0037] Since the partition parameter may indicate how to partition the target patch into a plurality of blocks, the target patch may be partitioned into at least one block according to the partition parameter.
[0038] For example, the division parameter may include the number of blocks, and the target surface can be divided into at least one block according to the number of blocks; for another example, the division parameter may be the distribution density of the target shape pattern in the horizontal and vertical directions, and the surface model can be divided into at least one block according to the distribution density; the division parameter can also indicate the position of each block in the target surface, and the target surface can be divided into multiple blocks based on the division parameter. Whether the sizes of the multiple blocks obtained by division are the same or different depends on the division parameter. If the sizes of the blocks obtained by division can be made different by setting the division parameter.
[0039] It can be understood that dividing the target surface into at least one block does not mean splitting the target surface into multiple surfaces. The target surface remains one surface before and after the division. Dividing the target surface into at least one block means distinguishing different areas on the target surface.
[0040] In one embodiment, the target patch may be divided into a plurality of blocks by processing the texture coordinates. That is, in one embodiment, the step of “dividing the target patch into at least one block according to the division parameter” may include:
[0041] Expanding the texture coordinates of each pixel point of the target patch according to the division parameter to obtain the first texture coordinates;
[0042] De-integer the first texture coordinates to obtain second texture coordinates corresponding to each pixel point of the target surface;
[0043] The target surface is divided into a plurality of blocks according to the second texture coordinates, wherein the second texture coordinates of the pixels in each block are distributed within a preset coordinate range.
[0044] Among them, the pixel is the smallest unit of image display, the division parameter can be the number of blocks or the distribution density, the target surface is a surface model, and the texture coordinates corresponding to each pixel point of the target surface are distributed between (0,0) and (1,1). The block density of the surface model in the horizontal and vertical directions can be determined according to the division parameter, and the texture coordinates of each pixel point on the target surface are multiplied according to the block density to expand the texture coordinates to obtain the first texture coordinates.
[0045] Assuming the block density is 2, multiply u and v in the texture coordinates (u, v) of each pixel on the target patch by 2 to obtain the first texture coordinate (2u, 2v).
[0046] Then, remove the integer in the first texture coordinate and retain the decimal part in the first texture coordinate to obtain the second texture coordinate. For example, the first texture coordinate (1.5, 1.5) is decremented to obtain the second texture coordinate (0.5, 0.5). For the first texture coordinate (1.5, 1.5), the first texture coordinate (2.5, 2.5) is decremented to obtain the second texture coordinate (0.5, 0.5). Therefore, by decrementing the first texture coordinate, an independent texture coordinate with linear horizontal and vertical changes can be mapped to each pixel point of the block.
[0047] The target surface can be divided into multiple blocks according to the second texture coordinates, and the second texture coordinates of the pixels in each block meet the preset coordinate range, that is, the second texture coordinates of the pixels in each block are distributed between (0,0) and (1,1).
[0048] 103. Calculate the target distance between each pixel point in each block and the center point of the block.
[0049] Among them, the block center point can be a point located at the center of the block, and the target distance can be the distance between the texture coordinates of the pixel point and the block center point, or the distance between the pixel point and the pixel coordinates of the block center point. It can be selected according to specific needs and is not limited here.
[0050] For example, for each block, the distance between each pixel point of the block and the center point of the block is calculated based on the texture coordinates of the center point of the block and the texture coordinates corresponding to each pixel point in the block to obtain the target distance; for another example, for each block, the distance between each pixel point of the block and the center point of the block is calculated based on the pixel coordinates of the center point of the block and the pixel coordinates of each pixel point in the block to obtain the target distance.
[0051] Alternatively, if the target shape pattern is a rectangle, the target distance may be the maximum distance between the pixel point and the block center point in the u direction and the v direction. That is, in one embodiment, the step of "calculating the target distance between each pixel point in each block and the block center point" may include:
[0052] For each block, calculating a first distance in a first direction and a second distance in a second direction between each pixel point of the block and the center point of the block based on the texture coordinates of each pixel point of the block and the texture coordinates of the center point of the block;
[0053] A target distance between each pixel point of the block and the center point of the block is determined according to the first distance and the second distance.
[0054] Among them, the first direction may refer to the u direction, and the second direction may refer to the v direction. For each block, according to the u component of the texture coordinates of the block center point and the u component of the texture coordinates corresponding to each pixel point in the block, the distance between each pixel point in the block and the center point of the block in the u direction is calculated to obtain the first distance; according to the v component of the texture coordinates of the center point of the block and the v component of the texture coordinates corresponding to each pixel point in the block, the distance between each pixel point in the block and the center point of the block in the v direction is calculated to obtain the second distance.
[0055] The maximum value of the first distance and the second distance is determined as the target distance, so that a first area with a rectangular shape can be determined in the block based on the target distance.
[0056] 104. For each block, determine a first area covered by the target shape pattern and a second area not covered by the target shape pattern in the block at different times based on the display change control parameter and the target distance of each pixel point in the block.
[0057] The display control parameters can be used to control the change in the size of the target shape pattern in the same block over time, and / or to control the difference between the target shape patterns in different blocks. Therefore, based on the display change control parameters and the target distance of each pixel point in the block, the first area covered by the target shape pattern at different times can be mapped out in the block, and the area outside the first area in the block can be determined as the second area not covered by the target shape pattern.
[0058] For example, the display change control parameter may include a change speed, which is the speed at which the size of the target shape pattern changes over time. Size information of the target shape pattern at different moments can be determined based on the change speed and time. That is, in one example, the display change control parameter includes the change speed. The step of "determining, for each block, the first area covered by the target shape pattern in the block at different moments based on the display change control parameter and the target distance between pixels in the block" may include:
[0059] For each block, calculate the size information of the target shape pattern at different times according to the change speed;
[0060] According to the target distance corresponding to each pixel point in the block and the size information of the target shape pattern at different times, the first area covered at different times is determined in each block.
[0061] For example, the relationship between the size of the target shape pattern and the time and change speed can be pre-set, and the size information of the target shape pattern at different times can be calculated based on the change speed and time. For example, when the animation starts playing, the size of the target shape pattern can be the largest, and then the size gradually becomes smaller with time, or when the animation starts playing, the size of the target shape pattern can be the smallest, and then the size gradually becomes larger with time, and the target shape pattern can change cyclically, for example, first changing from the largest to the smallest, and then changing from the largest to the smallest again, and continuously cycling.
[0062] For example, the target shape pattern is a grid. The size of the grid changes from small to large over time, and then changes from small to small again, and the cycle continues. The schematic diagram of the change effect of the grid in a block of the target patch can be shown as follows: Figure 2 shown.
[0063] For different shape patterns, the corresponding size information is different. For example, if the target shape pattern is a circle, the size information may be the radius or diameter; if the target shape pattern is a rectangle, the size information may be the side length of the rectangle.
[0064] For each block, based on the size information of the target shape pattern at different times and the target distance corresponding to each pixel point in the block, determine whether the pixel point is located in the first area covered by the target shape pattern, and determine the first area in the block based on the pixel points determined to be located in the first area.
[0065] For each block, a first area covered by the target shape pattern in the block is determined. Specifically, a boundary condition of the target shape pattern in the block can be determined based on size information of the target shape pattern, and the first area is determined from the block based on the boundary condition. That is, the step of "determining the first area covered at different times in each block based on the target distance corresponding to each pixel in the block and the size information of the target shape pattern at different times" includes:
[0066] For each moment, determining the boundary conditions of the target shape pattern in the block according to the size information of the target shape pattern at the moment;
[0067] According to the boundary conditions corresponding to the target shape pattern at the time, the pixel points whose target distance meets the boundary conditions are determined in the block to obtain the first areas corresponding to different time periods.
[0068] For the first block in the block, the boundary condition of the target shape pattern in the first block can be determined for each moment based on the size information of the target shape pattern at that moment. The boundary condition can indicate a distance threshold of the target distance of the pixel points located in the first area. The pixel points whose target distance meets the boundary condition are determined in the block to obtain the first area of the target shape pattern in the first block at that moment. The first area of the target shape pattern in the first block at each moment can be obtained in the same way.
[0069] The same process may be performed on other blocks to obtain the first area of the target shape pattern in each block at different times.
[0070] Exemplarily, the target shape pattern is a circle, the size information is the radius of the circle, the target distance of the pixel points in the block can be the distance between the pixel points and the center point of the block, the boundary condition can be that the target distance is equal to the radius, or that the difference between the target distance and the radius is equal to zero. For each block, the pixel points whose target distance meets the boundary conditions can be determined in the block based on the boundary conditions at different times, and then the first area can be obtained.
[0071] In another example, the target shape pattern is a rectangle, and the size information is the side length of the rectangle. The target distance of the pixel points in the block can be twice the maximum distance between the pixel point and the center point of the block in the u direction and the v direction. The boundary condition can be that the target distance is equal to the side length of the rectangle, or that the difference between the target distance and the side length of the rectangle is equal to zero. For each block, the pixel points whose target distance meets the boundary conditions can be determined in the block based on the boundary conditions at different times, and then the first area can be obtained.
[0072] Optionally, a border width of the target shape pattern may be set, and boundary conditions may be set based on the border width to adjust the line width of the target shape pattern displayed in the block. That is, in one example, the display change control parameter includes the border width of the target shape pattern, and the boundary conditions include a first boundary condition and a second boundary condition. The step of "determining the boundary condition of the target shape pattern in the block based on the size information of the target shape pattern at each moment" may include:
[0073] For each moment, determining a first boundary condition of the target shape pattern in the block according to size information of the target shape pattern at the moment;
[0074] The second boundary conditions of the target shape pattern in each block at different times are determined according to the border width.
[0075] For the first block in the block, the boundary condition can indicate the distance range of the target distance of the pixel points located in the first area, the first boundary condition can indicate one of the minimum threshold and the maximum threshold of the target distance of the pixel points located in the first area, and the second boundary condition can indicate the other. The pixel points whose target distance meets the boundary condition are determined in the block, and the first area of the target shape pattern in the first block at that moment is obtained. The first area of the target shape pattern in the first block at each moment can be obtained in the same way.
[0076] The same process may be performed on other blocks to obtain the first area of the target shape pattern in each block at different times.
[0077] Exemplarily, the target shape pattern is a circle, the size information is the radius of the circle, the target distance of the pixel point in the block can be the distance between the pixel point and the center point of the block, the first boundary condition can be that the target distance is equal to the radius, or that the difference between the target distance and the radius is greater than or equal to zero, the second boundary condition can be that the target distance is less than or equal to the radius + the border width, or that the difference between the target distance and the radius is less than or equal to the border width. For each block, the pixel points whose target distance meets the boundary conditions can be determined in the block according to the boundary conditions at different times, and then the first area can be obtained.
[0078] In another example, the target shape pattern is a rectangle, and the size information is the side length of the rectangle. The target distance of the pixel points in the block can be twice the maximum distance between the pixel point and the center point of the block in the u direction and the v direction. The first boundary condition can be that the target distance is greater than or equal to the side length of the rectangle, or that the difference between the target distance and the side length of the rectangle is greater than or equal to zero. The second boundary condition can be that the target distance is less than or equal to the side length of the rectangle + the border width, or that the difference between the target distance and the side length of the rectangle is less than or equal to the border width. For each block, the pixel points whose target distance meets the boundary conditions can be determined in the block according to the boundary conditions at different times, and then the first area can be obtained. The difference between the first areas determined by different border widths can be as follows. Figure 3 As shown, Figure 3 The middle is the first area determined based on different border widths. The larger the border width, the thicker the rectangular lines.
[0079] In one embodiment, the first region may be determined from each block by using a function smoothstep().
[0080] At the same moment, the sizes of the target shape patterns in different blocks can be the same or different. If the sizes of the target shape patterns in two blocks are different at the same moment, they can be adjusted by the adjustment parameters corresponding to the blocks. For example, in one embodiment, each block can correspond to a block phase, and the block phase is used to control the size difference of the target shape patterns in different blocks. For example, the target shape pattern corresponds to preset size information. According to the block phase corresponding to each block, the size of the target shape pattern in the block is adjusted so that the size of the target shape pattern in different blocks is different. Exemplarily, at the same moment, the effect of the size of the target shape patterns in different blocks can be as follows. Figure 4 shown.
[0081] Optionally, the size information of the target shape pattern in each block may be calculated based on the change rate, and then the size information may be adjusted based on the block phase. That is, in one embodiment, the step of "calculating the size information of the target shape pattern at different times based on the change rate for each block" includes:
[0082] Determine the initial size information of the target shape pattern at different times based on the product of the change speed and different times;
[0083] For each block, performing differential adjustment processing on the initial size information based on the block phase of the block to obtain adjusted size information of the target shape pattern in the block at different times, wherein the block phases of at least two blocks are different;
[0084] The size information of the target shape pattern in the block at different times is obtained based on the adjusted size information.
[0085] For example, the change speed and the different moments may be multiplied to obtain the initial size information of the target shape pattern at different moments, where the different moments refer to the playing time of the target animation.
[0086] Each block corresponds to a block phase, and the initial size information is differentially adjusted according to the block phase. The initial size information and the block phase may be multiplied to obtain the adjusted size information, or the initial size information and the block phase may be added to obtain the adjusted size information.
[0087] The block phase determines the size of the target shape pattern initially displayed in the block. The difference in block phase between blocks determines the size difference of the target shape pattern displayed between blocks at the same time. In one embodiment, the display change control parameter may further include a phase difference adjustment parameter for adjusting the block phase difference between blocks. The size difference of the target shape pattern displayed between blocks at the same time may be adjusted by the block phase difference. That is, the display change control parameter includes the phase difference adjustment parameter. The step of "for each block, performing difference adjustment processing on the initial size information based on the block phase of the block to obtain adjusted size information of the target shape pattern in the block at different times" may include:
[0088] Adjusting the block phase corresponding to each block according to the phase difference adjustment parameter to obtain an adjusted block phase corresponding to each block;
[0089] The initial size information of each block at different times is adjusted according to the adjusted block phase corresponding to each block, so as to obtain the adjusted size information of the target shape pattern of each block at different times.
[0090] For example, for each block, the phase difference adjustment parameter and the block phase corresponding to the block can be multiplied to adjust the block phase to obtain the adjusted block phase corresponding to the block. By adjusting the block phase through the phase difference adjustment parameter, the phase difference between the blocks can be adjusted, for example, the phase difference between the blocks can be increased or reduced.
[0091] The initial size information corresponding to each block at different times is resized according to the adjusted block phase corresponding to each block. Specifically, the initial size information and the adjusted block phase may be multiplied to obtain the adjusted size information, or the initial size information and the adjusted block phase may be added to obtain the adjusted size information.
[0092] Since the block phases of at least two blocks are different, after the initial size information is adjusted based on the block phases, the adjusted size information corresponding to at least two blocks is different, which can increase the flexibility of changing the target shape pattern in each block.
[0093] After obtaining the adjusted size information, the adjusted size information of the target shape pattern in the block at different times may be used as the size information of the target shape pattern in the block at different times.
[0094] Optionally, the decimal part of the adjusted size information may be retained and used as the size information of the target shape pattern in the block at different times. Assuming that the adjusted size information is 3.2, the decimal part is retained, and the size information obtained is 0.2.
[0095] Alternatively, for each block, the adjusted size information of the target shape at different times is mapped to a fixed value range to obtain size information of the target shape pattern in the block at different times. That is, in one embodiment, the step of "obtaining size information of the target shape pattern in the block at different times based on the adjusted size information" includes:
[0096] The adjusted size information of the target shape pattern in the block at different times is mapped to a fixed value range to obtain the size information of the target shape pattern in the block at different times. The size information changes cyclically within the fixed value range over time.
[0097] Among them, the fixed numerical range can be related to the texture coordinate range or pixel coordinate range of the block. If the block is rectangular, the target shape pattern is circular, and the size information is the radius of the circle, then the fixed numerical range is 0 to 1 / 2 of the minimum side length of the block. If the size information is the diameter of the circle, then the fixed numerical range is 0 to the minimum side length of the block.
[0098] If the target shape pattern is a rectangle and the size information is the side length of the rectangle, the fixed value range can be 0 to the minimum side length of the block. If the texture coordinates of each block are mapped to between (0,0) and (1,1) when the target surface is divided into multiple blocks, then the fixed value range can be [0,1].
[0099] Specifically, for each block, the adjusted size information of the target shape pattern in the block at different times is mapped to a fixed numerical range using the objective function, thereby obtaining the size information of the target shape pattern in the block at different times. If the fixed numerical range is [0, 1], the objective function can map the adjusted size information that changes over time to size information that changes cyclically from 0 to 1 and then back to 0 to 1. The objective function can be a function such as frac().
[0100] The block phase corresponding to each block can be manually preset, or the display change control parameter includes the block phase corresponding to each block. The block phase corresponding to each block can be determined according to the display change control parameter. By controlling the block phase corresponding to the block by the display change control parameter, the difference between blocks can be flexibly set.
[0101] Optionally, a random number may be generated for each block as the block phase, or the block phase may be obtained by mapping according to the texture coordinates of the block. That is, in one embodiment, before the step of "for each block, performing differential adjustment processing on the initial size information based on the block phase of the block to obtain adjusted size information of the target shape pattern in the block at different times", the method further includes:
[0102] Rounding the first texture coordinates of the pixel points of each block to obtain the third texture coordinates of the pixel points of each block;
[0103] A block phase corresponding to each block is generated according to the third texture coordinates of the pixel points of each block.
[0104] The rounding process may be to retain the integers of the coordinate components in the first texture coordinates. For example, if the coordinate component is 1.2, it will be 1 after rounding. For example, if the coordinate component is 2.3, it will be 2 after rounding.
[0105] Since the first texture coordinate is obtained by multiplying the texture coordinates of each pixel on the target surface according to the distribution density of the block patch model in the horizontal and vertical directions, for example, the block density in the horizontal and vertical directions of the target surface is 2, then the u and v in the texture coordinates (u, v) of each pixel on the target surface are multiplied by 2 respectively to obtain the first texture coordinate (2u, 2v). Therefore, the third texture coordinates corresponding to the pixels in the same block are the same, for example, (1,1), (2,2) or (3,3).
[0106] The third texture coordinate corresponding to each block may be mapped to a random number to obtain the block phase corresponding to each block.
[0107] Optionally, a mapping algorithm may be configured to map the third texture coordinate to a block phase to achieve a customized variation effect.
[0108] 105. Control the first area and the second area in the same block to display with different display parameters to generate a target animation.
[0109] The display parameters of the first area and the second area in the same block are different, so the display effects of the first area and the second area are different. The display difference between the first area and the second area visually presents a target shape pattern displayed in the block. Since the first area changes over time, the animation effect is that the target shape pattern changes continuously over time.
[0110] The different display parameters of the first area and the second area may include different textures, different transparencies and / or different colors. The different display parameters of the first area and the second area may be pre-set in the program, or may be configured according to the required effects, such as setting the corresponding parameters in the display change control parameters to control the display effects of the first area and the second area.
[0111] For different colors, different areas can be preset to display different colors. For example, as shown in the figure, the first area can be black and the second area can be white. The colors of the first area and the second area can also be determined by display change control parameters. That is, in one embodiment, the display change control parameters include the background color of the target surface and the border color of the target shape pattern on the target surface. The step of "controlling the first area and the second area in the same block to display with different display parameters to generate the target animation" may include:
[0112] The first area is mapped to a border color, and the second area is mapped to a background color to generate a target animation.
[0113] For example, the display change control parameters may include the background color of the target surface and the border color of the target shape pattern. The background color of the target surface is the color of the second area, and the border color of the target shape pattern is the color of the first area. According to the display change parameters, the first area is mapped to the border color, and the second area is mapped to the background color to generate the target animation.
[0114] The embodiments of the present application can be used to create dynamic lighting effects or other special effects in a virtual scene.
[0115] The embodiment of the present application renders an animation in which at least one target shape pattern changes continuously over time without the need for mapping, such as a diffusion animation or a contraction animation of the target shape pattern. Since the animation can be rendered without the need for mapping, the process of texture mapping required for animation production and the process of sampling the texture mapping are reduced, which can reduce the difficulty of animation production and the computer resources occupied by rendering the animation.
[0116] If an animation effect is generated by means of animation sequence frames, when it is necessary to render an animation in which multiple target shape patterns change continuously over time, it is necessary to produce a corresponding number of facets based on the number of target shape patterns, and set a corresponding texture map for each facet. However, the embodiment of the present application only requires one facet model to generate and render an animation in which multiple target shape patterns change continuously over time, which can further improve the animation production effect.
[0117] In addition, the embodiment of the present application can flexibly control the animation effect by displaying change control parameters, thereby improving the animation change effect.
[0118] As can be seen from the above, the embodiment of the present application obtains animation parameters corresponding to the target surface, and the animation parameters include division parameters of the target surface for the target shape pattern and display change control parameters corresponding to the target shape pattern; divides the target surface into at least one block according to the division parameters; calculates the target distance between each pixel point of each block and the center point of the block; for each block, based on the display change control parameters and the target distance of each pixel point of the block, determines the first area covered by the target shape pattern in the block at different times, and the second area not covered by the target shape pattern; controls the first area and the second area in the same block to be displayed with different display parameters, generates the target animation, and realizes the generation of animation effects without using texture mapping, and since there is no need to pre-make texture mapping, the difficulty of generating animation can be reduced, and no texture sampling is required, which can reduce the computer resources occupied by rendering animation.
[0119] Based on the above embodiment, the following description will be made by taking the target shape pattern as a grid and the animation effect as the grid spreading over time as an example.
[0120] Artists can load the corresponding shader into the model material. The shader contains an algorithm for implementing the animation effect of the grid diffusing over time. They can set the block density and display change control parameters through the provided panel or other means. The display change control parameters may include change speed, phase difference adjustment parameters, border width, border color, and background color.
[0121] After receiving the block density and display change control parameters entered by the artist, the terminal processes the texture coordinates based on the algorithm in the shader to divide the target patch into multiple blocks. Specifically, the block density multiplies the texture coordinates of each pixel on the target patch to expand the texture coordinates and obtain the first texture coordinates. Assuming the block density is 2, the u and v of the texture coordinates (u, v) of each pixel on the target patch are multiplied by 2 to obtain the first texture coordinates (2u, 2v).
[0122] Then, remove the integer in the first texture coordinate and retain the decimal part in the first texture coordinate to obtain the second texture coordinate. For example, the first texture coordinate (1.5, 1.5) is decremented to obtain the second texture coordinate (0.5, 0.5), the first texture coordinate (2.5, 2.5) is decremented to obtain the second texture coordinate (0.5, 0.5), and the first texture coordinate (2.5, 2.5) is decremented to obtain the second texture coordinate (0.5, 0.5). Therefore, by decrementing the first texture coordinate, an independent texture coordinate with linear horizontal and vertical changes can be mapped to each pixel point of each block.
[0123] The target surface can be divided into multiple blocks according to the second texture coordinates, and the second texture coordinates of the pixels in each block meet the preset coordinate range, that is, the second texture coordinates of the pixels in each block are distributed between (0,0) and (1,1).
[0124] The first texture coordinates are rounded to the integer of each coordinate component, obtaining the third texture coordinates. For example, a coordinate component of 1.2 is rounded to 1, and a coordinate component of 2.3 is rounded to 2. Pixels in the same block have the same third texture coordinates, such as (1,1), (2,2), or (3,3).
[0125] The third texture coordinate corresponding to each block may be mapped to a random number to obtain the block phase corresponding to each block.
[0126] For each block, the distance between each pixel in the block and the block center is calculated based on the texture coordinates of the block center and the texture coordinates corresponding to each pixel in the block. The distance is multiplied by 2 to obtain the target distance.
[0127] The size information of a square can be the side length of the square. The relationship between the side length of the square and time can be sideLength = frac(changeSpeed × Time + rand × randAmount), where changeSpeed is the change speed, Time is the time, rand is the block phase corresponding to the block, and randAmount is the phase difference adjustment parameter. The function frac() can realize the side length from 0 to 1, and then from 0 to 1 again, in a continuous cycle. Based on the relationship between the side length of the square and time, the side length of the square at different times can be determined.
[0128] For each block, according to the target distance of each pixel point in the block, the side length of the corresponding square and the border width, a first area that is continuously expanding can be mapped from each square.
[0129] The first area and the second area are mapped to different colors to generate a target animation.
[0130] In order to facilitate better implementation of the animation generation method provided in the embodiment of the present application, an animation generation device is also provided in one embodiment. The meanings of the terms are the same as those in the above animation generation method, and the specific implementation details can be referred to the description in the method embodiment.
[0131] The animation generating device can be integrated into a computer device, such as Figure 5 As shown, the animation generating device may include: an acquiring unit 301, a dividing unit 302, a calculating unit 303, a determining unit 304 and a generating unit 305, specifically as follows:
[0132] (1) An acquisition unit 301 is used to acquire animation parameters corresponding to a target patch. The animation parameters include division parameters of the target patch for a target shape pattern and display change control parameters corresponding to the target shape pattern.
[0133] (2) A division unit 302, configured to divide the target patch into at least one block according to a division parameter.
[0134] In one embodiment, the dividing unit 302 may also be configured to:
[0135] Expanding the texture coordinates of each pixel point of the target patch according to the division parameter to obtain the first texture coordinates;
[0136] De-integer the first texture coordinates to obtain second texture coordinates corresponding to each pixel point of the target surface;
[0137] The target surface is divided into a plurality of blocks according to the second texture coordinates, wherein the second texture coordinates of the pixels in each block are distributed within a preset coordinate range.
[0138] (3) A calculation unit 303 is used to calculate the target distance between each pixel point in each block and the center point of the block.
[0139] In one embodiment, the calculation unit 303 may also be configured to:
[0140] For each block, calculating a first distance in a first direction and a second distance in a second direction between each pixel point of the block and the center point of the block based on the texture coordinates of each pixel point of the block and the texture coordinates of the center point of the block;
[0141] A target distance between each pixel point of the block and the center point of the block is determined according to the first distance and the second distance.
[0142] (4) A determination unit 304 is configured to determine, for each block, a first area covered by the target shape pattern and a second area not covered by the target shape pattern at different times based on the display change control parameter and the target distance of each pixel point in the block.
[0143] In one embodiment, the display change control parameter includes a change speed, and the determination unit 304 may further be configured to:
[0144] For each block, calculate the size information of the target shape pattern at different times according to the change speed;
[0145] According to the target distance corresponding to each pixel point in the block and the size information of the target shape pattern at different times, the first area covered at different times is determined in each block.
[0146] In one embodiment, the determining unit 304 may also be configured to:
[0147] Determine the initial size information of the target shape pattern at different times based on the product of the change speed and different times;
[0148] For each block, performing differential adjustment processing on the initial size information based on the block phase of the block to obtain adjusted size information of the target shape pattern in the block at different times, wherein the block phases of at least two blocks are different;
[0149] The size information of the target shape pattern in the block at different times is obtained based on the adjusted size information.
[0150] In one embodiment, the display change control parameter includes a phase difference adjustment parameter, and the determination unit 304 may further be configured to:
[0151] Adjusting the block phase corresponding to each block according to the phase difference adjustment parameter to obtain an adjusted block phase corresponding to each block;
[0152] The initial size information of each block at different times is adjusted according to the adjusted block phase corresponding to each block, so as to obtain the adjusted size information of the target shape pattern of each block at different times.
[0153] In one embodiment, the determining unit 304 may also be configured to:
[0154] The adjusted size information of the target shape pattern in the block at different times is mapped to a fixed value range to obtain the size information of the target shape pattern in the block at different times. The size information changes cyclically within the fixed value range over time.
[0155] In one embodiment, the determining unit 304 may also be configured to:
[0156] For each moment, determining the boundary conditions of the target shape pattern in the block according to the size information of the target shape pattern at the moment;
[0157] According to the boundary conditions corresponding to the target shape pattern at each time, pixel points whose target distances meet the conditions are determined in the block to obtain the first areas corresponding to different time periods.
[0158] In one embodiment, the display change control parameter includes a border width of the target shape pattern. The determining unit 304 may further be configured to:
[0159] For each moment, determining a first boundary condition of the target shape pattern in the block according to size information of the target shape pattern at the moment;
[0160] The second boundary conditions of the target shape pattern in each block at different times are determined according to the border width.
[0161] In one embodiment, the animation generating device may further include:
[0162] a rounding unit, configured to round the first texture coordinates of the pixel points of each block to obtain the third texture coordinates of the pixel points of each block;
[0163] The phase generating unit is used to generate a block phase corresponding to each block according to the third texture coordinates of the pixel points of each block.
[0164] (5) A generating unit 305 is used to control the first area and the second area in the same block to be displayed with different display parameters to generate a target animation.
[0165] In one embodiment, the display change control parameters include the background color of the target patch and the border color of the target shape pattern on the target patch. The generating unit 305 may also be used to:
[0166] The first area is mapped to a border color, and the second area is mapped to a background color to generate a target animation.
[0167] As can be seen from the above, the animation generation device of the embodiment of the present application obtains the animation parameters corresponding to the target surface through the acquisition unit 301, and the animation parameters include the division parameters of the target shape pattern on the target surface and the display change control parameters corresponding to the target shape pattern; the division unit 302 divides the target surface into at least one block according to the division parameters; the calculation unit 303 calculates the target distance between each pixel point of each block and the center point of the block; the determination unit 304 determines, for each block, the first area covered by the target shape pattern in the block at different times, and the second area not covered by the target shape pattern based on the display change control parameters and the target distance of each pixel point of the block; the generation unit 305 controls the first area and the second area in the same block to be displayed with different display parameters, generates the target animation, and realizes the generation of animation effects without using texture mapping, and since there is no need to pre-make texture mapping, the difficulty of generating animation can be reduced, and no texture sampling is required, which can reduce the computer resources occupied by rendering animation.
[0168] Accordingly, the embodiment of the present application also provides a computer device, which may be a terminal. Figure 6 As shown, Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. Those skilled in the art will appreciate that the computer device structure shown in the figure does not constitute a limitation of the computer device, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0169] The processor 501 is the control center of the computer device 500. It uses various interfaces and lines to connect various parts of the entire computer device 500. By running or loading software programs and / or modules stored in the memory 502 and calling data stored in the memory 502, it executes various functions of the computer device 500 and processes data, thereby monitoring the computer device 500 as a whole.
[0170] In the embodiment of the present application, the processor 501 in the computer device 500 loads instructions corresponding to one or more application processes into the memory 502 according to the following steps, and the processor 501 runs the application stored in the memory 502 to implement various functions:
[0171] Obtaining animation parameters corresponding to the target patch, the animation parameters including division parameters of the target patch for the target shape pattern and display change control parameters corresponding to the target shape pattern;
[0172] Divide the target surface into at least one block according to the division parameter;
[0173] Calculating a target distance between each pixel of each block and the center point of the block; for each block, determining a first area covered by the target shape pattern and a second area not covered by the target shape pattern at different times based on the display change control parameter and the target distance between each pixel of the block;
[0174] The first area and the second area in the same block are controlled to be displayed with different display parameters to generate a target animation.
[0175] The embodiments of the present application realize the generation of animation effects without using texture maps, and since there is no need to pre-produce texture maps, the difficulty of generating animation can be reduced, and the computer resources occupied by rendering animation can be reduced without the need for texture sampling.
[0176] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0177] Optional, such as Figure 6 As shown, the computer device 500 further includes: a touch screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. Among them, the processor 501 is electrically connected to the touch screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507 respectively. It can be understood by those skilled in the art that Figure 6 The computer device structure shown in the figure does not constitute a limitation to the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0178] The touch display screen 503 can be used for displaying a graphical user interface and receiving the operation instructions generated by the user acting on the graphical user interface. The touch display screen 503 can include a display panel and a touch panel. Among them, the display panel can be used for displaying the information input by the user or the information provided to the user and various graphical user interfaces of the computer device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel can be used for collecting the touch operation of the user thereon or near it (such as the user uses any suitable object or accessory such as a finger, a stylus on the touch panel or near the touch panel), and generates corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 501, and can receive the command sent by the processor 501 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event, and then the processor 501 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to realize input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize input and output functions. That is, the touch display screen 503 can also be used as part of the input unit 506 to realize the input function.
[0179] The radio frequency circuit 504 may be used to transmit and receive radio frequency signals, so as to establish wireless communication with a network device or other computer device through wireless communication, and to transmit and receive signals between the network device or other computer device.
[0180] Audio circuit 505 can be used to provide an audio interface between the user and the computer device through a speaker and microphone. Audio circuit 505 can convert received audio data into electrical signals and transmit them to the speaker, which then converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuit 505 and converted into audio data. The audio data is then output to processor 501 for processing, then transmitted via RF circuit 504 to, for example, another computer device, or to memory 502 for further processing. Audio circuit 505 may also include an earphone jack to allow communication between external headphones and the computer device.
[0181] The input unit 506 may be configured to receive input digital, character information, or user feature information (such as fingerprint, iris, or facial information), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
[0182] Power supply 507 is used to supply power to various components of computer device 500. Optionally, power supply 507 can be logically connected to processor 501 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. Power supply 507 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.
[0183] although Figure 6 Not shown in the figure, the computer device 500 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0184] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0185] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0186] To this end, an embodiment of the present application provides a computer-readable storage medium storing a plurality of computer programs, which can be loaded by a processor to execute the steps of any of the animation generation methods provided in the embodiments of the present application. For example, the computer program can execute the following steps:
[0187] Obtaining animation parameters corresponding to the target patch, the animation parameters including division parameters of the target patch for the target shape pattern and display change control parameters corresponding to the target shape pattern;
[0188] Divide the target surface into at least one block according to the division parameter;
[0189] Calculating a target distance between each pixel of each block and the center point of the block; for each block, determining a first area covered by the target shape pattern and a second area not covered by the target shape pattern at different times based on the display change control parameter and the target distance between each pixel of the block;
[0190] The first area and the second area in the same block are controlled to be displayed with different display parameters to generate a target animation.
[0191] The embodiments of the present application realize the generation of animation effects without using texture maps, and since there is no need to pre-produce texture maps, the difficulty of generating animation can be reduced, and the computer resources occupied by rendering animation can be reduced without the need for texture sampling.
[0192] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0193] The storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0194] The above is a detailed introduction to an animation generation method, device, computer equipment and computer storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An animation generation method, characterized in that: include: Acquire animation parameters corresponding to the target surface, wherein the animation parameters include division parameters of the target surface for the target shape pattern and display change control parameters corresponding to the target shape pattern; Dividing the target surface into at least one block according to the division parameter; Calculating the target distance between each pixel point of each block and the center point of the block; For each of the blocks, based on the display change control parameter and the target distance of each pixel point of the block, determining a first area covered by the target shape pattern in the block at different times, and a second area not covered by the target shape pattern; The first area and the second area in the same block are controlled to be displayed with different display parameters to generate a target animation.
2. The method according to claim 1, characterized in that The display change control parameter includes a change speed, and for each of the blocks, determining the first area covered by the target shape pattern in the block at different times based on the display change control parameter and the target distance of each pixel point in the block, comprises: For each of the blocks, calculating size information of the target shape pattern at different times according to the change speed; According to the target distance corresponding to each pixel point in the block and the size information of the target shape pattern at different times, the first covered area at different times is determined in each block.
3. The method according to claim 2, characterized in that The step of calculating the size information of the target shape pattern at different times according to the change speed for each of the blocks includes: Determining initial size information of the target shape pattern at different times according to the product of the change speed and different times; For each block, respectively performing difference adjustment processing on the initial size information based on the block phase of the block to obtain adjusted size information of the target shape pattern in the block at the different time, wherein the block phases of at least two of the blocks are different; The size information of the target shape pattern in the block at the different time points is obtained based on the adjusted size information.
4. The method according to claim 3, characterized in that: The display change control parameter includes a phase difference adjustment parameter, and for each block, the initial size information is subjected to difference adjustment processing based on the block phase of the block to obtain the adjusted size information of the target shape pattern in the block at the different time, including: Adjusting the block phase corresponding to each of the blocks according to the phase difference adjustment parameter to obtain an adjusted block phase corresponding to each of the blocks; The initial size information corresponding to each block at different times is subjected to size adjustment processing according to the adjusted block phase corresponding to each block, so as to obtain the adjusted size information corresponding to the target shape pattern of each block at the different times.
5. The method according to claim 3, characterized in that: The obtaining the size information of the target shape pattern in the block at the different time based on the adjusted size information includes: The adjusted size information of the target shape pattern in the block at the different moments is mapped into a fixed numerical range to obtain the size information of the target shape pattern in the block at the different moments, and the size information changes cyclically within the fixed numerical range over time.
6. The method according to claim 2, characterized in that The determining the first covered area at different times in each of the blocks according to the target distance corresponding to each pixel point in the block and the size information of the target shape pattern at different times includes: For each moment, determining a boundary condition of the target shape pattern in the block according to size information of the target shape pattern at the moment; According to the boundary conditions corresponding to the target shape pattern at the time, the pixel points whose target distance meets the conditions are determined in the block to obtain the first areas corresponding to different time.
7. The method according to claim 6, characterized in that The display change control parameter includes a border width of the target shape pattern, the boundary condition includes a first boundary condition and a second boundary condition, and for each moment, determining the boundary condition of the target shape pattern in the block according to size information of the target shape pattern at the moment, includes: For each moment, determining a first boundary condition of the target shape pattern in the block according to size information of the target shape pattern at the moment; The second boundary conditions of the target shape pattern in each of the blocks at different times are determined according to the border width.
8. The method according to claim 3, characterized in that Before performing difference adjustment processing on the initial size information for each block based on the block phase of the block to obtain the adjusted size information of the target shape pattern in the block at the different time instants, the method further includes: Rounding the first texture coordinates of the pixel points of each block to obtain the third texture coordinates of the pixel points of each block; The block phase corresponding to each of the blocks is generated according to the third texture coordinates of the pixel points of each of the blocks.
9. The method according to claim 1, characterized in that: The step of dividing the target surface into at least one block according to the division parameter comprises: Expanding the texture coordinates of each pixel point of the target surface according to the division parameter to obtain first texture coordinates; De-integering the first texture coordinates to obtain second texture coordinates corresponding to each pixel point of the target surface patch; The target surface is divided into a plurality of blocks according to the second texture coordinates, wherein the second texture coordinates of the pixels in each of the blocks are distributed within a preset coordinate range.
10. The method according to claim 1, characterized in that The display change control parameters include the background color of the target surface and the border color of the target shape pattern on the target surface, and the first area and the second area in the same block are controlled to be displayed with different display parameters to generate the target animation, including: The first area is mapped to the border color, and the second area is mapped to the background color to generate a target animation.
11. The method according to any one of claims 1 to 10, characterized in that: The calculating the target distance between each pixel point of each block and the center point of the block includes: For each of the blocks, according to the texture coordinates of each pixel point of the block and the texture coordinates of the center point of the block, calculate a first distance in a first direction and a second distance in a second direction between each pixel point of the block and the center point of the block; A target distance between each pixel point of the block and a center point of the block is determined according to the first distance and the second distance.
12. An animation generating device, characterized in that: include: An acquisition unit, configured to acquire animation parameters corresponding to a target face, wherein the animation parameters include division parameters of the target face for a target shape pattern and display change control parameters corresponding to the target shape pattern; A division unit, configured to divide the target surface into at least one block according to the division parameter; A calculation unit, used for calculating the target distance between each pixel point of each block and the center point of the block; a determining unit, configured to determine, for each of the blocks, a first area covered by the target shape pattern and a second area not covered by the target shape pattern in the block at different times based on the display change control parameter and the target distance of each pixel point of the block; The generating unit is used to control the first area and the second area in the same block to be displayed with different display parameters to generate a target animation.
13. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the animation generation method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the animation generation method according to any one of claims 1 to 11.