Animation effect rendering method and device, electronic equipment and readable storage medium

By dynamically switching the texture map of the three-dimensional animation model and adjusting the style of the preset sheet model, the problem of monotonous color change effect in the existing technology is solved, and a more natural and realistic color transition effect is achieved.

CN119832125APending Publication Date: 2025-04-15NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411686564.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

When the prior art realizes the color change effect of three-dimensional animation models, the color switching is too monotonous and lacks natural and real transition effects.

Method used

By obtaining the target three-dimensional model and configuring two sets of texture maps for it, during the process of traversing the model, the texture map is dynamically switched, and the pixel values ​​and styles of the preset sheet model are adjusted according to the traversal state to achieve a natural color transition.

Benefits of technology

Enrich the color change effect of the 3D animation model, making it look more natural and realistic, avoiding monotonous color switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832125A_ABST
    Figure CN119832125A_ABST
Patent Text Reader

Abstract

The invention discloses an animation effect rendering method and device, electronic equipment and a readable storage medium, and the method comprises the steps: obtaining a target three-dimensional model, the target three-dimensional model uses a first texture map, and each second vertex is provided with a preset sheet model with the size being a first scaling; taking a preset coordinate axis direction as a traversal direction and a preset traversal width as a traversal window in a traversal process from the first end to the second end of the target three-dimensional model; and according to the current traversal states of the target first vertex and the second target vertex, adjusting a pixel value corresponding to the target first vertex, and adjusting a pixel value and a target style of a preset sheet model placed at the target second vertex. In the process of switching the texture map of the target three-dimensional model from the first texture map to the second texture map, dynamic transformation of the color and the target style of the preset sheet model is added, the animation effect is enriched, and the color changing effect presented in the map switching process is more natural.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of three-dimensional rendering technology, and in particular to an animation effect rendering method, device, electronic device and computer-readable storage medium. Background Art

[0002] In 3D animation production, the current color change effect rendering method usually uses two sets of different texture maps in the shader graph, and switches the model texture between the two texture maps through interpolation method, so as to achieve the color change effect of the model. However, the color change effect achieved by the above-mentioned prior art appears too monotonous when the color is switched. Summary of the invention

[0003] The present application provides an animation effect rendering method, device, electronic device and computer-readable storage medium to solve the problem that the color change effect achieved in the prior art appears too monotonous when the color is switched.

[0004] In a first aspect, an embodiment of the present application provides an animation effect rendering method, the method comprising:

[0005] Acquire a target three-dimensional model, the target three-dimensional model comprising a plurality of first vertices and a plurality of second vertices, the texture map configured for the target three-dimensional model comprising a first texture map and a second texture map, the texture map currently used by the target three-dimensional model is the first texture map, and a preset sheet model with a size ratio scaled to a first scaling ratio is placed on each of the second vertices;

[0006] Taking a preset coordinate axis direction as a traversal direction and a preset traversal width as a traversal window, in a traversal process from a first end to a second end of the target three-dimensional model, determining a current traversal state of a target first vertex and a target second vertex, wherein the target first vertex is any one of a plurality of first vertices, and the target second vertex is any one of a plurality of second vertices, and the traversal state includes not traversed, traversing, and traversed;

[0007] In the process of switching the current traversal state of the first vertex of the target from being traversed to being traversed, switching the pixel value corresponding to the first vertex of the target from the pixel value of the UV coordinate corresponding to the first vertex of the target in the first texture map to the pixel value of the UV coordinate corresponding to the first vertex of the target in the second texture map, so that after completing the traversal of the target three-dimensional model from the first end to the second end, the texture map currently used by the target three-dimensional model is switched from the first texture map to the second texture map;

[0008] According to the current traversal state of the target second vertex, the pixel value and target style of the target preset sheet model placed at the target second vertex are adjusted.

[0009] In a second aspect, an embodiment of the present application provides an animation effect rendering device, the device comprising:

[0010] an acquisition module, configured to acquire a target three-dimensional model, the target three-dimensional model comprising a plurality of first vertices and a plurality of second vertices, the texture map configured for the target three-dimensional model comprising a first texture map and a second texture map, the texture map currently used by the target three-dimensional model is the first texture map, and a preset sheet model with a size ratio scaled to a first scaling ratio is placed on each of the second vertices;

[0011] A determination module, used to determine the current traversal status of a target first vertex and a target second vertex in a traversal process from a first end to a second end of the target three-dimensional model with a preset coordinate axis direction as a traversal direction and a preset traversal width as a traversal window, wherein the target first vertex is any one of a plurality of first vertices, and the target second vertex is any one of a plurality of second vertices, and the traversal status includes not traversed, traversing, and traversed;

[0012] a first adjustment module, configured to switch, during a process in which a current traversal state of the target first vertex is switched from being traversed to having been traversed, a pixel value corresponding to the target first vertex from a pixel value of a UV coordinate corresponding to the target first vertex in the first texture map to a pixel value of a UV coordinate corresponding to the target first vertex in the second texture map, so that after completing the traversal of the target three-dimensional model from the first end to the second end, the texture map currently used by the target three-dimensional model is switched from the first texture map to the second texture map;

[0013] The second adjustment module is used to adjust the pixel value and target style of the target preset sheet model placed at the target second vertex according to the current traversal state of the target second vertex.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:

[0015] A memory and a processor, wherein the memory and the processor are coupled;

[0016] The memory is used to store one or more computer instructions;

[0017] The processor is used to execute the one or more computer instructions to implement the animation effect rendering method described in any one of the first aspects above.

[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having one or more computer instructions stored thereon, characterized in that the instruction is executed by a processor to implement the animation effect rendering method described in any one of the first aspects above.

[0019] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the animation effect rendering method described in any one of the first aspects above.

[0020] Compared with the prior art, this application has the following advantages:

[0021] The animation effect rendering method provided by the present application obtains a target three-dimensional model, the target three-dimensional model includes a plurality of first vertices and a plurality of second vertices, the texture map configured for the target three-dimensional model includes a first texture map and a second texture map, the texture map currently used by the target three-dimensional model is the first texture map, and a preset sheet model with a size ratio scaled to the first scaling ratio is placed on each second vertex. With the preset coordinate axis direction as the traversal direction and the preset traversal width as the traversal window, in the process of traversing from the first end to the second end of the target three-dimensional model, the current traversal status of the target first vertex and the target second vertex is determined, the target first vertex is any one of the plurality of first vertices, the target second vertex is any one of the plurality of second vertices, and the traversal status includes not traversed, traversing, and traversed. In the process of switching the current traversal state of the first vertex of the target from being traversed to having been traversed, the pixel value corresponding to the first vertex of the target is switched from the pixel value of the UV coordinate corresponding to the first vertex of the target in the first texture map to the pixel value of the UV coordinate corresponding to the first vertex of the target in the second texture map, so that after completing the traversal of the target three-dimensional model from the first end to the second end, the texture map currently used by the target three-dimensional model is switched from the first texture map to the second texture map. According to the current traversal state of the second vertex of the target, the pixel value and target style of the target preset sheet model placed at the second vertex of the target are adjusted.

[0022] Compared with the prior art, in the process of traversing the target 3D model based on the traversal window, the texture map of the target 3D model in the traversal window is switched from the first texture map to the second texture map, and the pixel value of the target preset sheet model placed at the second vertex of the target in the traversal window is adjusted at the same time, so that the target preset model is synchronized with the entire color switch of the target 3D model, and the target style of the target preset sheet model is adjusted at the same time. In the end, it looks like the change of the target style of the preset sheet model leads to the transition color change of the target 3D model, which enriches the color change animation effect of the texture map of the target 3D model transitioning from the first texture map to the second texture map, making the whole process look more natural and real. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0024] Figure 1 A schematic diagram of a flow chart of an animation effect rendering method provided in one embodiment of the present application;

