Sea wave animation generation method and device and sea wave special effect rendering method and device
By using wave animation production tools to adjust the plane model and generate wave animation, the problem of lack of dynamic performance of wave effects in the game is solved, and the dynamic performance of waves and game development efficiency is improved.
Patent Information
- Application Number
- CN202411472125.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, the wave effect in the game lacks dynamic performance, resulting in high game development time cost and low development efficiency.
By creating a plane model and calling the wave animation production tool, the plane model is adjusted based on multiple preset parameter values to generate wave animation. The wave animation production tool includes multiple nodes connected in sequence, each node corresponds to at least one node parameter, the node parameters include multiple node sub-parameters, and the node sub-parameters correspond to the keyframes of the wave animation.
It realizes the dynamic performance of the waves, reduces the time cost during the game development process, and improves the efficiency of game development.
Smart Images

Figure CN119478162A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for generating an ocean wave animation, a method for rendering an ocean wave special effect, and a device, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the rapid advancement of computer technology and graphics processing technology, the gaming industry has entered an unprecedented stage of development. Game developers are no longer only concerned with the richness of game plots and gameplay, but are also paying more and more attention to the user's gaming experience. Special effects, as an important part of the gaming experience, can not only improve the beauty of the game screen, but also enhance the user's sense of immersion.
[0003] At present, in games and other application projects, the performance of special effects varies, and no wave special effects with dynamic effects have been found. The wave effects shown in the game are mainly formed by rendering the pre-created wave model using wave maps, which lacks the dynamic sense of the waves. And when the wave effect in the game is not good, or other forms of wave effects need to be shown, it is often necessary to return to the model making software to recreate a new wave model, which undoubtedly increases the time cost of game development and reduces the efficiency of game development.
[0004] Therefore, there is an urgent need for a method for forming a dynamic wave special effect, so as to improve the dynamic performance of the waves in the game, reduce the time cost of game development, and improve the development efficiency of the game. Summary of the invention
[0005] The present application provides a method for generating an ocean wave animation, a method for rendering an ocean wave special effect, and a device, an electronic device, and a computer-readable storage medium, so as to solve the technical problems existing in the prior art that the ocean wave effect lacks dynamic expression, and the game development time cost is high and the development efficiency is low.
[0006] In a first aspect, an embodiment of the present application provides a method for generating an ocean wave animation, the method comprising: creating a plane model; calling an ocean wave animation production tool, adjusting the shape of the plane model based on a plurality of preset parameter values, and generating an ocean wave animation; wherein the ocean wave animation production tool comprises a plurality of nodes connected in sequence, the nodes being used to characterize operation execution units of the ocean wave animation production tool, each of the nodes corresponding to at least one node parameter, the node parameters comprising a first number of node sub-parameters, the first number being the number of key frames preset for the ocean wave animation, each of the node sub-parameters corresponding to one of the key frames; the parameter values are preset for the node sub-parameters.
[0007] In a second aspect, an embodiment of the present application provides a method for rendering ocean wave special effects, the method comprising: obtaining a vertex animation texture map, the vertex animation texture map being formed by encoding vertex animation data of an ocean wave model in an ocean wave animation into a texture map, and the ocean wave animation being generated based on a method for generating an ocean wave animation; wherein the method for generating an ocean wave animation comprises: creating a plane model; calling an ocean wave animation production tool, and performing morphological adjustments on the plane model based on a plurality of preset parameter values to generate the ocean wave animation; wherein the ocean wave animation production tool comprises a plurality of nodes connected in sequence, the nodes being used to characterize operation execution units of the ocean wave animation production tool, each of the nodes corresponding to at least one node parameter, the node parameters comprising a first number of node sub-parameters, the first number being the number of key frames preset for the ocean wave animation, and each of the node sub-parameters corresponding to one of the key frames; the parameter value being preset for the node sub-parameters; calling a shader, and combining the vertex animation texture map and a water material to render the ocean wave special effects corresponding to the ocean wave animation.
[0008] In a third aspect, an embodiment of the present application provides a device for generating an ocean wave animation, the device comprising: a model creation unit and an animation generation unit; the model creation unit is used to create a plane model; the animation generation unit is used to call an ocean wave animation production tool, and based on a plurality of preset parameter values, the plane model is morphologically adjusted to generate an ocean wave animation; wherein the ocean wave animation production tool comprises a plurality of nodes connected in sequence, the nodes are used to characterize operation execution units of the ocean wave animation production tool, each of the nodes corresponds to at least one node parameter, the node parameters comprise a first number of node sub-parameters, the first number being the number of key frames preset for the ocean wave animation, and each of the node sub-parameters corresponds to one of the key frames; the parameter values are preset for the node sub-parameters.
[0009] In a fourth aspect, an embodiment of the present application provides a rendering device for ocean wave special effects, the device comprising: a map acquisition unit and a special effects rendering unit; the map acquisition unit is used to acquire a vertex animation texture map, the vertex animation texture map is formed by encoding vertex animation data of an ocean wave model in an ocean wave animation into a texture map, and the ocean wave animation is generated based on a method for generating an ocean wave animation; wherein the method for generating an ocean wave animation comprises: creating a plane model; calling an ocean wave animation production tool, and performing morphological adjustment on the plane model based on a plurality of preset parameter values to generate the ocean wave animation; wherein the ocean wave animation production tool comprises a plurality of nodes connected in sequence, the nodes are used to characterize operation execution units of the ocean wave animation production tool, each of the nodes corresponds to at least one node parameter, the node parameters comprise a first number of node sub-parameters, the first number being the number of key frames preset for the ocean wave animation, and each of the node sub-parameters corresponds to one key frame; the parameter value is preset for the node sub-parameter; the special effects rendering unit is used to call a shader, and render the ocean wave special effects corresponding to the ocean wave animation in combination with the vertex animation texture map and a water material.
[0010] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor; the memory is used to store one or more computer instructions; the processor is used to execute the one or more computer instructions to implement the above method.
[0011] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having one or more computer instructions stored thereon, which, when executed by a processor, executes the above method.
[0012] Compared with the prior art, the method for generating a wave animation provided by the present application includes: creating a plane model; calling a wave animation production tool, adjusting the shape of the plane model based on a plurality of preset parameter values, and generating a wave animation; wherein the wave animation production tool includes a plurality of nodes connected in sequence, the node is used to characterize the operation execution unit of the wave animation production tool, each node corresponds to at least one node parameter, the node parameter includes a first number of node sub-parameters, the first number is the number of key frames preset for the wave animation, and each node sub-parameter corresponds to a key frame; the parameter value is preset for the node sub-parameter. First, the method is based on the wave animation production tool and the preset parameter value to adjust the shape of the plane model, thereby generating a wave animation. Therefore, when the wave effect in the game is not well performed, or other forms of wave effects need to be performed, it is not necessary to rebuild the model, and wave animations with different performance effects can be formed by only modifying the parameter value, which reduces the time cost in the game development process and improves the game development efficiency. Second, the node parameters corresponding to each node in the wave animation production tool include a group (first number) of node sub-parameters, and these node sub-parameters correspond to each key frame of the wave animation. Therefore, when the wave animation production tool is called and the parameter values preset for these node sub-parameters are used to change the shape of the plane model, at least a wave model corresponding to each key frame can be formed, thereby generating a wave animation including multiple frames, and realizing the dynamic expression of the waves. Therefore, the wave animation generation method provided by the present application solves the technical problems of the lack of dynamic expression of the wave effect, high game development time cost, and low development efficiency in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is an application system diagram of the method for generating an ocean wave animation provided in an embodiment of the present application;
[0014] Figure 2 It is an application system diagram of the method for rendering ocean wave special effects provided in an embodiment of the present application;
[0015] Figure 3 is a flow chart of a method for generating an ocean wave animation provided in the first embodiment of the present application;
[0016] FIG4( a) is a first schematic diagram of a wave model corresponding to a first key frame provided in the first embodiment of the present application;
[0017] FIG4( b ) is a second schematic diagram of a wave model corresponding to a first key frame provided in the first embodiment of the present application;
[0018] FIG4( c ) is a third schematic diagram of the wave model corresponding to the first key frame provided in the first embodiment of the present application;
[0019] FIG4( d ) is a fourth schematic diagram of a wave model corresponding to a first key frame provided in the first embodiment of the present application;
[0020] FIG4( e ) is a fifth schematic diagram of an ocean wave model corresponding to a first key frame provided in the first embodiment of the present application;
[0021] FIG4( f ) is a sixth schematic diagram of the wave model corresponding to the first key frame provided in the first embodiment of the present application;
[0022] FIG4( g) is a seventh schematic diagram of the wave model corresponding to the first key frame provided in the first embodiment of the present application;
[0023] Figure 5 is a flow chart of a method for rendering ocean wave special effects provided in the second embodiment of the present application;
[0024] Figure 6 is a schematic structural diagram of a device for generating an ocean wave animation provided in a third embodiment of the present application;
[0025] Figure 7 is a schematic structural diagram of a rendering device for ocean wave special effects provided in a fourth embodiment of the present application;
[0026] Figure 8 It is a schematic diagram of the structure of an electronic device provided in the fifth embodiment of the present application. DETAILED DESCRIPTION
[0027] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0028] With the rapid advancement of computer technology and game development technology, the game industry has entered an unprecedented stage of development. Game developers are no longer only concerned with the richness of game plots and gameplay, but are also paying more and more attention to the user's gaming experience. Special effects, as an important part of the gaming experience, can not only improve the beauty of the game screen, but also enhance the user's sense of immersion.
[0029] At present, many types of special effects have appeared in games and other application projects, such as explosion effects, lightning effects, particle effects, etc. The production methods of special effects are different, and the performance effects are also uneven. However, no wave effects with dynamic effects have been found so far. The wave effects shown in the game are mainly formed by rendering the pre-made wave model using wave maps, which lacks the dynamic sense of the waves. And when the wave effect in the game is not good, or other forms of wave effects need to be shown, it is often necessary to return to the model making software to recreate a new wave model, which undoubtedly increases the time cost of game development and reduces the efficiency of game development.
[0030] In view of this, the present application provides a method for generating an ocean wave animation. First, the method is based on an ocean wave animation production tool and preset parameter values to adjust the shape of a plane model, thereby generating an ocean wave animation. Therefore, when the ocean wave effect in the game is not good, or when other forms of ocean wave effects need to be expressed, there is no need to rebuild the model. Ocean wave animations with different performance effects can be formed by simply modifying the parameter values, thereby reducing the time cost in the game development process and improving the game development efficiency. Second, the node parameters corresponding to each node in the ocean wave animation production tool include a group (a first number) of node sub-parameters, and these node sub-parameters correspond to each key frame of the ocean wave animation. Therefore, when the ocean wave animation production tool is called and the shape of the plane model is changed using the preset parameter values for these node sub-parameters, at least the ocean wave model corresponding to each key frame can be formed, thereby generating an ocean wave animation including multiple frames, and realizing the dynamic expression of the ocean wave.
[0031] The following is a further detailed description of the method for generating an ocean wave animation, the method for rendering an ocean wave special effect, and the device, electronic device, and computer-readable storage medium described in the present application in conjunction with specific embodiments and drawings.
[0032] Figure 1 is an application system diagram of the method for generating ocean wave animation provided in the embodiment of the present application. Figure 1As shown, the system includes a first user terminal 101 and a first server terminal 102. The first user terminal 101 can be any device such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant (PDA), etc. The first server terminal 102 can be a processing module located inside the first user terminal 101, or a processing device electrically connected to the first user terminal 101, or a server connected to multiple first user terminals 101 in communication. The first server terminal 102 is deployed with a method for generating an ocean wave animation. In response to receiving multiple parameters sent by the first user terminal 101 (the multiple parameters are preset by the developer based on the first user terminal 101), the first server terminal 102 generates an ocean wave animation that meets the developer's expectations based on the method for generating an ocean wave animation.
[0033] Figure 2 1 is an application system diagram of the method for rendering the sea wave special effects provided in the embodiment of the present application. Figure 2 As shown, the system includes a second user terminal 201, a second server terminal 202, and a third server terminal 203. The second user terminal 201 can be any device such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant (PDA), etc. The second server terminal 202 can be a processing module located inside the second user terminal 201, or a processing device electrically connected to the second user terminal 201, or a server connected to multiple second user terminals 201 in communication. The second server terminal 202 is deployed with a game application for pre-rendered wave special effects and a rendering method for wave special effects. In response to receiving a wave special effect rendering instruction sent by the second user terminal 201, the second server terminal 202 uses the vertex animation texture corresponding to the wave animation imported from the third server terminal 203 (the third server terminal 203 is deployed with a method for generating wave animation) to render the corresponding wave special effects on the graphical user interface provided by the second user terminal 201.
[0034] The first embodiment of the present application provides a method for generating an ocean wave animation.
[0035] This method is deployed in Figure 1 The first server 102 is used to generate a wave animation that meets the developer's expectations. In an optional implementation, the wave animation generation method is executed by three-dimensional animation production software (such as Houdini).
[0036] Figure 3 Flowchart of the method for generating the ocean wave animation provided by this embodiment. Figure 3The method for generating the ocean wave animation provided by this embodiment is described in detail. The embodiments described below are used to explain the technical solution of this application and are not intended to be used as limitations for actual use.
[0037] like Figure 3 As shown, the method for generating the ocean wave animation provided in this embodiment includes the following steps S310 to S320:
[0038] Step S310, creating a plane model.
[0039] The plane model can be understood as a two-dimensional surface, without thickness, existing only on a plane. The plane model is usually composed of vertices, edges and faces. Optionally, the plane model is a quadrilateral patch, composed of four vertices and four edges, forming a plane area.
[0040] In this embodiment, the plane model is a basic model for making an ocean wave animation, and the plane model is changed into an ocean wave model with different ocean wave shapes by changing its shape.
[0041] Step S320, calling the wave animation production tool, adjusting the shape of the plane model based on multiple preset parameter values, and generating a wave animation; wherein the wave animation production tool includes multiple nodes connected in sequence, each node corresponds to at least one node parameter, the node is used to characterize the operation execution unit of the wave animation production tool, and is used to execute the corresponding preset operation, the node parameter includes a first number of node sub-parameters, the first number is the number of key frames preset for the wave animation, and each node sub-parameter corresponds to a key frame; the parameter value is preset for the node sub-parameter.
[0042] The wave animation production tool can be understood as a functional component preset by the developer, which is used to adjust the plane model into a wave model with a wave shape, thereby generating a wave animation composed of the wave model. The wave animation production tool is composed of a plurality of nodes connected in sequence, and the nodes can be understood as the basic units constituting the wave animation production tool, specifically, the operation execution units of the wave animation production tool, each node represents and executes a specific function or operation, and the nodes transmit data through the connection to form a complete processing flow.
[0043] A node can be considered as an independent functional unit, responsible for performing specific tasks, such as creating geometry, transforming objects, applying materials, simulating physics, etc. A node is preset with at least one node parameter, so that developers can assign different parameter values to the node parameters to obtain different task results based on the node.
[0044] The node parameters can be understood as the configuration items included in each node. Developers can change the behavior or output of the node by adjusting the parameter values configured by the configuration items. In this embodiment, the node parameters are composed of a set of node sub-parameters, which correspond to different stages of a configuration item. The stage can be represented by time, such as each node sub-parameter corresponds to a configuration item at a different time point, and can also be represented by a frame number, such as each node sub-parameter corresponds to a configuration item with a different frame number. In this embodiment, the frame number is used to distinguish the node sub-parameters included in the node parameters.
[0045] The wave animation production tool includes a plurality of nodes, each of which corresponds to at least one node parameter, each of which corresponds to a first number of node sub-parameters, and the first number corresponds to the number of key frames preset by the developer for the wave animation. Exemplarily, the key frames preset by the developer for the wave animation are 3 frames, including wave generation (first key frame), wave peak (second key frame), and wave hitting the shore (third key frame). Each node parameter will correspond to 3 node sub-parameters, and each node sub-parameter corresponds to one of the above key frames. When in the wave generation stage, the parameter value of the node sub-parameter corresponding to the first key frame will be used to adjust the shape of the plane model to form a wave model that simulates the wave generation shape.
[0046] In an optional implementation, the number of key frames is set by the developer based on the expectation of the wave special effect, and the wave special effect is often associated with the game events in the game, that is, when setting the number of key frames, the developer needs to consider the development rhythm of the game events that the wave special effect matches. Exemplarily, the developer pre-uses a 50-meter sea wave to match the wave skill. Since the development rhythm of the skill can include skill startup, skill assembly, and skill release, the wave special effect can be set to three stages to match the development rhythm of the wave skill. Since the wave special effect is preset to three stages, the developer will set the wave animation to include three key frames during the generation stage of the wave animation. For example, the first key frame corresponding to the wave generation stage is set to match the startup stage of the wave skill, the second key frame corresponding to the wave peak is set to match the assembly stage of the wave skill, and the third key frame corresponding to the wave hitting the shore is set to match the release stage of the wave skill. The number of key frames specifically set is associated with the game events that the wave special effect needs to match, and is not limited here.
[0047] In this step, the node parameters corresponding to each node in the wave animation production tool include a group (first number) of node sub-parameters, and these node sub-parameters correspond to a key frame of the wave animation, so when the three-dimensional animation production software calls the wave animation production tool and uses the parameter values preset for these node sub-parameters to change the shape of the plane model, it can at least form a wave model corresponding to each key frame, thereby generating a wave animation including multiple frames, and realizing the dynamic expression of the waves. In addition, the node sub-parameters in the wave animation production tool are matched with the key frames preset for the wave animation, which reduces the number of node sub-parameters, which reduces the workload of developers in setting parameter values on the one hand, and reduces the amount of data storage and memory usage during the animation production process on the other hand, thereby improving production efficiency.
[0048] In an optional implementation, calling an ocean wave animation production tool, adjusting the shape of the plane model based on a plurality of preset parameter values, and generating an ocean wave animation may specifically include the following steps S321 to S322:
[0049] Step S321, running multiple nodes, adjusting the shape of the plane model according to the parameter values of multiple node sub-parameters corresponding to each key frame, to form a wave model corresponding to each key frame.
[0050] Step S322, generating an ocean wave animation according to the ocean wave model corresponding to each key frame.
[0051] Exemplarily, the developer presets three key frames for the wave animation, including wave generation (first key frame), wave peak (second key frame), and wave hitting the shore (third key frame). Each node parameter corresponds to three node sub-parameters, and each node sub-parameter corresponds to a key frame. For the first key frame, run multiple nodes, and adjust the plane model according to the parameter values of the multiple node sub-parameters corresponding to the first key frame, and adjust the plane model from the original form to the first form that simulates the real wave generation form, and use the plane model of the first form as the wave model corresponding to the first key frame. For the second key frame, run multiple nodes, and adjust the plane model according to the parameter values of the multiple node sub-parameters corresponding to the second key frame, and adjust the plane model from the original form to the second form that simulates the real wave peak form, and use the plane model of the second form as the wave model corresponding to the second key frame. For the third key frame, multiple nodes are run, and the plane model is adjusted in shape according to the parameter values of multiple node sub-parameters corresponding to the third key frame, and the plane model is adjusted from the original shape to the third shape that simulates the shape of real waves hitting the shore, and the plane model in the third shape is used as the wave model corresponding to the third key frame. The wave animation is generated according to the wave model corresponding to the first key frame, the wave model corresponding to the second key frame, and the wave model corresponding to the third key frame.
[0052] In an optional implementation, generating an ocean wave animation according to an ocean wave model corresponding to each key frame may specifically include the following steps S322-1 to S322-2:
[0053] Step S322-1, based on the ocean wave models corresponding to the two adjacent key frames, an interpolation operation is performed to generate an ocean wave model corresponding to each frame between the two adjacent key frames.
[0054] Step S322-2, the wave models corresponding to the two adjacent key frames and the wave models corresponding to each frame between the two adjacent key frames form a wave animation.
[0055] The interpolation operation can be used to estimate or calculate the unknown value between two known data points. In this embodiment, the two known data points are the wave models corresponding to two adjacent key frames, and the unknown value is the wave model corresponding to each frame between the two adjacent key frames. Therefore, based on the interpolation operation, a smooth transition effect can be generated between two key frames, thereby forming a wave animation with a naturally changing wave shape.
[0056] Exemplarily, firstly, based on the difference operation, the wave model corresponding to the plurality of frames between the wave model corresponding to the first key frame and the wave model corresponding to the second key frame is generated. Secondly, based on the difference operation, the wave model corresponding to the plurality of frames between the wave model corresponding to the second key frame and the wave model corresponding to the third key frame is generated. The wave model corresponding to the first key frame, the wave model corresponding to the plurality of frames between the first key frame and the second key frame, the wave model corresponding to the second key frame, the wave model corresponding to the plurality of frames between the second key frame and the third key frame, and the wave model corresponding to the third key frame form a wave animation from wave generation to wave peak and then to wave hitting the shore.
[0057] The following is a detailed description of the wave animation tool:
[0058] In an optional implementation, the wave animation production tool includes at least a first node group, a second node group, a third node group, and a fourth node group. The first node group includes at least one node for adjusting the original form of the plane model to a first form with a bulge in the middle and the two ends maintaining the plane height, and the area occupied by the bulge in the middle in the plane model and the degree of bulge are determined by the parameter values of the nodes included in the corresponding first node group. Based on different parameter values, different forms of the central raised area can be obtained, exemplarily, a central raised area with a small raised range and a small raised height, a central raised area with a small raised range but a large raised height, and a central raised area with a large raised range but a small raised height. The specific raised state is determined by the parameter values set by the developer based on the expected wave model form; the second node group includes at least one node, which is used to compress the central raised area of the first form along a first direction to form a second form including a central raised area and two side plane areas, the first direction is a direction perpendicular to the central raised area along the plane where the plane model is located, the two side plane areas are areas on both sides of the central raised area in the plane model except the central raised area, and the central raised area The degree of compression is determined by the parameter values of the nodes included in the corresponding second node group; the third node group includes at least one node, which is used to change the position of the pivot point so that the central raised area of the second form curls along the changed pivot point to form a third form including a central curling area and two side plane areas, and the pivot point position is determined by the parameter values of the nodes included in the corresponding third node group; the fourth node group includes at least one node, which is used to attenuate the central curling area of the third form on both sides along the second direction to form a fourth form including a central bulging area and two side plane areas, the second direction is a direction parallel to the central curling area, and the attenuation degree of the central curling area on both sides along the second direction is determined by the parameter values of the nodes included in the corresponding fourth node group.
[0059] In a specific implementation, the first node group includes at least a fit node, an abs node, a complement node, a pow node, and a multiply node, wherein the fit node is used to adapt or scale a value to a specified range. For example, if there is a value between 0 and 100 and it needs to be converted to a value between 0 and 1, the fit node can be used to complete the conversion. The abs node represents the absolute value function, which is used to return the absolute value of the input value, such as inputting -5, the output will be 5. The complement node is a complement operation, which is used to perform a logical inverse operation on a value. For example, in binary operations, if a Boolean value or a binary number is input, the complement node will reverse its bit value (0 becomes 1, 1 becomes 0). The pow node represents a power operation, which is used to calculate another power of a number. For example, if two values a and b are input, the pow node will calculate a to the power of b. The multuply node is a multiplication operation node, which is used to calculate the product of two or more values. For example, if two input values a and b are input, the multiply node will calculate the result of a×b. Through the functions of the multiple nodes included in the first node group, the middle of the plane model can be raised while the two ends maintain the plane height, that is, the original form of the plane model is adjusted to the first form with the middle part raised and the two ends maintaining the plane height.
[0060] In a specific implementation, the second node group includes at least a fit node and a pow node. Through the functions of the multiple nodes included in the second node group, the range of the central raised area of the first form can be limited, so that both sides of the central raised area form a smooth plane transition, the purpose is to leave room for the movement of the waves, and to facilitate the formation of an animation of the waves from generation to shore. Specifically, through the processing of the second node group, the central raised area of the first form of the plane model can be compressed along the first direction (the direction perpendicular to the central raised area along the plane where the plane model is located), and the first form is adjusted to a second form including the central raised area and the plane areas on both sides.
[0061] In a specific implementation, the third node group includes at least a Transform Matrix node, which is used to operate a change matrix of a geometric body. The change matrix can be used to describe properties such as position, rotation, and scaling of a geometric body. Through the transformation matrix, precise transformation operations can be performed on the geometric body, such as translation, rotation, and scaling. In this embodiment, the Transform Matrix node is used to change the position of the pivot point so that the middle convex area of the second form of the plane model curls along the changed pivot point to form a third form including a middle curled area and two side plane areas.
[0062] In a specific implementation, the fourth node group includes at least a vecto float node and a ramp node. The vecto float node is used to process vector data and can convert the XYZ coordinates of the space into three floating point values corresponding to the X axis, the Y axis, and the Z axis respectively. The ramp node is used to create and edit color or value gradients and can create smooth color transitions or value changes. Through the functions of the multiple nodes included in the fourth node group, the middle curled area of the third form of the plane model can be attenuated on both sides along the second direction (a direction parallel to the middle curled area, if the middle curled area is formed along the X axis, then the second direction is the direction of the X axis), forming a fourth form including a middle bulging area and two side plane areas.
[0063] Based on this, multiple nodes are run, and the plane model is morphologically adjusted according to the parameter values of multiple node sub-parameters corresponding to each key frame to form a wave model corresponding to each key frame. Specifically, the following steps S11 to S16 may be included:
[0064] Step S11, obtaining parameter values of multiple node sub-parameters corresponding to a first key frame, where the first key frame is any one of a first number of key frames.
[0065] Step S12, based on the first parameter value corresponding to the first key frame, run the first node group to adjust the original shape of the plane model to a first shape with a convex middle and plane height maintained at both ends, the first parameter value being the parameter value of the node included in the corresponding first node group among multiple parameter values.
[0066] Step S13, based on the second parameter value corresponding to the first key frame, run the second node group to adjust the first form of the plane model to a second form including a central raised area and two side plane areas, the second parameter value being the parameter value of the node included in the corresponding second node group among the multiple parameter values.
[0067] Step S14, based on the third parameter value corresponding to the first key frame, run the third node group to adjust the second form of the plane model to a third form including a central curled area and two side plane areas, the third parameter value being the parameter value of the node included in the corresponding third node group among the multiple parameter values.
[0068] Step S15, based on the fourth parameter value corresponding to the first key frame, run the fourth node group to adjust the third form of the plane model to a fourth form including a central bulging area and two side plane areas, the fourth parameter value being the parameter value of the node included in the corresponding fourth node group among the multiple parameter values.
[0069] Step S16: Using the plane model in the fourth form as the wave model corresponding to the first key frame.
[0070] In an optional implementation, the wave animation production tool also includes a fifth node group; the fifth node group includes at least one node, which is used to change the pivot point position so that the sub-area close to the middle bulging area in the first plane area of the fourth form bulges, forming a fifth form including the middle bulging area, the first plane area with the bulging sub-area, and the second plane area. The first plane area is a plane area in the two side plane areas located in the curling direction of the middle bulging area, and the second plane area is another plane area in the two side plane areas except the first plane area. The pivot point position is determined by the parameter value of the node included in the corresponding fifth node group.
[0071] In a specific implementation, the fifth node group includes at least a Transform Matrix node, which is used to change the position of the pivot point so that the sub-region close to the central bulging region in the first plane region of the fourth form of the plane model bulges, so that the model presents details of being pushed and squeezed.
[0072] Based on this, after the step of running the fourth node group based on the fourth parameter value corresponding to the first key frame to adjust the third form of the plane model to a fourth form including a central bulging area and two side plane areas, the method provided in this embodiment may further include the following steps S21 to S22:
[0073] Step S21, based on the fifth parameter value corresponding to the first key frame, run the fifth node group to adjust the fourth form of the plane model to a fifth form including a middle bulging area, a first plane area with a sub-area bulge, and a second plane area, and the fifth parameter value is the parameter value of the node included in the fifth node group corresponding to the multiple parameter values.
[0074] Step S21: Using the plane model in the fifth form as the wave model corresponding to the first key frame.
[0075] In an optional implementation, the wave animation production tool also includes a sixth node group; the sixth node group includes at least one node, which is used to adjust the concave and convexity of the middle bulging area of the fifth form along the second direction to form a sixth form including the middle bulging area after the concave and convex adjustment, the first plane area of the sub-area bulge, and the second plane area. The second direction is a direction parallel to the middle bulging area, and the degree of adjustment of the concave and convexity of the middle bulging area along the second direction is determined by the parameter value of the node included in the corresponding sixth node group.
[0076] In a specific implementation, the sixth node group includes at least a fit node and an abs node, which are used to adjust the concave and convex details of the middle bulging area of the fifth form of the plane model so that the middle bulging area has convex and concave undulations along the second direction, which is more similar to the real wave shape.
[0077] Based on this, after the step of running the fifth node group based on the fifth parameter value corresponding to the first key frame to adjust the fourth form of the plane model to a fifth form including a middle bulging area, a first plane area with sub-area bulges, and a second plane area, the method provided in this embodiment may further include the following steps S31 to S32:
[0078] Step S31, based on the sixth parameter value corresponding to the first key frame, run the sixth node group, adjust the fifth form of the plane model to a sixth form including the middle bulging area after the concave-convex adjustment, the first plane area with sub-area bulge, and the second plane area, and the sixth parameter value is the parameter value of the node included in the sixth node group corresponding to the multiple parameter values.
[0079] Step S32: Using the plane model in the sixth form as the wave model corresponding to the first key frame.
[0080] Through the above node group, based on the preset parameter values, different forms of wave models corresponding to each key frame can be formed, thereby forming a wave animation.
[0081] The method provided in this embodiment adjusts the shape of the plane model through a variety of nodes, so that the formed wave model achieves a real wave effect. And because the bottom layer is controllable, the adjustment or optimization of the wave model can be easily achieved, increasing the controllability of the wave effect.
[0082] FIG. 4 is a schematic diagram of a wave model corresponding to a first key frame provided in this embodiment.
[0083] As shown in FIG. 4( a ), the original form 410 of the plane model is a quadrilateral facet.
[0084] As shown in Fig. 4(b), the first node group is run, and based on the first parameter value corresponding to the first key frame, the original shape 410 of the plane model is adjusted to the first shape 420. The first shape 420 includes a central raised area 401, and a first end 402 and a second end 403 that maintain the plane height.
[0085] As shown in FIG4(c), the second node group is run, and based on the second parameter value corresponding to the first key frame, the central raised area 401 of the first form 420 is compressed along the first direction (the direction perpendicular to the central raised area 401 on the plane where the quadrilateral facet is located), and the first form 420 is adjusted to the second form 430. The second form 430 includes the compressed central raised area 404, the first side plane area 405, and the second side plane area 406.
[0086] As shown in FIG4(d), the third node group is run, and based on the third parameter value corresponding to the first key frame, the position of the pivot point 407 is changed, so that the middle raised area 404 of the second form 430 is curled along the pivot point 407, and the second form 430 is adjusted to the third form 440. The third form 440 includes the middle curled area 408, the first side plane area 405, and the second side plane area 406.
[0087] As shown in FIG4(e), the fourth node group is run, and based on the fourth parameter value corresponding to the first key frame, the middle curled region 408 of the third form 440 is attenuated on both sides along the second direction (a direction parallel to the middle curled region 408), and the third form 440 is adjusted to the fourth form 450. The fourth form 450 includes a middle bulging region 409, a first side plane region 405, and a second side plane region 406.
[0088] As shown in FIG4(f), the fifth node group is run, and based on the fifth parameter value corresponding to the first key frame, the position of the pivot point 4010 is changed, so that the sub-region 4011 close to the middle bulging region 409 in the first side plane region 405 (the first side plane region 405 is located in the curling direction of the middle bulging region 409) of the fourth form 450 bulges, and the fourth form 450 is adjusted to the fifth form 460. The fifth form 460 includes the middle bulging region 409, the first side plane region 4012 with bulging sub-regions, and the second side plane region 406 (in order to highlight the bulging state of the sub-region 4011, the second side plane region 406 is not shown in this figure).
[0089] As shown in FIG4(g), the sixth node group is run, and based on the sixth parameter value corresponding to the first key frame, the middle bulging area 409 of the fifth form 460 is adjusted to be concave and convex along the second direction (the direction parallel to the middle bulging area 409), and the fifth form 460 is adjusted to the sixth form 470. The sixth form 470 includes the middle bulging area 4013 after the concave and convex adjustment, the first side plane area 4012 of the sub-area bulge, and the second side plane area 406 (in order to highlight the concave and convex state of the middle bulging area, the second side plane area 406 is not shown in the diagram). The sixth form is the wave model corresponding to the first key frame.
[0090] In an optional implementation provided in this embodiment, the method provided in this embodiment may further include the following steps S331 to S332:
[0091] Step S331, encoding the vertex animation data of the wave model in the wave animation into a texture map to form a vertex animation texture map corresponding to the wave animation.
[0092] Step S332, exporting the vertex animation texture map to the game engine, so that the game engine renders the wave special effects corresponding to the wave animation based on the vertex animation texture map.
[0093] The Vertex Animation Texture (VAT) is an efficient animation storage technology that can reduce storage requirements and improve animation rendering efficiency.
[0094] Optionally, encoding the vertex animation data of the wave model in the wave animation into a texture map, and forming a vertex animation texture map corresponding to the wave animation can be achieved by the following operations: first, extracting the vertex position data of each frame from the wave animation, and the vertex position data is usually expressed in the form of vertex coordinates (X, Y, Z); second, using a script or tool to encode the vertex position data of each frame into a texture map, and a common encoding method is to store the position change of the vertex in the pixel color value of the texture map, and each pixel corresponds to a vertex. Exemplarily, the RGBA channel of the texture map is used to store the displacement of the vertex on the XYZ axis, and the color value of the pixel represents the position change of the vertex.
[0095] After the vertex animation texture map corresponding to the wave animation is formed, the vertex animation texture map can be imported into a game engine, such as a Messiah game engine, and the game engine can render the corresponding wave special effects in the game based on the vertex animation texture map.
[0096] Optionally, the game engine can render the wave effects based on the vertex animation texture map through the following operations: first, create a water material and assign the vertex animation texture map to the water material; second, create a shader, read the vertex position offset from the vertex animation texture map, and calculate the new position of each vertex according to the current time or frame number to render the wave effects.
[0097] In an optional implementation, the game engine renders the wave special effects corresponding to the wave animation based on the vertex animation texture map with a preset trigger condition. Specifically, in response to monitoring the game event, the shader is called, and the wave special effects are rendered in combination with the vertex animation texture map and the water material. Exemplarily, in response to monitoring the player triggering the wave skill during the game (such as the player using the wave props in the game backpack, the player clicking the wave skill control on the graphical user interface, etc.), the game engine calls the shader, combines the vertex animation texture map and the water material, and renders the wave special effects that match the wave skill.
[0098] The method provided in this embodiment generates wave animation based on the wave animation production tool. By changing the parameter values of the node sub-parameters in the wave animation production tool, the expected wave shape can be obtained, which belongs to a bottom-level controllable programmatic control method. Encapsulating this method as a wave asset can facilitate the subsequent optimization of wave animation and secondary production of similar needs.
[0099] The first embodiment provides an optional method for producing wave animation. First, the method is based on the wave animation production tool and the preset parameter values to adjust the shape of the plane model, thereby generating a wave animation. Therefore, when the wave effect in the game is not good or needs to show other forms of wave effects, it is not necessary to rebuild the model. Only by modifying the parameter value, a wave animation with different performance effects can be formed, which reduces the time cost in the game development process and improves the game development efficiency. Second, the node parameters corresponding to each node in the wave animation production tool include a group (first number) of node sub-parameters, and these node sub-parameters correspond to each key frame of the wave animation. Therefore, when the wave animation production tool is called and the parameter values preset for these node sub-parameters are used to change the shape of the plane model, at least a wave model corresponding to each key frame can be formed, thereby generating a wave animation including multiple frames, and realizing the dynamic performance of the wave. Third, the wave animation production tool includes multiple node groups, each of which gradually changes the shape of the plane model from the details, so that the finally formed wave model has the shape of a real wave, which increases the realism of the wave animation and improves the user's immersion.
[0100] It should be noted that the examples in the first embodiment are only for explaining the method described in this application and are not intended to be limiting for actual use. The method for generating the wave animation provided in this application includes but is not limited to the method described in the first embodiment.
[0101] The second embodiment of the present application provides a method for rendering ocean wave special effects.
[0102] This method is deployed in Figure 2 The second server 202 is used to render the wave special effect during the game running process. In an optional implementation, the wave special effect rendering method is executed by a game engine (such as Messiah).
[0103] Figure 5 : is a flow chart of the method for rendering the sea wave special effects provided by this embodiment. Figure 5 The rendering method of the ocean wave special effect provided by this embodiment is described in detail. The embodiments described below are used to explain the technical solution of this application and are not intended to be used as limitations for actual use.
[0104] like Figure 5As shown, the rendering method of the ocean wave special effect provided in this embodiment includes the following steps S510 to S520:
[0105] Step S510, obtaining a vertex animation texture map, wherein the vertex animation texture map is formed by encoding vertex animation data of a wave model in an ocean wave animation into a texture map, and the ocean wave animation is generated based on a method for generating an ocean wave animation; wherein the method for generating an ocean wave animation comprises: creating a plane model; calling an ocean wave animation production tool, and adjusting the shape of the plane model based on a plurality of preset parameter values to generate an ocean wave animation; wherein the ocean wave animation production tool comprises a plurality of nodes connected in sequence, wherein the nodes are used to characterize operation execution units of the ocean wave animation production tool, wherein each node corresponds to at least one node parameter, wherein the node parameter comprises a first number of node sub-parameters, wherein the first number is the number of key frames preset for the ocean wave animation, and each node sub-parameter corresponds to a key frame; and the parameter value is preset for the node sub-parameter.
[0106] Step S520, calling the shader, combining the vertex animation texture map and the water material, rendering the wave special effects corresponding to the wave animation.
[0107] The Vertex Animation Texture (VAT) is an efficient animation storage technology that can reduce storage requirements and improve animation rendering efficiency.
[0108] In this embodiment, the vertex animation texture map is formed by encoding the vertex animation data of the wave model in the wave animation into the texture map. Optionally, it is achieved by the following operations: first, extracting the vertex position data of each frame from the wave animation, and the vertex position data is usually expressed in the form of vertex coordinates (X, Y, Z); second, using a script or tool to encode the vertex position data of each frame into a texture map. The commonly used encoding method is to store the position change of the vertex in the pixel color value of the texture map, and each pixel corresponds to a vertex. Exemplarily, the RGBA channel of the texture map is used to store the displacement of the vertex on the XYZ axis, and the color value of the pixel represents the position change of the vertex.
[0109] After the wave animation is generated by the method described in the first embodiment of the present application, the vertex animation texture map corresponding to the wave animation can be formed based on the above method. After the game engine obtains the vertex animation texture map, it can render the wave animation based on the vertex animation texture map and the water material in the game engine to form a wave special effect. Optionally, the game engine can render the wave special effect based on the vertex animation texture map through the following operations: first, create a water material and assign the vertex animation texture map to the water material; second, create a shader, read the vertex position offset from the vertex animation texture map, and calculate the new position of each vertex according to the current time or frame number to render the wave special effect.
[0110] In an optional implementation, calling a shader, combining a vertex animation texture map and a water material, and rendering a wave special effect corresponding to the wave animation includes: in response to monitoring a game event, calling a shader, combining a vertex animation texture map and a water material, and rendering a wave special effect, that is, rendering the wave special effect is triggered based on a specific game event, and specifically, the game event can be a triggering event of a wave skill. Exemplarily, during the game, a player triggers a wave skill (such as using a wave prop in a game backpack, clicking a wave skill control on a graphical user interface, etc.), and the game engine calls a shader, combines a vertex animation texture map and a water material, and renders a wave special effect that matches the wave skill.
[0111] In a specific implementation, the rendered wave special effects will coordinate with the release rhythm of the wave skill. For example, when the ocean skill is in the startup stage, the first key frame of the wave animation is rendered, and the first key frame corresponds to the wave generation form. When the wave skill develops to the assembly stage, the second key frame of the wave animation is rendered, and the second key frame corresponds to the wave peak form. When the wave skill develops to the release stage, the third key frame of the wave animation is rendered, and the third key frame corresponds to the wave hitting the shore form, thereby forming a wave special effect that develops from wave generation to wave peak and then to wave hitting the shore.
[0112] Of course, the rendering of the wave special effects can also be triggered based on other game events, such as the emotional state of the controlled virtual character develops into mania, the weather in the virtual scene changes to a storm, etc. The specific details can be determined according to the game settings and are not limited here.
[0113] The above-mentioned second embodiment provides an optional method for rendering ocean wave special effects. It should be noted that the example in the second embodiment is only for explaining the method described in this application and is not intended to be a limitation for actual use. The method for rendering ocean wave special effects provided in this application includes but is not limited to the method described in the second embodiment.
[0114] The third embodiment of the present application provides a device for generating an ocean wave animation. Figure 6Schematic diagram of the structure of the device for generating the ocean wave animation provided in this embodiment.
[0115] like Figure 6 As shown, the device for generating an ocean wave animation provided by this embodiment includes: a model creation unit 601 and an animation generation unit 602 .
[0116] The model creation unit 601 is used to create a plane model.
[0117] The animation generation unit 602 is used to call an ocean wave animation production tool, adjust the shape of the plane model based on a plurality of preset parameter values, and generate an ocean wave animation; wherein the ocean wave animation production tool includes a plurality of nodes connected in sequence, and the nodes are used to represent operation execution units of the ocean wave animation production tool, and each of the nodes corresponds to at least one node parameter, and the node parameters include a first number of node sub-parameters, and the first number is the number of key frames preset for the ocean wave animation, and each of the node sub-parameters corresponds to one key frame; and the parameter value is preset for the node sub-parameter.
[0118] Optionally, calling a wave animation production tool to adjust the shape of the plane model based on a plurality of preset parameter values to generate a wave animation includes:
[0119] Running the plurality of nodes, and adjusting the shape of the plane model according to the parameter values of the plurality of node sub-parameters corresponding to each of the key frames, to form a wave model corresponding to each of the key frames;
[0120] The ocean wave animation is generated according to the ocean wave model corresponding to each of the key frames.
[0121] Optionally, generating the wave animation according to the wave model corresponding to each key frame includes:
[0122] According to the wave models corresponding to the two adjacent key frames, an interpolation operation is used to generate a wave model corresponding to each frame between the two adjacent key frames;
[0123] The ocean wave animation is composed of the ocean wave models corresponding to the two adjacent key frames and the ocean wave models corresponding to each frame between the two adjacent key frames.
[0124] Optionally, the wave animation production tool includes at least a first node group, a second node group, a third node group, and a fourth node group: wherein,
[0125] The first node group includes at least one node, which is used to adjust the original shape of the plane model to a first shape in which the middle part is convex and the two ends maintain the plane height, and the area occupied by the middle convexity in the plane model and the degree of convexity are determined by the parameter value of the node included in the first node group;
[0126] The second node group includes at least one node, which is used to compress the central convex area of the first form along a first direction to form a second form including the central convex area and two side plane areas, wherein the first direction is a direction perpendicular to the central convex area along the plane where the plane model is located, and the two side plane areas are areas located on both sides of the central convex area in the plane model except the central convex area, and the compression degree of the central convex area is determined by the parameter value of the node included in the corresponding second node group;
[0127] The third node group includes at least one node, which is used to change the position of the pivot point so that the central convex area of the second form curls along the changed pivot point to form a third form including a central curling area and two side plane areas, and the pivot point position is determined by the parameter value of the node included in the third node group;
[0128] The fourth node group includes at least one node, which is used to attenuate the central curled area of the third form on both sides along the second direction to form a fourth form including a central bulging area and two side plane areas, the second direction is a direction parallel to the central curled area, and the attenuation degree of the central curled area on both sides along the second direction is determined by the parameter value of the node included in the corresponding fourth node group.
[0129] Optionally, the running of the plurality of nodes and adjusting the shape of the plane model according to the parameter values of the plurality of node sub-parameters corresponding to each of the key frames to form a wave model corresponding to each of the key frames includes:
[0130] Obtain parameter values of a plurality of the node sub-parameters corresponding to a first key frame, wherein the first key frame is any one of the first number of key frames;
[0131] Based on a first parameter value corresponding to the first key frame, the first node group is run to adjust the original shape of the plane model to a first shape in which the middle is convex and both ends maintain plane height, wherein the first parameter value is a parameter value corresponding to the node included in the first node group among the plurality of parameter values;
[0132] Based on a second parameter value corresponding to the first key frame, running the second node group to adjust the first form of the plane model to a second form including a central convex area and two side plane areas, the second parameter value being a parameter value of the node included in the second node group corresponding to the plurality of parameter values;
[0133] Based on a third parameter value corresponding to the first key frame, running the third node group to adjust the second form of the plane model to a third form including a middle curled area and two side plane areas, the third parameter value being a parameter value of the node included in the third node group corresponding to the plurality of parameter values;
[0134] Based on a fourth parameter value corresponding to the first key frame, running the fourth node group to adjust the third form of the plane model to a fourth form including a central bulging area and two side plane areas, the fourth parameter value being a parameter value of the node included in the fourth node group corresponding to the plurality of parameter values;
[0135] The plane model in the fourth form is used as the wave model corresponding to the first key frame.
[0136] Optionally, the ocean wave animation production tool further includes a fifth node group;
[0137] The fifth node group includes at least one node, which is used to change the position of the pivot point, so that the sub-region close to the middle bulging region in the first plane region of the fourth form bulges, forming a fifth form including the middle bulging region, the first plane region of the sub-region bulging, and the second plane region, the first plane region is a plane region in the two side plane regions located in the curling direction of the middle bulging region, and the second plane region is another plane region in the two side plane regions except the first plane region, the pivot point position is determined by the parameter value of the node corresponding to the fifth node group;
[0138] Before the step of using the plane model in the fourth form as the wave model corresponding to the first key frame, the method further includes:
[0139] Based on a fifth parameter value corresponding to the first key frame, running the fifth node group, adjusting the fourth form of the plane model to a fifth form including a middle bulging area, a first plane area with a sub-area bulge, and a second plane area, wherein the fifth parameter value is a parameter value of the node included in the fifth node group corresponding to the plurality of parameter values;
[0140] The using the plane model in the fourth form as the wave model corresponding to the first key frame includes:
[0141] The plane model in the fifth form is used as the wave model corresponding to the first key frame.
[0142] Optionally, the ocean wave animation production tool further includes a sixth node group;
[0143] The sixth node group includes at least one node, which is used to adjust the concave-convexity of the middle bulged area of the fifth form along the second direction to form a sixth form including the middle bulged area after the concave-convexity adjustment, the first plane area with bulged sub-areas, and the second plane area, and the adjustment degree of the concave-convexity adjustment of the middle bulged area along the second direction is determined by the parameter value of the node included in the sixth node group;
[0144] Before the step of using the plane model in the fifth form as the wave model corresponding to the first key frame, the method further includes:
[0145] Based on the sixth parameter value corresponding to the first key frame, the sixth node group is run to adjust the fifth form of the plane model to a sixth form including a bulging middle area after the concave-convex adjustment, a first plane area with bulging sub-areas, and a second plane area, wherein the sixth parameter value is a parameter value of the node included in the sixth node group corresponding to the plurality of parameter values;
[0146] The using the plane model in the fifth form as the wave model corresponding to the first key frame includes:
[0147] The plane model in the sixth form is used as the wave model corresponding to the first key frame.
[0148] Optionally, the device further comprises: a texture map exporting unit; the texture map exporting unit is used to:
[0149] Encoding vertex animation data of the wave model in the wave animation into a texture map to form a vertex animation texture map corresponding to the wave animation;
[0150] The vertex animation texture map is exported to a game engine, so that the game engine renders the wave special effects corresponding to the wave animation based on the vertex animation texture map.
[0151] Optionally, the game engine renders the wave special effects corresponding to the wave animation based on the vertex animation texture map, including:
[0152] In response to monitoring the game event, the game engine calls the shader, combines the vertex animation texture map and the water material, and renders the wave special effect;
[0153] Wherein, the game events at least include: a triggering event of a wave skill.
[0154] The fourth embodiment of the present application provides a device for rendering ocean wave special effects. Figure 7 It is a schematic diagram of the structure of the rendering device of the ocean wave special effect provided in this embodiment.
[0155] like Figure 7 As shown, the rendering device of the ocean wave special effect provided by this embodiment includes: a texture acquisition unit 701 and a special effect rendering unit 702.
[0156] The map acquisition unit 701 is used to obtain a vertex animation texture map, wherein the vertex animation texture map is formed by encoding vertex animation data of a wave model in an ocean wave animation into a texture map, and the ocean wave animation is generated based on a method for generating an ocean wave animation; wherein the method for generating an ocean wave animation comprises: creating a plane model; calling an ocean wave animation production tool, and performing morphological adjustments on the plane model based on a plurality of preset parameter values to generate the ocean wave animation; wherein the ocean wave animation production tool comprises a plurality of nodes connected in sequence, wherein the nodes are used to characterize operation execution units of the ocean wave animation production tool, and each of the nodes corresponds to at least one node parameter, and the node parameters comprise a first number of node sub-parameters, wherein the first number is the number of key frames preset for the ocean wave animation, and each of the node sub-parameters corresponds to one of the key frames; and the parameter value is preset for the node sub-parameter.
[0157] The special effect rendering unit 702 is used to call a shader, combine the vertex animation texture map and the water material, and render the wave special effect corresponding to the wave animation.
[0158] Optionally, calling a shader, combining the vertex animation texture map and the water material, and rendering the wave special effects corresponding to the wave animation includes:
[0159] In response to monitoring the game event, calling the shader, combining the vertex animation texture map and the water material, and rendering the wave special effect;
[0160] Wherein, the game events at least include: a triggering event of a wave skill.
[0161] A fifth embodiment of the present application provides an electronic device, Figure 8 It is a schematic diagram of the structure of the electronic device provided in this embodiment.
[0162] like Figure 8 As shown, the electronic device provided in this embodiment includes: a memory 801 and a processor 802;
[0163] The memory 801 is used to store computer instructions for executing a method for generating an ocean wave animation and / or a method for rendering an ocean wave special effect.
[0164] The processor 802 is configured to execute computer instructions stored in the memory 801 to perform the following operations:
[0165] Create a plane model;
[0166] Calling an ocean wave animation production tool, adjusting the shape of the plane model based on a plurality of preset parameter values, and generating an ocean wave animation; wherein the ocean wave animation production tool comprises a plurality of nodes connected in sequence, the nodes are used to characterize operation execution units of the ocean wave animation production tool, each of the nodes corresponds to at least one node parameter, the node parameters comprise a first number of node sub-parameters, the first number being the number of key frames preset for the ocean wave animation, each of the node sub-parameters corresponding to one of the key frames; the parameter values are preset for the node sub-parameters.
[0167] Optionally, calling a wave animation production tool to adjust the shape of the plane model based on a plurality of preset parameter values to generate a wave animation includes:
[0168] Running the plurality of nodes, and adjusting the shape of the plane model according to the parameter values of the plurality of node sub-parameters corresponding to each of the key frames, to form a wave model corresponding to each of the key frames;
[0169] The ocean wave animation is generated according to the ocean wave model corresponding to each of the key frames.
[0170] Optionally, generating the wave animation according to the wave model corresponding to each key frame includes:
[0171] According to the wave models corresponding to the two adjacent key frames, an interpolation operation is used to generate a wave model corresponding to each frame between the two adjacent key frames;
[0172] The ocean wave animation is composed of the ocean wave models corresponding to the two adjacent key frames and the ocean wave models corresponding to each frame between the two adjacent key frames.
[0173] Optionally, the wave animation production tool includes at least a first node group, a second node group, a third node group, and a fourth node group: wherein,
[0174] The first node group includes at least one node, which is used to adjust the original shape of the plane model to a first shape in which the middle part is convex and the two ends maintain the plane height, and the area occupied by the middle convexity in the plane model and the degree of convexity are determined by the parameter value of the node included in the first node group;
[0175] The second node group includes at least one node, which is used to compress the central convex area of the first form along a first direction to form a second form including the central convex area and two side plane areas, wherein the first direction is a direction perpendicular to the central convex area along the plane where the plane model is located, and the two side plane areas are areas located on both sides of the central convex area in the plane model except the central convex area, and the compression degree of the central convex area is determined by the parameter value of the node included in the corresponding second node group;
[0176] The third node group includes at least one node, which is used to change the position of the pivot point so that the central convex area of the second form curls along the changed pivot point to form a third form including a central curling area and two side plane areas, and the pivot point position is determined by the parameter value of the node included in the third node group;
[0177] The fourth node group includes at least one node, which is used to attenuate the central curled area of the third form on both sides along the second direction to form a fourth form including a central bulging area and two side plane areas, the second direction is a direction parallel to the central curled area, and the attenuation degree of the central curled area on both sides along the second direction is determined by the parameter value of the node included in the corresponding fourth node group.
[0178] Optionally, the running of the plurality of nodes and adjusting the shape of the plane model according to the parameter values of the plurality of node sub-parameters corresponding to each of the key frames to form a wave model corresponding to each of the key frames includes:
[0179] Obtain parameter values of a plurality of the node sub-parameters corresponding to a first key frame, wherein the first key frame is any one of the first number of key frames;
[0180] Based on a first parameter value corresponding to the first key frame, the first node group is run to adjust the original shape of the plane model to a first shape in which the middle is convex and both ends maintain plane height, wherein the first parameter value is a parameter value corresponding to the node included in the first node group among the plurality of parameter values;
[0181] Based on a second parameter value corresponding to the first key frame, running the second node group to adjust the first form of the plane model to a second form including a central convex area and two side plane areas, the second parameter value being a parameter value of the node included in the second node group corresponding to the plurality of parameter values;
[0182] Based on a third parameter value corresponding to the first key frame, running the third node group to adjust the second form of the plane model to a third form including a middle curled area and two side plane areas, the third parameter value being a parameter value of the node included in the third node group corresponding to the plurality of parameter values;
[0183] Based on a fourth parameter value corresponding to the first key frame, running the fourth node group to adjust the third form of the plane model to a fourth form including a central bulging area and two side plane areas, the fourth parameter value being a parameter value of the node included in the fourth node group corresponding to the plurality of parameter values;
[0184] The plane model in the fourth form is used as the wave model corresponding to the first key frame.
[0185] Optionally, the ocean wave animation production tool further includes a fifth node group;
[0186] The fifth node group includes at least one node, which is used to change the position of the pivot point, so that the sub-region close to the middle bulging region in the first plane region of the fourth form bulges, forming a fifth form including the middle bulging region, the first plane region of the sub-region bulging, and the second plane region, the first plane region is a plane region in the two side plane regions located in the curling direction of the middle bulging region, and the second plane region is another plane region in the two side plane regions except the first plane region, the pivot point position is determined by the parameter value of the node corresponding to the fifth node group;
[0187] Before the step of using the plane model in the fourth form as the wave model corresponding to the first key frame, the method further includes:
[0188] Based on a fifth parameter value corresponding to the first key frame, running the fifth node group, adjusting the fourth form of the plane model to a fifth form including a middle bulging area, a first plane area with a sub-area bulge, and a second plane area, wherein the fifth parameter value is a parameter value of the node included in the fifth node group corresponding to the plurality of parameter values;
[0189] The using the plane model in the fourth form as the wave model corresponding to the first key frame includes:
[0190] The plane model in the fifth form is used as the wave model corresponding to the first key frame.
[0191] Optionally, the ocean wave animation production tool further includes a sixth node group;
[0192] The sixth node group includes at least one node, which is used to adjust the concave-convexity of the middle bulged area of the fifth form along the second direction to form a sixth form including the middle bulged area after the concave-convexity adjustment, the first plane area with bulged sub-areas, and the second plane area, and the adjustment degree of the concave-convexity adjustment of the middle bulged area along the second direction is determined by the parameter value of the node included in the sixth node group;
[0193] Before the step of using the plane model in the fifth form as the wave model corresponding to the first key frame, the method further includes:
[0194] Based on the sixth parameter value corresponding to the first key frame, the sixth node group is run to adjust the fifth form of the plane model to a sixth form including a bulging middle area after the concave-convex adjustment, a first plane area with bulging sub-areas, and a second plane area, wherein the sixth parameter value is a parameter value of the node included in the sixth node group corresponding to the plurality of parameter values;
[0195] The using the plane model in the fifth form as the wave model corresponding to the first key frame includes:
[0196] The plane model in the sixth form is used as the wave model corresponding to the first key frame.
[0197] Optionally, also execute:
[0198] Encoding vertex animation data of the wave model in the wave animation into a texture map to form a vertex animation texture map corresponding to the wave animation;
[0199] The vertex animation texture map is exported to a game engine, so that the game engine renders the wave special effects corresponding to the wave animation based on the vertex animation texture map.
[0200] Optionally, the game engine renders the wave special effects corresponding to the wave animation based on the vertex animation texture map, including:
[0201] In response to monitoring the game event, the game engine calls the shader, combines the vertex animation texture map and the water material, and renders the wave special effect;
[0202] Wherein, the game events at least include: a triggering event of a wave skill.
[0203] Or, do the following:
[0204] Acquire a vertex animation texture map, wherein the vertex animation texture map is formed by encoding vertex animation data of a wave model in an ocean wave animation into a texture map, and the ocean wave animation is generated based on a method for generating an ocean wave animation; wherein the method for generating an ocean wave animation comprises: creating a plane model; calling an ocean wave animation production tool, and performing morphological adjustments on the plane model based on a plurality of preset parameter values to generate the ocean wave animation; wherein the ocean wave animation production tool comprises a plurality of nodes connected in sequence, wherein the nodes are used to characterize operation execution units of the ocean wave animation production tool, and each of the nodes corresponds to at least one node parameter, and the node parameters comprise a first number of node sub-parameters, wherein the first number is the number of key frames preset for the ocean wave animation, and each of the node sub-parameters corresponds to one of the key frames; and the parameter value is preset for the node sub-parameter;
[0205] The shader is called to combine the vertex animation texture map and the water material to render the wave special effects corresponding to the wave animation.
[0206] Optionally, calling a shader, combining the vertex animation texture map and the water material, and rendering the wave special effects corresponding to the wave animation includes:
[0207] In response to monitoring the game event, calling the shader, combining the vertex animation texture map and the water material, and rendering the wave special effect;
[0208] Wherein, the game events at least include: a triggering event of a wave skill.
[0209] A sixth embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes computer instructions, and when the computer instructions are executed by a processor, they are used to implement the methods described in the embodiments of the present application.
[0210] It should be noted that the relational terms such as "first" and "second" in this article are only used to distinguish one entity or operation from another entity or operation, and do not require or imply any actual relationship or order between these entities or operations. In addition, the words "include", "have", "include" and "includes" and other similar forms are the same in meaning, and the end of any one or more items after any of the above words is open-ended, and any of the above nouns does not mean that the one or more items have been exhaustively listed or are limited to the one or more items listed.
[0211] As used herein, unless expressly stated otherwise, the term "or" includes all possible combinations, except those that are not feasible. For example, if it is expressed that a database may include A or B, then unless otherwise specifically stated or not feasible, it may include database A, or B, or A and B. As a second example, if it is expressed that a database may include A, B, or C, then unless otherwise specifically stated or not feasible, the database may include database A, or B, or C, or A and B, or A and C, or B and C, or A, B, and C.
[0212] It is worth noting that the above embodiments can be implemented by hardware or software (program code), or a combination of hardware and software. If implemented by software, it can be stored in the above-mentioned computer-readable medium. When the software is executed by a processor, it can execute the above-mentioned disclosed method. The computing unit and other functional units described in the present disclosure can be implemented by hardware or software, or a combination of hardware and software. Those of ordinary skill in the art will also understand that the above-mentioned multiple modules / units can be combined into one module / unit, and each of the above-mentioned modules / units can be further divided into multiple sub-modules / sub-units.
[0213] In the above detailed description, the embodiments have been described with reference to many specific details, which may vary from implementation to implementation. Certain adaptations and modifications may be made to the embodiments. For those skilled in the art, other embodiments may be readily apparent from the specific embodiments disclosed in the present application. This specification and examples are for exemplary purposes only, and the true scope and essence of the present application are described by the claims. The sequence of steps shown in the diagrams is also for the purpose of explanation only and is not intended to be limited to any particular steps or sequence. Therefore, those skilled in the art will appreciate that these steps may be performed in different orders when implementing the same method.
[0214] In the drawings and detailed description of the present application, exemplary embodiments are disclosed. However, many variations and modifications may be made to these embodiments. Accordingly, although specific terms are used, these terms are only general and descriptive and not for the purpose of limitation.
Claims
1. A method for generating an ocean wave animation, characterized in that: The method comprises: Create a plane model; Calling an ocean wave animation production tool, adjusting the shape of the plane model based on a plurality of preset parameter values, and generating an ocean wave animation; wherein the ocean wave animation production tool comprises a plurality of nodes connected in sequence, the nodes are used to characterize operation execution units of the ocean wave animation production tool, each of the nodes corresponds to at least one node parameter, the node parameters comprise a first number of node sub-parameters, the first number being the number of key frames preset for the ocean wave animation, each of the node sub-parameters corresponding to one of the key frames; the parameter values are preset for the node sub-parameters.
2. The method according to claim 1, characterized in that The calling of the wave animation production tool to adjust the shape of the plane model based on a plurality of preset parameter values to generate the wave animation includes: Running the plurality of nodes, and adjusting the shape of the plane model according to the parameter values of the plurality of node sub-parameters corresponding to each of the key frames, to form a wave model corresponding to each of the key frames; The ocean wave animation is generated according to the ocean wave model corresponding to each of the key frames.
3. The method according to claim 2, characterized in that The generating the wave animation according to the wave model corresponding to each key frame includes: According to the wave models corresponding to the two adjacent key frames, an interpolation operation is used to generate a wave model corresponding to each frame between the two adjacent key frames; The ocean wave animation is composed of the ocean wave models corresponding to the two adjacent key frames and the ocean wave models corresponding to each frame between the two adjacent key frames.
4. The method according to claim 2, characterized in that: The wave animation production tool comprises at least a first node group, a second node group, a third node group, and a fourth node group: wherein, The first node group includes at least one node, which is used to adjust the original shape of the plane model to a first shape in which the middle part is convex and the two ends maintain the plane height, and the area occupied by the middle convexity in the plane model and the degree of convexity are determined by the parameter value of the node included in the first node group; The second node group includes at least one node, which is used to compress the central convex area of the first form along a first direction to form a second form including the central convex area and two side plane areas, wherein the first direction is a direction perpendicular to the central convex area along the plane where the plane model is located, and the two side plane areas are areas located on both sides of the central convex area in the plane model except the central convex area, and the compression degree of the central convex area is determined by the parameter value of the node included in the corresponding second node group; The third node group includes at least one node, which is used to change the position of the pivot point so that the central convex area of the second form curls along the changed pivot point to form a third form including a central curling area and two side plane areas, and the pivot point position is determined by the parameter value of the node included in the third node group; The fourth node group includes at least one node, which is used to attenuate the central curled area of the third form on both sides along the second direction to form a fourth form including a central bulging area and two side plane areas, the second direction is a direction parallel to the central curled area, and the attenuation degree of the central curled area on both sides along the second direction is determined by the parameter value of the node included in the corresponding fourth node group.
5. The method according to claim 4, characterized in that The running of the plurality of nodes, and adjusting the shape of the plane model according to the parameter values of the plurality of node sub-parameters corresponding to each of the key frames to form a wave model corresponding to each of the key frames, includes: Obtain parameter values of a plurality of the node sub-parameters corresponding to a first key frame, wherein the first key frame is any one of the first number of key frames; Based on a first parameter value corresponding to the first key frame, the first node group is run to adjust the original shape of the plane model to a first shape in which the middle is convex and both ends maintain plane height, wherein the first parameter value is a parameter value corresponding to the node included in the first node group among the plurality of parameter values; Based on a second parameter value corresponding to the first key frame, running the second node group to adjust the first form of the plane model to a second form including a central convex area and two side plane areas, the second parameter value being a parameter value of the node included in the second node group corresponding to the plurality of parameter values; Based on a third parameter value corresponding to the first key frame, running the third node group to adjust the second form of the plane model to a third form including a middle curled area and two side plane areas, the third parameter value being a parameter value of the node included in the third node group corresponding to the plurality of parameter values; Based on a fourth parameter value corresponding to the first key frame, running the fourth node group to adjust the third form of the plane model to a fourth form including a central bulging area and two side plane areas, the fourth parameter value being a parameter value of the node included in the fourth node group corresponding to the plurality of parameter values; The plane model in the fourth form is used as the wave model corresponding to the first key frame.
6. The method according to claim 5, characterized in that The ocean wave animation production tool further includes a fifth node group; The fifth node group includes at least one node, which is used to change the position of the pivot point, so that the sub-region close to the middle bulging region in the first plane region of the fourth form bulges, forming a fifth form including the middle bulging region, the first plane region of the sub-region bulging, and the second plane region, the first plane region is a plane region in the two side plane regions located in the curling direction of the middle bulging region, the second plane region is another plane region in the two side plane regions except the first plane region, and the pivot point position is determined by the parameter value of the node corresponding to the fifth node group; Before the step of using the plane model in the fourth form as the wave model corresponding to the first key frame, the method further includes: Based on a fifth parameter value corresponding to the first key frame, running the fifth node group, adjusting the fourth form of the plane model to a fifth form including a middle bulging area, a first plane area with a sub-area bulge, and a second plane area, wherein the fifth parameter value is a parameter value of the node included in the fifth node group corresponding to the plurality of parameter values; The using the plane model in the fourth form as the wave model corresponding to the first key frame includes: The plane model in the fifth form is used as the wave model corresponding to the first key frame.
7. The method according to claim 6, characterized in that The ocean wave animation production tool further includes a sixth node group; The sixth node group includes at least one node, which is used to adjust the concave-convexity of the middle bulged area of the fifth form along the second direction to form a sixth form including the middle bulged area after the concave-convexity adjustment, the first plane area with bulged sub-areas, and the second plane area, and the adjustment degree of the concave-convexity adjustment of the middle bulged area along the second direction is determined by the parameter value of the node included in the sixth node group; Before the step of using the plane model in the fifth form as the wave model corresponding to the first key frame, the method further includes: Based on the sixth parameter value corresponding to the first key frame, the sixth node group is run to adjust the fifth form of the plane model to a sixth form including a bulging middle area after the concave-convex adjustment, a first plane area with bulging sub-areas, and a second plane area, wherein the sixth parameter value is a parameter value of the node included in the sixth node group corresponding to the plurality of parameter values; The using the plane model in the fifth form as the wave model corresponding to the first key frame includes: The plane model in the sixth form is used as the wave model corresponding to the first key frame.
8. The method according to claim 1, characterized in that The method further comprises: Encoding vertex animation data of the wave model in the wave animation into a texture map to form a vertex animation texture map corresponding to the wave animation; The vertex animation texture map is exported to a game engine, so that the game engine renders the wave special effects corresponding to the wave animation based on the vertex animation texture map.
9. The method according to claim 8, characterized in that The game engine renders the wave special effects corresponding to the wave animation based on the vertex animation texture map, including: In response to monitoring the game event, the game engine calls the shader, combines the vertex animation texture map and the water material, and renders the wave special effect; Wherein, the game events at least include: a triggering event of a wave skill.
10. A method for rendering ocean wave special effects, characterized in that: The method comprises: Acquire a vertex animation texture map, wherein the vertex animation texture map is formed by encoding vertex animation data of a wave model in an ocean wave animation into a texture map, and the ocean wave animation is generated based on a method for generating an ocean wave animation; wherein the method for generating an ocean wave animation comprises: creating a plane model; calling an ocean wave animation production tool, and performing morphological adjustments on the plane model based on a plurality of preset parameter values to generate the ocean wave animation; wherein the ocean wave animation production tool comprises a plurality of nodes connected in sequence, wherein the nodes are used to characterize operation execution units of the ocean wave animation production tool, and each of the nodes corresponds to at least one node parameter, and the node parameters comprise a first number of node sub-parameters, wherein the first number is the number of key frames preset for the ocean wave animation, and each of the node sub-parameters corresponds to one of the key frames; and the parameter value is preset for the node sub-parameter; The shader is called to combine the vertex animation texture map and the water material to render the wave special effects corresponding to the wave animation.
11. The method according to claim 10, characterized in that The calling shader, combining the vertex animation texture map and the water material, and rendering the wave special effects corresponding to the wave animation includes: In response to monitoring the game event, calling the shader, combining the vertex animation texture map and the water material, and rendering the wave special effect; Wherein, the game events at least include: a triggering event of a wave skill.
12. A device for generating an ocean wave animation, characterized in that: The device comprises: a model creation unit and an animation generation unit; The model creation unit is used to create a plane model; The animation generation unit is used to call an ocean wave animation production tool, adjust the shape of the plane model based on a plurality of preset parameter values, and generate an ocean wave animation; wherein the ocean wave animation production tool includes a plurality of nodes connected in sequence, the nodes are used to represent operation execution units of the ocean wave animation production tool, each of the nodes corresponds to at least one node parameter, the node parameters include a first number of node sub-parameters, the first number is the number of key frames preset for the ocean wave animation, and each of the node sub-parameters corresponds to one key frame; the parameter value is preset for the node sub-parameter.
13. A rendering device for sea wave special effects, characterized in that: The device comprises: a texture acquisition unit and a special effect rendering unit; The map acquisition unit is used to acquire a vertex animation texture map, wherein the vertex animation texture map is formed by encoding vertex animation data of a wave model in an ocean wave animation into a texture map, and the ocean wave animation is generated based on a method for generating an ocean wave animation; wherein the method for generating an ocean wave animation comprises: creating a plane model; calling an ocean wave animation production tool, and performing morphological adjustments on the plane model based on a plurality of preset parameter values to generate the ocean wave animation; wherein the ocean wave animation production tool comprises a plurality of nodes connected in sequence, wherein the nodes are used to characterize operation execution units of the ocean wave animation production tool, and each of the nodes corresponds to at least one node parameter, and the node parameters comprise a first number of node sub-parameters, wherein the first number is the number of key frames preset for the ocean wave animation, and each of the node sub-parameters corresponds to one of the key frames; and the parameter value is preset for the node sub-parameter; The special effect rendering unit is used to call the shader, combine the vertex animation texture map and the water material, and render the wave special effect corresponding to the wave animation.
14. An electronic device, characterized in that: include: Memory, processor; The memory is used to store one or more computer instructions; The processor is used to execute the one or more computer instructions to implement the method according to any one of claims 1-11.
15. A computer-readable storage medium having one or more computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the method according to any one of claims 1 to 11 is performed.