Animation generation method and device and electronic equipment

By obtaining the animation information of the water body model and generating frame maps, the problems of low animation production efficiency and inaccurate drawing effects in the existing technology are solved, and efficient and accurate animation generation is achieved.

CN120070689APending Publication Date: 2025-05-30NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411937580.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, when creating an animation effect where water bodies come into contact with the surface of the object and wet the object, hand-drawing the texture is required, resulting in low animation production efficiency and low precision in the drawing effect.

Method used

By obtaining the animation information of the water body model, the contact position of the contact body model is determined, and the frame map corresponding to the animation frame is generated based on this, including the model position and humidity information in the target model, and the animation of the target model is directly rendered.

Benefits of technology

Without hand-drawing stickers, you can directly obtain animation information to generate frame stickers sequences, which improves animation production efficiency and the accuracy of texture drawing effects, and can automatically generate animated frame stickers sequences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070689A_ABST
    Figure CN120070689A_ABST
Patent Text Reader

Abstract

The invention provides an animation generation method and device and electronic equipment, and the method comprises the steps: obtaining animation information of a water body model; wherein the animation information comprises a water body state in multiple continuous animation frames; determining a contact position of a contact water body model from the target model based on the water body state in the animation frame; generating a frame map corresponding to the animation frame based on the contact position; wherein the frame map comprises a model position in the target model and humidity information of the model position; and obtaining a frame map, and mapping the frame map to the target model to render to obtain an animation of the target model. In the mode, the wetting area of the target model is determined according to the water body contact condition, so that the frame map sequence of the animation can be automatically generated, and the animation production efficiency and the accuracy of the map drawing effect are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of games, and in particular, to an animation generation method, device, and electronic device. Background Art

[0002] In order to produce an animation effect in which water contacts the surface of an object and wets the object, in the related art, two texture maps need to be drawn. One is the state of the object when it first contacts the water, and the other is the state of the object when it is finally wet by the water. Then, interpolation is performed between these two texture maps to obtain the animation effect of the object being gradually wet. However, this method requires staff to hand-draw texture maps, resulting in low animation production efficiency and low precision of the drawing effect. Summary of the Invention

[0003] In view of this, an object of the present invention is to provide an animation generation method, device, and electronic device to improve the animation production efficiency and the precision of the texture map drawing effect.

[0004] In a first aspect, an embodiment of the present invention provides an animation generation method, which includes: obtaining animation information of a water body model; wherein, the animation information includes: the water body states in multiple consecutive animation frames; determining a contact position where the water body model contacts the target model based on the water body state in the animation frame; generating a frame texture map corresponding to the animation frame based on the contact position; wherein, the frame texture map includes: the model position in the target model and the humidity information of the model position; obtaining the frame texture map and mapping the frame texture map to the target model to render the animation of the target model.

[0005] In a second aspect, an embodiment of the present invention further provides an animation generation device, which includes: an animation information acquisition module for obtaining animation information of a water body model; wherein, the animation information includes: the water body states in multiple consecutive animation frames; a contact position determination module for determining a contact position where the water body model contacts the target model based on the water body state in the animation frame; a frame texture map generation module for generating a frame texture map corresponding to the animation frame based on the contact position; wherein, the frame texture map includes: the model position in the target model and the humidity information of the model position; a mapping and rendering module for obtaining the frame texture map and mapping the frame texture map to the target model to render the animation of the target model.

[0006] In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a memory. The memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the above-mentioned animation generation method.

[0007] Fourthly, embodiments of the present disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when called and executed by a processor, cause the processor to implement the above-mentioned animation generation method.

[0008] The embodiments of the present invention bring the following beneficial effects:

[0009] For the above-mentioned animation generation method, device and electronic device, animation information of a water body model is obtained; wherein, the animation information includes: the water body states in multiple consecutive animation frames; based on the water body states in the animation frames, the contact positions where a target model contacts the water body model are determined from the target model; based on the contact positions, frame texture maps corresponding to the animation frames are generated; wherein, the frame texture maps include: the model positions in the target model and the humidity information of the model positions; the frame texture maps are obtained and mapped to the target model to render the animation of the target model. In this way, there is no need for staff to hand-draw texture maps. The animation information of the water body model can be directly obtained to get the water body states in multiple consecutive animation frames, and the contact positions where the target model contacts the water body model are determined from the target model according to the water body states, and then the frame texture maps corresponding to each animation frame are generated. This way determines the wetted area of the target model according to the water body contact situation, so that a sequence of frame texture maps of the animation can be automatically generated, improving the animation production efficiency and the accuracy of the texture map drawing effect.

[0010] Other features and advantages of the present invention will be described in the following specification, and some of them will become obvious from the specification or be understood by implementing the present invention. The objectives and other advantages of the present invention are achieved and obtained by the structures specifically pointed out in the specification, claims and drawings.

[0011] To make the above objectives, features and advantages of the present invention more obvious and understandable, the following specific preferred embodiments are given and described in detail in conjunction with the accompanying drawings. Description of the Drawings

[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative efforts.

[0013] Figure 1 It is a flowchart of an animation generation method provided by an embodiment of the present invention;

[0014] Figure 2 It is a schematic diagram of creating follicle points on the surface of a target model provided by an embodiment of the present invention;

[0015] Figure 3 Schematic diagram for determining the contact position of the water contact model on the target model provided by an embodiment of the present invention;

[0016] Figure 4 Schematic diagram of the target model and the UV coordinate system provided by an embodiment of the present invention;

[0017] Figure 5 Schematic diagram of a target texture map including a specified pixel region provided by an embodiment of the present invention;

[0018] Figure 6 Another schematic diagram of a target texture map including a specified pixel region provided by an embodiment of the present invention;

[0019] Figure 7 Schematic diagram for rendering the target model according to the frame texture map corresponding to the animation frame provided by an embodiment of the present invention;

[0020] Figure 8 Schematic diagram of the structure of an animation generation device provided by an embodiment of the present invention;

[0021] Figure 9 Schematic diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0022] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0023] The following explains the terms related to the present invention.

[0024] UV: In computer graphics and 3D modeling, UV mapping is a technology for applying a 2D texture image to the surface of a 3D model; UV coordinates are coordinates in a 2D space used to represent positions on the texture image; through UV mapping, the texture image can be accurately fitted to the surface of the 3D model, thereby adding color, details and material effects to the 3D model.