[0025] Figure 2 A schematic diagram of generating a second vertex for an initial three-dimensional model and instantiating a preset sheet model according to one embodiment of the present application;

[0026] Figure 3 A schematic diagram of a preset sheet model provided in one embodiment of the present application;

[0027] Figure 4 A schematic diagram of traversing a target three-dimensional model provided in one embodiment of the present application;

[0028] Figure 5 A schematic diagram of periodic changes in traversal provided in one embodiment of the present application;

[0029] Figure 6 A mapping effect for a preset sheet model error provided by one of the embodiments of the present application;

[0030] Figure 7 A schematic diagram of a texture of a preset sheet model before and after UV transfer provided in one embodiment of the present application;

[0031] Figure 8 The mapping effect of a preset sheet model after UV transfer provided by one of the embodiments of the present application;

[0032] Fig. 9 A schematic diagram of two zoom effects provided for one embodiment of the present application;

[0033] Fig.10 A schematic diagram of enhancing the display of a target preset sheet model provided by one embodiment of the present application;

[0034] Fig.11 A schematic diagram of the structure of an animation effect rendering device provided in one embodiment of the present application;

[0035] Fig.12 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application.

[0036] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0037] In order to make the purpose, advantages and features of the present application clearer, the present application is described clearly and completely below in conjunction with the accompanying drawings and specific embodiments. In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments, and all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0038] It should be noted that, in the description of the present application, the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance, and a specific order or sequence. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, the term "multiple" refers to two or more. The term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can be represented: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship. The terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0039] In order to solve the problems existing in the above-mentioned related technologies, the present application provides an animation effect rendering method, an animation effect rendering device corresponding to the method, an electronic device that can implement the animation effect rendering method, and a computer-readable storage medium. The following embodiments are provided to describe the above-mentioned method, device, electronic device, and computer-readable storage medium in detail.

[0040] In order to make the purpose and technical solution of the present application clearer and more intuitive, the method provided by the embodiment of the present application will be described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. It is understood that the following embodiments may exist separately, and the following embodiments and features in the embodiments may be combined with each other when there is no conflict between the embodiments provided in the present application, and the same or similar content will not be repeated in different embodiments. In addition, the step sequence in the following method embodiments is only an example, not a strict limitation, and in some cases, the steps shown or described may be performed in a different order from this.

[0041] The present application provides an animation effect rendering method, device, electronic device and computer-readable storage medium. Specifically, the animation effect rendering method of one embodiment of the present application can be executed by a computer device, wherein the computer device can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, etc. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client. The server can be an independent physical server, or 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, and big data and artificial intelligence platforms.

[0042] First embodiment

[0043] Next, combine Figure 1 , an animation effect rendering method provided in one embodiment of the present application is described, Figure 1 A flowchart of an animation effect rendering method provided in one embodiment of the present application.

[0044] like Figure 1 As shown, the animation effect rendering method includes S10-S40:

[0045] S10. Acquire a target three-dimensional model, where the target three-dimensional model includes a plurality of first vertices and a plurality of second vertices. The texture map configured for the target three-dimensional model includes a first texture map and a second texture map. The texture map currently used by the target three-dimensional model is the first texture map. A preset sheet model whose size ratio is scaled to a first scaling ratio is placed on each second vertex.

[0046] S20. Using the preset coordinate axis direction as the traversal direction and the preset traversal width as the traversal window, in the process of traversing from the first end to the second end of the target three-dimensional model, determine the current traversal status of the target first vertex and the target second vertex, the target first vertex is any one of the multiple first vertices, the target second vertex is any one of the multiple second vertices, and the traversal status includes not traversed, traversing, and traversed.

[0047] S30. In the process of switching the current traversal state of the first vertex of the target from being traversed to having been traversed, the pixel value corresponding to the first vertex of the target is switched from the pixel value of the UV coordinate corresponding to the first vertex of the target in the first texture map to the pixel value of the UV coordinate corresponding to the first vertex of the target in the second texture map, so that after completing the traversal of the target three-dimensional model from the first end to the second end, the texture map currently used by the target three-dimensional model is switched from the first texture map to the second texture map.

[0048] S40: According to the current traversal state of the second vertex of the target, the pixel value and the target style of the target preset sheet model placed at the second vertex of the target are adjusted.

[0049] Next, steps S10 to S40 are described in detail.

[0050] As mentioned above, the target three-dimensional model is a virtual object defined in a three-dimensional space created using three-dimensional animation software such as Houdini, and the multiple first vertices included therein are connected together to form polygons such as triangles and quadrilaterals, and these polygons are combined to form the surface contour shape of the virtual object. The target three-dimensional model also includes multiple second vertices, and a preset sheet model with a size ratio scaled to the first scaling ratio is placed on each second vertex, and the preset sheet model fits the surface of the target three-dimensional model, that is, it is laid flat on the surface of the target three-dimensional model. Among them, the preset sheet model can be a two-dimensional model or a three-dimensional model of any sheet shape, and the specific shape can be selected according to actual needs, and the embodiment of the present application does not impose any restrictions on this. For example, the preset sheet model can be a scale model, a leaf model, a feather model, a thin plate model, and the like.

[0051] As mentioned above, the first zoom ratio can be zero, five percent, ten percent, etc. This is only an example, and the embodiments of the present application do not impose any restrictions on this. The specific value of the first zoom ratio can be set according to actual needs (such as the desired animation effect and specific three-dimensional model).

[0052] For example, if the target 3D model is a virtual bird model, the preset sheet model on the target 3D model is the feather model on the virtual bird model, and the first scaling ratio can be set according to the size of the feathers suitable for the virtual bird model.

[0053] For another example, if the target three-dimensional model is a virtual pig head model, and assuming that the animation effect to be achieved is that a scale model (i.e., a preset flaky model) slowly grows on the surface of the virtual hair head model and then disappears from large to small, then the first scaling ratio of the preset flaky model before it grows can be set to zero.

[0054] In an optional implementation, a possible implementation method for obtaining a target three-dimensional model includes the following steps: obtaining an initial three-dimensional model, the initial three-dimensional model including a plurality of first vertices. Spreading points on the surface of the initial three-dimensional model, and generating a plurality of second vertices on the surface of the initial three-dimensional model after the points are spread. Obtaining a preset sheet model, the preset sheet model including a plurality of third vertices. Instantiating the preset sheet model to each second vertex, and scaling the size of the preset sheet model placed at each second vertex after instantiation to a first scaling ratio, to obtain a target three-dimensional model.

[0055] Specifically, the initial three-dimensional model is a three-dimensional model including a plurality of first vertices. Points are scattered on the surface of the initial three-dimensional model using a preset point distribution pattern, and a plurality of second vertices are generated on the surface of the initial three-dimensional model after the points are scattered. A preset sheet model is obtained, and the preset sheet model includes a plurality of third vertices. The preset sheet model is instantiated to the position of each second vertex (that is, a preset sheet model is placed at the position of each second vertex). Subsequently, the size of the preset sheet model placed at each second vertex after instantiation is scaled to a first scaling ratio to obtain a target three-dimensional model, and the preset sheet model placed on the surface of the target three-dimensional model is invisible.

[0056] Next, combine Figure 2 and Figure 3 The above optional implementation modes are exemplarily described. Figure 2 A schematic diagram of generating a second vertex for an initial three-dimensional model and instantiating a preset sheet model according to one embodiment of the present application is provided. Figure 3 A schematic diagram of a preset sheet model provided in one embodiment of the present application.

