Element generation method, rendering method, device, electronic device, storage medium

By binding the curves of the dynamically curved shape to the static mesh graphics, it bends with the curve, solving the problem of low efficiency in making bent objects in the game, and achieving flexible and efficient dynamic graphics generation.

CN115761088BActive Publication Date: 2025-05-06BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211436477.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-16
Publication Date
2025-05-06
Estimated Expiration
2042-11-16

AI Technical Summary

Technical Problem

In the game, when creating objects such as curved tree-like tentacle creatures or objects that need to swing with the changes in scene information, the prior art is difficult to efficiently realize the flexible production of these objects, which affects the game scene effect and production efficiency.

Method used

By obtaining the first static mesh pattern of the target element and generating a first curve representing its dynamic curved shape, the first curve is bound to the first static mesh pattern according to the dynamic curve information, so that it bends with the curve, thereby realizing the presentation of different bending forms.

Benefits of technology

This method improves the efficiency of dynamic graphics production of target elements, avoids the need to make models of different curved forms separately, and achieves more efficient game scene effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115761088B_ABST
    Figure CN115761088B_ABST
Patent Text Reader

Abstract

The present disclosure provides an element generation method, device, electronic device, storage medium and program product. The method comprises: obtaining a first static grid graphic for representing the static shape of a target element to be generated; generating a first curve for representing at least one frame of dynamic bending shape of the first static grid graphic; binding the first curve with the first static grid graphic according to the dynamic bending information of the target element, so that the bound first static grid graphic bends along with the bending of the first curve; and using the first static grid graphic bound with the first curve as the generated target element. The embodiments of the present disclosure can improve the efficiency of element generation and the dynamic effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer vision technology, and in particular to an element generation method, a rendering method, a device, an electronic device, a storage medium, and a program product. Background Art

[0002] With the development of computer technology, people's work, life, entertainment and other aspects are inextricably linked to computers. Computer games use computers as operating platforms and are realized through human-computer interaction. They are a new form of entertainment that can reflect the current high level of computer technology. With the increase in computer processing speed and the improvement of visual experience, computer games have become an indispensable part of the daily life of many users.

[0003] There are some bent branch-like tentacle creatures or objects in the game level. Sometimes these tentacle objects can cling to buildings and become part of the game level scene, or one of the important elements of the game. In addition, there are many other objects in the game that need to swing as the scene information changes and the game progresses. How to flexibly and efficiently make such objects is one of the important issues to improve the game scene effect and production efficiency. Summary of the invention

[0004] In view of this, the embodiments of the present disclosure provide an element generation method, a rendering method, an apparatus, an electronic device, a storage medium, and a program product, which can improve the production efficiency of objects such as tentacle creatures in games.

[0005] According to some embodiments of the present disclosure, the above element generation method may include:

[0006] Get the first static grid graphic of the target element;

[0007] generating a first curve for representing the curved shape of at least one frame of the first static mesh graphic;

[0008] According to the dynamic bending information of the target element, the first curve is bound to the first static grid graphic, so that the bound first static grid graphic bends along with the bending of the first curve;

[0009] The first static mesh graphic bound to the first curve is used as the generated target element.

[0010] According to some embodiments of the present disclosure, the rendering method may include:

[0011] Obtain a target element to be rendered; the target element is generated by the element generation method provided by any embodiment of the present disclosure;

[0012] Renders the target element.

[0013] According to some embodiments of the present disclosure, the above-mentioned element generating device may include:

[0014] A static grid graphic generation module, used to obtain a first static grid graphic of a target element;

[0015] A curve generating module, used for generating a first curve for representing at least one frame of dynamic bending shape of the first static grid graphic;

[0016] A binding module, used for binding the first curve with the first static grid graphic according to the dynamic bending information of the target element, so that the bound first static grid graphic bends along with the bending of the first curve;

[0017] The element module is used to use the first static mesh graphic bound to the first curve as the generated target element.

[0018] According to some embodiments of the present disclosure, the rendering device includes:

[0019] A target element obtaining module, used to obtain a target element to be rendered; the target element is generated by the element generating device provided by any embodiment of the present disclosure;

[0020] The rendering module is used to render the target element.

[0021] In addition, an embodiment of the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the above method is implemented when the processor executes the program.

[0022] An embodiment of the present disclosure further provides a non-transitory computer-readable storage medium, which stores computer instructions for causing a computer to execute the above method.

