Virtual asset rendering method and apparatus, and electronic device

By partially intercepting particle animations to generate virtual assets, and using pre-constructed animation curves and curve texture mapping technology, the contradiction between virtual assets landing performance and accuracy is solved, and virtual asset rendering with high precision and low package size is achieved.

CN119868931AActive Publication Date: 2025-04-25NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411942866.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-25
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

In the case where the landing performance of virtual assets is limited, the virtual resources corresponding to long-term animation resources are not high in accuracy and the landing effect is not good.

Method used

Virtual assets are generated by performing local intercepting operations on particle animations, and the animation curves pre-constructed according to the animation to be rendered are obtained. The coordinate data of each vertex of the dynamic model is collected using the curve texture map to realize the animation to be rendered when the dynamic model moves cyclically along the animation curve.

Benefits of technology

Without reducing the accuracy of virtual assets, optimize the package size of virtual assets, reduce landing performance consumption, and improve the accuracy and landing effect of animation resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119868931A_ABST
    Figure CN119868931A_ABST
Patent Text Reader

Abstract

The invention discloses a virtual asset rendering method and device, electronic equipment and a computer readable storage medium. The method comprises the following steps: acquiring a virtual asset and a curve texture map corresponding to an animation curve; rendering a dynamic model corresponding to the virtual assets according to the grid model and the vertex animation texture map included in the virtual assets, and controlling the dynamic model to deform along the animation curve; determining a corresponding point of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding point in the curve texture map; and at each time point, changing the position of each vertex of the dynamic model based on the coordinate data corresponding to each vertex of the dynamic model at the time point, and forming a to-be-rendered animation of the dynamic model moving circularly along the animation curve. According to the method, the technical problems that in the prior art, under the condition that the landing performance of virtual assets is limited, the precision of virtual resources corresponding to animation resources with long duration is not high, and the landing effect is not good are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a rendering method, device, electronic device, and computer-readable storage medium for virtual assets. Background Art

[0002] The application of virtual assets in virtual application projects such as games can increase the visual sense of the application projects, especially some high-precision virtual assets can bring an immersive experience to users.

[0003] At present, VAT (Vertex Animation Textures) technology is an efficient way to create virtual assets with complex physical dynamics such as liquid fluids. VAT technology stores the position information of each vertex of the model in the form of texture maps, reducing the package size and landing performance consumption of virtual resources. However, for some animation resources with a long overall duration, there is often a contradiction between the landing performance and accuracy of virtual assets. Usually, in order to optimize the landing performance, the accuracy of virtual assets can only be reduced, but this will undoubtedly affect the final landing effect and bring a poor experience to users.

[0004] Therefore, the prior art has the technical problem that when the landing performance of virtual assets is limited, the virtual resources corresponding to animation resources with a long duration are not accurate and the landing effect is not good. Summary of the invention

[0005] The present application provides a method, device, electronic device, and computer-readable storage medium for rendering virtual assets to solve the technical problems in the prior art that, when the landing performance of virtual assets is limited, the virtual resources corresponding to animation resources with a long duration are not accurate and the landing effect is poor.

[0006] In a first aspect, an embodiment of the present application provides a method for rendering a virtual asset, the method comprising: obtaining a virtual asset and a curve texture map corresponding to an animation curve; wherein the virtual asset is generated based on a local interception operation on a particle animation, and comprises a mesh model and a vertex animation texture map, the animation curve is pre-constructed according to the animation to be rendered, and the curve texture map stores curve information corresponding to each point on the animation curve, and the curve information comprises at least coordinate data of each point on the animation curve; according to the mesh model and vertex animation texture map included in the virtual asset, a dynamic model corresponding to the virtual asset is rendered, and the dynamic model is controlled to deform along the animation curve; the corresponding points of each vertex of the dynamic model on the animation curve at each time point are determined, and the coordinate data of the corresponding points are collected in the curve texture map; at each time point, the positions of each vertex of the dynamic model are changed based on the coordinate data corresponding to each vertex of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0007] In a second aspect, an embodiment of the present application provides a rendering device for a virtual asset, the device comprising: an acquisition unit, a deformation unit, a collection unit, and a rendering unit; the acquisition unit is used to acquire a virtual asset and a curve texture map corresponding to an animation curve; wherein the virtual asset is generated based on a local interception operation of a particle animation, and comprises a mesh model and a vertex animation texture map, the animation curve is pre-constructed according to the animation to be rendered, and the curve texture map stores curve information corresponding to each point on the animation curve, and the curve information at least comprises coordinate data of each point on the animation curve; the deformation unit is used to render a dynamic model corresponding to the virtual asset according to the mesh model and the vertex animation texture map included in the virtual asset, and control the deformation of the dynamic model along the animation curve; the collection unit is used to determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collect the coordinate data of the corresponding points in the curve texture map; the rendering unit is used to change the positions of each vertex of the dynamic model at each time point based on the coordinate data corresponding to each vertex of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0008] In a third 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.

[0009] In a fourth 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.

[0010] Compared with the prior art, the rendering method of virtual assets provided by the present application includes: obtaining virtual assets and curve texture maps corresponding to animation curves; wherein the virtual assets are generated based on a local interception operation of particle animation, including a mesh model and a vertex animation texture map, the animation curve is pre-built according to the animation to be rendered, and the curve texture map stores the curve information corresponding to each point on the animation curve, and the curve information at least includes the coordinate data of each point on the animation curve; according to the mesh model and vertex animation texture map included in the virtual asset, the dynamic model corresponding to the virtual asset is rendered, and the dynamic model is controlled to deform along the animation curve; the corresponding points of each vertex of the dynamic model on the animation curve at each time point are determined, and the coordinate data of the corresponding points are collected in the curve texture map; at each time point, the positions of each vertex of the dynamic model are changed based on the coordinate data corresponding to each vertex of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve. First, the method generates virtual assets by performing a local interception operation on the particle animation. That is, the method maintains the high precision of the virtual asset while reducing the size of the virtual asset package and optimizing the landing performance of the virtual asset by intercepting the local part. This method does not need to optimize the landing performance of virtual assets by reducing the accuracy of the mesh model, the number of faces, and the resolution of the vertex texture map. That is, the accuracy of the virtual assets generated by this method is not damaged, and the problem of poor landing effect will not be caused. Second, the method obtains the animation curve pre-constructed according to the animation to be rendered, and samples the coordinate data of each vertex of the dynamic model (obtained based on the virtual asset rendering) at each time point in the curve texture map corresponding to the animation curve, so that the dynamic model can move cyclically along the animation curve to form the animation to be rendered. That is, the method realizes the formation of long-duration animation resources based on virtual assets of small packages through animation curves. Therefore, the rendering method of virtual assets provided by the present application solves the technical problems that the virtual resources corresponding to the animation resources with longer durations are not accurate and the landing effect is poor when the landing performance of the virtual assets is limited in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 It is an application system diagram of the method for generating virtual assets provided in an embodiment of the present application;

[0012] Figure 2 It is an application system diagram of the virtual asset rendering method provided in the embodiment of the present application;

[0013] Figure 3 is a flow chart of a method for generating virtual assets provided in the first embodiment of the present application;

[0014] FIG4( a ) is a first schematic diagram of intercepting a local area of ​​a particle flow and splicing it into a sub-particle flow provided by the first embodiment of the present application;

[0015] FIG4( b ) is a second schematic diagram of intercepting a local area of ​​a particle flow and splicing it into a sub-particle flow provided by the first embodiment of the present application;

[0016] FIG4( c ) is a third schematic diagram of intercepting a local area of ​​a particle flow and splicing it into a sub-particle flow provided by the first embodiment of the present application;

[0017] FIG4(d) is a fourth schematic diagram of intercepting a local area of ​​a particle flow and splicing it into a sub-particle flow provided by the first embodiment of the present application;

[0018] FIG4(e) is a fifth schematic diagram of intercepting a local area of ​​a particle flow and splicing it into a sub-particle flow provided by the first embodiment of the present application;

[0019] FIG4( f ) is a sixth schematic diagram of intercepting a local area of ​​a particle flow and splicing it into a sub-particle flow provided by the first embodiment of the present application;

[0020] Figure 5 is a flowchart of a method for rendering virtual assets provided in the second embodiment of the present application;

[0021] Figure 6 is a schematic diagram of rendering different animation effects of virtual assets provided by the second embodiment of the present application;

[0022] Figure 7 It is a structural schematic diagram of a device for generating virtual assets provided in the third embodiment of the present application;

[0023] Figure 8 It is a structural schematic diagram of a rendering device for virtual assets provided in the fourth embodiment of the present application;

[0024] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in the fifth embodiment of the present application. DETAILED DESCRIPTION

[0025] 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.

[0026] With the rapid advancement of computer technology, virtual application projects such as games have entered an unprecedented stage of development. While developers are improving functions, they are also paying more and more attention to the user experience. The landing of virtual assets in virtual application projects can increase the visual sense of the application projects, especially some high-precision virtual assets, which can give users good psychological feedback and bring users an immersive experience.

[0027] At present, VAT (Vertex Animation Textures) technology is an efficient way to produce virtual assets with complex physical dynamics such as liquid fluids. VAT technology stores the position information of each vertex of the model in the form of texture maps, reducing the package size and landing performance consumption of virtual resources. When the virtual assets prepared by VAT technology are landed in the virtual application project, the shader of the rendering engine can sample from the vertex animation texture map to obtain the position information of each vertex of the model at a specific time point, so as to render the animation effects corresponding to the virtual resources in the virtual application project, such as fluid animation effects. However, for some animation resources with a long overall duration, there is often a contradiction between the landing performance and accuracy of virtual assets. Usually, in order to optimize the landing performance, the accuracy of the virtual assets can only be reduced (such as reducing the accuracy of the model, reducing the number of faces of the model, reducing the resolution of the vertex animation texture map, etc.), but this will undoubtedly affect the final landing effect and bring a poor experience to users. In addition, since the accuracy of virtual assets is related to the overall duration of animation resources, for animation resources of different lengths, only the corresponding virtual assets can be customized, and the reusability is poor. When the virtual asset landing performance is poor, it is necessary to return to the virtual asset preparation process for repeated modifications, which undoubtedly reduces the development efficiency of virtual application projects. Especially for virtual application projects deployed in terminal devices with poor storage and processing performance such as mobile phones, it is more difficult to implement high-precision virtual resources in the application project.

[0028] Therefore, there is an urgent need for a virtual asset production and implementation method that can reduce the package size of virtual assets without reducing the accuracy of virtual assets, thereby reducing the performance consumption of virtual asset implementation, so as to solve the technical problems existing in the prior art that, when the implementation performance of virtual assets is limited, the virtual resources corresponding to animation resources with a long duration are not of high accuracy and the implementation effect is not good.

[0029] In view of this, the present application provides a method for rendering virtual assets. First, the method generates virtual assets by performing a local interception operation on a particle animation. That is, the method reduces the size of the virtual asset package and optimizes the landing performance of the virtual asset by intercepting the local part, while maintaining the high precision of the virtual asset. The method does not need to optimize its landing performance by reducing the precision of the virtual asset by reducing the mesh model precision, the number of faces, and the vertex texture map resolution. That is, the precision of the virtual assets generated by this method is not damaged, and the problem of poor landing effect will not be caused. Second, the method obtains an animation curve pre-constructed according to the animation to be rendered, and samples the coordinate data of each vertex of the dynamic model (obtained based on the virtual asset rendering) at each time point in the curve texture map corresponding to the animation curve, so that the dynamic model can move cyclically along the animation curve to form the animation to be rendered. That is, the method realizes the formation of long-duration animation resources based on virtual assets of small packages through animation curves.