[0057] Prepare an initial 3D model such as Figure 2The pig head model shown in the figure can provide the function of scattering points on the surface of the three-dimensional model through the Scatter node in three-dimensional animation production software such as Houdini. In Houdini, the Scatter node is mainly used to place points on the surface of a given three-dimensional model in a preset point distribution pattern. These points can be used for further geometric generation, such as generating virtual vegetation on the virtual ground. Among them, the point distribution pattern includes but is not limited to random distribution, regular distribution, and texture-based distribution. In an embodiment of the present application, taking the initial three-dimensional model as a pig head model as an example, after obtaining a pig head model, the node of the pig head model is connected to the input port of the Scatter node. Afterwards, configure parameters such as the number of points to be placed, point distribution pattern, seed, and weight (i.e., used to control the point density in different areas). After configuring the parameters, you can preview the point scattering effect and adjust the configuration parameters as needed. Figure 2 The surface of the pig head model shown in the figure generates multiple second vertices. Figure 3 The scale model shown in the figure includes four third vertices. Next, use the copy to points node in Houdini to instantiate the scale model to each second vertex in the pig head model after the point spreading process, so that the following is obtained: Figure 2 The pig head model wrapped by the scale model is shown in the figure. The copyto points node provides the function of instantiating a 3D model to another set of geometry (i.e., target vertices), which means placing multiple identical 3D models on these vertices, and controlling the position, direction, and size of each 3D model. Specifically, you can connect the output of the Scatter node to the first input port of the Copy To Points node, and then connect the scale model to the second input port of the Copy To Points node. After that, configure the parameters of the Copy To Points node, including alignment, scaling, rotation, and other parameters.

[0058] In an embodiment of the present application, a first texture map and a second texture map are configured for the target three-dimensional model. The target three-dimensional model is currently using the first texture map and is waiting to use the second texture map. Each first vertex on the target three-dimensional model corresponds to a UV coordinate for the two texture maps. Among them, the two texture maps are two two-dimensional images used to add different details and colors to the surface of the target three-dimensional model. By mapping the two-dimensional images onto the surface of the target three-dimensional model, the model is increased in realism. For example, texture maps can be used to simulate the appearance of materials such as skin, wood, and metal. UV coordinates are a two-dimensional coordinate system used to map texture maps to the surface of the target three-dimensional model, and U and V correspond to the horizontal and vertical directions of the texture map, respectively. Each vertex has a corresponding UV coordinate, and the UV coordinate ensures that each pixel on the texture map can be correctly mapped to the corresponding first vertex position of the target three-dimensional model.

[0059] In the embodiment of the present application, with the preset coordinate axis direction as the traversal direction and the preset traversal width as the traversal window, in the traversal process from the first end to the second end of the target three-dimensional model, the current traversal state of the target first vertex and the target second vertex is determined. The target first vertex is any one of the multiple first vertices on the target three-dimensional model, the target second vertex is any one of the multiple second vertices on the target three-dimensional model, and the traversal state includes not traversed, traversing, and traversed.

[0060] Specifically, in a traversal window with a preset coordinate axis direction as the traversal direction and a preset traversal width, during the traversal process from the first end to the second end of the target three-dimensional model, when the target first vertex or the target second vertex is within the traversal window, the current traversal state of the target first vertex or the target second vertex is determined to be traversing; when the target first vertex or the target second vertex is outside the traversal window, if the traversal window does not pass through the target first vertex or the target second vertex, the current traversal state of the target first vertex or the target second vertex is determined to be not traversed; on the contrary, if the traversal window has passed through the target first vertex or the target second vertex, the current traversal state of the target first vertex or the target second vertex is determined to be traversed.

[0061] Next, combine Figure 4 , the process of traversing the target three-dimensional model is illustrated by way of example, Figure 4 A schematic diagram of traversing a target three-dimensional model provided in one embodiment of the present application.

[0062] like Figure 4As shown, taking the target three-dimensional model as a pig head model as an example, the maximum and minimum Z-axis coordinates (both absolute values) of the pig head model in the Z-axis direction are obtained, and Zmax and Zmin are obtained. The reverse direction of the Z axis is used as the preset coordinate axis direction, and the three-dimensional cylinder is used as the traversal window to traverse the pig head model. Taking the three vertices on the pig head model as an example, the current traversal state of vertex 1 is not traversed, the current traversal state of vertex 2 is traversing, and the current traversal state of vertex 3 is traversed.

[0063] In an embodiment of the present application, during traversal of the target three-dimensional model, the pixel value corresponding to the first vertex of the target is adjusted based on the first texture map and the second texture map according to the current traversal state of the first vertex of the target, so that after the traversal is completed, the texture map currently used by the target three-dimensional model is switched from the first texture map to the second texture map.

[0064] Specifically, when the current traversal state of the first vertex of the target is not traversed, if the UV coordinate corresponding to the first vertex of the target in the first texture map is UV coordinate 1, the pixel value corresponding to UV coordinate 1 in the first texture map is maintained as the pixel value of the first vertex of the target. In the process of switching the current traversal state of the first vertex of the target from traversing to traversed, the pixel value corresponding to the first vertex of the target is gradually transitioned from the pixel value of the UV coordinate corresponding to the first vertex of the target in the first texture map to the pixel value of the UV coordinate corresponding to the first vertex of the target in the second texture map.

[0065] For example, when the current traversal state of the first vertex of the target is traversing, if the UV coordinates corresponding to the first vertex of the target in the first texture map and the second texture map are UV coordinates 1 and UV coordinates 2 respectively, then, according to the degree of traversal, interpolation is performed between the pixel value corresponding to UV coordinate 1 in the first texture map and the pixel value corresponding to UV coordinate 2 in the second texture map to determine the pixel value of the first vertex of the target. When the current traversal state of the first vertex of the target is traversed, if the UV coordinate corresponding to the first vertex of the target in the second texture map is UV coordinate 2, the pixel value corresponding to UV coordinate 2 in the second texture map is used as the pixel value of the first vertex of the target.

[0066] In the embodiment of the present application, during the traversal of the target three-dimensional model, the pixel value and target style of the target preset sheet model placed at the target second vertex are adjusted according to the current traversal state of the target second vertex. The target style includes at least one of the following: size, rotation angle, but is not limited thereto.

[0067] For adjusting the pixel value of the target preset sheet model placed at the second vertex of the target, specifically, when the current traversal state of the second vertex of the target is not traversed, if the UV coordinate corresponding to the first vertex closest to the second vertex of the target in the first texture map is UV coordinate 3, then the pixel value corresponding to UV coordinate 3 in the first texture map is maintained as the pixel value of the target preset sheet model placed at the second vertex of the target. When the current traversal state of the second vertex of the target is traversing, if the UV coordinates corresponding to the first vertex closest to the second vertex of the target in the first texture map and the UV coordinate 4 in the second texture map are respectively UV coordinate 3 and UV coordinate 4, then, according to the degree of traversal, interpolation is performed between the pixel value corresponding to UV coordinate 3 in the first texture map and the pixel value corresponding to UV coordinate 4 in the second texture map to determine the pixel value of the target preset sheet model placed at the second vertex of the target. When the current traversal state of the second vertex of the target is traversed, if the UV coordinate corresponding to the first vertex closest to the second vertex of the target in the second texture map is UV coordinate 4, then the pixel value corresponding to UV coordinate 4 in the second texture map is used as the pixel value of the target preset sheet model placed at the second vertex of the target.

[0068] For adjusting the target style of the target preset sheet model placed at the target second vertex, specifically, when the target style includes a rotation angle, when the current traversal state of the target second vertex is not traversed, the rotation angle of the target preset sheet model placed at the target second vertex is rotation angle 1, such as 0°; when the current traversal state of the target second vertex is traversed, the rotation angle of the target preset sheet model placed at the target second vertex is rotation angle 2, such as 180°; when the current traversal state of the target second vertex is traversing, according to the traversal degree of the target second vertex, the rotation angle of the target preset sheet model placed at the target second vertex is transitioned between rotation angle 1, such as 0° and rotation angle 2, such as 180°.

[0069] For adjusting the target style of the target preset sheet model placed at the target second vertex, specifically, when the target style includes size, when the current traversal state of the target second vertex is untraversed and traversed, the size scaling ratio is maintained at the first scaling ratio, such as zero; when the current traversal state of the target second vertex is in the traversal process from untraversed to traversed, the size scaling ratio of the target preset sheet model placed at the target second vertex can first be scaled from the first scaling ratio, such as zero, to the second scaling ratio, such as one, and then scaled from the second scaling ratio, such as one, to the first scaling ratio, such as zero.