[0025] Currently, in order to produce an animation effect in which water contacts the surface of an object and wets the object, it is usually necessary to manually draw the wet area by staff according to the contact area between the water and the object. Different brushes and texture effects can be used to simulate the edges of water droplets and wet areas, so as to produce the wet effect generated by the collision between the water and the surface of the object. However, the above operations consume high time costs and labor costs.

[0026] In the related art, a three-dimensional drawing tool can be used to manually draw a wet area on a model. First, two texture maps need to be drawn. One is the state of the object when it first touches the water body, and the other is the state of the object when it is finally wet by the water body. Then, interpolation is performed between these two texture maps to obtain an animation effect of the object being gradually wet. However, this method requires staff to hand-draw texture maps, resulting in low animation production efficiency, low precision of the drawing effect, and great adjustment difficulty.

[0027] Based on this, an animation generation method, device, and electronic device provided by an embodiment of the present invention can be applied to a texture map sequence for making animation frames in three-dimensional software to achieve a dynamic dry-wet effect.

[0028] For ease of understanding of this embodiment, first, a detailed introduction to an animation generation method disclosed by an embodiment of the present invention is provided. This method can run on a local terminal device or a server and is applicable to various three-dimensional software, such as Maya software. As Figure 1 shown, this method includes the following steps:

[0029] Step S102, obtain animation information of the water body model; wherein, the animation information includes: the water body state in multiple consecutive animation frames;

[0030] In an animation containing a water body model, the water body states of different animation frames are usually different. This water body state can be the position, shape, etc. of the water body model in the animation frame. The water body model can be displayed as falling water droplets, a pool of water, or flowing water on the surface of an object in the animation frame.

[0031] Specifically, obtain the animation information of the water body model to obtain the water body state in multiple consecutive animation frames. For example, obtain the animation of the water body model flowing or the water body model colliding with an object from the system, and traverse each animation frame of this animation to obtain the position, shape, etc. of the water body model in each animation frame.

[0032] Step S104, based on the water body state in the animation frame, determine the contact position where the target model contacts the water body model;

[0033] The target model can be a ground model, a rock model, a tree model, etc., and a partial area of the water body model contacts the target model.

[0034] Specifically, first, the three-dimensional target model is converted into a two-dimensional UV coordinate system, and each coordinate point in the UV coordinate system corresponds to a model position of the target model; in the UV coordinate system, the position coordinates of the hair follicle points are evenly set at a preset interval. For example, if the preset interval is 2 unit lengths, then a position coordinate of a hair follicle point is set every 2 unit lengths, and a mapping relationship between the position coordinates of the hair follicle points and the model positions of the target model is established. Then, according to the mapping relationship between the position coordinates and the model positions, the hair follicle points are created on the surface of the target model. Here, if the preset interval is smaller, then the hair follicle points on the surface of the target model are denser, and the detection accuracy for the contact positions in the target model is higher.

[0035] It should be noted that the mapping relationship between the position coordinates of the hair follicle points and the model positions of the target model is usually a one-to-one correspondence to avoid one position coordinate mapping to multiple model positions, that is, one position coordinate corresponding to multiple hair follicle points, resulting in the situation of UV overlap.

[0036] Furthermore, according to the water body state in the animation frame, the distance between the hair follicle points and the water body model can be obtained. If the distance is less than the preset distance value, then the hair follicle points corresponding to the distance are determined as the target hair follicle points, and the model positions of the target hair follicle points on the target model are obtained as the contact positions on the surface of the target model when the target model contacts the water body model.

[0037] In the above method, determining the contact positions in the target model according to the water body state in the animation frame makes it simpler and more convenient to detect the area of the target model wetted by the water body.

[0038] Step S106: Generate a frame texture map corresponding to the animation frame based on the contact positions; wherein, the frame texture map includes: the model positions in the target model and the humidity information of the model positions.

[0039] This frame texture map contains the model positions in the target model. That is to say, after mapping the position coordinates of the hair follicle points to the pixel positions of the frame texture map, there is a mapping relationship between the pixel positions in the frame texture map and the model positions corresponding to the hair follicle points on the surface of the target model.

[0040] This humidity information can specifically include a completely wet state, a completely dry state, and an intermediate transition state. The intermediate transition state can be a relatively wet state such as a humidity percentage of 60, or a relatively dry state such as a humidity percentage of 40; the humidity information can usually be determined according to the pixel values in the frame texture map. If the pixel values of the pixel positions in the frame texture map are different, then the humidity information of the model positions in the target model is different.

[0041] Specifically, after the terminal determines the contact position of the contact water body model from the target model, according to the mapping relationship between the model position of the target model and the position coordinates of the hair follicle points, it extracts the position coordinates of the target hair follicle points from the UV coordinate system to obtain the target UV values; then, according to the target UV values and the mapping relationship between the position coordinates of the hair follicle points and the pixel positions of the frame texture map, in the target texture map, the area composed of the pixel positions corresponding to the position coordinates of the target hair follicle points is determined as the specified pixel area, and a graphic with a preset radius such as a circle is generated at the pixel positions corresponding to the position coordinates of the target hair follicle points. The pixels in the specified pixel area are set to the specified pixel value, and the specified pixel value indicates that the model position of the target model is in a completely wet state, that is, the humidity percentage at this model position is 100. The target texture map containing the specified pixel area can be determined as the texture map corresponding to the animation frame.

[0042] It can be understood that if the position coordinates of the target hair follicle points are denser, then the preset radius of the graphic generated at the pixel positions corresponding to the position coordinates of the target hair follicle points should be smaller, and the accuracy of the drawing effect for the wet area in the texture map is higher.

[0043] Here, the terminal determines the target texture map according to whether the animation frame is the first frame in a multi-frame continuous animation frame. When the animation frame is the first frame, the terminal obtains a preset texture map and uses the preset texture map as the target texture map of the animation frame. The pixels in the preset texture map are set with a preset pixel value, and the preset pixel value indicates that the model position of the target model is in a completely dry state, that is, the humidity percentage at this model position is 0; when the animation frame is not the first frame, the terminal determines the texture map corresponding to the previous animation frame of the animation frame as the target texture map. In a preferred manner, the preset pixel value is assigned 0, so that the pixel positions with a pixel value of 0 in the preset texture map indicate a completely dry state, and the color of the pixel positions is black; and, the specified pixel value is assigned 1, so that the pixel positions with a pixel value of 1 in the texture map indicate a completely wet state, and the color of the pixel positions is white.