[0030] The following is a further detailed description of the virtual asset rendering method, device, electronic device, and computer-readable storage medium described in the present application in conjunction with specific embodiments and drawings. The following embodiments will respectively describe the generation (i.e., production) of virtual assets and the rendering (i.e., landing) of virtual assets.

[0031] Figure 1 : is an application system diagram of the method for generating virtual assets provided in the embodiment of the present application. Figure 1 As 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. A virtual asset generation method is deployed on the first server terminal 102, and in response to receiving a virtual asset generation request sent by the first user terminal 101, a high-precision, low-package-size virtual asset is generated based on the virtual asset generation method.

[0032] Figure 2 is an application system diagram of the virtual asset rendering method provided in the embodiment of the present application. Figure 2As 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 virtual application project (such as a game application) and a rendering method of a virtual asset. In response to receiving a virtual asset rendering instruction sent by the second user terminal 201, the second server terminal 202 uses the virtual asset imported from the third server terminal 203 (a method for generating virtual assets is deployed on the third server terminal 203) to render a corresponding animation effect in the virtual application project.

[0033] The first embodiment of the present application provides a method for generating a virtual asset.

[0034] This method is deployed in Figure 1 In the first server 102 shown, in response to receiving the virtual asset generation instruction, the first server 102 generates a high-precision, low-package-size virtual asset based on the method provided in this embodiment to ensure that the virtual asset consumes less performance when it is implemented in the virtual application project and achieves a better effect. In an optional implementation, the virtual asset generation method is executed by 3D animation production software (such as Houdini, SD, etc.).

[0035] Figure 3 Flowchart of the method for generating virtual assets provided in this embodiment. Figure 3 The method for generating virtual assets provided in 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.

[0036] like Figure 3 As shown, the method for generating virtual assets provided in this embodiment includes the following steps S310 to S340:

[0037] Step S310, creating a particle animation, wherein a plurality of particles in the particle animation move along a preset particle motion path to form a particle flow.

[0038] The particle animation may be understood as a motion animation formed by the movement of multiple particles. In this embodiment, multiple particles move along a preset particle movement path, and a particle group formed by the movement of multiple particles along the preset particle movement path is defined as a particle flow.

[0039] In an optional implementation, creating a particle animation may specifically include the following steps S311 to S314:

[0040] Step S311, obtaining a pre-constructed particle motion path, and generating a velocity field along the particle motion path, wherein the particle motion path is associated with the type of the virtual asset.

[0041] Step S312, controlling the particle emitter to emit multiple particles, and applying the velocity field to the multiple particles, so that the multiple particles move along the particle motion path to form a particle flow.

[0042] Step S313 , based on the preset disturbance parameters, applying a force corresponding to the disturbance parameters to the plurality of particles, so as to adjust the shape of the particle flow to be consistent with the type of the virtual asset.

[0043] Step S314, generating particle animation.

[0044] The particle movement path may be carried by the virtual asset generation instruction and transmitted to the first server 102, and is used to guide the particle to move. The path may be a curve or a geometric body of any shape. Specifically, it needs to be pre-constructed according to the type of the pre-generated virtual asset. Exemplarily, if the type of the pre-generated virtual asset is a fluid, then the particle movement path may be constructed as a linear path (e.g., a straight line, a curve, etc.); if the type of the pre-generated virtual asset is a rigid body, then the particle movement path may be constructed as a closed geometric body (e.g., a square, a triangle, etc.).

[0045] After obtaining the particle movement path, a particle emitter can be established to emit particles, and by setting the velocity field direction to be consistent with the particle movement path, the particles move along the particle movement path to form a particle flow.

[0046] Optionally, in order to make the shape of the particle flow more consistent with the type of virtual asset, other forces can be applied to the particles by adding disturbance parameters to adjust the particle flow to a shape consistent with the type of virtual asset. Exemplarily, if the type of the pre-generated virtual asset is a fluid, then parameters that can help the particle flow simulate fluid behavior (such as viscosity, surface tension, etc.) can be added to adjust the particle flow to a liquid shape.

[0047] Step S320, intercepting a sub-particle flow of a preset length, and obtaining a sub-particle animation corresponding to the sub-particle flow from the particle animation, where the sub-particle flow is a local area in the particle flow.

[0048] In the method provided in this embodiment, a local area is intercepted from the particle flow, and the intercepted local area and the local particle animation corresponding to the local area are used as the original resources for generating virtual assets. In this embodiment, the local area intercepted from the particle flow is defined as a sub-particle flow, and the local particle animation corresponding to the local area is defined as a sub-particle animation.

[0049] In an optional implementation, intercepting the sub-particle flow of the preset length may specifically include: according to a preset interception rule, intercepting a local area of ​​the particle flow with the preset length that meets the interception rule as the sub-particle flow.

[0050] The interception rule can be understood as the definition of which local area to intercept from the particle flow, and the interception rule can be redefined according to the specific virtual asset generation requirements. For example, the interception rule can be to intercept an area of ​​a preset length from the middle of the particle flow, or to intercept the key area with the most complex morphological changes according to the morphology of the particle flow.

[0051] In an optional implementation, in order to ensure that the virtual assets generated by the sub-particle stream and the sub-particle animation will not have the traces of the beginning and the end splicing when the landing loop, the sub-particle stream of the preset length is not directly intercepted, but a local area shorter than the preset length is intercepted, and then the sub-particle stream of the preset length is formed by splicing. Based on this, intercepting the sub-particle stream of the preset length may specifically include the following steps S321 to S324:

[0052] Step S321 , intercepting a first sub-particle flow of a first length, wherein the first length is less than a preset length, and the first sub-particle flow includes a first end and a second end.

[0053] Step S322, performing a replication operation on the first sub-particle flow to form a first replication sub-particle flow corresponding to the first sub-particle flow, wherein the first replication sub-particle flow includes a third end and a fourth end, wherein the third end is the same as the first end, and the fourth end is the same as the second end.

[0054] Step S323, performing a middle cutting operation on the first replicator particle flow, dividing the first replicator particle flow into a first part and a second part, wherein the first part includes the third end and the cut-off part, and the second part includes the fourth end and the cut-off part;

[0055] Step S324, splicing the third end of the first part with the second end of the first sub-particle flow, and splicing the fourth end of the second part with the first end of the first sub-particle flow, to form a sub-particle flow of a preset length, the sub-particle flow including a fifth end and a sixth end, both of which are cut-off parts.

[0056] Exemplarily, three sub-particle flows of unit length are pre-cut from the particle flow. First, two first sub-particle flows of unit length are cut from the particle flow. The first sub-particle flow includes a first end (head) and a second end (tail). Then, the first sub-particle flow is replicated to form a first replicated sub-particle flow. The first replicated sub-particle flow includes a third end (head) and a fourth end (tail). The first replicated sub-particle flow is cut in the middle again to split the first replicated sub-particle flow into a first part of unit length and a second part of unit length. The first part includes the third end (head). and the cut-off part, the second part includes the cut-off part and the fourth end (tail), and finally the third end (head) of the first part is spliced ​​with the second end (tail) of the first sub-particle flow, with an overlap of 0.5 units at the splicing point, and the fourth end (tail) of the second part is spliced ​​with the first end (head) of the first sub-particle flow, with an overlap of 0.5 units at the splicing point, and finally a sub-particle flow is formed by the second part, the first sub-particle flow, and the first part, and the sub-particle flow includes the fifth end (head) and the sixth end (tail), and the fifth end and the sixth end are actually the cut-off part. When the virtual asset is landed and the head and tail are spliced ​​in a loop, since the head and tail are the same, no splicing marks will appear.

[0057] It should be noted that the middle cutting operation on the first replicator particle flow does not need to be strictly cut from the middle of the first replicator particle flow to form two equal-length parts. It can also be cut from other positions according to actual conditions. It can also be cut obliquely, curved, etc. according to the shape of the first replicator particle flow. There is no specific limitation.

[0058] Step S330, meshing the sub-particle flow to generate a mesh model corresponding to the sub-particle flow, and determining the displacement information of each vertex of the mesh model according to the sub-particle animation, and baking the displacement information of each vertex of the mesh model into a texture map to generate a vertex animation texture map.

[0059] This step includes two aspects: one is to generate a model based on the sub-particle flow, and the other is to generate a vertex animation texture map based on the sub-particle animation.

[0060] In this implementation, the mesh conversion method is used to generate the model based on the sub-particle flow. The mesh conversion method is relatively mature and will not be described in detail here. In an optional implementation, the sub-particle flow corresponding to each time point in the sub-particle animation has a different shape. Therefore, the sub-particle flow corresponding to each time point in the sub-particle animation is firstly meshed to form a candidate mesh model corresponding to the sub-particle flow at each time point; then the candidate mesh model with the largest number of mesh faces in the candidate mesh model is used as the mesh model. Selecting the candidate mesh model with the largest number of faces as the mesh model included in the final virtual asset can ensure that the mesh model can simulate the shape at any time point.

[0061] In this embodiment, VAT technology is used to generate vertex animation texture maps based on sub-particle animation. Specifically, since the mesh model is formed by mesh conversion of the sub-particle flow, each vertex of the mesh model can find the corresponding particle in the sub-particle flow, thereby determining the displacement information of each vertex of the mesh model based on the motion trajectory of the corresponding particle in the sub-particle animation. Then, the displacement information of each vertex of the mesh model is baked into the texture map to generate a vertex animation texture map. A pixel point in the vertex animation texture map stores the position information of a vertex of the mesh model at a time point.

[0062] Step S340: combining the mesh model and the vertex animation texture map into a virtual asset.

[0063] In this embodiment, the virtual asset is composed of a mesh model and a vertex animation texture map. In the above steps, the mesh model and the vertex animation texture map are generated respectively, and the virtual asset can be formed by combining the two.

[0064] The following takes fluid assets (virtual assets) as an example and Houdini as the executor of the method provided in this embodiment to illustrate how to generate high-precision, low-envelope-size fluid assets based on the virtual asset generation method provided in this embodiment.

[0065] Generating fluid assets based on the virtual asset generation method provided in this embodiment may include the following steps S401 to S405:

[0066] Step S401, establishing a particle emitter and a particle motion path.

[0067] The particle emitter can be in the form of a point, line, surface or volume, depending on the fluid phenomenon you want to simulate, and the particle emitter is used to emit multiple particles.

[0068] The particle motion path can be understood as the path that guides the movement of particles. It can be a curve or a geometric body of any shape. The asset model corresponding to the fluid asset is a fluid model. Therefore, the particle motion path can be a curve to simulate the flow form of the fluid.

[0069] Specifically, you can use the Curve tool or Spline node in Houdini to create fluid curves, and ensure that the fluid curves have sufficient resolution and smoothness to accurately represent the guide path.

[0070] Step S402, emitting particles based on the particle emitter, and setting the direction of the velocity field to be consistent with the particle motion path.