[0070] For example, the target three-dimensional model is a pig head model, and the preset sheet model is a scale model, that is, a scale model with a size scaling of zero (i.e., a first scaling ratio) is placed at each second vertex on the pig head model, and the scale model is invisible before the pig head model is traversed from the first end to the second segment. Below, the adjustment of the pixel value, size, and scaling ratio of the scale model is described when the target second vertex is in the states of not traversed, traversing, and traversed, respectively.

[0071] When the current traversal state of the target second vertex is untraversed, if the UV coordinate corresponding to the first vertex closest to the target second vertex in the first texture map is UV coordinate 3, the pixel value corresponding to UV coordinate 3 in the first texture map is kept as the pixel value of the target flake model placed at the target second vertex. And the rotation angle and size scaling ratio of the target flake model are 0° and zero respectively.

[0072] When the current traversal state of the second vertex of the target is traversing, if the UV coordinates of the first vertex closest to the second vertex of the target in the first texture map and the second texture map are UV coordinates 3 and 4 respectively, then, according to the degree of traversal, interpolation is performed between the pixel value corresponding to UV coordinate 3 in the first texture map and the pixel value corresponding to UV coordinate 4 in the second texture map to determine the pixel value of the target flake model. According to the degree of traversal of the second vertex of the target, the rotation angle of the target flake model is transitioned between (0°, 180°). The size scaling ratio of the target flake model can first transition between (0, 1] and then between [1, 0).

[0073] When the current traversal state of the target second vertex is traversed, the pixel value corresponding to UV coordinate 4 in the second texture map is used as the pixel value of the target flake model, and the rotation angle and size scaling ratio of the target flake model are 180° and zero respectively.

[0074] In this way, during the traversal of the pig head model from the first end to the second end, the texture map currently used by the pig head model is switched from the first texture map to the second texture map. At the same time, for the target second vertex in the traversal, the color of the target scale model placed at the target second vertex gradually switches from the pixel value corresponding to the UV coordinate 3 in the first texture map to the pixel value corresponding to the UV coordinate 4 in the second texture map, which is synchronized with the entire color switching of the pig head model. At the same time, the rotation angle of the target scale model is transitioned between (0°, 180°), and the size scaling ratio can be first transitioned between (0, 1] and then between [1, 0]. In this way, the size scaling ratio of the scale model is first transitioned between (0, 1] and then between [1, 0), so that the effect looks like the scales are gradually growing out of the surface of the pig head model and then gradually disappearing. At the same time, a 180° rotation is applied to the target scale model during this process, which ultimately makes it look as if the scale model is flipped and the size changes, causing the color of the pig head model to change. This enriches the color change effect of the texture map of the pig head model transitioning from the first texture map to the second texture map, making it look more natural and realistic.

[0075] The animation effect rendering method provided by the embodiment of the present application first obtains a target three-dimensional model, the target three-dimensional model includes a plurality of first vertices and a plurality of second vertices, the texture map configured for the target three-dimensional model includes a first texture map and a second texture map, the texture map currently used by the target three-dimensional model is the first texture map, and a preset sheet model with a size ratio scaled to the first scaling ratio is placed on each second vertex. Afterwards, with the preset coordinate axis direction as the traversal direction and the preset traversal width as the traversal window, in the process of traversing from the first end to the second end of the target three-dimensional model, the current traversal status of the target first vertex and the target second vertex is determined, the target first vertex is any one of the plurality of first vertices, the target second vertex is any one of the plurality of second vertices, and the traversal status includes not traversed, traversing, and traversed. In the process of switching the current traversal state of the first vertex of the target from being traversed to having been traversed, the pixel value corresponding to the first vertex of the target is switched from the pixel value of the UV coordinate corresponding to the first vertex of the target in the first texture map to the pixel value of the UV coordinate corresponding to the first vertex of the target in the second texture map, so that after completing the traversal of the target three-dimensional model from the first end to the second end, the texture map currently used by the target three-dimensional model is switched from the first texture map to the second texture map. According to the current traversal state of the second vertex of the target, the pixel value and target style of the target preset sheet model placed at the second vertex of the target are adjusted.

[0076] Compared with the prior art, in the process of traversing the target three-dimensional model based on the traversal window, the texture map of the target three-dimensional model in the traversal window is transitioned from the first texture map to the second texture map, and the pixel value of the target preset sheet model placed at the second vertex of the target in the traversal window is adjusted at the same time, so that the target preset model is synchronized with the entire color switch of the target three-dimensional model, and the target style of the target preset sheet model is adjusted at the same time. In the end, it looks like the change of the target style of the preset sheet model causes the transition color change of the target three-dimensional model, which enriches the color change animation effect of the texture map of the target three-dimensional model transitioning from the first texture map to the second texture map, making the whole process look more natural and real.

[0077] Based on the above embodiments, the animation effect rendering method provided in the embodiments of the present application is further described below.

[0078] In an optional implementation manner, a possible implementation manner of "determining the current traversal state of the target second vertex" in step S20 includes steps S201-S202:

[0079] S201: Determine the relative position between the second vertex of the target and the traversal window along a preset coordinate axis direction.

[0080] In the embodiment of the present application, along the preset coordinate axis direction, the relative position between the target second vertex and the traversal window includes the target second vertex being located before, between, and after the traversal window. It should be noted that the method for determining the relative position between the target first vertex and the traversal window is the same as the method for determining the relative position between the target first vertex and the traversal window. For the sake of simplicity, the relative position between the target second vertex and the traversal window is determined as an example to illustrate the specific determination method.

[0081] An optional implementation method, first obtain the first coordinate range covered by the target three-dimensional model in the preset coordinate axis direction. Determine the first coordinate value of the target second vertex in the preset coordinate axis direction. Based on the first coordinate range, normalize the first coordinate value to obtain the second coordinate value. Obtain the third coordinate value of the current traversal center in the preset coordinate axis direction. Calculate the difference between the second coordinate value and the starting coordinate value of the traversal window in the preset coordinate axis direction to obtain the first difference. Based on the first width range, normalize the first difference to obtain the traversal state value. Among them, the minimum width of the first width range is zero, the maximum width is the preset traversal width, the traversal state value is used to characterize the relative position between the target second vertex and the traversal window, the traversal state value has a value range of [0,1], and the traversal state value equal to 0 indicates that the target second vertex is located after the traversal window along the preset coordinate axis direction. The traversal state value is greater than 0 and less than 1, indicating that the target second vertex is located within the traversal window along the preset coordinate axis direction. The traversal state value is greater than 0, indicating that the target second vertex is located before the traversal window along the preset coordinate axis direction.

[0082] Exemplarily, taking the target three-dimensional model as a pig head model, the length coverage range of the pig head model in the Z-axis direction (i.e., the first coordinate range) is [Zmin, Zmax]. Assuming that there is a target second vertex with a coordinate of Pp on the pig head model, Pp.z is the first coordinate value of the target second vertex in the preset coordinate axis direction, i.e., the Z-axis. Then, referring to Formula 1, the 0-1 representation value, i.e., the second coordinate value, of the target second vertex located in the Z-axis range of the pig head model can be obtained.

[0083] z01=Remap(Pp.z,Zmin,Zmax,0,1) Formula 1

[0084] Among them, the Remap function is used to map Pp.z from the range [Zmin, Zmax] to the range [0, 1], and z01 is the second coordinate value of the second vertex of the target in the direction of the preset coordinate axis.

[0085] Next, the method of determining the transition center is described according to the different times of traversing the target three-dimensional model.