[0044] This step of generating the texture map according to the contact position is beneficial to drawing the wet position in the target model and improving the accuracy of the drawing effect.

[0045] Step S108, obtain the texture map and map the texture map to the target model to render the animation of the target model.

[0046] Specifically, the terminal obtains multiple texture maps corresponding to multiple frame continuous animation frames, determines the specified pixel area for each texture map according to the mapping relationship between the pixel positions of each texture map and the position coordinates of the hair follicle points, and then maps the texture map corresponding to the animation frame to the target model according to the mapping relationship between the model position of the target model and the position coordinates of the hair follicle points.

[0047] Next, according to the pixel values in the frame texture map, obtain the humidity information of the model position indicated by the pixel values, and determine the rendering parameters of the model position based on the humidity information, and then render the target model. The rendering parameters can be parameters such as reflectivity, refractive index, transparency, and roughness. By adjusting the numerical values of the rendering parameters, the rendering effect obtained by rendering the target model can be controlled, so that the rendering effect of the model position matches the humidity information of the model position. For example, apply the frame texture map to the material of the target model. Here, assign the frame texture map to the corresponding attribute of the material, so as to adjust the numerical values of the rendering parameters and render the target model.

[0048] In the above method, by rendering the target model according to the humidity information of the model position included in the frame texture map to obtain the animation of the target model, the animation production efficiency can be improved.

[0049] In the above animation generation method, obtain the animation information of the water body model; wherein, the animation information includes: the water body state in multiple consecutive animation frames; based on the water body state in the animation frame, determine the contact position where the target model contacts the water body model from the target model; based on the contact position, generate a frame texture map corresponding to the animation frame; wherein, the frame texture map includes: the model position in the target model and the humidity information of the model position; obtain the frame texture map, map the frame texture map to the target model, and render to obtain the animation of the target model. In this method, there is no need for staff to hand-draw texture maps. The water body state in multiple consecutive animation frames can be directly obtained from the animation information of the water body model. According to the water body state, determine the contact position where the target model contacts the water body model from the target model, and then generate a frame texture map corresponding to each animation frame. This method determines the wetted area of the target model according to the water body contact situation, so that a sequence of frame texture maps of the animation can be automatically generated, improving the animation production efficiency and the accuracy of the texture map drawing effect.

[0050] The following embodiments provide a specific implementation manner for determining the contact position where the target model contacts the water body model from the target model.

[0051] Specifically, create follicle points on the surface of the target model; obtain the distance between the follicle points and the water body model, and determine the target follicle points with a distance less than a preset distance value; determine the model position of the target follicle points on the target model as the contact position where the target model contacts the water body model.

[0052] The above follicle points are usually evenly created on the surface of the target model. Optionally, generate follicles at the follicle points. The initial shape of the follicles is a sphere with a preset radius. When the distance between the follicle points and the water body model is less than the preset distance value, the follicles contact the water body model; according to the model position corresponding to the follicle points, determine the target shape of the follicles generated at the follicle points. For example, when the model position corresponding to the follicle points is located at the edge of the target model, the target shape of the follicles generated at the follicle points may be an ellipsoid. Mapping the follicles at the follicle points can display the graphics corresponding to the follicle shape.

[0053] In Figure 2 it, taking the target model as the ground model as an example, hair follicle points are created on the surface of the ground model, and then the distance between the hair follicle points and the water body model is obtained. If the distance is less than the preset distance value, then the hair follicle point is determined as the target hair follicle point, and further, the model position of the target hair follicle point on the target model is determined as the contact position; for example, the preset distance value is set to 0.01 cm. If the distance between the hair follicle point and the water body model is less than 0.01 cm, then the hair follicle point is confirmed as the target hair follicle point. For example, Figure 3 the two target hair follicle points within the square box in

[0054] In the above method, the hair follicle points with a distance less than the preset distance value from the water body model are determined as the target hair follicle points, and then the contact position on the surface of the target model is determined. The operation of determining the wetted position in the target model is simple and convenient.

[0055] Furthermore, obtain the UV coordinate system of the target model, set the position coordinates of the hair follicle points at preset intervals in the UV coordinate system, and establish the mapping relationship between the position coordinates and the model positions; at the model positions that have a mapping relationship with the position coordinates, create hair follicle points.

[0056] This UV coordinate system is usually used to represent the coordinate system after unfolding the three-dimensional target model into a two-dimensional plane image. The UV coordinates cannot overlap and the stretching of the UV coordinate system should be reduced during the unfolding process. That is to say, it is necessary to make the target model unfold reasonably, and each coordinate point of the UV coordinate system corresponds to a model position of the target model.

[0057] In the UV coordinate system, set the position coordinates of the hair follicle points at preset intervals. For example, if the preset interval is 2 unit lengths, then set the position coordinates of a hair follicle point every 2 unit lengths, and establish the mapping relationship between the position coordinates of the hair follicle points and the model positions of the target model. Then, according to the mapping relationship between the position coordinates and the model positions, create hair follicle points on the surface of the target model; at this time, the hair follicle points are relatively evenly attached to the surface of the target model. Assuming that the position coordinates of the hair follicle points are not mapped to the model positions, then such hair follicle points are usually generated at the origin position, and just delete such hair follicle points. Here, if the preset interval is smaller, then the hair follicle points on the surface of the target model are denser, and the detection accuracy for the contact position in the target model is higher.

[0058] It should be noted that there is a one-to-one mapping relationship between the position coordinates of the hair follicle points and the model positions of the target model to avoid a situation where one position coordinate maps to multiple model positions, that is, one position coordinate corresponds to multiple hair follicle points, resulting in the occurrence of UV overlap.