[0071] Multiple particles are emitted from the particle emitter, and the direction of the particles' movement is controlled by the velocity field. The direction of the velocity field is consistent with the particle's movement path to ensure that the particles move along the particle's movement path, forming a particle flow with a specific shape. In this example, the particle's movement path is a curve, and the direction of the velocity field is set to be consistent with the curve, so that the particles move along the curve, forming a particle flow with a fluid shape.

[0072] Specifically, you can use the Pop Source node in Houdini to define the initial properties of particles, such as position, velocity, etc., use the Trail or Stream node to generate a velocity field along the particle motion path, use the Popobject node to associate particles with the particle motion path, and use the Pop Force node to apply the velocity field to particles.

[0073] Step S403, adjusting the particles to a liquid state by using the disturbance parameters and the popfluid node to form a fluid particle animation.

[0074] The purpose of adding disturbance is to make the particle flow look more like a fluid. In this step, you can introduce some random disturbances into the particle flow by adjusting the velocity, acceleration or other physical properties of the particles. The Pop Fluid node can help the particle flow simulate the behavior of fluids, such as viscosity, surface tension, etc. By adjusting these parameters, the particle flow can be made closer to the real fluid form.

[0075] Specifically, you can use the Pop Drag node and Pop Wind node in Houdini to add random forces to particles to simulate environmental influences, and use the Pop Fluid Solver node to make the particle flow simulate the physical properties of the fluid, such as viscosity, density, surface tension, etc., and adjust parameters such as Viscosity and Surface Tension to make the movement of the particle flow more realistic.

[0076] Step S404: intercepting a local area in the particle flow to form a sub-particle flow, and obtaining a sub-fluid particle animation corresponding to the sub-particle flow in the fluid particle animation.

[0077] For example, a sub-particle flow of 3 units in length is intercepted from a particle flow of 10 units in length, and a sub-fluid particle animation corresponding to the sub-particle flow of 3 units in length is obtained from the fluid particle animation. Optionally, the intercepted sub-particle flow can be the middle area of ​​the particle flow, or the key area of ​​the particle flow (such as an area with a vortex, an area with splashing water, etc.). The specific intercepted area can be determined according to the implementation requirements of the fluid asset, and is not limited here.

[0078] In an optional implementation, in order to ensure that there are no splicing marks due to cyclic sampling when the fluid asset lands, it is necessary to ensure that the first position of the fluid model is connected. In this example, after intercepting the local area, the intercepted local area can be spliced ​​by two-way continuous welding technology. Specifically, copy the local area, cut off the copied local area from the middle, connect the head of the left part with the tail of the local area, and connect the tail of the right part with the head of the local area to form a sub-particle flow spliced ​​by the left part, the local area, and the right part. The head and tail of the sub-particle flow are both cut-off points, so they are the same. When cyclic sampling is performed later, because the head and tail are the same, the head and tail can be closely connected without splicing marks. It should be noted that because the sub-particle flow is spliced ​​by two local areas, when intercepting the local area, it needs to be less than the length of the sub-particle flow to be formed in the end. Exemplarily, 1.5 units of the local area are intercepted from the particle flow of 10 units in length, and after two-way continuous welding, a sub-particle flow of 3 units in length is formed. In practical applications, since there will be partial overlap during splicing, the length of the intercepted local area can be appropriately increased. For example, from a particle flow of 10 units in length, a local area of ​​2 units is intercepted and continuously welded to form a sub-particle flow of 3 units in length. The interception length needs to be determined according to the splicing requirements.

[0079] Specifically, you can use the Copy Stamp or Attribute Transfer nodes in Houdini to copy and splice local areas of the particle flow.

[0080] FIG. 4 is a schematic diagram of intercepting a local area of ​​a particle flow and splicing it into a sub-particle flow provided by this embodiment.

[0081] As shown in FIG. 4( a ), a fluid particle animation is formed based on a particle emitter and a preset particle motion path, and the fluid particle animation includes a particle flow 401 of 10 unit lengths.

[0082] As shown in FIG4( b ), a local region 402 of 2 unit lengths is cut from the middle region of the particle flow 401 , and the head of the local region 402 is a and the tail is b.

[0083] As shown in FIG. 4( c ), the local area 402 is copied to form a copied local area 403 , and the head of the copied local area 403 is a and the tail is b.

[0084] As shown in FIG4(d), the copied local area 403 is cut in the middle to form a left portion 4031 and a right portion 4032. The left portion 4031 has a header a and a tail c, and the right portion 4032 has a header c and a tail b.

[0085] As shown in FIG4(e), the tail b of the right part 4032 is spliced ​​with the head a of the local area 402, with an overlap of 0.5 units at the splicing, and the head a of the left part 4031 is spliced ​​with the tail b of the local area 402, with an overlap of 0.5 units at the splicing.

[0086] As shown in FIG4(f), a sub-particle stream 404 is formed, and the head of the sub-particle stream 404 is c, and the tail is c, so the first part is the same.

[0087] Step S405, mesh conversion is performed on the sub-particle flow at a certain time point in the sub-fluid particle animation to generate a fluid model, and VAT technology is used to generate a vertex animation texture map corresponding to the sub-fluid particle animation. The fluid model and the vertex animation texture map are combined into a fluid asset.

[0088] Create a surface for the sub-particle flow corresponding to each time point in the sub-fluid particle animation and refine the mesh structure to form a polygonal mesh, and output the polygonal mesh with the largest number of faces as the fluid model. Furthermore, bake the displacement information of each vertex of the fluid model at each time point into a texture map and output it as a vertex animation texture map. The fluid model and the vertex animation texture map are combined into a fluid asset.

[0089] Specifically, you can use the SOP Particle To Mesh node in Houdini to convert the sub-particle flow into a mesh, and use a dedicated vat baking tool or script to bake the displacement information of each vertex of the fluid model into a texture map so that it can be sampled by the shader during rendering.

[0090] Through the above steps, a fluid asset including a fluid model and a vertex animation texture map is generated, and the fluid asset realizes a downgraded simulation of fluid path. Without reducing the accuracy of the fluid model and the resolution of the vertex animation texture map, the length of the fluid model and the total number of frames (i.e., time points) recorded in the vertex animation texture map are reduced, thereby reducing the package size of the fluid asset and reducing the performance consumption of the fluid asset when it is implemented in a virtual application project.

[0091] The first embodiment described above provides an optional method for generating virtual assets. First, the method generates virtual assets based on the sub-particle flow and the sub-particle animation corresponding to the sub-particle flow by intercepting a sub-particle flow of a preset length in the particle flow. That is, the method reduces the size of the virtual asset package and optimizes the landing performance of the virtual asset by intercepting a part, while maintaining the high precision of the virtual asset. Second, the method does not need to optimize the landing performance of the virtual asset by reducing the mesh model precision, the number of faces, and the vertex texture map resolution. That is, the precision of the virtual assets generated by this method is not damaged, and does not cause the problem of poor landing effect.

[0092] 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 a limitation for actual use. The method for generating virtual assets provided in this application includes but is not limited to the method described in the first embodiment.

[0093] The second embodiment of the present application provides a method for rendering a virtual asset.

[0094] This method is deployed in Figure 2 The second server 202 is used to render the animation effect corresponding to the virtual resource in the virtual application project. In an optional implementation, the rendering method of the virtual asset is executed by a shader of a rendering engine.

[0095] Figure 5 is a flow chart of the method for rendering virtual assets provided in this embodiment. Figure 5 The rendering method of the virtual asset provided in 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.

[0096] like Figure 5 As shown, the virtual asset rendering method provided in this embodiment includes the following steps S510 to S540:

[0097] Step S510, obtaining virtual assets and curve texture maps corresponding to animation curves; wherein, the virtual assets are generated based on a local interception operation on a particle animation, including a mesh model and a vertex animation texture map, the animation curve is pre-constructed according to the animation to be rendered, and the curve texture map stores curve information corresponding to each point on the animation curve, and the curve information includes at least coordinate data of each point on the animation curve.

[0098] The virtual asset includes a vertex animation texture map and a mesh model, and the virtual asset is generated by the virtual asset generation method provided in the first embodiment of the present application.

[0099] The animation curve is pre-created in the 3D software according to the animation path in the animation to be rendered. For example, in the animation to be rendered, the fluid flows from point A to point B along a straight line, and the length between point A and point B is 50 units, then the animation curve is a straight line with a length of 50 units. For example, in the animation to be rendered, the fluid flows from point A to point B in a spiral manner, and the length between point A and point B is 50 units, then the animation curve is a spiral curve with a length of 50 units.

[0100] The curve texture map is a texture map that records curve information. Optionally, the animation curve produced in the 3D software is imported into software that supports processing curve data and can output texture maps, such as Houdini, SD, to calculate the length of the animation curve, and the width, coordinates, normal, tangent, binormal and other curve information of each point on the animation curve, and write these curve information into the texture map to form a curve texture map.

[0101] Step S520 , rendering a dynamic model corresponding to the virtual asset according to the mesh model and vertex animation texture map included in the virtual asset, and controlling the dynamic model to deform along the animation curve.

[0102] In the rendering engine, the shader can sample the vertex animation texture map, and obtain the displacement information of each vertex of the mesh model based on the sampling, and render mesh models of different forms at different time points. The mesh models at multiple time points are composed of mesh models with dynamic effects. In this embodiment, the mesh model with dynamic effects is defined as a dynamic model. After rendering the dynamic model corresponding to the virtual asset, it is necessary to control the dynamic model to deform along the animation curve so as to render the animation effect in the animation to be rendered.

[0103] In an optional implementation, according to the mesh model and vertex animation texture map included in the virtual asset, the dynamic model corresponding to the virtual asset is rendered, and the dynamic model is controlled to deform along the animation curve, which may specifically include the following steps S521 to S522:

[0104] Step S521, rendering each vertex of the mesh model according to the displacement information of each vertex of the mesh model recorded in the vertex animation texture map to form a dynamic model.

[0105] Step S522 , mapping the coordinate axes of each vertex of the dynamic model to the tangent direction, normal direction, and secondary tangent direction of the animation curve respectively, so that the dynamic model is deformed along the animation curve.

[0106] Normal, tangent, and binormal are the three basic directions of a curve. Tangent (T) is the direction along the curve. The tangent vector at any point on the curve points to the instantaneous direction of the curve at that point. Normal (N) is the direction perpendicular to the tangent and usually points to the outside of the curve. The normal vector at any point on the curve determines the curvature of the curve at that point. Binormal (B) is the direction perpendicular to both the tangent and the normal.

[0107] Mapping the coordinate axes of each vertex of the dynamic model to the three directions of the animation curve is actually redefining a new coordinate system for each vertex of the dynamic model, which is relative to the animation curve. Specifically, mapping the X axis of each vertex of the dynamic model to the tangent of the animation curve allows the dynamic model to stretch, compress or remain unchanged along the direction of the animation curve, ensuring that the dynamic model is correctly aligned along the path of the animation curve. Mapping the Y axis of each vertex of the dynamic model to the normal of the animation curve controls how the dynamic model expands outward relative to the curve, which can be used to adjust the width or other vertical dimensions of the dynamic model. Mapping the Z axis of each vertex of the dynamic model to the secondary tangent of the animation curve helps to maintain the correct orientation of the dynamic model in space. By mapping the coordinate axis of the dynamic model to the three basic directions of the animation curve, the synchronization of the dynamic model and the animation curve is basically achieved.