[0086] An optional implementation method, assuming that the length range of the target 3D model in the Z-axis direction is [Zmin, Zmax], and the target 3D model is only traversed once from the x1th second to the x2th second of the entire game, the traversal center L = Remap(t,x1,x2,0,1). Where t is the length of the game start. For example, if the target 3D model is traversed only once from the 10th second to the 15th second after the game starts, then from the 10th second to the 15th second, the traversal center L = Remap(t1,10,15,0,1), 10≤t1≤15.

[0087] Another optional implementation, assuming that the length range of the target three-dimensional model in the Z-axis direction is [Zmin, Zmax], and that the target three-dimensional model is periodically traversed throughout the game, assuming the game time GameTime, then the traversal center is L = Frac(GameTime). Among them, Frac(x) represents the decimal part of x. For any positive real number x, the result of Frac(x) is always between [0, 1). For example, the result of Frac(3.75) is 0.75. In other words, a loop function is created using the game time GameTime. Since the value of L returns to 0 each time GameTime increases by an integer multiple, L has a periodic characteristic. By using the L value obtained by Frac(GameTime), the traversal process of the target three-dimensional model can be repeated periodically. For example Figure 5 As shown, Figure 5 This is a schematic diagram of a periodic change of traversal provided in one embodiment of the present application. Figure 5 As shown, it includes (a) and (b). Figure 5 In (a), x is a monotonically increasing function, such as Figure 5 In (b), Frac(x) is shown as a periodically changing function.

[0088] After the traversal center L is determined, the traversal state value of the target second vertex may be determined by referring to Formula 2.

[0089] c=Remap(z01-(L-width / 2),0,width,0,1) Formula 2

[0090] Wherein, width is the preset traversal width of the traversal window, c is the traversal state value of the second vertex of the target, z01-(L-width / 2) is the first difference, and [0,width] is the first width range. When c is equal to 0, it indicates that the second vertex of the target is located after the traversal window along the preset coordinate axis. When c is less than 0 and greater than 1, it indicates that the second vertex of the target is located within the traversal window along the preset coordinate axis. When c is equal to 1, it indicates that the second vertex of the target is located before the traversal window along the preset coordinate axis.

[0091] Furthermore, in order to limit the value of c to the interval [0,1] and avoid interpolation overflow, refer to Formula 3 to limit the value of c.

[0092] c=Clamp(c,0,1) Formula 3

[0093] The Clamp function is used to limit the value of c to the interval [0,1]. Specifically, if c is less than 0, it returns 0; if c is greater than 1, it returns 1; if c is greater than or equal to 0 and less than or equal to 1, it returns c itself.

[0094] S202: Determine a current traversal state of the target second vertex according to a relative position between the target second vertex and the traversal window.

[0095] An optional implementation manner, based on the above traversal state value can reflect the relative position between the target second vertex and the traversal window, therefore, according to the traversal state value of the target second vertex, the current traversal state of the target second vertex is determined. Specifically, when the traversal state value is equal to 0, the current traversal state of the target second vertex is not traversed. When the traversal state value is greater than 0 and less than 1, the current traversal state of the target second vertex is traversing. When the traversal state value is equal to 1, the current traversal state of the target second vertex is traversed.

[0096] In an optional implementation, each first vertex in the target three-dimensional model corresponds to the same UV coordinate in the first texture map and the second texture map. For example, taking the three first vertices in the target three-dimensional model as an example, the UV coordinates corresponding to the three first vertices in the first texture map are (x1, y1), (x 20 ,y 20 )、(x 15 ,y 15 ), the UV coordinates of the three first vertices in the second texture map are (x1, y1), (x 20 ,y 20 )、(x 15 ,y 15 ).

[0097] In an optional implementation, when each first vertex in the target three-dimensional model corresponds to the same UV coordinate in the first texture map and the second texture map, a possible implementation method of "adjusting the pixel value of the target preset sheet model placed at the target second vertex according to the current traversal state of the target second vertex" in step S40 includes the following steps: using the traversal state value of the target second vertex as an interpolation factor, linearly interpolating between the first pixel value and the second pixel value to obtain the target pixel value. The first pixel value is the pixel value of the UV coordinate corresponding to the first vertex closest to the target second vertex in the second texture map, and the second pixel value is the pixel value of the UV coordinate corresponding to the first vertex closest to the target second vertex in the first texture map. The pixel value of the target preset sheet model is adjusted to the target pixel value.

[0098] Exemplarily, taking the first pixel value as C1 and the second pixel value as C2 as an example, c is the traversal state value of the target second vertex, and referring to Formula 4, the target preset sheet model is calculated to determine the target pixel value.

[0099] FinalC=Lerp(C1,C2,c) Formula 4

[0100] As described above, the Lerp function is used to perform linear interpolation between the pixel value C1 and the pixel value C2, and calculate a pixel value as a target pixel value according to an interpolation factor between 0 and 1, namely, the traversal state value c.

[0101] One point that needs to be emphasized is that in order to correctly attach the first texture map and the second texture map to the preset sheet model, the UV coordinates of the first vertex closest to the preset sheet model are transferred through a UV mapping. The UV Transfer function provided by Houdini can be used to match the first vertex on the preset sheet model and the target 3D model through the nearest position and transfer UV to obtain the correct UV coordinates, so that the mapping effect of the preset sheet model corresponds to the mapping effect of the target 3D model.

[0102] Next, combine Figure 6 , Figure 7 and Figure 8 , taking the target 3D model as a pig head model and the preset flake model as a scale model as an example, the different mapping effects of the preset flake model are explained. Figure 6 This is a mapping effect for a preset sheet model error provided by one embodiment of the present application. Figure 7 This is a schematic diagram of a texture of a preset sheet model before and after UV transfer provided in one embodiment of the present application. Figure 8 This is a mapping effect on a preset sheet model after UV transfer provided by one of the embodiments of the present application.

[0103] like Figure 6 As shown in the figure, the entire first map texture is pasted on a single scale model, and the wrong tiling is shown as shown in the figure. This mapping effect shows that the scale model divides the pig head model into local blocks, which makes it difficult to naturally integrate the scale model into the pig head model. Figure 7 The effect before mapping is as shown in Figure 6 As shown in the figure, the entire first map texture is pasted on a single scale model to present the mapping effect, as shown in the figure. Figure 7 The mapping effect shown in is the mapping effect presented after UV transfer uses the pixel value corresponding to the UV coordinate of the first vertex closest to the scale model in the first mapping texture as the pixel value of the scale model. Figure 8 The texture effect before UV mapping is shown in Figure 1 ,like Figure 8 The texture effect after UV mapping is shown in Figure 2 , the map effect Figure 2 The effect presented is that the color of the scale model can correspond to the color of the position of the pig head model, so that the scale model can be better integrated into the pig head model.

[0104] In an optional implementation, the target style includes a rotation state, so that when the target second vertex is in the process of traversal, the rotation angle of the preset sheet model at the target second vertex can be adjusted synchronously. When the target style is in a rotation state, a possible implementation method of "adjusting the target style of the target preset sheet model placed at the target second vertex according to the current traversal state of the target second vertex" in step S40 includes the following steps: determining a rotation center for the target preset sheet model placed at the target second vertex. Using the traversal state value of the target second vertex as an interpolation factor, linear interpolation is performed between the first rotation angle and the second rotation angle to obtain a target rotation angle, and the second rotation angle is greater than the first rotation angle. Control the target preset sheet model to rotate around the rotation center to the target rotation angle.

[0105] Exemplarily, taking the first rotation angle as 0° and the second rotation angle as 180° as an example, c is the traversal state value of the second vertex of the target, and the target rotation angle is determined by calculating the target preset sheet model with reference to Formula 5.

[0106] FinalAngle=Lerp(0°,180°,c) Formula 5

[0107] As described above, the Lerp function is used to perform linear interpolation between the first rotation angle 0° and the second rotation angle 180°, and calculate a rotation angle as the target rotation angle FinalAngle according to an interpolation factor between 0 and 1, namely, the traversal state value c.