[0059] Taking the target model as the ground model as an example, as Figure 4 The ground model shown in (a) in Figure 4 is a three-dimensional model. After unfolding the ground model, the UV coordinate system shown in (b) in Figure 4 is obtained. In one example, if the UV coordinates of the target model are within the range of (0, 0) to (1, 1), and the preset interval is 2 unit lengths, then the position coordinates of the follicle points are set at the preset interval in the UV coordinate system, and the UV list [(0, 0), (0, 0.2),..., (1, 0), (1, 0.2),..., (1, 1)] can be obtained, where 1 unit length is 0.1. Traverse this list to obtain the UV values of each follicle point, and then set the parameter U and parameter V for each follicle point. For example, the cmds.setAttr() method provided by the API (Application Programming Interface) of Maya is used to set the parameter U and parameter V attributes of the follicle points.

[0060] In the above method, by setting the position coordinates of the follicle points at the preset interval, the density of the follicle points created at the model positions having a mapping relationship with the position coordinates can be controlled.

[0061] In one way, when the animation frame is the first frame in the animation information, a preset texture map is obtained and used as the target texture map for the animation frame; wherein, the pixels in the preset texture map are set with preset pixel values; the preset pixel values are used to indicate that the model position of the target model is in a completely dry state; when the animation frame is not the first frame in the animation information, the frame texture map corresponding to the previous animation frame of the animation frame is determined as the target texture map.

[0062] In one example, when the animation frame is the first frame in a multi-frame continuous animation frame, the terminal obtains a preset texture map and uses it as the target texture map for the animation frame. The resolution of the preset texture map can be user-defined. The pixels in the preset texture map are set with preset pixel values, and the preset pixel values indicate that the model position of the target model is in a completely dry state, that is, the humidity percentage of the model position is 0; in an alternative way, the preset pixel value is assigned 0, so that the color of the pixel position indicating the model position in a completely dry state in the preset texture map appears black; of course, the preset pixel value can also be assigned 1, so that the color of the pixel position appears white.

[0063] When the animation frame is not the first frame in the multi-frame continuous animation frame, the terminal determines the frame texture map corresponding to the previous animation frame of the animation frame as the target texture map.

[0064] The following embodiments provide specific implementation manners for generating the frame texture map corresponding to the animation frame.

[0065] Specifically, obtain the position coordinates of the target hair follicle points at the contact position; in the target texture map, generate a specified pixel area based on the position coordinates of the target hair follicle points; wherein, the pixels in the specified pixel area are set with a specified pixel value; the specified pixel value is used to indicate that the model position of the target model is in a completely wet state; determine the target texture map containing the specified pixel area as the frame texture map corresponding to the animation frame.

[0066] The terminal obtains the position coordinates of the target hair follicle points at the contact position of the target model, and can obtain the values of parameter U and parameter V, that is, the UV value; then determine the target texture map according to whether the animation frame is the first frame, and then generate a specified pixel area in the target texture map according to the position coordinates of the target hair follicle points. The specified pixel area indicates that the model position of the target model is in a completely wet state.

[0067] In an optional manner, the specified pixel value of the pixels in the specified pixel area is assigned a value of 1, so that the color of the pixel position indicating that the model position is in a completely wet state in the frame texture map appears white; of course, the specified pixel value can also be assigned a value of 0, so that the color of the pixel position appears black.

[0068] In an example, project the shape of the hair follicle generated at the target hair follicle point onto the target texture map. If the hair follicle generated at the target hair follicle point is a sphere, then a circle with a preset radius can be generated at the pixel position in the target texture map according to the graphic shape mapped by the sphere at the target hair follicle point and the pixel position corresponding to the position coordinates of the target hair follicle point; as Figure 5 In the example, when the water body model first contacts the target model, according to the pixel position mapped by the position coordinates of the target hair follicle point in the target texture map, multiple white circles with a preset radius are generated in the target texture map that appears black, and the multiple white circles with a preset radius are displayed as a superimposed effect. Optionally, according to the position coordinates of the target hair follicle point and the resolution of the target texture map, solve the pixel position where the graphic shape at the target hair follicle point is mapped in the target texture map.

[0069] It can be understood that if the position coordinates of the target hair follicle points are denser, then the preset radius of the graphic generated at the pixel position corresponding to the position coordinates of the target hair follicle points should be smaller, and the accuracy of the drawing effect for the wet area in the texture map is higher.

[0070] Here, the terminal obtains the target texture map containing the specified pixel area, and uses the target texture map containing the specified pixel area as the frame texture map corresponding to this animation frame.

[0071] Further, when the animation frame is not the first frame in the animation information, adjust the pixel values in the target texture map so that the adjusted pixel values are different from the specified pixel values; in the target texture map, generate a specified pixel area based on the position coordinates of the target hair follicle point; wherein, the pixel values in the target texture map are used to indicate the humidity information of the model position of the target model.

[0072] When the animation frame is not the first frame in a multi-frame continuous animation, the target texture map is usually the frame texture map corresponding to the previous animation frame of the animation frame; the terminal obtains the target texture map and adjusts the pixel values in the target texture map so that the pixel values in the adjusted target texture map are different from the specified pixel values.

[0073] Exemplarily, the target texture map contains preset pixel values indicating that the model position of the target model is in a completely dry state, first pixel values indicating that the model position of the target model is in a relatively dry state, second pixel values indicating that the model position of the target model is in a relatively humid state, and specified pixel values indicating that the model position of the target model is in a completely humid state. The terminal can reduce or increase the first pixel values, second pixel values, and specified pixel values by a specified pixel amplitude so that the adjusted pixel values are different from the specified pixel values, and set the preset pixel values as pixel thresholds.

[0074] Next, the terminal can determine the pixel position corresponding to the target hair follicle point in the target texture map according to the mapping relationship between the position coordinates of the hair follicle point and the pixel position, and then generate a specified pixel area. For example, Figure 6 in the shown example, the white area is the specified pixel area composed of the pixel positions corresponding to the target hair follicle points, that is, the model position corresponding to the white area is in a completely humid state; the black area is the area composed of the preset pixel values indicating that the model position is in a completely dry state; the gray area is the area composed of the pixel values indicating the intermediate transition state of the model position, that is, the humidity percentage of the model position corresponding to the white area is between 0 and 100, Figure 6 the darker the brightness of the gray area in [[ ]], the lower the humidity percentage of the model position of the target model.

[0075] Further, determine a target pixel area from the target texture map; wherein, the pixel values in the target pixel area are used to indicate that the model position of the target model is in a non-completely dry state; reduce the pixel values in the target pixel area by a specified pixel amplitude.