[0108] Step S530, determining the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting the coordinate data of the corresponding points in the curve texture map.

[0109] The above steps realize the synchronization between the dynamic model and the animation curve. In order to enable the dynamic model to move along the animation curve and form an animation effect, the concept of time needs to be introduced. Each vertex of the dynamic model corresponds to a different point on the animation curve at each time point, so as to render the animation to be rendered in which the dynamic model moves along the animation curve as time increases. In this embodiment, the point on the animation curve corresponding to each vertex of the dynamic model at each time point is defined as a corresponding point.

[0110] In an optional implementation, the corresponding points of each vertex of the dynamic model on the animation curve at each time point are determined, and the coordinate data of the corresponding points are collected in the curve texture map, which may specifically include the following steps S531 to S533:

[0111] Step S531 , normalizing the coordinates of each vertex of the dynamic model along the tangent direction of the animation curve according to the length of the dynamic model to form normalized coordinates of each vertex of the dynamic model along the tangent direction of the animation curve.

[0112] Step S532, uses the decimal part of the sum of the normalized coordinates and the time value corresponding to each time point, and the storage position of the coordinate data in the curve texture map as the sampling coordinates of each vertex of the dynamic model at each time point, and the point on the curve corresponding to the sampling coordinates is the corresponding point of each vertex of the dynamic model on the animation curve.

[0113] Step S533 , according to the sampling coordinates of each vertex of the dynamic model at each time point, the coordinate data corresponding to each vertex of the dynamic model are collected in the curve texture map.

[0114] To allow each vertex of the dynamic model to move along the animation curve, it is necessary to assign the coordinate data of the corresponding point on the animation curve to each vertex of the dynamic model. Since the coordinate data of the point on the animation curve is recorded in the curve texture map, it is necessary to normalize the coordinates of each vertex of the dynamic model along the tangent direction of the animation curve to between 0 and 1, so that a corresponding relationship can be established between each vertex of the dynamic model and the point recorded in the curve texture map. In this embodiment, the coordinates obtained by normalizing the coordinates of each vertex of the dynamic model along the tangent direction of the animation curve are defined as normalized coordinates.

[0115] By adding the time value to the normalized coordinates of each vertex of the dynamic model along the tangent direction of the animation curve, each vertex of the dynamic model can correspond to different points on the animation curve at different time points, so that each vertex of the dynamic model moves along the animation curve with time. By adding the time value to the normalized coordinates of each vertex of the dynamic model along the tangent direction of the animation curve and taking the decimal part, each vertex of the dynamic model can move from the head to the tail of the animation curve and then return to the head to continue moving, so that the dynamic model can move cyclically along the animation curve to increase the animation duration. Therefore, in this embodiment, the decimal part of the sum of the normalized coordinates and the time value corresponding to each time point is used as the U value of the sampling coordinate.

[0116] The curve texture map stores the curve information of the animation curve. Usually, different curve information is stored in partitions. For example, the curve texture map is divided into four areas in the vertical direction, the attribute information of the curve is stored in the first area, and the coordinate data of the curve is stored in the second area. Therefore, in this embodiment, the storage location of the coordinate data in the curve texture map is used as the V value of the sampling coordinate.

[0117] After obtaining the sampling coordinates (U, V) of each vertex of the dynamic model at each time point, sampling can be performed in the curve texture map to obtain the corresponding coordinate data of each vertex of the dynamic model at each time point.

[0118] Step S540 , at each time point, the positions of the vertices of the dynamic model are changed based on the coordinate data corresponding to the vertices of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0119] After obtaining the coordinate data of each vertex of the dynamic model at each time point, the position of each vertex of the dynamic model at each time point is updated based on the coordinate data, so that the animation to be rendered can be formed in which the dynamic model moves cyclically along the animation curve. It should be noted that the animation to be rendered rendered by this embodiment not only realizes the movement of the model along the curve, but also maintains the dynamics of the model itself, making the dynamic effect of the animation to be rendered richer and more natural.

[0120] In an optional implementation provided in the present embodiment, before the step of obtaining the virtual asset and the curve texture map corresponding to the animation curve, the method provided in the present embodiment may further include: performing a local interception operation on the particle animation to generate a virtual asset. Specifically, performing a local interception operation on the particle animation to generate a virtual asset may include the following steps: creating a particle animation, wherein multiple particles in the particle animation move along a preset particle motion path to form a particle flow; intercepting a sub-particle flow of a preset length, and obtaining a sub-particle animation corresponding to the sub-particle flow from the particle animation, wherein the sub-particle flow is a local area in the particle flow; performing a mesh conversion on the sub-particle flow to generate a mesh model corresponding to the sub-particle flow, and determining the displacement information of each vertex of the mesh model according to the sub-particle animation, and baking the displacement information of each vertex of the mesh model to a texture map to generate a vertex animation texture map; combining the mesh model with the vertex animation texture map into a virtual asset. The specific method for generating a virtual asset may refer to the detailed description in the first embodiment of the present application, and will not be repeated here.

[0121] This embodiment also provides several optional implementation methods for optimizing the rendering effect of virtual assets, which are described one by one below.

[0122] In an optional implementation, the curve information also includes transparency data of each point on the animation curve. Based on this, the corresponding points of each vertex of the dynamic model on the animation curve at each time point are determined, and the coordinate data of the corresponding points are collected in the curve texture map. It can also include: determining the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting the coordinate data and transparency data of the corresponding points in the curve texture map. By collecting the transparency data corresponding to each vertex of the dynamic model, when rendering the animation to be rendered, an animation to be rendered whose transparency changes with time can be formed, thereby enhancing the landing effect of the virtual asset.

[0123] Based on this, at each time point, the positions of each vertex of the dynamic model are changed based on the coordinate data corresponding to each vertex of the dynamic model at that time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve. Specifically, it may include: at each time point, the positions of each vertex of the dynamic model are changed based on the coordinate data corresponding to each vertex of the dynamic model at that time point, and the transparency of each vertex of the dynamic model is changed based on the transparency data, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0124] In another optional implementation, the curve information also includes the width data of each point on the animation curve. Based on this, the corresponding points of each vertex of the dynamic model on the animation curve at each time point are determined, and the coordinate data of the corresponding points are collected in the curve texture map. It can also include: determining the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting the coordinate data and width data of the corresponding points in the curve texture map. By collecting the width data corresponding to each vertex of the dynamic model, when rendering the animation to be rendered, the dynamic model can be scaled along the animation curve based on the width data, realizing the secondary deformation of the dynamic model, and forming an animation to be rendered whose width of the dynamic model changes with time, thereby enhancing the landing effect of the virtual asset.

[0125] After the dynamic model is deformed twice, the coordinate data of each vertex of the dynamic model will be offset with the width scaling. Therefore, the offset of each vertex of the dynamic model with the width scaling is calculated, and the offset is added to the coordinate data to form the coordinate data of each vertex of the dynamic model after the width scaling. Based on this, at each time point, the position of each vertex of the dynamic model is changed based on the coordinate data corresponding to each vertex of the dynamic model at that time point, forming an animation to be rendered in which the dynamic model moves cyclically along the animation curve, which may specifically include the following steps S541-1 to S541-4:

[0126] Step S541 - 1 , taking the coordinates of each vertex of the dynamic model along the normal direction and the secondary tangent direction of the animation curve as the basic offset of each vertex of the dynamic model on the radial plane of the animation curve.

[0127] Step S541 - 2 , based on the width data corresponding to each vertex of the dynamic model at each time point and the basic offset, calculate the first offset of each vertex of the dynamic model on the radial plane of the animation curve after each vertex of the dynamic model is scaled along the animation curve at each time point.

[0128] Step S541 - 3 , taking the sum of the coordinate data corresponding to each vertex of the dynamic model at each time point and the first offset as the first coordinate data corresponding to each vertex of the dynamic model at each time point.

[0129] Step S541 - 4 , at each time point, the positions of each vertex of the dynamic model are changed based on the first coordinate data corresponding to each vertex of the dynamic model at that time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0130] In the present embodiment, after scaling each vertex of the dynamic model along the animation curve, the offset of each vertex of the dynamic model on the radial plane of the animation curve is defined as the first offset. The first offset is the product of the width data corresponding to each vertex of the dynamic model at each time point and the basic offset. After obtaining the first offset, the first offset is added to the coordinate data corresponding to each vertex of the dynamic model at each time point, so as to form the coordinate data of each vertex of the dynamic model after scaling each vertex of the dynamic model along the animation curve. In the present embodiment, after scaling each vertex of the dynamic model along the animation curve, the coordinate data of each vertex of the dynamic model is defined as the first coordinate data. After obtaining the first coordinate data corresponding to each vertex of the dynamic model at each time point, the position of each vertex of the dynamic model can be changed based on the corresponding first coordinate data at each time point, so as to form an animation to be rendered in which the dynamic model moves cyclically after scaling along the animation curve.

[0131] In another optional implementation, the curve information also includes the rotation angle data of the animation curve. Based on this, the corresponding points of each vertex of the dynamic model on the animation curve at each time point are determined, and the coordinate data of the corresponding points are collected in the curve texture map. It can also include: determining the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting the coordinate data of the corresponding points in the curve texture map, as well as the rotation angle data of the animation curve. Collecting the rotation angle data can make the dynamic model rotate along the animation curve based on the rotation angle data when rendering the animation to be rendered, realize the secondary deformation of the dynamic model, and form the animation to be rendered in which the dynamic model rotates over time, thereby enhancing the landing effect of the virtual asset.

[0132] After the dynamic model is deformed twice, the coordinate data of each vertex of the dynamic model will be offset with the rotation. Therefore, the offset of each vertex of the dynamic model with the rotation is calculated, and the offset is added to the coordinate data to form the coordinate data of each vertex of the dynamic model after rotation. Based on this, at each time point, the position of each vertex of the dynamic model is changed based on the coordinate data corresponding to each vertex of the dynamic model at that time point to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve. Specifically, the following steps S542-1 to S542-5 may be included:

[0133] Step S542-1, taking the coordinates of each vertex of the dynamic model along the normal direction and the secondary tangent direction of the animation curve as the basic offset of each vertex of the dynamic model on the radial plane of the animation curve.

[0134] Step S542-2, based on the rotation angle data of the animation curve, the radial plane basis vectors of the animation curve are calculated, and the radial plane basis vectors include the secondary tangent basis vectors and the normal basis vectors.

[0135] Step S542-3, based on the basic offset, the secondary tangent basis vector, and the normal basis vector, calculate the second offset of each vertex of the dynamic model on the radial plane of the animation curve after each vertex of the dynamic model rotates along the animation curve.

[0136] Step S542 - 4 , taking the sum of the coordinate data corresponding to each vertex of the dynamic model at each time point and the second offset as the second coordinate data corresponding to each vertex of the dynamic model at each time point.