[0108] In an optional implementation, the target style includes a size, so that when the second vertex of the target is being traversed, the size of the preset sheet model at the second vertex of the target can be adjusted synchronously.

[0109] When the target style is size, a possible implementation of "adjusting the target style of the target preset sheet model placed at the target second vertex according to the current traversal state of the target second vertex" in step S40 includes the steps of: determining a rotation center for the target preset sheet model placed at the target second vertex. When the current traversal state of the target second vertex is traversing, determining a target scaling ratio according to the distance between the target second vertex and the current traversal center. Scaling the size of the target preset sheet model to the target scaling ratio.

[0110] In an optional implementation, a possible implementation of the above step of "determining the target zoom ratio according to the distance between the target second vertex and the current traversal center when the current traversal state of the target second vertex is traversing" includes the steps of: determining the absolute difference between the first coordinate value and the third coordinate value. Based on the second width range, the absolute difference is normalized to obtain a zoom state value; wherein the minimum width of the second width range is zero and the maximum width is half of the preset traversal width. Using the zoom state value as an interpolation factor, linear interpolation is performed between the first zoom ratio and the second zoom ratio to obtain the target zoom ratio.

[0111] In the embodiment of the present application, during the entire process of the target second vertex being traversed, the size scaling ratio of the target preset sheet model placed at the target second vertex is scaled from the first scaling ratio to the second scaling ratio, and then from the second scaling ratio to the first scaling ratio. Below, the scaling state value and the target scaling ratio are calculated with reference to Formula 6 and Formula 7, respectively.

[0112] cs=Remap(abs(z01-L),0,width / 2,0,1) Formula 6

[0113] s=Lerp(sc1,sc2,cs) Formula 7

[0114] Among them, the abs function is used to calculate the absolute difference between the first coordinate value z01 and the third coordinate value L, [0, width / 2] is the second width range, and according to an interpolation factor between 0 and 1, that is, the scaling state value cs, the Lerp function is used to perform linear interpolation between the first scaling ratio sc1 and the second scaling ratio sc2 based on cs as the scaling state value to calculate a scaling ratio as the target scaling ratio s.

[0115] In an optional implementation, the preset sheet model includes a plurality of third vertices. A possible implementation of the above step of "determining the rotation center for the target preset sheet model placed at the target second vertex" is as follows: determining the center of the bottom edge connected by the third vertices in the target preset sheet model as the rotation center of the target preset sheet model.

[0116] In the embodiment of the present application, for the preset sheet model placed at each second vertex on the target three-dimensional model, the bottom edge center position of the preset sheet model is set as the rotation center of the preset sheet model, and the rotation center is stored on each third vertex included in the preset sheet model. It can be understood that a common rotation center attribute is stored on the four vertices of the preset sheet model to ensure that all third vertices of the preset sheet model share the same rotation center.

[0117] by Figure 3Taking the scale model shown as an example, the bottom edge includes two third vertices, and the coordinates of the midpoint on the line connecting the two third vertices are determined as the rotation center of the scale model, i.e., the pivot. In this way, when the scale model rotates, the scale rotates with the bottom edge as the rotation axis, and it looks like the scale model grows on the surface of the target three-dimensional model and rotates.

[0118] Next, combine Fig. 9 Taking the target 3D model as a pig head model and the preset flake model as a scale model as an example, the different zoom effects achieved by setting the zoom center and not setting the zoom center are explained. Fig. 9 A schematic diagram of two zoom effects provided for one embodiment of the present application.

[0119] like Fig. 9 As shown, including (a) and (b). The coordinates of the midpoint on the bottom edge of the scale model are determined as the rotation center of the scale model, i.e., the pivot. In this way, when scaling the scale model, the scale model is scaled as a whole. Fig. 9 The correct scaling effect is shown in (a) in the figure. If the scaling center is not set for the scale model, then when scaling the scale model, the pig head model is taken as a whole, and the entire pig head model and the scale model on the pig head model are scaled as shown in the figure. Fig. 9 The incorrect scaling effect shown in (b).

[0120] In an optional implementation manner, the animation effect rendering method provided in the embodiment of the present application also includes the steps of: after traversing one round of the target three-dimensional model, before conducting the next round of traversing the target three-dimensional model from the first end to the second end, adjusting the pixel value of the target preset sheet model placed at the second vertex of the target to an initial pixel value, and the initial pixel value is the pixel value of the corresponding UV coordinate closest to the second vertex of the target in the first texture map.

[0121] In an embodiment of the present application, there will be a jump in the pixel values ​​of all the target second vertices in the current round of traversal from the first end to the second end of the target three-dimensional model, that is, the pixel value of the target preset sheet model placed at the target second vertex will jump to the initial pixel value, and the initial pixel value is the pixel value of the UV coordinate corresponding to the first vertex closest to the target second vertex in the first texture map.

[0122] For example, in the first round of traversal from the first end to the second end of the target three-dimensional model, when the second round of traversal is performed, the pixel values ​​of the preset sheet models placed at the second vertices of all the targets will have a jump. The parity T of the traversal rounds is determined by referring to Formula 8.

[0123] T=Floor(GameTime)%2Formula 8

[0124] Among them, the Floor function is used to obtain the integer part of the traversal round of GameTime, and % represents the remainder, so that when T is 0, the traversal round is an even number, and when T is 1, the traversal round is an odd number. Since the number of traversal rounds starts from 0, the jump of the traversal state value is realized based on the following formula 9, and then the pixel value of the preset sheet model placed at the second vertex of all targets is jumped according to the jump of the traversal state value.

[0125] if(T==1){c=1-c;}Formula 9

[0126] Among them, when the traversal round is an odd number, the traversal state value jumps, that is, jumps from 1 to 0.

[0127] In an optional implementation manner, the animation effect rendering method provided in the embodiment of the present application further includes the step of: when the current traversal state of the second vertex of the target is in traversal, enhancing the display of the target preset sheet model placed at the second vertex of the target to highlight the shape of the target preset sheet model, which further enriches the display effect of the target preset sheet model. Among them, the enhanced display method includes but is not limited to highlighting the contour edge of the preset sheet model and adding a highlight effect. For example, adding a self-luminous edge to the preset sheet model to highlight the shape of the preset sheet model. Fig.10 This is a schematic diagram of enhancing the display of a target preset sheet model provided by one embodiment of the present application. Fig.10 As shown, including (a) and (b). Fig.10 The scale model shown in (a) Fig.10 The scale model shown in (b) has a self-luminous edge to highlight the shape of each scale model, which further enriches the display effect of the scale model.

[0128] The animation effect rendering device provided in the present application is described below. The animation effect rendering device described below and the animation effect rendering method described above can be referenced to each other.

[0129] Fig.11 This is a schematic diagram of the structure of an animation effect rendering device provided in one embodiment of the present application. Fig.11 As shown, the animation effect rendering device 1100 includes: an acquisition module 1101 , a determination module 1102 , a first adjustment module 1103 , and a second adjustment module 1104 .

[0130] An acquisition module is used to acquire a target three-dimensional model, wherein the target three-dimensional model includes multiple first vertices and multiple second vertices, and the texture map configured for the target three-dimensional model includes a first texture map and a second texture map. The texture map currently used by the target three-dimensional model is the first texture map, and a preset sheet model with a size ratio scaled to a first scaling ratio is placed on each of the second vertices.

[0131] A determination module is used to determine the current traversal status of a target first vertex and a target second vertex during the traversal from the first end to the second end of the target three-dimensional model with a preset coordinate axis direction as the traversal direction and a preset traversal width as the traversal window, wherein the target first vertex is any one of a plurality of first vertices, and the target second vertex is any one of a plurality of second vertices, and the traversal status includes not traversed, traversing, and traversed.