[0076] This specified pixel amplitude is usually used to control the amplitude of the decrease in the humidity percentage of the model position of the target model, that is, to control the speed at which the model position changes from a non-completely dry state to a completely dry state. The specified pixel amplitude can be adjusted by the user according to needs; the non-completely dry state can specifically include a completely humid state, or a completely humid state and an intermediate transition state.

[0077] Exemplarily, in the frame texture map corresponding to the previous frame of the animation frame, the area composed of the pixel positions indicating that the model position of the target model is in a non-fully dry state is determined as the target pixel area; assuming that the specified pixel amplitude is set to 0.1, then the pixel values in the target pixel area of the target texture map are reduced at the specified pixel amplitude of 0.1 per frame. For example, in the frame texture map corresponding to the previous frame of the animation frame, there is a specified pixel area with a pixel value of 1 (showing white). Taking this specified pixel area as the target pixel area and reducing the pixel values in the target pixel area of the target texture map at the specified pixel amplitude of 0.1, then after 10 animation frames in which the specified pixel amplitude decreases for each frame of the animation frame, the target pixel area in the target texture map shows black.

[0078] In the above method, by adjusting the pixel values in the target pixel area with the specified pixel amplitude, the process of the wet area in the target model changing from wet to dry can be simulated.

[0079] Specifically, the color level break in the frame texture map is smoothed to obtain a frame texture map with a smooth transition effect.

[0080] This smoothing process can be the fusion transition of black, white, and gray, or the edge transition of non-black pixels, and can be specifically implemented through PIL (Python Imaging Library, a Python image processing library).

[0081] According to the foregoing embodiments, the pixel values in the target texture map are adjusted with the specified pixel amplitude, and then a specified pixel area is generated in the target texture map. Therefore, the frame texture map contains different pixel values indicating different humidity information of the model position, and different pixel values are displayed as different colors in the frame texture map, which will cause a color level break in the frame texture map, such as Figure 6 the dividing line shown in. Here, the color level break in the frame texture map can be smoothed through the fusion transition of black, white, and gray, making the transition at the edge of the color level break more natural and smooth.

[0082] The following embodiments provide a specific implementation method for rendering the animation of the target model.

[0083] Specifically, multiple frame texture maps corresponding to multiple consecutive animation frames are obtained, and a specified pixel area is determined from the multiple frame texture maps; based on the specified pixel area, the frame texture map corresponding to the animation frame is mapped to the target model; based on the humidity information of the model position, the rendering parameters of the model position are determined, and the model position is rendered through the rendering parameters; among them, in the rendered target model, the humidity effect of the model position matches the humidity information of the model position indicated by the frame texture map.

[0084] The rendering parameters can be parameters such as reflectivity, roughness, transparency, refractive index, etc., and the humidity effect of the model position of the target model is controlled through the rendering parameters.

[0085] Exemplarily, the terminal obtains multiple frame textures corresponding to multiple consecutive animation frames from the system, determines a specified pixel region for each frame texture, and then maps the frame texture corresponding to the animation frame to the target model according to the mapping relationship between the pixel positions of the frame texture and the position coordinates of the hair follicle points, as well as the specified pixel region determined in the frame texture. Then, according to the mapping relationship between the model position of the target model and the position coordinates of the hair follicle points, when mapping the frame texture to the target model, it can be understood that the UV values of the model position included in the frame texture are mapped within the range of (0, 0) to (1, 1) in the two-dimensional UV coordinate system, regardless of the resolution of this frame texture.

[0086] Next, according to the pixel values in the frame texture, obtain the humidity information of the model position indicated by the pixel values, and determine the rendering parameters of the model position according to the humidity information, and then render the target model. The rendering parameters can be parameters such as reflectivity, refractive index, transparency, and roughness; by adjusting the values of the rendering parameters, the rendering effect obtained by rendering the humidity effect of the model position of the target model can be controlled, so that the rendering effect of the model position matches the humidity information of the model position. As Figure 7 shown in (a) below, apply the frame texture to the material of the target model. The rendered target model is as Figure 7 shown in (b) below. Here, assign the frame texture to the property corresponding to the material, control the values of the rendering parameters of the target model according to the humidity information of the model position indicated by different pixel values in the frame texture, and then render the target model through the rendering parameters.

[0087] Here, different frame textures correspond to different animation frames. In different frame textures, the pixel values at different pixel positions usually change. Therefore, multiple frame textures need to be set in the form of a frame texture sequence; in the rendered target model, the humidity effect of the model position matches the humidity information of the model position indicated by the pixel values in the frame texture.

[0088] In the above method, the rendering parameters of the target model are determined based on the humidity information of the model position indicated by the pixel values in the frame texture, and then the target model is rendered. By controlling the rendering parameters, the humidity effect of the model position is controlled, and the rendering of the target model has convenience and controllability.

[0089] Furthermore, when the animation frame is the last frame in the animation information, based on the humidity information of the model position, determine the target pixel region from the frame texture, and gradually adjust the pixel values in the target pixel region to the preset pixel values.

[0090] In an alternative approach, when the animation frame is the last frame among a sequence of multiple consecutive animation frames, after completing the rendering process for the last animation frame in the texture map sequence, the pixel values in the target pixel area can be continuously decreased until the pixel values in the frame texture map corresponding to the last frame in the animation frame are all 0. At this time, the surface of the target model resumes the effect of being completely dry; during the process of gradually adjusting the frame texture map corresponding to the last frame in the animation frame to a preset pixel value, based on the humidity information of the model position indicated by the pixel values in the frame texture map, the rendering parameters of the model position are determined, and then the rendering effect obtained by rendering the target model is controlled.

[0091] In one approach, the rendering parameters of the target model can be determined in the following manner.

[0092] Specifically, based on the humidity information of the model position, the parameters in the reflectivity map and / or roughness map of the target model are adjusted.

[0093] Exemplarily, obtain the frame texture map corresponding to an animation frame. Based on the humidity information of the model position indicated by different pixel values in the frame texture map, generate the reflectivity map of the target model, or the reflectivity map, or the reflectivity map and roughness map; then, for the frame texture maps corresponding to different animation frames, adjust the parameters in the reflectivity map or roughness map to obtain the adjusted reflectivity map or roughness map. The terminal renders the target model according to the reflectivity map corresponding to the animation frame to obtain a reflection effect that matches the humidity information of the model position; renders the target model according to the roughness map corresponding to the animation frame to obtain a rough effect that matches the humidity information of the model position.