[0023] An embodiment of the present disclosure further provides a computer program product, including computer program instructions. When the computer program instructions are executed on a computer, the computer is enabled to execute the above method.

[0024] From the above content, it can be seen that through the solution provided by the present invention, the dynamic bending shape of the target element in at least one frame can be represented by a first curve, and the first curve can be bound to the first static grid graphic representing the target element, so that the first static grid graphic can change the bending shape as the parameters of the first curve change, presenting different bending shapes, and thus, there is no need to produce different models for different bending shapes of a target element, thereby improving the production efficiency of the dynamic graphics corresponding to the target element. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0026] Figure 1 A schematic diagram of one application scenario of the element generation method provided in an embodiment of the present disclosure;

[0027] Figure 2 The implementation process of the element generation method of some embodiments of the present disclosure is shown;

[0028] Figure 3 A schematic diagram of a static grid according to an embodiment of the present disclosure is shown;

[0029] Figure 4 A schematic diagram of a spline curve of an embodiment of the present disclosure is shown;

[0030] Figure 5 A schematic diagram showing the steps included in the element generation method in some embodiments of the present disclosure;

[0031] Figure 6 A schematic diagram of a tentacle creature showing some embodiments of the present disclosure;

[0032] Figure 7 A schematic diagram of a first static grid pattern in a bent static state according to some embodiments of the present disclosure is shown;

[0033] Figure 8 A schematic diagram of an element generation device according to some embodiments of the present disclosure is shown;

[0034] Fig. 9 A schematic diagram of a rendering device according to some embodiments of the present disclosure is shown;

[0035] Fig.10 A more specific schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0036] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0037] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0038] The modifications of "one", "multiple" or "at least one" mentioned in the embodiments of the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0039] As mentioned above, in general, the business logic is completely coupled to the routing module. Every time a new routing rule is added, the code of the routing module must be modified, which causes inconvenience in updating and maintaining the code of the routing module.

[0040] To this end, some embodiments of the present disclosure provide an information display method. Figure 1 , which is a schematic diagram of an application scenario of the information display method provided by the embodiment of the present disclosure. The application scenario includes: a terminal device 101.

[0041] In an embodiment of the present disclosure, the terminal device 101 may run an image processing tool, an animation element generation tool, and a generation tool for adding animation elements to a scene.

[0042] In the embodiments of the present disclosure, the terminal device 101 includes but is not limited to a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA) or other electronic devices capable of implementing the above functions. The terminal device 101 has a storage unit and an input device, and can create static elements corresponding to animation elements by calling the tools of the storage unit, and can also obtain line information, surface information, etc. of the static elements through the input device to generate static elements.

[0043] After the terminal device 101 generates animation elements or places animation elements into a specific scene to generate a game scene, the generated results can be input into the next terminal device 102, so that downstream operators can further perform subsequent game production based on the animation elements or the scene with added animation elements.

[0044] Based on the above application scenarios and other possible application scenarios, some embodiments of the present disclosure provide an element generation method, which can assist users to quickly generate static elements corresponding to dynamic elements when users need to generate dynamic elements that swing randomly, and provide operational convenience for rendering static elements, thereby improving production efficiency.

[0045] The embodiments of the present disclosure may also be applied to terminal devices having necessary Internet and local area network connections.

[0046] Figure 2 The implementation process of the element generation method of the embodiment of the present disclosure is shown. Figure 2 As shown, the method may include the following steps:

[0047] Step S201: Acquire a first static grid graphic of a target element;

[0048] Step S202: generating a first curve for representing at least one frame of the curved shape of the first static grid graphic;

[0049] Step S203: Binding the first curve to the first static grid graphic according to the bending dynamic information of the target element, so that the bound first static grid graphic bends along with the bending of the first curve;

[0050] Step S204: taking the first static mesh graphic bound to the first curve as the generated target element.

[0051] In one embodiment of the present disclosure, the target element may be an object in a scene to be constructed in a game, animation, movie, etc. For example, the target element may be a tentacle-like creature (i.e., a tentacle creature), a long strip-shaped object, a flat floating object, etc.

[0052] In one embodiment of the present disclosure, the static mesh graphic may be a static mesh object, which may be a polygonal model created in an external tool (such as Maya, image processing software, etc.) and with a texture added. The static mesh graphic may have information such as the shape and surface characteristics corresponding to the target element. The static mesh graphic may be a graphic used to represent the target element, and specifically may be a three-dimensional image, a plane graphic, etc. If the target element is a dynamic element, the static mesh graphic may represent the basic shape of the target element in a static state. For example, if the target element is a tentacle that can swing, the static mesh graphic may be an elongated conical graphic in a static, straight state, representing a straightened static tentacle, such as Figure 3 shown.