[0137] Step S542-5: at each time point, the positions of the vertices of the dynamic model are changed based on the second coordinate data corresponding to the vertices of the dynamic model at that time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0138] In this embodiment, after each vertex of the dynamic model is rotated along the animation curve, the offset of each vertex of the dynamic model on the radial plane of the animation curve is defined as the second offset. The second offset is the product of the radial plane basis vector calculated based on the rotation angle data and the basic offset, specifically, including the secondary tangential offset obtained by multiplying the secondary tangential basis vector by the basic offset, and the normal offset obtained by multiplying the normal basis vector by the basic offset. After obtaining the second offset, the second offset is added to the coordinate data corresponding to each vertex of the dynamic model at each time point, and the coordinate data of each vertex of the dynamic model after each vertex of the dynamic model is rotated along the animation curve can be formed. In this embodiment, after each vertex of the dynamic model is rotated along the animation curve, the coordinate data of each vertex of the dynamic model is defined as the second coordinate data. After obtaining the second coordinate data corresponding to each vertex of the dynamic model at each time point, the position of each vertex of the dynamic model can be changed based on the corresponding second coordinate data at each time point to form an animation to be rendered in which the dynamic model rotates and moves cyclically along the animation curve.

[0139] As can be seen from the above, changes in the animation curve will lead to changes in the curve information, and ultimately produce different virtual asset rendering effects. Therefore, the method provided in this embodiment can not only reduce the landing performance of the virtual asset while maintaining the high precision of the virtual asset, but also realize the reuse of virtual assets, so that the same virtual asset can be landed with different animation effects. Figure 6 As shown, Figure 6 (a) is a schematic diagram of the dynamic model corresponding to virtual assets. Figure 6 (b) is a schematic diagram of an animation effect obtained by rendering the virtual asset. Figure 6 (c) is a schematic diagram of another animation effect obtained by rendering the virtual asset. Figure 6 (d) is a schematic diagram of another animation effect obtained by rendering the virtual asset. Figure 6 It can be seen that the same virtual assets and the same dynamic model can render different animation effects.

[0140] The following takes the implementation of fluid assets in a game engine as an example, and uses the shader of the game engine as the executor of the method provided in this embodiment to illustrate how to render the fluid animation corresponding to the fluid asset in a game application based on the rendering method of the virtual asset provided in this embodiment.

[0141] Rendering a fluid asset based on the virtual asset rendering method provided in this embodiment may include the following steps S601 to S607:

[0142] Step S601, obtaining fluid assets and generating a fluid dynamic model.

[0143] The fluid asset is generated through steps S401 to S405 in the first embodiment of the present application, which includes a fluid model and a vertex animation texture map, and the vertex animation texture map records the displacement information of each vertex of the fluid model at each time point. After the game engine obtains the fluid asset, the shader can render a fluid model with dynamic effects based on the vertex animation texture map. In this embodiment, the fluid model with dynamic effects is defined as a fluid dynamic model. Specifically, the shader reads the displacement information of each vertex of the fluid model at each time point from the vertex animation texture map, thereby rendering a fluid model of a specific shape at each time point, and the fluid model of a specific shape at each time point is composed of a fluid dynamic model with dynamic effects.

[0144] Step S602, obtaining a curve texture map corresponding to the animation curve.

[0145] The animation curve can be understood as a fluid movement path pre-constructed according to the expected animation path. For example, the expected animation path is a straight path of 10 units in length, then the pre-constructed animation curve is a straight line of 10 units in length. For another example, the expected animation path is a broken line path of 20 units in length, then the pre-constructed animation curve is a broken line of 20 units in length, and the turning point is consistent with the turning point of the broken line path. For another example, the expected animation path is a circular path of 5 units in length, then the pre-constructed animation curve is a closed circle of 5 units in length. Optionally, the animation curve is produced based on 3D software.

[0146] The curve texture map corresponding to the animation curve can be understood as a texture map that records the curve information. Optionally, the animation curve produced in the 3D software is imported into the software that supports processing curve data and can output textures, and the curve information such as the length, width, coordinates, normal, tangent, and binormal of the animation curve is calculated, and the curve is written into the texture map to form a curve texture map. In this example, the curve texture map is exported from software such as Houdini and imported into the rendering engine.

[0147] Step S603 , mapping the coordinate axes of each vertex of the fluid dynamic model to the tangent direction, normal direction, and sub-tangent direction of the animation curve respectively, so that the fluid dynamic model deforms along the curve.

[0148] The purpose of this step is to move the coordinate space of the fluid dynamic model along the curve, so that the fluid dynamic model can be deformed according to the direction and shape of the curve.

[0149] In a specific implementation, mapping the coordinate axes of each vertex of the fluid dynamic model to the tangent direction, normal direction, and sub-tangent direction of the curve may include the following steps S603-1 to S603-3:

[0150] Step S603-1, placing the fluid dynamic model along the negative direction of the X-axis of the model coordinate space.

[0151] Specifically, the head of the fluid dynamic model is located at the origin (0,0,0) of the model coordinate space, and the tail of the fluid dynamic model is located in the negative direction of the X axis of the model coordinate space (-ModleLength,0,0), where ModleLength represents the length of the fluid dynamic model. The model coordinate space can be a world coordinate space or a local coordinate space, and there is no specific limitation.

[0152] Step S603-2, reading the coordinates of each vertex of the fluid dynamics model on the YZ plane as the offset vectors of each vertex of the fluid dynamics model on the radial plane of the curve.

[0153] Specifically, it can be achieved through the following expression 3.1:

[0154] offset rPlant =float3(0,LocalPos.yz) Expression 3.1

[0155] Among them, Offset rPlant It represents the offset vector of each vertex of the fluid dynamics model in the radial plane of the curve. LocalPos.yz represents the Y and Z coordinates of each vertex of the fluid dynamics model in the model coordinate space. float3() represents a vector containing three floating point numbers.

[0156] Step S603-3, reading the coordinates of each vertex of the fluid dynamic model on the X-axis, and dividing them by the length of the fluid dynamic model, as the normalized coordinates of each vertex of the fluid dynamic model in the tangent direction of the animation curve.

[0157] Since the sampling range of the curve texture map corresponding to the animation curve is 0 to 1, the coordinates of each vertex of the fluid dynamic model in the tangent direction of the animation curve are normalized to normalized coordinates in this step to facilitate sampling in the curve texture map in subsequent steps.

[0158] Specifically, it can be achieved through the following expression 3.2:

[0159] offset tPlant =remap(-LocalPos.x,(0,ModleLength),(0,1))Expression 3.2

[0160] Among them, offset tPlant It represents the normalized coordinates of each vertex of the fluid dynamic model in the tangent direction of the animation curve. LocalPos.x represents the X coordinate of each vertex of the fluid dynamic model in the model coordinate space. ModleLength represents the length of the fluid dynamic model. remap() is a mapping function, which means mapping the value of -LocalPos.x from one range (0, ModleLength) to another range (0,1).

[0161] Step S604 , moving the fluid dynamics model along the animation curve as the system time increases, and calculating the sampling coordinates of the sampling curve data of each vertex of the fluid dynamics model at each system time.

[0162] System time is a value that increases automatically during the game. Using system time as the sampling interval does not require additional management of timers or time intervals, which simplifies the implementation process and reduces performance consumption during runtime. The consistency of system time also makes it easier to render fluid animations at a certain game time.

[0163] Specifically, it can be achieved by the following expressions 4.1 to 4.4:

[0164] TexCoord mix =float2(frac(offset tPlant +Time),0.125) Expression 4.1

[0165] TexCoord pos =float2(frac(Offset tPlant +Time),0.375) Expression 4.2

[0166] TexCoord normal =float2(frac(Offset tPlant +Time),0.625) Expression 4.3

[0167] TexCoord tangent =float2(frac(Offset tPlant +Time),0.875) Expression 4.4

[0168] Among them, TexCoord mix Represents the sampling coordinates of the mix data (i.e., the length, width, and transparency of the curve) of the sampled curve in the curve texture map, TexCoord pos Represents the sampling coordinates of the coordinate data of the points on the sampled curve in the curve texture map, TexCoord normal Represents the sampling coordinates of the normal data of the sampled curve point in the curve texture map, TexCoord tangent Indicates the sampling coordinates of the tangent data of the sampled curve point in the curve texture map, Offset tPlant It represents the normalized coordinates of each vertex of the fluid model in the tangent direction of the animation curve (obtained by expression 3.2), Time represents the system time, frac() is a function used to extract the decimal part of a value, and frac(X+Time) realizes the movement of each vertex of the fluid dynamic model along the animation curve as the system time increases. When each vertex of the fluid dynamic model passes the tail of the animation curve, it returns from the head of the animation curve and continues the cycle. 0.125, 0.375, 0.625, and 0.875 represent 1 / 8, 3 / 8, 5 / 8, and 7 / 8 respectively. The curve texture map is divided into 4 equal parts in the vertical direction (0 / 8 to 2 / 8 is the first part, 2 / 8 to 4 / 8 is the second part, 4 / 8 to 6 / 8 is the third part, and 6 / 8 to 6 / 8 is the fourth part). The mix data of the curve, the coordinate data of the points on the curve, the normal data of the points on the curve, and the tangent data of the points on the curve are stored respectively. In order to avoid data contamination between adjacent pixels, the pixels on the longitudinal center of each part (i.e., 1 / 8, 3 / 8, 5 / 8, 7 / 8) are used to store the corresponding curve data. Therefore, the V value of the sampling coordinate is the coordinate of the longitudinal center of each part.

[0169] Step S605 , sampling the curve data in the curve texture map based on the sampling coordinates of the curve data sampled at each vertex of the fluid dynamic model at each system time.

[0170] Specifically, it can be achieved by the following expressions 5.1 to 5.7:

[0171] Data mix =Sample(DataTexture,TexCoord mix ) Expression 5.1

[0172] Data Pos =Sample(DataTexture,TexCoord pos ).xyz Expression 5.2

[0173] Data normal =Sample(DataTexture,TexCoordnormal ).xyz Expression 5.3

[0174] Data tangent =Sample(DataTexture,TexCoord tangent ).xyz Expression 5.4

[0175] Data binormal =cross(Data normal ,Data tangent ) Expression 5.5

[0176] Data thickness =Data mix .x Expression 5.6

[0177] Data alpha =Data mix .y Expression 5.7

[0178] Among them, Data mix Represents the mix data of the curve (i.e., the length, width, and transparency of the curve), Data Pos Represents the coordinate data of the point on the curve, Data normal Represents the normal data of the point on the curve, Data tangent Represents the tangent data of the point on the curve, Data binormal Indicates the secondary tangent data of a point on the curve. This data is passed through Data normal With Data tangent The cross multiplication operation is obtained, Data thickness Represents the width data of the point on the curve, which is Data mix The x component of the data, Data alpha Represents the transparency data of the point on the curve, which is Data mix The y component of the data, DataTexture represents the curve texture map, TexCoord mix Represents the sampling coordinates of the mix data of the sampled curve in the curve texture map (obtained by expression 4.1), TexCoord pos Represents the sampling coordinates of the coordinate data of the point on the sampled curve in the curve texture map (obtained by expression 4.2), TexCoord normal Represents the sampling coordinates of the normal data of the sampled curve point in the curve texture map (obtained by expression 4.3), TexCoord tangentIndicates the sampling coordinates of the tangent data of the sampled curve point in the curve texture map (obtained by expression 4.4). Sample() is a sampling function. Sample(DataTexture,TexCoord mix ) indicates that it is based on TexCoord mix Sampling Data from DataTexture mix Data, Sample (DataTexture, TexCoord pos ).xyz represents the TexCoord pos Sampling Data from DataTexture Pos The components of the data in the x, y, and z directions, Sample(DataTexture,TexCoord normal ).xyz represents the TexCoord normal Sampling Data from DataTexture normal The components of the data in the x, y, and z directions, Sample(DataTexture,TexCoord tangent ).xyz represents the TexCoord tangent Sampling Data from DataTexture tangent The x, y, and z components of the data.