[0094] The above embodiments of the present application can generate a high-precision frame texture map sequence through an automated method based on object contact detection, and use the PIL library of Python to generate and update the frame texture map sequence to achieve a dynamic wet and dry effect; quickly and flexibly implement animation production and wet and dry transition effects, provide rich adjustable parameters for users, and provide a fast and controllable method for producing the wetting effect when a conventional object contacts with water.

[0095] Corresponding to the above method embodiments, refer to Figure 8 The schematic diagram of an animation generation device shown in

[0096] An animation information acquisition module 801, configured to acquire the animation information of the water body model; wherein, the animation information includes: the water body state in a sequence of multiple consecutive animation frames;

[0097] A contact position determination module 802, configured to determine the contact position of the target model contacting the water body model based on the water body state in the animation frame;

[0098] The frame texture generation module 803 is configured to generate a frame texture corresponding to an animation frame based on the contact position; wherein, the frame texture includes: the model position in the target model and the humidity information of the model position.

[0099] The mapping and rendering module 804 is configured to obtain the frame texture, map the frame texture to the target model, and render the animation of the target model.

[0100] The above animation generation device obtains the animation information of the water body model; wherein, the animation information includes: the water body state in multiple consecutive animation frames; based on the water body state in the animation frame, determines the contact position of the target model contacting the water body model from the target model; based on the contact position, generates a frame texture corresponding to the animation frame; wherein, the frame texture includes: the model position in the target model and the humidity information of the model position; obtains the frame texture, maps the frame texture to the target model, and renders the animation of the target model. In this way, there is no need for staff to hand-draw textures. The animation information of the water body model can be directly obtained to get the water body state in multiple consecutive animation frames. The contact position of the target model contacting the water body model is determined from the target model according to the water body state, and then the frame texture corresponding to each animation frame is generated. This method determines the wetted area of the target model according to the water body contact situation, so that a sequence of frame textures of the animation can be automatically generated, improving the animation production efficiency and the accuracy of the texture drawing effect.

[0101] The above contact position determination module is further configured to create hair follicle points on the surface of the target model; obtain the distance between the hair follicle points and the water body model, and determine the target hair follicle points with a distance less than a preset distance value; determine the model position of the target hair follicle points on the target model as the contact position of the target model contacting the water body model.

[0102] The above model position determination module is further configured to obtain the UV coordinate system of the target model, set the position coordinates of the hair follicle points at preset intervals in the UV coordinate system, and establish a mapping relationship between the position coordinates and the model position; create hair follicle points at the model positions having a mapping relationship with the position coordinates.

[0103] The above device further includes a target texture determination module, configured to obtain a preset texture and use the preset texture as the target texture of the animation frame when the animation frame is the first frame in the animation information; wherein, the pixels in the preset texture are set with preset pixel values; the preset pixel values are used to indicate that the model position of the target model is in a completely dry state; when the animation frame is not the first frame in the animation information, determine the frame texture corresponding to the previous animation frame of the animation frame as the target texture.

[0104] The above frame texture generation module is further configured to obtain the position coordinates of the target hair follicle points at the contact position; in the target texture, generate a specified pixel area based on the position coordinates of the target hair follicle points; wherein, the pixels in the specified pixel area are set with specified pixel values; the specified pixel values are used to indicate that the model position of the target model is in a completely wet state; and determine the texture map corresponding to the animation frame as the texture map containing the specified pixel area.

[0105] The above frame texture generation module is further configured to, when the animation frame is not the first frame in the animation information, adjust the pixel values in the target texture so that the adjusted pixel values are different from the specified pixel values; in the target texture, generate a specified pixel area based on the position coordinates of the target hair follicle points; wherein, the pixel values in the target texture are used to indicate the humidity information of the model position of the target model.

[0106] The above frame texture generation module is further configured to determine a target pixel area from the target texture; wherein, the pixel values in the target pixel area are used to indicate that the model position of the target model is in a non-completely dry state; and reduce the pixel values in the target pixel area by a specified pixel amplitude.

[0107] The above device further includes a smoothing processing module, configured to perform smoothing processing on the color level break in the texture map of the animation frame to obtain a texture map with a smooth transition effect.

[0108] The above mapping and rendering module is further configured to obtain multiple texture maps corresponding to multiple consecutive animation frames, determine a specified pixel area from the multiple texture maps; based on the specified pixel area, map the texture map corresponding to the animation frame to the target model; determine the rendering parameters of the model position based on the humidity information of the model position, and render the model position through the rendering parameters; wherein, in the rendered target model, the humidity effect of the model position matches the humidity information of the model position indicated by the texture map.

[0109] The above device further includes a pixel value adjustment module, configured to, when the animation frame is the last frame in the animation information, determine a target pixel area from the texture map based on the humidity information of the model position, and gradually adjust the pixel values in the target pixel area to a preset pixel value.

[0110] The above mapping and rendering module is further configured to adjust the parameters in the reflectivity texture map and / or roughness texture map of the target model based on the humidity information of the model position.

[0111] This embodiment further provides an electronic device, including a processor and a memory, the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the above animation generation method or implement the above rendering method for the wet effect. The electronic device can be a server or a terminal device.

[0112] See Figure 9 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores computer-executable instructions that can be executed by the processor 100, and the processor 100 executes the computer-executable instructions to implement the above-mentioned animation generation method.

[0113] Furthermore, Figure 9 the electronic device shown further includes a bus 102 and a communication interface 103. The processor 100, the communication interface 103, and the memory 101 are connected through the bus 102.

[0114] Among them, the memory 101 may include a high-speed random access memory (RAM, Random Access Memory), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 103 (which can be wired or wireless), a communication connection is established between this system network element and at least one other network element, and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 102 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 9 only a bidirectional arrow is used in [[ ]] to represent it, but it does not mean that there is only one bus or one type of bus.

[0115] The processor 100 may be an integrated circuit chip with the ability to process signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 100 or the instructions in the form of software. The above-mentioned processor 100 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by the combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and combines its hardware to complete the steps of the method in the foregoing embodiments.

[0116] The processor in the above electronic device can implement the following operations in the above animation generation method by executing computer-executable instructions:

[0117] Obtain the animation information of the water body model; wherein, the animation information includes: the water body state in multiple consecutive animation frames; based on the water body state in the animation frame, determine the contact position where the target model contacts the water body model from the target model; based on the contact position, generate a frame texture map corresponding to the animation frame; wherein, the frame texture map includes: the model position in the target model and the humidity information of the model position; obtain the frame texture map, map the frame texture map to the target model, and render to obtain the animation of the target model.

[0118] Create hair follicle points on the surface of the target model; obtain the distance between the hair follicle points and the water body model, and determine the target hair follicle points with a distance less than a preset distance value; determine the model position of the target hair follicle points on the target model as the contact position where the target model contacts the water body model.

[0119] Obtain the UV coordinate system of the target model, set the position coordinates of the follicle points at a preset interval in the UV coordinate system, and establish a mapping relationship between the position coordinates and the model positions; create follicle points at the model positions that have a mapping relationship with the position coordinates.

[0120] When the animation frame is the first frame in the animation information, obtain a preset texture map and use the preset texture map as the target texture map for the animation frame; wherein, the pixels in the preset texture map are set with preset pixel values; the preset pixel values are used to indicate that the model position of the target model is in a completely dry state; when the animation frame is not the first frame in the animation information, determine the frame texture map corresponding to the previous animation frame of the animation frame as the target texture map.

[0121] Obtain the position coordinates of the target follicle point at the contact position; in the target texture map, generate a specified pixel area based on the position coordinates of the target follicle point; wherein, the pixels in the specified pixel area are set with specified pixel values; the specified pixel values are used to indicate that the model position of the target model is in a completely wet state; determine the target texture map containing the specified pixel area as the frame texture map corresponding to the animation frame.

[0122] When the animation frame is not the first frame in the animation information, adjust the pixel values in the target texture map so that the adjusted pixel values are different from the specified pixel values; in the target texture map, generate a specified pixel area based on the position coordinates of the target follicle point; wherein, the pixel values in the target texture map are used to indicate the humidity information of the model position of the target model.

[0123] Determine a target pixel area from the target texture map; wherein, the pixel values in the target pixel area are used to indicate that the model position of the target model is in a non-completely dry state; reduce the pixel values in the target pixel area by a specified pixel amplitude.

[0124] Smooth the color level breaks in the frame texture map to obtain a frame texture map with a smooth transition effect.

[0125] Obtain multiple frame texture maps corresponding to multiple consecutive animation frames, determine a specified pixel area from the multiple frame texture maps; based on the specified pixel area, map the frame texture map corresponding to the animation frame to the target model; determine the rendering parameters of the model position based on the humidity information of the model position, and render the model position through the rendering parameters; wherein, in the rendered target model, the humidity effect of the model position matches the humidity information of the model position indicated by the frame texture map.

[0126] When the animation frame is the last frame in the animation information, determine a target pixel area from the frame texture map based on the humidity information of the model position, and gradually adjust the pixel values in the target pixel area to the preset pixel values.

[0127] Adjust the parameters in the reflectivity map and / or roughness map of the target model based on the humidity information of the model position.

[0128] In this method, there is no need for staff to hand-draw the map. The animation information of the water body model can be directly obtained to get the water body state in multiple consecutive animation frames. According to the water body state, the contact position where the water body model contacts the target model is determined from the target model, and then the frame map corresponding to each animation frame is generated. This method determines the wetted area of the target model according to the water body contact situation, so that the frame map sequence of the animation can be automatically generated, improving the animation production efficiency and the accuracy of the map drawing effect.

[0129] This embodiment also provides a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the above animation generation method.

[0130] The computer-executable instructions stored in the above computer-readable storage medium can, by executing the computer-executable instructions, implement the following operations in the above animation generation method:

[0131] Obtain the animation information of the water body model; wherein, the animation information includes: the water body state in multiple consecutive animation frames; based on the water body state in the animation frame, determine the contact position where the water body model contacts the target model from the target model; based on the contact position, generate the frame map corresponding to the animation frame; wherein, the frame map includes: the model position in the target model and the humidity information of the model position; obtain the frame map and map the frame map to the target model to render the animation of the target model.

[0132] Create follicle points on the surface of the target model; obtain the distance between the follicle points and the water body model, and determine the target follicle points with a distance less than the preset distance value; determine the model position of the target follicle points on the target model as the contact position where the water body model contacts.

[0133] Obtain the UV coordinate system of the target model, set the position coordinates of the follicle points at preset intervals in the UV coordinate system, and establish the mapping relationship between the position coordinates and the model position; create follicle points at the model positions having the mapping relationship with the position coordinates.

[0134] When the animation frame is the first frame in the animation information, obtain the preset map and use the preset map as the target map of the animation frame; wherein, the pixels in the preset map are set with preset pixel values; the preset pixel values are used to indicate that the model position of the target model is in a completely dry state; when the animation frame is not the first frame in the animation information, determine the frame map corresponding to the previous animation frame of the animation frame as the target map.

[0135] Obtain the position coordinates of the target hair follicle points at the contact position; in the target texture map, generate a specified pixel area based on the position coordinates of the target hair follicle points; wherein, the pixels in the specified pixel area are set with specified pixel values; the specified pixel values are used to indicate that the model position of the target model is in a completely wet state; determine the target texture map containing the specified pixel area as the frame texture map corresponding to the animation frame.

[0136] When the animation frame is not the first frame in the animation information, adjust the pixel values in the target texture map so that the adjusted pixel values are different from the specified pixel values; in the target texture map, generate a specified pixel area based on the position coordinates of the target hair follicle points; wherein, the pixel values in the target texture map are used to indicate the humidity information of the model position of the target model.

[0137] Determine the target pixel area from the target texture map; wherein, the pixel values in the target pixel area are used to indicate that the model position of the target model is in a non-completely dry state; reduce the pixel values in the target pixel area by a specified pixel amplitude.

[0138] Smooth the color level break in the frame texture map to obtain a frame texture map with a smooth transition effect.

[0139] Obtain multiple frame texture maps corresponding to multiple consecutive animation frames, determine the specified pixel area from the multiple frame texture maps; map the frame texture map corresponding to the animation frame to the target model based on the specified pixel area; determine the rendering parameters of the model position based on the humidity information of the model position, and render the model position through the rendering parameters; wherein, in the rendered target model, the humidity effect of the model position matches the humidity information of the model position indicated by the frame texture map.