[0053] In one embodiment of the present disclosure, the static grid graphic may be composed of lines, planes, or unit graphics, and may include information such as size and coordinates. In a level of the game, multiple copies of a static grid graphic may be placed without a significant drop in machine performance.

[0054] In one embodiment of the present disclosure, the target element is an element with a bendable property, such as a tentacle creature, a vine creature, a flag, a ribbon, etc. The target element can be bent according to some information in the scene in which it exists, such as wind direction, other external forces, changes in the internal force of the target element, etc.

[0055] In an embodiment of the present disclosure, the first curve is a curve that can be expressed by a function expression, and the curvature of the first curve can be changed by using different function parameters.

[0056] In another possible implementation of the present disclosure, the first curve may also be a curve with certain fixed points. The fixed points may be determined by a function expression, and the curve segments between the fixed points may be curve segments determined by other functions.

[0057] In another possible implementation of the present disclosure, the first curve may include a plurality of known points, and the first curve is generated based on the known points and the curve function. In this case, generating the first curve representing the curved shape of the static grid graphic may include generating at least some control points of the first curve, which are the known points.

[0058] In one embodiment of the present disclosure, the aforementioned binding of the first curve to the first static grid graphic according to the bending information of the target element may be binding at least some points of the first curve to the first static grid graphic according to the bending trend of the target element. For example, if the target element is a tentacle-like object, the bending information of the target element may include: bending along the direction in which the tentacle extends, and then the first curve may be bound along the direction of the first static grid graphic corresponding to the extension of the tentacle. For another example, if the target element is a flag, the bending information of the target element may include: bending along the length direction and the width direction of the flag, and then the first curve may be bound along the length direction or the width direction of the first static grid graphic.

[0059] In an embodiment of the present disclosure, the first static mesh graphic after binding bends as the first curve bends, which may include the first static mesh graphic bending as the parameters of the first curve change. As the bending state of the first curve changes in different animation frames, the first static mesh graphic also presents a bending change animation.

[0060] In an embodiment of the present disclosure, the first static mesh graphic bound to the first curve (i.e., the first curve, the first static mesh graphic, and the binding relationship between the first curve and the first static mesh graphic) can be used as the execution result of the element generation method. The first static mesh graphic bends as the parameters of the first curve change, thereby achieving the bending of the first static mesh graphic and achieving the generation of at least one animation state of the target element.

[0061] In the disclosed embodiment, the first curve is used to represent the dynamic bending shape of the target element in at least one frame, and the first curve is bound to the first static grid graphic representing the target element, so that the bending shape of the first static grid graphic can change as the parameters of the first curve change, presenting different bending shapes. Therefore, there is no need to produce different models for different bending shapes of a target element, thereby improving the production efficiency of the dynamic graphics corresponding to the target element.

[0062] In one embodiment of the present disclosure, Figure 4 As shown, the first curve 401 is a spline curve; the first curve generated for representing at least one frame of dynamic bending shape of the first static grid graphic includes:

[0063] Generate a first control point 402 representing the first curve;

[0064] The first control point 402 is used to represent the first curve 401 .

[0065] In an embodiment of the present disclosure, the first curve may be a spline curve, and the spline curve may be a non-uniform rational B-spline curve, which may refer to a curve obtained by giving a set of control points, and the general shape of the curve may be controlled by these control points. The spline curve in the embodiment of the present disclosure is further at least one of an interpolation spline curve and an approximation spline curve, and may be an N-order curve (N≥2).

[0066] In one embodiment of the present disclosure, the control points representing the first curve may be control points of a spline curve corresponding to the first curve. In the spline curve, the control points may be a series of points given in advance. In the embodiment of the present disclosure, the control points may be generated by random generation, segmented capture on the first static grid graph, and the like.

[0067] In an embodiment of the present disclosure, the first control points are used to represent the first curve. After the expression of the first curve or the three-dimensional (or two-dimensional) coordinate generation method of each point on the first curve is predetermined, a plurality of first control points that can be used to fit the first curve are generated, and the first curve is considered to be generated. Alternatively, after the control points are generated, the first curve can be generated by using a spline curve generation method.