[0132] The first adjustment module is used to switch the pixel value corresponding to the first vertex of the target from the pixel value of the UV coordinate corresponding to the first vertex of the target in the first texture map to the pixel value of the UV coordinate corresponding to the first vertex of the target in the second texture map during the process of switching the current traversal state of the first vertex of the target from traversing to traversed, so that after completing the traversal of the target three-dimensional model from the first end to the second end, the texture map currently used by the target three-dimensional model is switched from the first texture map to the second texture map.

[0133] The second adjustment module is used to adjust the pixel value and target style of the target preset sheet model placed at the target second vertex according to the current traversal state of the target second vertex.

[0134] In an optional implementation manner, the determining module is specifically configured to:

[0135] The relative position between the target second vertex and the traversal window is determined along the preset coordinate axis direction.

[0136] The current traversal state of the target second vertex is determined according to the relative position between the target second vertex and the traversal window.

[0137] In an optional implementation manner, the determining module is specifically configured to:

[0138] A first coordinate range covered by the target three-dimensional model in the direction of the preset coordinate axis is obtained.

[0139] Determine a first coordinate value of the target second vertex in the direction of the preset coordinate axis.

[0140] Based on the first coordinate range, the first coordinate value is normalized to obtain a second coordinate value.

[0141] Get the third coordinate value of the current traversal center in the direction of the preset coordinate axis.

[0142] The difference between the second coordinate value and the starting coordinate value of the traversal window in the direction of the preset coordinate axis is calculated to obtain a first difference value.

[0143] Based on the first width range, the first difference is normalized to obtain a traversal state value. The minimum width of the first width range is zero, the maximum width is the preset traversal width, the traversal state value is used to characterize the relative position between the target second vertex and the traversal window, and the traversal state value has a value range of [0,1]. The traversal state value equal to 0 indicates that along the preset coordinate axis, the target second vertex is located after the traversal window. The traversal state value greater than 0 and less than 1 indicates that along the preset coordinate axis, the target second vertex is located within the traversal window. The traversal state value greater than 0 indicates that along the preset coordinate axis, the target second vertex is located before the traversal window.

[0144] In an optional implementation manner, the determining module is specifically configured to:

[0145] When the traversal state value is equal to 0, the current traversal state of the target second vertex is untraversed.

[0146] When the traversal state value is greater than 0 and less than 1, the current traversal state of the target second vertex is traversing.

[0147] When the traversal state value is equal to 1, the current traversal state of the target second vertex is traversed.

[0148] In an optional implementation manner, each first vertex in the target three-dimensional model corresponds to the same UV coordinate in the first texture map and the second texture map. The second adjustment module is specifically configured to:

[0149] The traversal state value of the target second vertex is used as an interpolation factor, and linear interpolation is performed between the first pixel value and the second pixel value to obtain the target pixel value, wherein the first pixel value is the pixel value of the UV coordinate corresponding to the first vertex closest to the target second vertex in the second texture map, and the second pixel value is the pixel value of the UV coordinate corresponding to the first vertex closest to the target second vertex in the first texture map.

[0150] The pixel value of the target preset sheet model is adjusted to the target pixel value.

[0151] In an optional implementation manner, the target style includes a rotation state. The second adjustment module is specifically configured to:

[0152] A rotation center is determined for a preset sheet model of the target placed at the second vertex of the target.

[0153] The traversal state value of the target second vertex is used as an interpolation factor, and linear interpolation is performed between the first rotation angle and the second rotation angle to obtain a target rotation angle, where the second rotation angle is greater than the first rotation angle.

[0154] The target preset sheet model is controlled to rotate around the rotation center to the target rotation angle.

[0155] In an optional implementation manner, the target style includes a size. The second adjustment module is specifically configured to:

[0156] Determining a rotation center for a preset sheet model of a target placed at a second vertex of the target;

[0157] When the current traversal state of the target second vertex is traversing, the target scaling ratio is determined according to the distance between the target second vertex and the current traversal center.

[0158] The size of the target preset sheet model is scaled to the target scaling ratio.

[0159] In an optional implementation manner, the preset sheet model includes a plurality of third vertices. The second adjustment module is specifically configured to:

[0160] The center of the bottom edge connected by the third vertices in the target preset sheet model is determined as the rotation center of the target preset sheet model.

[0161] In an optional implementation manner, the second adjustment module is specifically used to:

[0162] An absolute difference between the first coordinate value and the third coordinate value is determined.

[0163] Based on a second width range, the absolute difference is normalized to obtain a zoom state value; wherein the minimum width of the second width range is zero, and the maximum width is half of the preset traversal width;

[0164] The zoom state value is used as an interpolation factor, and linear interpolation is performed between the first zoom ratio and the second zoom ratio to obtain a target zoom ratio.

[0165] In an optional implementation manner, before acquiring the target three-dimensional model, the device further includes a creation module, wherein the creation module is specifically configured to:

[0166] An initial three-dimensional model is obtained, where the initial three-dimensional model includes a plurality of first vertices.

[0167] Points are scattered on the surface of the initial three-dimensional model, and after the points are scattered, a plurality of second vertices are generated on the surface of the initial three-dimensional model.

[0168] A preset sheet model is obtained, where the preset sheet model includes a plurality of third vertices.

[0169] The preset sheet model is instantiated on each of the second vertices, and the size of the instantiated preset sheet model placed at each of the second vertices is scaled to the first scaling ratio to obtain a target three-dimensional model.

[0170] In an optional implementation manner, the device further includes a processing module, and the processing module is specifically configured to:

[0171] After completing one round of traversal of the target three-dimensional model, before performing the next round of traversal of the target three-dimensional model from the first end to the second end, the pixel value of the target preset sheet model placed at the second vertex of the target is adjusted to an initial pixel value, and the initial pixel value is the pixel value of the UV coordinate corresponding to the first vertex closest to the second vertex of the target in the first texture map.

[0172] In an optional implementation manner, the device further includes a display module, and the display module is specifically used for:

[0173] When the current traversal state of the target second vertex is in traversal, the target preset sheet model placed at the target second vertex is enhanced and displayed.

[0174] The animation effect rendering device provided in this embodiment can be used to execute the technical solution of the above-mentioned animation effect rendering method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.

[0175] Fig.12 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application is shown in FIG. Fig.12 As shown, the electronic device 1200 of this embodiment includes: a processor 1201 and a memory 1202.

[0176] The memory 1202 is used to store computer-executable instructions.

[0177] The processor 1201 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the animation effect rendering method in the above embodiment. For details, please refer to the relevant description in the above method embodiment.

[0178] Optionally, the memory 1202 may be independent or integrated with the processor 1201 .

[0179] When the memory 1202 is independently provided, the electronic device further includes a bus 1203 for connecting the memory 1202 and the processor 1201 .

[0180] One embodiment of the present application further provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, a technical solution corresponding to the animation effect rendering method in any of the above embodiments executed by the electronic device is implemented.

[0181] One embodiment of the present application also provides a computer program product, which includes: a computer program, which is stored in a readable storage medium. At least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the technical solution corresponding to the animation effect rendering method in any of the above embodiments.

[0182] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.

[0183] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0184] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application.

[0185] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0186] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0187] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0188] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0189] Those skilled in the art will appreciate that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed. The aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.

[0190] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the above embodiments can still be modified, or some or all of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for rendering animation effects, characterized in that: The method comprises: Acquire a target three-dimensional model, the target three-dimensional model comprising a plurality of first vertices and a plurality of second vertices, the texture map configured for the target three-dimensional model comprising a first texture map and a second texture map, the texture map currently used by the target three-dimensional model is the first texture map, and a preset sheet model with a size ratio scaled to a first scaling ratio is placed on each of the second vertices; Taking a preset coordinate axis direction as a traversal direction and a preset traversal width as a traversal window, in a traversal process from a first end to a second end of the target three-dimensional model, determining a current traversal state of a target first vertex and a target second vertex, wherein the target first vertex is any one of a plurality of first vertices, and the target second vertex is any one of a plurality of second vertices, and the traversal state includes not traversed, traversing, and traversed; In the process of switching the current traversal state of the first vertex of the target from being traversed to being traversed, switching the pixel value corresponding to the first vertex of the target from the pixel value of the UV coordinate corresponding to the first vertex of the target in the first texture map to the pixel value of the UV coordinate corresponding to the first vertex of the target in the second texture map, so that after completing the traversal of the target three-dimensional model from the first end to the second end, the texture map currently used by the target three-dimensional model is switched from the first texture map to the second texture map; According to the current traversal state of the target second vertex, the pixel value and target style of the target preset sheet model placed at the target second vertex are adjusted.