[0140] When the animation frame is the last frame in the animation information, determine the target pixel area from the frame texture map based on the humidity information of the model position, and gradually adjust the pixel values in the target pixel area to the preset pixel values.

[0141] Adjust the parameters in the reflectivity texture map and / or roughness texture map of the target model based on the humidity information of the model position.

[0142] In this method, there is no need for staff to hand-draw texture maps. The animation information of the water body model can be directly obtained to get the water body state in multiple consecutive animation frames. The contact position where the water body model contacts the target model is determined from the target model according to the water body state, and then the frame texture map corresponding to each animation frame is generated. This method determines the wetted area of the target model according to the water body contact situation, so that a sequence of frame texture maps of the animation can be automatically generated, improving the animation production efficiency and the accuracy of the texture map drawing effect.

[0143] The computer program product of the animation generation method, device, and electronic device provided by the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the foregoing method embodiments. For specific implementation, reference can be made to the method embodiments and will not be elaborated herein.

[0144] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0145] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installation", "connection", and "coupling" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.

[0146] If the described functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage media include: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, and other media that can store program code.

[0147] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.

[0148] Finally, it should be noted that the above embodiments are only specific embodiments of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the technical field can still modify the technical solutions recorded in the foregoing embodiments or easily conceive of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. An animation generation method, characterized in that: The method comprises: Acquire animation information of a water body model; wherein the animation information includes: water body states in multiple consecutive animation frames; Determining a contact position of the water model from the target model based on the state of the water model in the animation frame; Based on the contact position, a frame map corresponding to the animation frame is generated; wherein the frame map includes: a model position in the target model and humidity information of the model position; The frame map is obtained, and the frame map is mapped to the target model to render and obtain an animation of the target model.

2. The method according to claim 1, characterized in that The step of determining a contact position of the target model that contacts the water body model comprises: Create follicle points on the surface of the target model; Acquire the distance between the hair follicle point and the water body model, and determine the target hair follicle point whose distance is less than a preset distance value; The model position of the target hair follicle point on the target model is determined as the contact position contacting the water body model.

3. The method according to claim 2, characterized in that The steps of creating hair follicle points on the surface of the target model include: Acquire a UV coordinate system of the target model, set the position coordinates of the hair follicle points in the UV coordinate system according to preset intervals, and establish a mapping relationship between the position coordinates and the model position; A hair follicle point is created at a model position that has a mapping relationship with the position coordinates.

4. The method according to claim 1, characterized in that: Before the step of generating a frame map corresponding to the animation frame based on the contact position, the method further includes: When the animation frame is the first frame in the animation information, a preset map is obtained, and the preset map is used as a target map of the animation frame; wherein pixels in the preset map are set with preset pixel values; the preset pixel values ​​are used to indicate that: the model position of the target model is in a completely dry state; When the animation frame is not the first frame in the animation information, a frame texture corresponding to the previous animation frame of the animation frame is determined as the target texture.

5. The method according to claim 1, characterized in that The step of generating a frame map corresponding to the animation frame based on the contact position comprises: Acquiring the position coordinates of the target hair follicle point at the contact position; In the target map, a designated pixel area is generated based on the position coordinates of the target hair follicle point; wherein the pixels in the designated pixel area are provided with designated pixel values; the designated pixel values ​​are used to indicate that the model position of the target model is in a completely wet state; The target map including the designated pixel area is determined as the frame map corresponding to the animation frame.

6. The method according to claim 5, characterized in that In the target map, the step of generating a designated pixel area based on the position coordinates of the target hair follicle point comprises: When the animation frame is not the first frame in the animation information, adjusting the pixel value in the target map so that the adjusted pixel value is different from the specified pixel value; In the target map, a designated pixel area is generated based on the position coordinates of the target hair follicle point; wherein the pixel values ​​in the target map are used to indicate: humidity information of the model position of the target model.

7. The method according to claim 6, characterized in that The step of adjusting the pixel values ​​in the target map so that the adjusted pixel values ​​are different from the specified pixel values ​​comprises: Determining a target pixel area from the target map; wherein the pixel values ​​in the target pixel area are used to indicate that: the model position of the target model is in a non-completely dry state; Reduce the pixel values ​​in the target pixel area by a specified pixel amplitude.

8. The method according to claim 1, characterized in that After the step of generating a frame map corresponding to the animation frame based on the contact position, the method further comprises: smoothing the color level faults in the frame map to obtain a frame map with a smooth transition effect.

9. The method according to claim 1, characterized in that: The step of obtaining the frame map and mapping the frame map to the target model to render an animation of the target model comprises: Acquire a plurality of frame maps corresponding to the plurality of continuous animation frames, and determine a specified pixel area from the plurality of frame maps; Based on the designated pixel area, mapping the frame map corresponding to the animation frame to the target model; Based on the humidity information of the model position, the rendering parameters of the model position are determined, and the model position is rendered using the rendering parameters; wherein, in the rendered target model, the humidity effect of the model position matches the humidity information of the model position indicated by the frame map.

10. The method according to claim 9, characterized in that Before the step of determining the rendering parameters of the model position based on the humidity information of the model position, the method further includes: When the animation frame is the last frame in the animation information, based on the humidity information of the model position, a target pixel area is determined from the frame map, and pixel values ​​in the target pixel area are gradually adjusted to preset pixel values.

11. The method according to claim 9, characterized in that The step of determining the rendering parameters of the model position based on the humidity information of the model position comprises: Based on the humidity information at the model location, parameters in the reflectivity map and / or the roughness map of the target model are adjusted.

12. An animation generating device, characterized in that: The device comprises: An animation information acquisition module is used to acquire animation information of a water body model; wherein the animation information includes: water body states in multiple consecutive animation frames; A contact position determination module, used to determine a contact position of the water model from a target model based on the state of the water model in the animation frame; A frame map generation module, used to generate a frame map corresponding to the animation frame based on the contact position; wherein the frame map includes: a model position in the target model and humidity information of the model position; The mapping and rendering module is used to obtain the frame map, map the frame map to the target model, and render to obtain the animation of the target model.

13. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement 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 stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the animation generation method according to any one of claims 1 to 11.