[0068] In one embodiment of the present disclosure, the spline curve can be a cubic spline curve, and a piecewise cubic spline interpolation can be implemented in the Vertex Shader (vertex shading engine) to express the curvature of the static mesh of the target element such as the tentacle creature. In a specific implementation method, a series of control points of the cubic spline curve are first determined, and between every two adjacent control points, the positions of each fixed point between the two adjacent control points are determined according to the positions of the two adjacent control points and the tangent direction of each vertex. Among them, the tangent direction of each vertex can be determined based on the external force information that may affect the target element such as the tentacle creature, such as the wind direction in the target scene.

[0069] In this embodiment, the first curve adopts a spline curve, so as to improve the swinging and floating effects of the target element after it is generated.

[0070] In an embodiment of the present disclosure, the binding of the first curve with the first static grid graphic according to the bending dynamic information of the target element includes:

[0071] Bind the vertices of the first static mesh graphic to the corresponding first control points.

[0072] In this embodiment, the points of the first static grid graphic representing the target element are bound to the first control points representing the first curve, so that the first static grid can bend along with the bending of the first curve, thereby achieving the dynamic effect of swinging and bending of the target element.

[0073] In one embodiment of the present disclosure, the element generation method further includes:

[0074] In response to the generation instruction, an instance of the target element is generated according to the expression of the first control point and the first curve;

[0075] According to the acquired orientation information of the target element, the positions of all vertices of the first static mesh graphic are determined using the above example.

[0076] Through the above embodiment, the target element is placed in the game scene, so that dynamically changeable tentacles can be generated in the game scene.

[0077] In one embodiment of the present disclosure, the element generation method further includes:

[0078] When the generated target element is placed in the target scene, detect whether there is a collision between the target element and other elements;

[0079] In the case of collision, axis adjustment information for the target element is generated according to the preset element spacing;

[0080] Adjust the information according to the axis to obtain the orientation information.

[0081] In one embodiment of the present disclosure, when the element generation method is applied to the generation of a tentacle creature in a game, a scene blueprint may be provided first to represent a tentacle creature. Place the tentacle creature into the level, adjust the position, size, and direction (the basic growth direction of the tentacle) of the tentacle creature, and click "Re-randomly Generate" to automatically generate spline points randomly. During generation, collision detection is performed on the scene to ensure that the position of each spline point (control point) is legal, thereby achieving wall climbing and window penetration. It is assumed that the spline point position P(0) of the 0th (i.e., the root of the tentacle) to the spline point with the maximum number of spline points is legal one by one, and the position of the next spline point (i) of the previous spline point (i-1) is randomly generated according to the position of the previous spline point, the spline point spacing, the direction, and the maximum random cone angle (Cone Angle). From the position of the previous spline point to the position of the next spline point, a Line Trace is performed on the scene collision. If the result is true, it means that there is a collision between the target elements interspersed between the spline points. Calculate a rotation angle and rotation axis based on the position of the previous spline point, the position of the next spline point, the wall normal, and the allowed distance from the wall (Off Wall Distance). Recalculate the position of the next spline point based on the direction of the rotation of the vector [position of the next spline point, position of the previous spline point] to adjust the position of the spline point. Record the last spline point affected by the scene collision as the animatable starting spline point. The aforementioned maximum random cone angle can be a cone angle randomly generated by the tentacle within the allowed swing range.

[0082] In one embodiment of the present disclosure, the vertex positions determined according to the orientation information may be the positions of all vertices of the first static mesh graph when the target element is in a bent and stationary state. After binding the first curve 701, the first static mesh graph 702 in a stationary state may refer to Figure 7 shown.

[0083] In one embodiment of the present disclosure, an element generation method is used to generate tentacle creatures (tentacle creatures) in a game level. After the game level is edited, all tentacle creatures in the target scene are converted into corresponding instanced static meshes, each tentacle creature corresponds to an instance, and the position and tangent direction of each spline point become per-instance custom data. According to the per-instance custom data, the vertex position of each target element static mesh graph can be obtained, and the corresponding target element static mesh graph is composed of the positions of all vertices.

[0084] In the disclosed embodiment, the static mesh graphics can be rendered through the instance corresponding to the target element to achieve the color, texture and other effects required by the game. When using the instance for real-time rendering, the Vertex Shader reads the per-instance custom data to obtain the position and tangent direction of each spline point, and calculates the offset value of each vertex of the static mesh graphics through the above-mentioned piecewise cubic spline curve interpolation function to achieve the bending of each tentacle creature as the target element.