[0179] Step S606 , determining rendering information of each vertex of the fluid dynamics model at each system time according to the curve data corresponding to each vertex of the fluid dynamics model at each system time.

[0180] The rendering information can be understood as the information required to render the fluid dynamic model into a fluid animation. In this embodiment, the rendering information at least includes the vertex coordinates of each vertex of the fluid dynamic model. The vertex coordinates can be understood as the coordinate data of each vertex of the fluid dynamic model corresponding to the point on the curve, and the coordinate data has been obtained through the above expression 5.2. Therefore, based on the rendering information, a fluid animation of the fluid dynamic model moving along the curve can be rendered.

[0181] In an optional implementation, the rendering information at least includes the vertex transparency of each vertex of the fluid dynamic model. Vertex transparency can be understood as the transparency data of each vertex of the fluid dynamic model corresponding to the point on the curve, and the transparency data has been obtained through the above expressions 5.1 and 5.7. Therefore, based on the rendering information, a more realistic fluid animation can be rendered in which the fluid dynamic model moves along the curve and the transparency changes.

[0182] In another optional implementation, the curve data also includes the width data of the animation curve and the rotation angle data of the curve. In this case, the vertex coordinates of each vertex of the fluid dynamic model cannot directly correspond to the coordinate data obtained by expression 5.2, but it is necessary to add the offset due to the width scaling and rotation changes of each vertex of the fluid dynamic model along the animation curve on the basis of the coordinate data to obtain the final vertex coordinates of each vertex of the fluid dynamic model. Specifically, it may include the following steps S606-1 to S606-4:

[0183] Step S606-1, calculating the basis vectors of the radial plane of the rotated curve according to the rotation angle data of the animation curve.

[0184] Specifically, it can be achieved by the following expressions 6.1 to 6.2:

[0185] BaseVector binormal =float3(0,sin(RotateAngle),cos(RotateAngle))

[0186] Expression 6.1

[0187] BaseVector normal

[0188] =float3(0,sin(RotateAngle+90°),cos(RotateAngle+90°))

[0189] Expression 6.2

[0190] Among them, BaseVector binormal Represents the basis vector of the rotated curve's secondary tangent, BaseVector normal It represents the basis vector of the normal direction of the curve after rotation, and RotateAngle represents the rotation angle data of the curve.

[0191] Step S606-2, calculating the offset vectors of each vertex of the fluid dynamics model in the radial plane of the curve after the width of each vertex of the fluid dynamics model is scaled along the animation curve according to the width data of the animation curve.

[0192] Specifically, it can be achieved by the following expression 6.3:

[0193] Offset rPlant ′=Offset rPlant *Data thickness Expression 6.3

[0194] Among them, Offset rPlant′ represents the offset vector of each vertex of the fluid dynamic model in the radial plane of the curve after the width of each vertex of the fluid dynamic model is scaled along the animation curve. rPlant The offset vector of each vertex of the fluid dynamic model in the radial plane of the curve (obtained by expression 3.1), Data thickness Represents the width data of the curve (obtained by Expression 5.6).

[0195] Step S606-3, based on the offset vectors of each vertex of the fluid dynamic model on the radial plane of the curve after scaling and the basis vectors of the radial plane of the curve after rotation, calculate the offset vectors of each vertex of the fluid dynamic model on the radial plane of the curve after rotation along the animation curve.

[0196] Specifically, it can be achieved by the following expression 6.4:

[0197] Offset rPlant ″=Offset rPlant ′.x*BaseVector normal +Offset rPlant ′.y*0+Offset rPlant ′.z*BaseVector binormal Expression 6.4

[0199] Among them, Offset rPlant ″ represents the offset vector of each vertex of the fluid dynamic model on the radial plane of the curve after the rotation transformation of the fluid dynamic model. rPlant ′.x represents the x component of the offset vector of each vertex of the fluid dynamic model on the radial plane of the curve after the fluid dynamic model is scaled along the width of the curve (obtained by expression 6.3), Offset rPlant ′.y represents the y component of the offset vector of each vertex of the fluid dynamic model on the radial plane of the curve after the fluid dynamic model is scaled along the width of the curve (obtained by expression 6.3), Offset rPlant ′.z represents the z component of the offset vector of each vertex of the fluid dynamic model in the radial plane of the curve after the fluid dynamic model is scaled along the width of the curve (obtained by expression 6.3), BaseVector normal BaseVector represents the basis vector of the normal direction of the curve after rotation (obtained by expression 6.2), binormal Represents the basis vectors of the secondary tangent of the rotated curve (obtained by expression 6.1).

[0200] Step S606-4, calculating the vertex coordinates of each vertex of the fluid dynamic model according to the coordinate data of the points on the curve corresponding to each vertex of the fluid dynamic model and the offset vector of each vertex of the fluid dynamic model on the radial plane of the curve after the rotation transformation of the fluid dynamic model.

[0201] Specifically, it can be achieved by the following expression 6.5:

[0202] Position=Data Pos +Offset rPlant ″ Expression 6.5

[0203] Among them, Position represents the vertex coordinates of each vertex of the fluid dynamic model, Data Pos Represents the coordinate data of the points on the curve corresponding to each vertex of the fluid dynamic model (obtained by expression 5.2), Offset rPlant ″ represents the offset vector of each vertex of the fluid dynamic model on the radial plane of the curve after the rotation transformation of the fluid dynamic model (obtained by expression 6.4).

[0204] Step S607 , rendering the fluid animation in the game application based on the rendering information of each vertex of the fluid dynamic model at each system time.

[0205] Specifically, according to the vertex coordinates of each vertex of the fluid dynamic model at each system time, each vertex of the fluid dynamic model is moved to the position indicated by the vertex coordinates, and according to the vertex transparency of each vertex of the fluid dynamic model at each system time, the visual performance of each vertex of the fluid dynamic model is changed, so as to obtain a fluid animation with high fidelity in which the fluid dynamic model moves along the animation curve and repeatedly cycles.

[0206] It should be noted that when rendering fluid assets, different forms of fluid animations can be formed by assigning different shading materials, such as fluid animation in the form of water, fluid animation in the form of magma, etc.

[0207] The above-mentioned second embodiment provides an optional method for rendering virtual assets, through which the same virtual asset can be rendered into different performance effects due to changes in the animation curve, thereby realizing the reuse of virtual assets. It should be noted that the examples in the second embodiment are only for explaining the method described in this application, and are not intended to be used as a limitation for actual use. The method for rendering virtual assets provided in this application includes but is not limited to the method described in the second embodiment.

[0208] The third embodiment of the present application provides a device for generating virtual assets. Figure 7 It is a schematic diagram of the structure of the device for generating virtual assets provided in this embodiment.

[0209] like Figure 7 As shown, the virtual asset generation device provided in this embodiment includes: a creation unit 701, an interception unit 702, a generation unit 703, and a combination unit 704.

[0210] The creation unit 701 is used to create a particle animation, in which a plurality of particles move along a preset particle motion path to form a particle flow.

[0211] Optionally, the creating particle animation includes:

[0212] Acquire a pre-constructed particle motion path and generate a velocity field along the particle motion path, wherein the particle motion path is associated with the type of the virtual asset;

[0213] Controlling a particle emitter to emit a plurality of particles, and applying the velocity field to the plurality of particles, so that the plurality of particles move along the particle movement path to form a particle flow;

[0214] Based on a preset disturbance parameter, applying a force corresponding to the disturbance parameter to the plurality of particles to adjust the shape of the particle flow to be consistent with the type of the virtual asset;

[0215] Generate particle animation.

[0216] The interception unit 702 is used to intercept a sub-particle flow of a preset length and obtain a sub-particle animation corresponding to the sub-particle flow from the particle animation. The sub-particle flow is a local area in the particle flow.

[0217] Optionally, intercepting a sub-particle flow of a preset length includes:

[0218] According to a preset interception rule, a local area of ​​a preset length in the particle flow that meets the interception rule is intercepted as the sub-particle flow.

[0219] Optionally, intercepting a sub-particle flow of a preset length includes:

[0220] intercepting a first particle sub-flow of a first length, wherein the first length is less than the preset length, and the first particle sub-flow comprises a first end and a second end;

[0221] Performing a replication operation on the first sub-particle flow to form a first replication sub-particle flow corresponding to the first sub-particle flow, wherein the first replication sub-particle flow includes a third end and a fourth end, wherein the third end is the same as the first end, and the fourth end is the same as the second end;

[0222] Performing a middle cutting operation on the first replicator particle flow to split the first replicator particle flow into a first part and a second part, wherein the first part includes the third end and the cut-off part, and the second part includes the fourth end and the cut-off part;

[0223] The third end of the first part is spliced ​​with the second end of the first sub-particle flow, and the fourth end of the second part is spliced ​​with the first end of the first sub-particle flow to form the sub-particle flow of the preset length, the sub-particle flow includes a fifth end and a sixth end, and the fifth end and the sixth end are both the cut-off parts.

[0224] The generating unit 703 is used to perform mesh conversion on the sub-particle flow to generate a mesh model corresponding to the sub-particle flow, determine the displacement information of each vertex of the mesh model according to the sub-particle animation, bake the displacement information of each vertex of the mesh model into a texture map, and generate a vertex animation texture map.

[0225] Optionally, the sub-particle flow corresponding to each time point in the sub-particle animation has a different form; and the grid conversion of the sub-particle flow to form a grid model corresponding to the sub-particle flow includes:

[0226] Performing grid conversion on the sub-particle flow corresponding to each time point in the sub-particle animation to form a candidate grid model corresponding to the sub-particle flow at each time point;

[0227] The candidate mesh model with the largest number of mesh faces among the candidate mesh models is used as the mesh model.

[0228] The combining unit 704 is used to combine the mesh model and the vertex animation texture map into the virtual asset.

[0229] The fourth embodiment of the present application provides a rendering device for a virtual asset. Figure 8 It is a schematic diagram of the structure of the virtual asset rendering device provided in this embodiment.

[0230] like Figure 8 As shown, the virtual asset rendering device provided in this embodiment includes: an acquisition unit 801, a deformation unit 802, a collection unit 803, and a rendering unit 804.

[0231] The acquisition unit 801 is used to acquire virtual assets and curve texture maps corresponding to animation curves; wherein the virtual assets are generated based on a local interception operation on a particle animation, including a mesh model and a vertex animation texture map, the animation curve is pre-constructed according to the animation to be rendered, and the curve texture map stores curve information corresponding to each point on the animation curve, and the curve information at least includes coordinate data of each point on the animation curve.

[0232] The deformation unit 802 is used to render the dynamic model corresponding to the virtual asset according to the mesh model and vertex animation texture map included in the virtual asset, and control the dynamic model to deform along the animation curve.

[0233] Optionally, rendering a dynamic model corresponding to the virtual asset according to the mesh model and vertex animation texture map included in the virtual asset, and controlling the dynamic model to deform along the animation curve includes:

[0234] Rendering each vertex of the mesh model according to the displacement information of each vertex of the mesh model recorded in the vertex animation texture map to form the dynamic model;