2. The method according to claim 1, characterized in that The determining the current traversal state of the target second vertex includes: Determine the relative position between the second vertex of the target and the traversal window along the preset coordinate axis direction; The current traversal state of the target second vertex is determined according to the relative position between the target second vertex and the traversal window.

3. The method according to claim 2, characterized in that The determining the relative position between the target second vertex and the traversal window comprises: Acquire a first coordinate range covered by the target three-dimensional model in the direction of the preset coordinate axis; Determine a first coordinate value of the target second vertex in the direction of the preset coordinate axis; Based on the first coordinate range, normalize the first coordinate value to obtain a second coordinate value; Obtain the third coordinate value of the current traversal center in the direction of the preset coordinate axis; Calculate the difference between the second coordinate value and the starting coordinate value of the traversal window in the direction of the preset coordinate axis to obtain a first difference; Based on a first width range, the first difference is normalized to obtain a traversal state value; wherein, the minimum width of the first width range is zero, and the maximum width is the preset traversal width, and the traversal state value is used to characterize the relative position between the target second vertex and the traversal window, and the value range of the traversal state value is [0,1], and the traversal state value equal to 0 indicates that along the preset coordinate axis direction, the target second vertex is located after the traversal window; the traversal state value greater than 0 and less than 1 indicates that along the preset coordinate axis direction, the target second vertex is located within the traversal window; the traversal state value greater than 0 indicates that along the preset coordinate axis direction, the target second vertex is located before the traversal window.

4. The method according to claim 3, characterized in that The determining the current traversal state of the target second vertex according to the relative position between the target second vertex and the traversal window includes: When the traversal state value is equal to 0, the current traversal state of the target second vertex is untraversed; When the traversal state value is greater than 0 and less than 1, the current traversal state of the target second vertex is traversing; When the traversal state value is equal to 1, the current traversal state of the target second vertex is traversed.

5. The method according to claim 3, characterized in that: Each first vertex in the target three-dimensional model corresponds to the same UV coordinate in the first texture map and the second texture map; The step of adjusting the pixel value of the target preset sheet model placed at the target second vertex according to the current traversal state of the target second vertex includes: Using the traversal state value of the target second vertex as an interpolation factor, linear interpolation is performed between the first pixel value and the second pixel value to obtain a target pixel value; wherein the first pixel value is the pixel value of the UV coordinate corresponding to the first vertex closest to the target second vertex in the second texture map, and the second pixel value is the pixel value of the UV coordinate corresponding to the first vertex closest to the target second vertex in the first texture map, and the target first vertex is; The pixel value of the target preset sheet model is adjusted to the target pixel value.

6. The method according to claim 3, characterized in that The target pattern includes a rotation state; The step of adjusting the target style of the target preset sheet model placed at the target second vertex according to the current traversal state of the target second vertex includes: Determining a rotation center for a preset sheet model of a target placed at a second vertex of the target; Using the traversal state value of the second vertex of the target as an interpolation factor, linear interpolation is performed between the first rotation angle and the second rotation angle to obtain a target rotation angle, wherein the second rotation angle is greater than the first rotation angle; The target preset sheet model is controlled to rotate around the rotation center to the target rotation angle.

7. The method according to claim 3, characterized in that The target style includes a size; and adjusting the target style of the target preset sheet model placed at the target second vertex according to the current traversal state of the target second vertex includes: Determining a rotation center for a preset sheet model of a target placed at a second vertex of the target; When the current traversal state of the target second vertex is in traversal, determining the target scaling ratio according to the distance between the target second vertex and the current traversal center; The size of the target preset sheet model is scaled to the target scaling ratio.

8. The method according to claim 7, characterized in that The step of determining the target scaling ratio according to the distance between the target second vertex and the current traversal center includes: determining an absolute difference between the first coordinate value and the third coordinate value; Based on a second width range, the absolute difference is normalized to obtain a zoom state value; wherein the minimum width of the second width range is zero, and the maximum width is half of the preset traversal width; The zoom state value is used as an interpolation factor, and linear interpolation is performed between the first zoom ratio and the second zoom ratio to obtain a target zoom ratio.

9. The method according to claim 6 or 7, characterized in that: The preset sheet model includes a plurality of third vertices; determining a rotation center for the target preset sheet model placed at the target second vertex includes: The center of the bottom edge connected by the third vertices in the target preset sheet model is determined as the rotation center of the target preset sheet model.

10. The method according to claim 1, characterized in that The step of acquiring the target three-dimensional model comprises: Acquire an initial three-dimensional model, wherein the initial three-dimensional model includes a plurality of first vertices; Spreading points on the surface of the initial three-dimensional model, and generating a plurality of second vertices on the surface of the initial three-dimensional model after the points are spread; Acquire a preset sheet model, wherein the preset sheet model includes a plurality of third vertices; The preset sheet model is instantiated on each of the second vertices, and the size of the instantiated preset sheet model placed at each of the second vertices is scaled to the first scaling ratio to obtain a target three-dimensional model.

11. The method according to claim 1, characterized in that: The method further comprises: After completing one round of traversal of the target three-dimensional model, before performing the next round of traversal of the target three-dimensional model from the first end to the second end, the pixel value of the target preset sheet model placed at the second vertex of the target is adjusted to an initial pixel value, and the initial pixel value is the pixel value of the UV coordinate corresponding to the first vertex closest to the second vertex of the target in the first texture map.

12. The method according to claim 1, characterized in that The method further comprises: When the current traversal state of the target second vertex is in traversal, the target preset sheet model placed at the target second vertex is enhanced and displayed.

13. An animation effect rendering device, characterized in that: The device comprises: an acquisition module, configured to acquire a target three-dimensional model, the target three-dimensional model comprising a plurality of first vertices and a plurality of second vertices, the texture map configured for the target three-dimensional model comprising a first texture map and a second texture map, the texture map currently used by the target three-dimensional model is the first texture map, and a preset sheet model with a size ratio scaled to a first scaling ratio is placed on each of the second vertices; A determination module, used to determine the current traversal status of a target first vertex and a target second vertex in a traversal process from a first end to a second end of the target three-dimensional model with a preset coordinate axis direction as a traversal direction and a preset traversal width as a traversal window, wherein the target first vertex is any one of a plurality of first vertices, and the target second vertex is any one of a plurality of second vertices, and the traversal status includes not traversed, traversing, and traversed; a first adjustment module, configured to switch, during a process in which a current traversal state of the target first vertex is switched from being traversed to having been traversed, a pixel value corresponding to the target first vertex from a pixel value of a UV coordinate corresponding to the target first vertex in the first texture map to a pixel value of a UV coordinate corresponding to the target first vertex in the second texture map, so that after completing the traversal of the target three-dimensional model from the first end to the second end, the texture map currently used by the target three-dimensional model is switched from the first texture map to the second texture map; The second adjustment module is used to adjust the pixel value and target style of the target preset sheet model placed at the target second vertex according to the current traversal state of the target second vertex.

14. An electronic device, characterized in that: The electronic device comprises: Processor; and The memory is used to store a data processing program. After the electronic device is powered on and runs the program through the processor, the animation effect rendering method according to any one of claims 1 to 12 is executed.

15. A computer-readable storage medium, characterized in that: A data processing program is stored, and the program is run by a processor to execute the animation effect rendering method as described in any one of claims 1-12.