[0085] In this embodiment, generating an instance of the target element according to the expression of the first control point and the first curve may include instantiating the first static mesh and the first curve bound thereto. The instance generated by the instantiation process can render each frame of the animation screen in which the first static mesh changes along with the first curve.

[0086] In one embodiment of the present disclosure, the element generation method further includes:

[0087] When the generated element is placed in the target scene, in response to an axis adjustment operation on the target element, acquiring axis adjustment information on the element;

[0088] The above-mentioned orientation information is obtained according to the above-mentioned axis adjustment information.

[0089] In the embodiment of the present disclosure, the generated element includes a first static grid figure, a first curve and a binding relationship between the two. The element generated by the method of the embodiment of the present disclosure can be placed in a game level. After the generated target element is placed in the game level, the axis of the corresponding target element can be obtained, and the axis can be substantially consistent with the extension direction of the first static grid figure.

[0090] The direction of the first static grid graphic can be adjusted by adjusting the axis, that is, the direction of the target element can be adjusted. After the direction is adjusted, the first static grid graphic can generate effects such as interlacing and surrounding according to objects such as buildings in the scene.

[0091] In this embodiment, when the generated element is placed in the target scene, the orientation of the target element can be adjusted, so that different target elements can be generated as needed in scenes such as game levels.

[0092] In one embodiment of the present disclosure, the element generation method further includes:

[0093] In response to the selection instruction, determining at least one sub-element generation point on the target element; the generation point is a vertex on the first static mesh graphic;

[0094] generating a sub-element second curve and a second sub-element static mesh graphic related to the sub-element according to the generating point;

[0095] Bind the sub-element curve to the above sub-element static mesh graphic;

[0096] Set the sub-element static mesh graphics of the bound sub-element curve as the sub-element of the above target element;

[0097] The sub-element is bound to the element, so that the curve corresponding to the target element includes the sub-element curve, and the vertices of the target element include the vertices of the static mesh of the sub-element.

[0098] In one embodiment of the present disclosure, the generation point may be one of the vertices of the first static mesh graphic. Any point on the first static mesh graphic may be selected as the generation point of the sub-element, and the sub-element of the target element may be generated in a manner similar to the process of binding the first static mesh and the first curve. In the case where the target element is a tentacle creature, the sub-element may be a sub-tentacle; in the case where the target element is a vine creature, the sub-element may be a sub-branch of the vine creature.

[0099] In the case of having a sub-element, the curve corresponding to the target element may include a sub-element curve of the sub-element and a first curve corresponding to the first static mesh graphic.

[0100] The type of the sub-element curve can be the same as or different from the first curve.

[0101] When the branches of the child elements, i.e. the target elements, are generated, the position of their roots on the trunk and their size relative to the trunk are considered; scene collisions are also considered.

[0102] In this embodiment, a target element and sub-elements of the target element can be generated in a similar manner, thereby enriching the form of the target element.

[0103] In one embodiment of the present disclosure, the first curve is any one of a Bezier curve and a Nyquist curve; and the target element is a tentacle creature.

[0104] In the embodiment of the present disclosure, if the first curve is not a spline curve, the type of the first curve may be a Bezier curve or a Nyquist curve. The tentacle creature in the embodiment of the present disclosure may be an animal tentacle or a plant tentacle, and the tentacle creature may be placed in a scene, and the position, size, and orientation may be adjusted according to the surrounding scene, so as to make it look like it is clinging to a building while avoiding mistakes (the tentacles may intersect with the building when swinging).

[0105] In one embodiment of the present disclosure, a rendering method is provided, including:

[0106] Obtain a target element to be rendered; the target element is generated by the element generation method provided by any embodiment of the present disclosure;

[0107] Renders the target element.

[0108] In one embodiment of the present disclosure, Figure 5 As shown, the element generation method uses the above example to perform the following steps for each target animation frame of the above target element:

[0109] Step S501: obtaining the floating direction information of the target element;

[0110] Step S502: acquiring parameters of the curve corresponding to the target element according to the floating direction information; the curve corresponding to the element includes the first curve;

[0111] Step S503: determining the positions of the vertices of the first static mesh graphic according to the above parameters;

[0112] Step S504: Determine the shape of the target element according to the position of the vertex.

[0113] In the disclosed embodiment, the fluttering direction information can be determined based on the background information of the target scene where the target element is located. For example, the target element can flutter with the wind direction in the target scene. The instance corresponding to the target element can obtain the fluttering direction information generated by external factors or the movement of the target element itself in the target scene, and adjust the bending state of each frame of the target element animation according to the fluttering direction information to present a more realistic dynamic effect.