[0235] The coordinate axes of each vertex of the dynamic model are respectively mapped to the tangent direction, the normal direction, and the secondary tangent direction of the animation curve, so that the dynamic model is deformed along the animation curve.

[0236] The acquisition unit 803 is used to determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and to acquire the coordinate data of the corresponding points in the curve texture map.

[0237] Optionally, determining corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding points in the curve texture map, includes:

[0238] According to the length of the dynamic model, normalizing the coordinates of each vertex of the dynamic model along the tangent direction of the animation curve to form normalized coordinates of each vertex of the dynamic model along the tangent direction of the animation curve;

[0239] The decimal part of the sum of the normalized coordinates and the time value corresponding to each time point, and the storage position of the coordinate data in the curve texture map are used as the sampling coordinates of each vertex of the dynamic model at each time point, and the point on the curve corresponding to the sampling coordinates is the corresponding point of each vertex of the dynamic model on the animation curve;

[0240] According to the sampling coordinates of each vertex of the dynamic model at each time point, the coordinate data corresponding to each vertex of the dynamic model are collected in the curve texture map.

[0241] The rendering unit 804 is used to change the positions of the vertices of the dynamic model at each time point based on the coordinate data corresponding to the vertices of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0242] Optionally, the curve information also includes transparency data of each point on the animation curve;

[0243] The determining of corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding points in the curve texture map, comprises:

[0244] Determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collect the coordinate data and transparency data of the corresponding points in the curve texture map;

[0245] At each time point, the positions of the vertices of the dynamic model are changed based on the coordinate data corresponding to the vertices of the dynamic model at the time point to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve, including:

[0246] At each time point, the positions of each vertex of the dynamic model are changed based on the coordinate data corresponding to each vertex of the dynamic model at that time point, and the transparency of each vertex of the dynamic model is changed based on the transparency data, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0247] Optionally, the curve information also includes width data of each point on the animation curve;

[0248] The determining of corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding points in the curve texture map, comprises:

[0249] Determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collect the coordinate data and width data of the corresponding points in the curve texture map;

[0250] At each time point, the positions of the vertices of the dynamic model are changed based on the coordinate data corresponding to the vertices of the dynamic model at the time point to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve, including:

[0251] Taking the coordinates of each vertex of the dynamic model along the normal direction and the secondary tangent direction of the animation curve as the basic offset of each vertex of the dynamic model on the radial plane of the animation curve;

[0252] Based on the width data corresponding to each vertex of the dynamic model at each time point and the basic offset, calculate the first offset of each vertex of the dynamic model on the radial plane of the animation curve after each vertex of the dynamic model is scaled along the animation curve at each time point;

[0253] The sum of the coordinate data corresponding to each vertex of the dynamic model at each time point and the first offset is used as the first coordinate data corresponding to each vertex of the dynamic model at each time point;

[0254] At each time point, the positions of the vertices of the dynamic model are changed based on the first coordinate data corresponding to the vertices of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0255] Optionally, the curve information also includes rotation angle data of the animation curve;

[0256] The determining of corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding points in the curve texture map, comprises:

[0257] Determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collect the coordinate data of the corresponding points and the rotation angle data of the animation curve in the curve texture map;

[0258] At each time point, the positions of the vertices of the dynamic model are changed based on the coordinate data corresponding to the vertices of the dynamic model at the time point to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve, including:

[0259] Taking the coordinates of each vertex of the dynamic model along the normal direction and the secondary tangent direction of the animation curve as the basic offset of each vertex of the dynamic model on the radial plane of the animation curve;

[0260] Based on the rotation angle data of the animation curve, calculating the radial plane basis vectors of the animation curve, the radial plane basis vectors including the secondary tangent basis vectors and the normal basis vectors;

[0261] Based on the basic offset, the secondary tangent basis vector, and the normal basis vector, calculating a second offset of each vertex of the dynamic model on a radial plane of the animation curve after each vertex of the dynamic model rotates along the animation curve;

[0262] The sum of the coordinate data corresponding to each vertex of the dynamic model at each time point and the second offset is used as the second coordinate data corresponding to each vertex of the dynamic model at each time point;

[0263] At each time point, the positions of the vertices of the dynamic model are changed based on the second coordinate data corresponding to the vertices of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0264] Optionally, the device further comprises: a generating unit;

[0265] The generating unit is used to perform a local interception operation on the particle animation to generate the virtual asset.

[0266] A fifth embodiment of the present application provides an electronic device, Fig. 9 It is a schematic diagram of the structure of the electronic device provided in this embodiment.

[0267] like Fig. 9 As shown, the electronic device provided in this embodiment includes: a memory 901, a processor 902;

[0268] The memory 901 is used to store computer instructions for executing a rendering method of a virtual asset.

[0269] The processor 902 is configured to execute computer instructions stored in the memory 901 to perform the following operations:

[0270] Acquire a virtual asset and a curve texture map corresponding to an animation curve; wherein the virtual asset is generated based on a local interception operation of a particle animation, and includes a mesh model and a vertex animation texture map; the animation curve is pre-constructed according to an animation to be rendered; the curve texture map stores curve information corresponding to each point on the animation curve, and the curve information includes at least coordinate data of each point on the animation curve;

[0271] Rendering a dynamic model corresponding to the virtual asset according to the mesh model and vertex animation texture map included in the virtual asset, and controlling the dynamic model to deform along the animation curve;

[0272] Determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collect coordinate data of the corresponding points in the curve texture map;

[0273] At each time point, the positions of the vertices of the dynamic model are changed based on the coordinate data corresponding to the vertices of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0274] Optionally, before the step of obtaining the virtual asset and the curve texture map corresponding to the animation curve, the following is further performed: performing a local interception operation on the particle animation to generate the virtual asset;

[0275] The performing a local interception operation on the particle animation to generate the virtual asset comprises:

[0276] Creating a particle animation, wherein a plurality of particles in the particle animation move along a preset particle motion path to form a particle flow;

[0277] intercepting a sub-particle flow of a preset length, and obtaining a sub-particle animation corresponding to the sub-particle flow from the particle animation, wherein the sub-particle flow is a local area in the particle flow;

[0278] Performing mesh conversion on the sub-particle flow to generate a mesh model corresponding to the sub-particle flow, and determining displacement information of each vertex of the mesh model according to the sub-particle animation, baking the displacement information of each vertex of the mesh model into a texture map to generate a vertex animation texture map;

[0279] The mesh model and the vertex animation texture map are combined into the virtual asset.

[0280] Optionally, the creating particle animation includes:

[0281] Acquire a pre-constructed particle motion path and generate a velocity field along the particle motion path, wherein the particle motion path is associated with the type of the virtual asset;

[0282] Controlling a particle emitter to emit a plurality of particles, and applying the velocity field to the plurality of particles, so that the plurality of particles move along the particle movement path to form a particle flow;

[0283] Based on a preset disturbance parameter, applying a force corresponding to the disturbance parameter to the plurality of particles to adjust the shape of the particle flow to be consistent with the type of the virtual asset;

[0284] Generate particle animation.

[0285] Optionally, intercepting a sub-particle flow of a preset length includes:

[0286] According to a preset interception rule, a local area of ​​a preset length in the particle flow that meets the interception rule is intercepted as the sub-particle flow.

[0287] Optionally, intercepting a sub-particle flow of a preset length includes:

[0288] intercepting a first particle sub-flow of a first length, wherein the first length is less than the preset length, and the first particle sub-flow comprises a first end and a second end;

[0289] Performing a replication operation on the first sub-particle flow to form a first replication sub-particle flow corresponding to the first sub-particle flow, wherein the first replication sub-particle flow includes a third end and a fourth end, wherein the third end is the same as the first end, and the fourth end is the same as the second end;

[0290] Performing a middle cutting operation on the first replicator particle flow to split the first replicator particle flow into a first part and a second part, wherein the first part includes the third end and the cut-off part, and the second part includes the fourth end and the cut-off part;

[0291] The third end of the first part is spliced ​​with the second end of the first sub-particle flow, and the fourth end of the second part is spliced ​​with the first end of the first sub-particle flow to form the sub-particle flow of the preset length, the sub-particle flow includes a fifth end and a sixth end, and the fifth end and the sixth end are both the cut-off parts.

[0292] Optionally, the sub-particle flow corresponding to each time point in the sub-particle animation has a different form; and the grid conversion of the sub-particle flow to form a grid model corresponding to the sub-particle flow includes:

[0293] Performing grid conversion on the sub-particle flow corresponding to each time point in the sub-particle animation to form a candidate grid model corresponding to the sub-particle flow at each time point;

[0294] The candidate mesh model with the largest number of mesh faces among the candidate mesh models is used as the mesh model.

[0295] Optionally, rendering a dynamic model corresponding to the virtual asset according to the mesh model and vertex animation texture map included in the virtual asset, and controlling the dynamic model to deform along the animation curve includes:

[0296] Rendering each vertex of the mesh model according to the displacement information of each vertex of the mesh model recorded in the vertex animation texture map to form the dynamic model;

[0297] The coordinate axes of each vertex of the dynamic model are respectively mapped to the tangent direction, the normal direction, and the secondary tangent direction of the animation curve, so that the dynamic model is deformed along the animation curve.

[0298] Optionally, determining corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding points in the curve texture map, includes:

[0299] According to the length of the dynamic model, normalizing the coordinates of each vertex of the dynamic model along the tangent direction of the animation curve to form normalized coordinates of each vertex of the dynamic model along the tangent direction of the animation curve;

[0300] The decimal part of the sum of the normalized coordinates and the time value corresponding to each time point, and the storage position of the coordinate data in the curve texture map are used as the sampling coordinates of each vertex of the dynamic model at each time point, and the point on the curve corresponding to the sampling coordinates is the corresponding point of each vertex of the dynamic model on the animation curve;

[0301] According to the sampling coordinates of each vertex of the dynamic model at each time point, the coordinate data corresponding to each vertex of the dynamic model are collected in the curve texture map.

[0302] Optionally, the curve information also includes transparency data of each point on the animation curve;

[0303] The determining of corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding points in the curve texture map, comprises:

[0304] Determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collect the coordinate data and transparency data of the corresponding points in the curve texture map;

[0305] At each time point, the positions of the vertices of the dynamic model are changed based on the coordinate data corresponding to the vertices of the dynamic model at the time point to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve, including:

[0306] At each time point, the positions of each vertex of the dynamic model are changed based on the coordinate data corresponding to each vertex of the dynamic model at that time point, and the transparency of each vertex of the dynamic model is changed based on the transparency data, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0307] Optionally, the curve information also includes width data of each point on the animation curve;

[0308] The determining of corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding points in the curve texture map, comprises:

[0309] Determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collect the coordinate data and width data of the corresponding points in the curve texture map;

[0310] At each time point, the positions of the vertices of the dynamic model are changed based on the coordinate data corresponding to the vertices of the dynamic model at the time point to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve, including:

[0311] Taking the coordinates of each vertex of the dynamic model along the normal direction and the secondary tangent direction of the animation curve as the basic offset of each vertex of the dynamic model on the radial plane of the animation curve;