[0114] In one embodiment of the present disclosure, the floating direction information may be information for causing the target element to float in a certain direction. For example, if the wind blows toward the south, the target element may float toward the south.

[0115] In the case where the target element is a tentacle creature, the animation of the tentacle creature floating is realized by updating the position of the spline point in each animation frame. The updating process may include: obtaining the position of each spline point, the tangent direction of the spline point, and other information in the target scene that affects the floating direction of the target element (such as wind direction, wind speed, wind strength, etc.) instance by instance through the Tick function (periodic scheduling function) of each animation frame, and calculating the rotation angle and rotation axis of each spline point according to the position of each spline point, the tangent direction of the spline point, and other information that affects the floating direction of the target element, and the calculation order is to calculate one by one from the spline point at the root of each tentacle creature to the spline point at the top.

[0116] In the disclosed embodiment, during the floating of the element, parameter information of the first curve is obtained through examples frame by frame, and the bending shape of the first curve is adjusted according to the parameter information determined frame by frame, and then the bending shape of the first static grid graphic is adjusted to achieve different bending states of the target element.

[0117] In the disclosed embodiment, the tentacle creature can be as follows Figure 6As shown. In general, the models and animations of such tentacle creatures in the game level are manually made by operators. According to the static mesh graphics, the skeleton of the tentacle creature is made, and the weights of each vertex of the static mesh model are obtained to obtain the skeleton model. Then the operator makes the idle animation of the skeleton model (animation when the character is idle) to show the fluttering of the tentacle creature. If the tentacle creature is made manually, there are the following disadvantages: the form is single, a skeleton model has only one form, if n forms are required, n models must be made, resulting in n times the workload and resources; the rendering efficiency is low, when multiple tentacles are displayed on the screen at the same time, multiple drawcalls are required (the process of the controller calling the image programming interface to realize the rendering operation). For example, if there are 3 tentacle creatures in the same scene, 3 drawcalls are required to render; the swing direction and amplitude of the tentacle creature are preset during the animation production, and cannot reflect the dynamic factors of the scene as a whole, such as the wind field (direction, wind speed, wind strength, etc.).

[0118] Through the disclosed embodiments, multiple target elements such as bent tentacle creatures with different shapes and different numbers of branches can be quickly generated; target elements such as tentacle creatures can automatically climb walls and pass through windows; through instantiated target elements, all target elements in the target scene can be efficiently rendered, and only one drawcall is required regardless of the number of target elements such as tentacle creatures in the entire scene. At the same time, the disclosed embodiments can express the movement and flutter parameters of target elements such as the dynamic wind field of the entire target scene through programmed spline point animation.

[0119] The present disclosure also provides an element generation device, such as Figure 8 As shown, including:

[0120] A static grid graphic generation module 801 is used to obtain a first static grid graphic of a target element;

[0121] A curve generating module 802, used for generating a first curve for representing a curved shape of at least one frame of the first static grid graphic;

[0122] A binding module 803 is used to bind the first curve to the first static grid graphic according to the dynamic bending information of the target element, so that the bound first static grid graphic bends along with the bending of the first curve;

[0123] The element module 804 is used to use the first static mesh graphic bound to the first curve as a generated target element.

[0124] In one implementation, the first curve is a spline curve; and the curve generation module includes:

[0125] A first control point unit, used to generate a first control point representing the first curve;

[0126] The first control point processing unit is used to use the first control point to represent the first curve.

[0127] In one embodiment, the binding module includes:

[0128] The vertex binding unit is used to bind the vertices of the first static mesh graphic to the corresponding first control points.

[0129] In one embodiment, the element generating device further comprises:

[0130] An instance generation module, configured to generate an instance of the target element according to the expression of the first control point and the first curve in response to a generation instruction;

[0131] A position module is used to determine the positions of all vertices of the first static mesh graphic according to the acquired orientation information of the target element using the above instance.

[0132] In one embodiment, the element generating device further comprises:

[0133] An axis adjustment module, configured to obtain axis adjustment information of the element in response to an axis adjustment operation on the target element when the generated target element is placed in the target scene;

[0134] The orientation module is used to obtain the orientation information according to the axis adjustment information.

[0135] In one embodiment, the element generating device further comprises:

[0136] A collision detection module, used for detecting whether there is a collision between the target element and other elements when the generated target element is placed in the target scene;

[0137] An adjustment information module, used for generating axis adjustment information for the target element according to a preset element spacing when there is a collision;

[0138] The second orientation module is used to obtain the orientation information according to the axis adjustment information. In one embodiment, the element generation device also includes:

[0139] A generation point module, used to determine the generation point of the sub-element on the target element in response to the selection instruction; the generation point is a vertex on the first static mesh graphic;

[0140] A sub-element generation module, used to generate a sub-element curve and a sub-element static grid graphic of the sub-element according to the generation point;

[0141] A sub-element binding information module is used to bind the sub-element curve to the above-mentioned sub-element static grid graphic;

[0142] A sub-element binding information processing module is used to use the sub-element static grid graphic of the bound sub-element curve as the sub-element of the target element;

[0143] The sub-element binding module is used to bind the above sub-element to the above element, so that the curve corresponding to the above target element includes the above sub-element curve, and the vertices of the above target element include the vertices of the above sub-element static mesh.

[0144] In one embodiment, the curve is any one of a Bezier curve and a Nyquist curve; and the target element is a tentacle creature.

[0145] The present disclosure provides a rendering device, such as Fig. 9 As shown, including:

[0146] The target element obtaining module 901 is used to obtain the target element to be rendered; the target element is generated by the element generating device provided by any embodiment of the present disclosure;

[0147] The rendering module 902 is used to render the target element.

[0148] In one embodiment, the rendering module includes:

[0149] Direction information unit, used to obtain the floating direction information of the target element;

[0150] A curve parameter unit, used to obtain the parameters of the curve corresponding to the target element according to the drift direction information; the curve corresponding to the element includes a first curve;

[0151] A curve parameter processing unit, used to determine the position of each vertex of the first static mesh figure according to the parameters;

[0152] The shape unit is used to determine the shape of the target element according to the position of the vertex.

[0153] The specific implementation of each of the above modules can refer to the above methods and drawings, and will not be repeated here. For the convenience of description, the above device is described by function and is divided into various modules and described separately. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0154] The device of the above embodiment is used to implement the corresponding method of placing a virtual object in a video in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0155] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for placing a virtual object in a video as described in any of the above-mentioned embodiments is implemented.

[0156] Fig.10 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 2010, a memory 2020, an input / output interface 2030, a communication interface 2040, and a bus 2050. The processor 2010, the memory 2020, the input / output interface 2030, and the communication interface 2040 are connected to each other in communication within the device through the bus 2050.

[0157] The processor 2010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0158] The memory 2020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 2020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 2020 and are called and executed by the processor 2010.

[0159] The input / output interface 2030 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0160] The communication interface 2040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0161] The bus 2050 includes a path that transmits information between the various components of the device (eg, the processor 2010, the memory 2020, the input / output interface 2030, and the communication interface 2040).

[0162] It should be noted that, although the above device only shows the processor 2010, the memory 2020, the input / output interface 2030, the communication interface 2040 and the bus 2050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0163] The electronic device of the above embodiment is used to implement the corresponding method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0164] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method described in any of the above embodiments.

[0165] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0166] The computer instructions stored in the storage medium of the above embodiments are used to enable the computer to execute the task processing method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0167] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.

[0168] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, the known power / ground connections to the integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0169] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0170] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.

Claims

1. A method for generating an element, comprising: Get the first static grid graphic of the target element; generating a first curve for representing a curved shape of at least one frame of the first static mesh graphic, wherein the first curve includes a first control point; Binding the first curve to the first static mesh graphic according to the dynamic bending information of the target element, so that the bound first static mesh graphic bends along with the bending of the first curve; Using the first static mesh graphic bound to the first curve as a generated target element; The method further comprises: In response to a generation instruction, generating an instance of the target element according to an expression of the first control point and the first curve; Determining positions of all vertices of a first static mesh graphic using the instance according to the acquired orientation information of the target element; The orientation information is determined based on whether the generated target element collides with other elements when placed in the target scene.

2. The method according to claim 1, wherein: The first curve is a spline curve; the step of generating a first curve for representing at least one frame of a dynamic curved shape of the first static mesh graphic comprises: generating first control points representing the first curve; The first curve is represented using the first control points.

3. The method according to claim 2, wherein: The step of binding the first curve to the first static mesh graphic according to the bending dynamic information of the target element includes: Bind the vertices of the first static mesh graphic to the corresponding first control points.