[0312] Based on the width data corresponding to each vertex of the dynamic model at each time point and the basic offset, calculate the first offset of each vertex of the dynamic model on the radial plane of the animation curve after each vertex of the dynamic model is scaled along the animation curve at each time point;

[0313] The sum of the coordinate data corresponding to each vertex of the dynamic model at each time point and the first offset is used as the first coordinate data corresponding to each vertex of the dynamic model at each time point;

[0314] At each time point, the positions of the vertices of the dynamic model are changed based on the first coordinate data corresponding to the vertices of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0315] Optionally, the curve information also includes rotation angle data of the animation curve;

[0316] The determining of corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding points in the curve texture map, comprises:

[0317] Determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collect the coordinate data of the corresponding points and the rotation angle data of the animation curve in the curve texture map;

[0318] At each time point, the positions of the vertices of the dynamic model are changed based on the coordinate data corresponding to the vertices of the dynamic model at the time point to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve, including:

[0319] Taking the coordinates of each vertex of the dynamic model along the normal direction and the secondary tangent direction of the animation curve as the basic offset of each vertex of the dynamic model on the radial plane of the animation curve;

[0320] Based on the rotation angle data of the animation curve, calculating the radial plane basis vectors of the animation curve, the radial plane basis vectors including the secondary tangent basis vectors and the normal basis vectors;

[0321] Based on the basic offset, the secondary tangent basis vector, and the normal basis vector, calculating a second offset of each vertex of the dynamic model on a radial plane of the animation curve after each vertex of the dynamic model rotates along the animation curve;

[0322] The sum of the coordinate data corresponding to each vertex of the dynamic model at each time point and the second offset is used as the second coordinate data corresponding to each vertex of the dynamic model at each time point;

[0323] At each time point, the positions of the vertices of the dynamic model are changed based on the second coordinate data corresponding to the vertices of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

[0324] 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.

[0325] 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.

[0326] 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.

[0327] 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.

[0328] 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.

[0329] 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 rendering a virtual asset, characterized in that: The method comprises: Acquire a virtual asset and a curve texture map corresponding to an animation curve; wherein the virtual asset is generated based on a local interception operation of a particle animation, and includes a mesh model and a vertex animation texture map; the animation curve is pre-constructed according to an animation to be rendered; the curve texture map stores curve information corresponding to each point on the animation curve, and the curve information includes at least coordinate data of each point on the animation curve; Rendering a dynamic model corresponding to the virtual asset according to the mesh model and vertex animation texture map included in the virtual asset, and controlling the dynamic model to deform along the animation curve; Determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collect coordinate data of the corresponding points in the curve texture map; At each time point, the positions of the vertices of the dynamic model are changed based on the coordinate data corresponding to the vertices of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

2. The method according to claim 1, characterized in that: Before the step of obtaining the virtual asset and the curve texture map corresponding to the animation curve, the method further includes: performing a local interception operation on the particle animation to generate the virtual asset; The performing a local interception operation on the particle animation to generate the virtual asset comprises: Creating a particle animation, wherein a plurality of particles in the particle animation move along a preset particle motion path to form a particle flow; intercepting a sub-particle flow of a preset length, and obtaining a sub-particle animation corresponding to the sub-particle flow from the particle animation, wherein the sub-particle flow is a local area in the particle flow; Performing mesh conversion on the sub-particle flow to generate a mesh model corresponding to the sub-particle flow, and determining displacement information of each vertex of the mesh model according to the sub-particle animation, baking the displacement information of each vertex of the mesh model into a texture map to generate a vertex animation texture map; The mesh model and the vertex animation texture map are combined into the virtual asset.

3. The method according to claim 2, characterized in that The creating particle animation comprises: Acquire a pre-constructed particle motion path and generate a velocity field along the particle motion path, wherein the particle motion path is associated with the type of the virtual asset; Controlling a particle emitter to emit a plurality of particles, and applying the velocity field to the plurality of particles, so that the plurality of particles move along the particle movement path to form a particle flow; Based on a preset disturbance parameter, applying a force corresponding to the disturbance parameter to the plurality of particles to adjust the shape of the particle flow to be consistent with the type of the virtual asset; Generate particle animation.

4. The method according to claim 2, characterized in that The method of intercepting a sub-particle flow of a preset length comprises: According to a preset interception rule, a local area of ​​a preset length in the particle flow that meets the interception rule is intercepted as the sub-particle flow.

5. The method according to claim 2, characterized in that: The method of intercepting a sub-particle flow of a preset length comprises: intercepting a first particle sub-flow of a first length, wherein the first length is less than the preset length, and the first particle sub-flow comprises a first end and a second end; Performing a replication operation on the first sub-particle flow to form a first replication sub-particle flow corresponding to the first sub-particle flow, wherein the first replication sub-particle flow includes a third end and a fourth end, wherein the third end is the same as the first end, and the fourth end is the same as the second end; Performing a middle cutting operation on the first replicator particle flow to split the first replicator particle flow into a first part and a second part, wherein the first part includes the third end and the cut-off part, and the second part includes the fourth end and the cut-off part; The third end of the first part is spliced ​​with the second end of the first sub-particle flow, and the fourth end of the second part is spliced ​​with the first end of the first sub-particle flow to form the sub-particle flow of the preset length, the sub-particle flow includes a fifth end and a sixth end, and the fifth end and the sixth end are both the cut-off parts.

6. The method according to claim 2, characterized in that The sub-particle flow corresponding to each time point in the sub-particle animation has a different form; the sub-particle flow is grid-converted to form a grid model corresponding to the sub-particle flow, including: Performing grid conversion on the sub-particle flow corresponding to each time point in the sub-particle animation to form a candidate grid model corresponding to the sub-particle flow at each time point; The candidate mesh model with the largest number of mesh faces among the candidate mesh models is used as the mesh model.

7. The method according to claim 1, characterized in that The step of rendering a dynamic model corresponding to the virtual asset according to the mesh model and vertex animation texture map included in the virtual asset, and controlling the dynamic model to deform along the animation curve comprises: Rendering each vertex of the mesh model according to the displacement information of each vertex of the mesh model recorded in the vertex animation texture map to form the dynamic model; The coordinate axes of each vertex of the dynamic model are respectively mapped to the tangent direction, the normal direction, and the secondary tangent direction of the animation curve, so that the dynamic model is deformed along the animation curve.

8. The method according to claim 1, characterized in that The determining of corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding points in the curve texture map, comprises: According to the length of the dynamic model, normalizing the coordinates of each vertex of the dynamic model along the tangent direction of the animation curve to form normalized coordinates of each vertex of the dynamic model along the tangent direction of the animation curve; The decimal part of the sum of the normalized coordinates and the time value corresponding to each time point, and the storage position of the coordinate data in the curve texture map are used as the sampling coordinates of each vertex of the dynamic model at each time point, and the point on the curve corresponding to the sampling coordinates is the corresponding point of each vertex of the dynamic model on the animation curve; According to the sampling coordinates of each vertex of the dynamic model at each time point, the coordinate data corresponding to each vertex of the dynamic model are collected in the curve texture map.

9. The method according to claim 1, characterized in that: The curve information also includes transparency data of each point on the animation curve; The determining of corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding points in the curve texture map, comprises: Determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collect the coordinate data and transparency data of the corresponding points in the curve texture map; At each time point, the positions of the vertices of the dynamic model are changed based on the coordinate data corresponding to the vertices of the dynamic model at the time point to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve, including: At each time point, the positions of each vertex of the dynamic model are changed based on the coordinate data corresponding to each vertex of the dynamic model at the time point, and the transparency of each vertex of the dynamic model is changed based on the transparency data, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

10. The method according to claim 1, characterized in that The curve information also includes width data of each point on the animation curve; The determining of corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding points in the curve texture map, comprises: Determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collect the coordinate data and width data of the corresponding points in the curve texture map; At each time point, the positions of the vertices of the dynamic model are changed based on the coordinate data corresponding to the vertices of the dynamic model at the time point to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve, including: Taking the coordinates of each vertex of the dynamic model along the normal direction and the secondary tangent direction of the animation curve as the basic offset of each vertex of the dynamic model on the radial plane of the animation curve; Based on the width data corresponding to each vertex of the dynamic model at each time point and the basic offset, calculate the first offset of each vertex of the dynamic model on the radial plane of the animation curve after each vertex of the dynamic model is scaled along the animation curve at each time point; The sum of the coordinate data corresponding to each vertex of the dynamic model at each time point and the first offset is used as the first coordinate data corresponding to each vertex of the dynamic model at each time point; At each time point, the positions of the vertices of the dynamic model are changed based on the first coordinate data corresponding to the vertices of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

11. The method according to claim 1, characterized in that: The curve information also includes rotation angle data of the animation curve; The determining of corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collecting coordinate data of the corresponding points in the curve texture map, comprises: Determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and collect the coordinate data of the corresponding points and the rotation angle data of the animation curve in the curve texture map; At each time point, the positions of the vertices of the dynamic model are changed based on the coordinate data corresponding to the vertices of the dynamic model at the time point to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve, including: Taking the coordinates of each vertex of the dynamic model along the normal direction and the secondary tangent direction of the animation curve as the basic offset of each vertex of the dynamic model on the radial plane of the animation curve; Based on the rotation angle data of the animation curve, calculating the radial plane basis vectors of the animation curve, the radial plane basis vectors including the secondary tangent basis vectors and the normal basis vectors; Based on the basic offset, the secondary tangent basis vector, and the normal basis vector, calculating a second offset of each vertex of the dynamic model on a radial plane of the animation curve after each vertex of the dynamic model rotates along the animation curve; The sum of the coordinate data corresponding to each vertex of the dynamic model at each time point and the second offset is used as the second coordinate data corresponding to each vertex of the dynamic model at each time point; At each time point, the positions of the vertices of the dynamic model are changed based on the second coordinate data corresponding to the vertices of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

12. A rendering device for virtual assets, characterized in that: The device comprises: an acquisition unit, a deformation unit, a collection unit, and a rendering unit; The acquisition unit is used to acquire a virtual asset and a curve texture map corresponding to an animation curve; wherein the virtual asset is generated based on a local interception operation of a particle animation, and includes a mesh model and a vertex animation texture map; the animation curve is pre-constructed according to an animation to be rendered; the curve texture map stores curve information corresponding to each point on the animation curve, and the curve information includes at least coordinate data of each point on the animation curve; The deformation unit is used to render a dynamic model corresponding to the virtual asset according to the mesh model and vertex animation texture map included in the virtual asset, and control the dynamic model to deform along the animation curve; The acquisition unit is used to determine the corresponding points of each vertex of the dynamic model on the animation curve at each time point, and to acquire the coordinate data of the corresponding points in the curve texture map; The rendering unit is used to change the positions of the vertices of the dynamic model at each time point based on the coordinate data corresponding to the vertices of the dynamic model at the time point, so as to form an animation to be rendered in which the dynamic model moves cyclically along the animation curve.

13. 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.

14. 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.

Citation Information

Patent Citations

  • Method and device for processing vertex animation

    CN113450435A

  • Special-effect deformation vertex animation generation method and device, equipment and storage medium

    CN117173296A

  • Fluid dynamic effect rendering method and device, equipment and storage medium

    CN117173301A

  • Animation data processing method, device and equipment and readable storage medium

    CN117541694A

  • Image rendering method and apparatus

    US20230073574A1