4. The method according to claim 1, further comprising: When the generated target element is placed in the target scene, in response to an axis adjustment operation on the target element, acquiring axis adjustment information on the target element; The orientation information is obtained according to the axis adjustment information.

5. The method according to claim 1, further comprising: When the generated target element is placed in the target scene, detecting whether there is a collision between the target element and other elements; In the case of a collision, generating axis adjustment information for the target element according to a preset element spacing; The orientation information is obtained according to the axis adjustment information.

6. The method according to claim 1, further comprising: In response to the selection instruction, determining at least one sub-element generation point on the target element; The generation point is a vertex on the first static mesh figure; Generating a sub-element curve and a sub-element static mesh graphic related to the sub-element according to the generating point; Binding the sub-element curve to the sub-element static mesh graphic; The sub-element static mesh graphic bound to the sub-element curve is used as a sub-element of the target element; The sub-element is bound to the target element, so that the curve corresponding to the target element includes the sub-element curve, and the vertices of the target element include the vertices of the sub-element static mesh.

7. The method according to claim 1, wherein: The curve is any one of a Bezier curve and a Nyquist curve; the target element is a tentacle creature in the game.

8. A rendering method, comprising: Get the target element to be rendered; The target element is generated by the method described in any one of claims 1 to 7; Render the target element.

9. The method according to claim 8, wherein: The rendering of the target element includes: Obtaining the floating direction information of the target element; According to the floating direction information, obtaining parameters of the curve corresponding to the target element; the curve corresponding to the element includes the first curve; Determine the position of each vertex of the first static mesh graphic according to the parameters; The shape of the target element is determined according to the position of the vertex.

10. An element generating device, comprising: A static grid graphic generation module, used for obtaining a first static grid graphic of a target element; A curve generating module, configured to generate a first curve for representing a curved shape of at least one frame of the first static grid graphic, wherein the first curve includes a first control point; A binding module, configured to bind the first curve to the first static grid graphic according to the dynamic bending information of the target element, so that the bound first static grid graphic bends along with the bending of the first curve; An element module, used for taking the first static mesh graphic bound to the first curve as a generated target element; The device further comprises: An instance generation module, configured to generate an instance of the target element according to the expression of the first control point and the first curve in response to a generation instruction; A position module, configured to determine positions of all vertices of the first static mesh graphic using the instance according to the acquired orientation information of the target element; The orientation information is determined based on whether the generated target element collides with other elements when placed in the target scene.

11. The device according to claim 10, wherein: The first curve is a spline curve; the curve generation module includes: A first control point unit, used to generate a first control point representing the first curve; The first control point processing unit is used to use the first control point to represent the first curve.

12. The device according to claim 11, wherein: The binding module includes: A vertex binding unit is used to bind the vertices of the first static mesh graphics to the corresponding first control points.

13. The apparatus according to claim 10, further comprising: an axis adjustment module, configured to obtain axis adjustment information of the element in response to an axis adjustment operation on the target element when the generated target element is placed in the target scene; The first orientation module is used to obtain the orientation information according to the axis adjustment information.

14. The apparatus according to claim 10, further comprising: A collision detection module, used for detecting whether there is a collision between the target element and other elements when the generated target element is placed in the target scene; An adjustment information module, used for generating axis adjustment information for the target element according to a preset element spacing when there is a collision; The second orientation module is used to obtain the orientation information according to the axis adjustment information.

15. The apparatus according to claim 10, further comprising: A generation point module, for determining a generation point of at least one sub-element on the target element in response to a selection instruction; The generation point is a vertex on the first static mesh figure; A sub-element generation module, used to generate a sub-element curve and a sub-element static grid graphic related to the sub-element according to the generation point; A sub-element binding information module, used to bind the sub-element curve to the sub-element static grid graphic; A sub-element binding information processing module, used to use the sub-element static grid graphic bound to the sub-element curve as the sub-element of the target element; The sub-element binding module is used to bind the sub-element to the target element, so that the curve corresponding to the target element includes the sub-element curve, and the vertices of the target element include the vertices of the sub-element static mesh.

16. A rendering device, comprising: A target element acquisition module is used to obtain the target element to be rendered; The target element is generated by the device described in any one of claims 10-15; A rendering module is used to render the target element.

17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 9 when executing the program.

18. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 9.

19. A computer program product, comprising computer program instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Using curves to emulate soft body deformation

    CN104050703A

  • Hose state simulation method and device, electronic equipment and storage medium

    CN112215937A

  • Terrain processing method and device, electronic equipment and readable storage medium

    CN115222904A