Simulation method and device of soft object and electronic equipment
By generating and processing points on the target model surface, generating and removing overlapping target objects, and performing soft object motion simulation, the problems of large resource consumption and complex operation of Vellum nodes in complex animation processing are solved, and efficient and low-cost soft object generation is achieved.
Patent Information
- Application Number
- CN202411823529.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-05-02
AI Technical Summary
When handling complex animations in the prior art, Vellum nodes have problems such as huge resource consumption, complex operation, low efficiency and high learning costs, making it difficult to achieve ideal results in a large-scale production environment.
By obtaining the target model, multiple points are generated and their dimension properties are determined, the target object matching is generated for each point, and the part overlapping inside the target model is removed, and the target object is finally simulated to generate a soft object that follows the target model's movement.
It realizes the generation of soft objects that follow the model running under the premise of low cost, reduces the computing resource requirements, and improves generation efficiency and cost-effectiveness.
Smart Images

Figure CN119919548A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of model rendering, and in particular to a simulation method, device and electronic equipment for a soft object. Background Art
[0002] In the field of computer graphics and visual effects, simulation of soft objects is an important research direction. In related technologies, the Vellum node in Houdini is usually used to simulate soft objects. This method performs well in terms of accuracy and physical effects. However, when dealing with complex animations, the Vellum node has the disadvantages of huge resource consumption, complex operation, low efficiency, and high learning cost. These problems make it difficult to achieve ideal results in large-scale production environments, especially when facing highly complex animation scenes. Summary of the invention
[0003] The purpose of the present disclosure is to provide a simulation method, device and electronic device for a soft object, so as to generate a soft object that follows the model at a low cost.
[0004] In a first aspect, the present disclosure provides a simulation method for a soft object, the method comprising: obtaining a target model and generating a plurality of points on the surface of the target model; determining size attributes corresponding to the plurality of points respectively; for each of the plurality of points, generating a target object matching the size attributes corresponding to the current point at the location of the current point; removing an object area on the target object that overlaps with the interior of the target model to obtain a target object located on the surface of the target model; and performing soft object motion simulation on the target object located on the surface of the target model to obtain a soft object that follows the movement of the target model.
[0005] In a second aspect, the present disclosure provides a simulation device for a soft object, which includes: a point scattering module, which is used to obtain a target model and generate multiple points on the surface of the target model; an attribute determination module, which is used to determine the size attributes corresponding to the multiple points; an object generation module, which is used to generate a target object that matches the size attribute corresponding to the current point at the location of the current point for each of the multiple points; an overlap removal module, which is used to remove the object area on the target object that overlaps with the interior of the target model to obtain the target object located on the surface of the target model; and a motion simulation module, which is used to perform soft object motion simulation on the target object located on the surface of the target model to obtain a soft object that follows the movement of the target model.
[0006] In a third aspect, the present disclosure provides an electronic device, which includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned soft object simulation method.
[0007] In a fourth aspect, the present disclosure provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned soft object simulation method.
[0008] The embodiments of the present disclosure bring the following beneficial effects:
[0009] The present disclosure provides a simulation method, device and electronic device for a soft object. First, a target model is obtained, and multiple points are generated on the surface of the target model; the size attributes corresponding to the multiple points are determined; for each of the multiple points, a target object matching the size attribute corresponding to the current point is generated at the location of the current point; then, the object area on the target object that overlaps with the interior of the target model is removed to obtain the target object located on the surface of the target model; then, the soft object motion simulation is performed on the target object located on the surface of the target model to obtain a soft object that follows the motion of the target model. In this method, by generating objects on scattered points on the surface of the target model and controlling the generated objects to simulate the motion of the soft object, a soft object that follows the motion of the target model is obtained. This method can not only generate soft objects on the target model, but also improve the generation efficiency and generation cost of the soft object while reducing the demand for computing resources.
[0010] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0011] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, the following specifically cites preferred implementation modes and describes them in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0013] Figure 1 A flowchart of a simulation method for a soft object provided by an embodiment of the present disclosure;
[0014] Figure 2 A schematic diagram of a target model provided in an embodiment of the present disclosure;
[0015] Figure 3 A schematic diagram of generating multiple points on a target model surface provided by an embodiment of the present disclosure;
[0016] Figure 4 A schematic diagram showing the size attributes corresponding to points generated on the surface of a target model provided by an embodiment of the present disclosure;
[0017] Figure 5 A schematic diagram of generating a target object on a target model surface provided by an embodiment of the present disclosure;
[0018] Figure 6 A schematic diagram showing overlap between a target object and a target model provided by an embodiment of the present disclosure;
[0019] Figure 7 A schematic diagram showing that there is no overlap between a target object and a target model provided by an embodiment of the present disclosure;
[0020] Figure 8 A schematic diagram of dist attribute visualization provided by an embodiment of the present disclosure;
[0021] Fig. 9 A schematic structural diagram of a soft object simulation device provided by an embodiment of the present disclosure;
[0022] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. The components of the embodiments of the present disclosure described and shown in the drawings here can be arranged and designed in various different configurations.
[0024] Therefore, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the present disclosure claimed for protection, but merely represents selected embodiments of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure.
[0025] In the field of computer graphics and visual effects, simulation of soft objects is an important research direction. The Vellum node system in Houdini is widely used in various complex animations and special effects because it can achieve high-precision soft body simulation effects. However, the simulation process of the Vellum node has some shortcomings, such as huge resource consumption, cumbersome operation procedures, low simulation efficiency, and a steep learning curve. These problems will have a great impact on production efficiency when facing complex animation scenes, especially in large-scale production environments.
[0026] Based on the above problems, the embodiments of the present disclosure provide a simulation method, device and electronic device for a soft object. The technology can be applied to the scene of generating a soft object on a three-dimensional model.
[0027] In order to facilitate understanding of the embodiments of the present disclosure, a simulation method of a soft object provided by the embodiments of the present disclosure is first introduced in detail. Figure 1 As shown, the method includes the following specific processes:
[0028] Step S102: acquiring a target model and generating a plurality of points on the surface of the target model.
[0029] In a specific implementation, the target model is usually a three-dimensional model, and the model style corresponding to the target model can be determined according to user operations. For example, the target model can be a character model, an animal model, or an object model. After acquiring the target model, a large number of points can be randomly generated on the surface of the target model, and a large number of points can also be generated at fixed positions on the surface of the target model, wherein the number of points generated can be determined according to user operations or R&D requirements. Specifically, the position of the surface generation point of the target model is also the position of the soft object that is subsequently generated to coexist with the target model.
[0030] Step S104, determining the size attributes corresponding to the multiple points respectively.
[0031] In specific implementation, after generating multiple points on the surface of the target model, it is necessary to determine the size attribute corresponding to each generated point according to user operation or R&D requirements. The size attribute is used to limit the size of the target object generated at the corresponding point, so that target objects of different sizes can be generated on the surface of the target model according to the size attribute corresponding to each point, so as to improve the randomness and authenticity of object generation. Specifically, the size attribute corresponding to each point generated on the surface of the target model can be randomly generated, can be generated according to a noise map, or can be generated according to rules set by the user.
[0032] Step S106 : for each point among the multiple points, generate a target object with a size attribute matching the size attribute corresponding to the current point at the location of the current point.
[0033] In the specific implementation, the volume size of the target object to be generated corresponding to each point can be determined according to the size attribute corresponding to each point on the surface of the target model, and then a target object of the corresponding volume size is generated at the position of each point, that is, the volume size of the target object generated at a certain point is the same as the volume size corresponding to the point.
[0034] Step S108 , removing the object area on the target object that overlaps with the interior of the target model, and obtaining the target object located on the surface of the target model.
[0035] Since the target object has a certain volume, the volume of the target object generated on the surface of the target model will have a part that overlaps with the model volume of the target model, that is, there is an interlacing between the target object and the target model, resulting in the target object not being attached to the surface of the target model. Therefore, it is necessary to remove the part of the target object that overlaps with the interior of the target model to obtain the target object with the overlapping part removed, that is, to obtain the target object that only exists on the outer surface of the target model.
[0036] Step S110 , performing soft object motion simulation on the target object located on the surface of the target model to obtain a soft object that moves along with the target model.
[0037] In specific implementation, the soft object movement needs to comply with natural rules. Based on this, the soft object movement can be that the closer the target object is to the target model, the less it moves, and the farther it is from the target model, the more it shakes. Therefore, according to the rules of the soft object movement, the distance between the vertices on the target object and the surface of the target model can be determined, and then the motion attributes corresponding to each vertex on the target object can be determined based on the distance, and the motion attributes are assigned to the target object, thereby generating a soft object that follows the movement of the target model.
[0038] The above-mentioned simulation method of soft objects generates objects at scattered points on the surface of the target model and controls the generated objects to simulate the movement of the soft objects, thereby obtaining a soft object that follows the movement of the target model. This method can not only generate soft objects on the target model, but also reduce the demand for computing resources while improving the generation efficiency and generation cost of the soft objects.
[0039] The following embodiments are used to describe the method of obtaining a target model and scattering points on the target model.
[0040] Specifically, the specific process steps for obtaining the target model may include at least one of the following:
[0041] The first method is to obtain a stationary three-dimensional model and determine the stationary three-dimensional model as a target model.
[0042] The second method is to obtain a three-dimensional model with animation, freeze the animation time of the three-dimensional model with animation, and determine the three-dimensional model with the frozen animation time as the target model.
[0043] In the specific implementation, you can use Houdini's File node to import a static 3D model or a 3D model with animation, and freeze the animation time of the 3D model with animation to ensure that the position and shape of the soft object generated on the 3D model are consistent in each animation frame. Specifically, since the principle of generating soft objects on the surface of the target model is the same, you can import multiple static 3D models or 3D models with animation at the same time, and then connect them through the switch node to switch to the target model you want to perform subsequent settlement this time.
[0044] If the imported model is an animated 3D model, in order to reduce the performance consumption of settlement and ensure that each soft object generated on the animated 3D model is generated at the same position of the 3D model, it is necessary to add a timeshift node in Houdini to fix the action of the 3D model (that is, the action of each animation frame of the 3D model is the same, and the time is frozen).
[0045] Furthermore, the specific process of generating a plurality of points on the surface of the target model may include: converting the target model into a mesh model having a point-line-surface structure; and randomly generating a plurality of points on the outer surface of the mesh model.
[0046] In the specific implementation, since the target model may be a model drawn in Houdini or an externally imported model, in order to avoid Houdini incompatibility and affect subsequent operations, the target model needs to be converted into a mesh model with a point-line-surface structure. Then, a large number of points are randomly generated on the surface of the mesh model, and the target object will be generated at the position of these points.
[0047] In a specific embodiment, the target model can be converted into a mesh model through a convert node in Houdini to ensure compatibility and flexibility of subsequent processing. Points can be scattered on the outer surface of the mesh model through a Scatter node in Houdini to generate a large number of points on the outer surface of the mesh model.
[0048] like Figure 2 FIG. 1 is a schematic diagram of a target model provided by an embodiment of the present disclosure, wherein the target model is a character model. Figure 3 FIG. 1 is a schematic diagram of generating multiple points on the surface of a target model provided by an embodiment of the present disclosure. Figure 3 The white dots on the surface of the character model are the multiple points generated by scattering dots on the target model.
[0049] The soft object simulation disclosed in this disclosure is not only applicable to static models, but also can efficiently generate soft objects on models with animations and follow the movement changes of the models. This flexibility makes the technology suitable for a variety of application scenarios, especially in complex character animation and visual effects production, and can effectively meet the needs of different types of soft object generation, such as the simulation of foam, fat and other substances.
[0050] The following embodiments are used to describe a method of determining the size attributes of points generated from the surface of a target model.
[0051] Specifically, the specific process of determining the size attributes respectively corresponding to the plurality of points may include: generating noise maps respectively corresponding to the plurality of points, and generating the size attributes respectively corresponding to the plurality of points based on the noise maps.
[0052] In specific implementation, the AttribVOP node in Hound can be used to configure a size attribute (equivalent to the pscale attribute) for each point generated on the surface of the target model. The size attribute is determined based on the noise map, so as to generate virtual volumes of different sizes (the virtual volume is equivalent to the target object) based on the noise map to form an irregular soft object mask. Specifically, the noise map corresponding to each point can be randomly generated or determined according to user input.
[0053] In an optional embodiment, the specific process of generating size attributes corresponding to multiple points based on the noise map may include: for the noise maps corresponding to the multiple points, converting the attributes of the noise map into grayscale values, normalizing the grayscale values to obtain normalized grayscale values, and determining the normalized grayscale values as the size attributes.
[0054] In the specific implementation, the size attribute is set for each point through the Attribute VOP node to control the distribution and size of the soft objects generated on the target model. The relevant principle is to pass the position information of the points generated on the surface of the target model to the Turbulent Noise node to generate a complex irregular noise map on the surface of the target model. Because we want to generate symbiotic soft objects of different sizes through the noise map on the surface of the target model in the future, in order to facilitate observation, it is necessary to convert the attributes of these noise patterns into grayscale values, and clamp the grayscale values between 0-1, and assign the size of this grayscale value to the size attribute. The size attribute is the attribute that controls the size of the symbiotic soft object later. When the size attribute is 0, the volume of the soft object is 0, and when the size attribute is 1, the volume of the soft object is 0.
[0055] The Turbulent Noise node is a node commonly used to generate noise effects in graphics and rendering. It is usually used to generate natural effects such as clouds, flames, terrain, etc. It is based on fractal noise to create more complex and irregular effects. The output of the Turbulent Noise node is between 0 and 1. In general, it can be understood that the position information of the point (3D vector) is randomly obtained to obtain a value (a floating point number between 0-1), which is the normalized gray value mentioned above.
[0056] like Figure 4 FIG. 1 is a schematic diagram showing the display of the size attributes corresponding to points generated on the surface of a target model provided by an embodiment of the present disclosure. Figure 4 The color of the point on the surface of the target model in is used to indicate the normalized grayscale value, which is also the size attribute corresponding to the point on the surface of the target model. Figure 4 The black color in the figure indicates that the grayscale value is 0 (that is, the size attribute is 0), the white color indicates that the grayscale value is 1 (that is, the size attribute is 1), and the grayscale value between white and black corresponds to a value between 0 and 1.
[0057] The following embodiments are used to describe a method of generating a target object and a method of removing an overlapping portion between the target object and a target model.
[0058] Specifically, the specific process of generating a target object matching the size attribute corresponding to the current point at the location of the current point may include: determining the target volume corresponding to the current point based on the size attribute corresponding to the current point; and generating a target object matching the target volume at the location of the current point.
[0059] In the specific implementation, each point generated on the surface of the target model needs to be used as a current point to generate a target object of corresponding volume at each point on the surface of the target model, thereby generating target objects of different sizes on the surface of the target model, and each target object has a certain volume. Specifically, the larger the size attribute corresponding to a point, the larger the target volume corresponding to the point. Among them, the shape of the above-mentioned target object can be determined according to research and development needs. For example, the shape of the target object can be round or square.
[0060] In a specific embodiment, when generating a target object on the target model surface, the VDB fromParticle node in Houdini is used to automatically read the size attribute corresponding to each point generated on the target model surface set by the Attribute Vop node to generate circular target objects of different sizes. Figure 5 FIG. 1 is a schematic diagram of generating a target object on the surface of a target model provided by an embodiment of the present disclosure. Figure 5The graphic objects of different sizes in the target model are target objects generated on the surface of the target model, and the target objects are used to subsequently generate soft objects attached to the surface of the target model.
[0061] In an optional embodiment, the data format of the target object is a three-dimensional volume data format. The target object is described in the three-dimensional volume data format, which can effectively reduce the consumption of memory and computing resources.
[0062] Specifically, the target object generated on the surface of the target model is not an ordinary model composed of points, lines and surfaces, but a structure called VDB (the VDB structure here refers to a structure filled with a voxel in the model), which is an efficient 3D volume data format suitable for fluid simulation, collision detection, volume modeling and rendering. It has the advantages of efficient memory usage, flexible data processing, fine volume representation and efficient computing performance.
[0063] In the specific implementation, the target objects generated on the surface of the target model are interspersed with the target model, lacking the sensory effect of the target objects attached to the target model, and these target objects interspersed with the target model may occupy half of the existing target objects, which will affect the speed of the subsequent solution. Therefore, it is necessary to remove the object area on the target object that overlaps with the interior of the target model to obtain the target object that is only located on the outer surface of the target model.
[0064] Specifically, the target model needs to be converted into a first model in a three-dimensional volume data format; the first model is subtracted from the target object to remove the volume of the target object located inside the first model, thereby obtaining the target object located on the surface of the target model. Since the target object is in a three-dimensional volume data format, the target model needs to be converted into a three-dimensional volume data format first, and then the target model in the three-dimensional volume data format is subtracted from the target object portion, thereby obtaining the target object without the interpenetration effect and located only on the outer surface of the target model.
[0065] like Figure 6 The target object and the target model provided by the present disclosure are overlapped schematically. Figure 6 The generated object in is also the target object generated on the target model. The target model is Figure 6 In the semi-transparent model, there is an interlaced part between the target model and the target object. Figure 7 FIG. 1 is a schematic diagram showing that there is no overlap between the target object and the target model provided by an embodiment of the present disclosure. Figure 7 Yes Figure 6 The effect diagram of the target object after the part overlapping with the target model is removed. After removal, the target object is only located on the outer surface of the target model.
[0066] The following embodiments are used to describe the method of simulating the motion of a soft object.
[0067] Specifically, the above-mentioned soft object motion simulation of the target object located on the surface of the target model to obtain the specific process of the soft object that follows the movement of the target model may include: determining the target distance between each vertex on the target object located on the surface of the target model and the target model surface; according to the target distance corresponding to each vertex, determining the motion attribute corresponding to each vertex; wherein the motion attribute is used to indicate the lag effect and / or jitter effect of the soft object moving on the surface of the target model.
[0068] In the specific implementation, the target distance between the target object and the target model surface must be calculated first. The target distance can be the vertical distance between each vertex on the target object and the target model surface, or the distance between a vertex on the target object and the point on the target model surface closest to the vertex. Then the target distance is mapped to a color attribute to generate a bottom fixed mask of the target object to ensure that the target object can be attached to the target model surface and remain stable during the simulation. Finally, the Point Deform node must be used to enable the generated target object to follow the movement of the target model, and to simulate the hysteresis and jitter effects of soft objects on the target object, thereby increasing the realism of the movement.
[0069] Furthermore, the movement degree corresponding to the movement attribute corresponding to the vertex of the target object is proportional to the target distance corresponding to the vertex. The movement degree is used to indicate the degree of jitter and / or lag of the target object.
[0070] In the specific implementation, after processing the interlacing, the target object and target model in the three-dimensional volume data format need to be converted into a normal model with points, lines and surfaces, which is called a polygon structure in Houdini. Next, a mask should be defined, which is to prepare for the simulation of the soft object following the movement of the target model surface. Generally speaking, the attachment on the surface of the target model (equivalent to the above-mentioned target object) will not move as it is closer to the surface of the target model, and will shake more as it is farther away from the surface of the target model. According to this principle, an attribute dist can be defined. In Houdini, the first port of the pointwrangle node is used to connect the target object, the second port is connected to the target model, and "@dist=xyzdist(1,@P);" can be filled in so that each fixed point of the target object of the first port can calculate the target distance from the surface of the target model, and give this target distance to the attribute dist. The greater the distance between the vertex in the target object and the surface of the target model, the greater the value of dist, and the smaller the distance between the vertex in the target object and the target model, the smaller the value of dist.
[0071] like Figure 8FIG. 1 is a schematic diagram of dist attribute visualization provided by an embodiment of the present disclosure. Figure 8 The darker the color of the target object on the surface of the target model in , the closer it is to the target model, that is, the smaller the value of the dist attribute is; the lighter the color, the farther it is from the target model, that is, the larger the value of the dist attribute is.
[0072] In practical applications, the first thing is to make the target object move along with the target model. At this time, you need to use a Point Deform node, which is a node used to apply the deformation of a high-polygon geometry to a low-polygon geometry. It is usually used in scenes such as character animation and cloth simulation. The number of faces of the target model is generally many times higher than that of the target object, so this node can be used to achieve the effect of following the movement. Then you need to add some movement details directly to the target object, because the target object is defined as a soft substance (such as foam, fat, etc.), and their movement is often elastic and has lag due to inertia.
[0073] The first is hysteresis, which can be achieved by adding a lag node, which is used to introduce lag or delay effects in geometry or animation curves. It can help create more natural movement and is often used for character animation, secondary motion in physical simulations, and other scenes that require time delay effects. After using the lag node, the target object can look more natural and soft when following the movement of the target model, with a real sense of inertia.
[0074] Next is the shaking effect. Here we add the Spring node, which simulates the movement of an object under the influence of spring force. It can add elasticity and damping effects to make the geometry or animation curve show spring-like physical behavior. Different elasticity and damping effects can be set according to the properties of different soft objects (foam, fat).
[0075] Finally, we need to set the motion effect of the target object close to the target model, because now every part of the generated object will follow and shake, but as mentioned above, the closer the target object is to the surface of the target model, the less it will move. We have also defined an attribute dist above, which we need to use now. We can use the pointwrangle node and use the following code:
[0076] vector oP=point(1,"P",@ptnum);
[0077] float mix=fit(@dist,chf("Min"),chf("Max"),1,0);
[0078] @P=lerp(@P,oP,mix);
[0079] The above vector oP=point(1,"P",@ptnum) code uses the point() function to extract the position data of the point from the geometry with index 1 in the input stream ("P" represents the position vector) and assigns the position to the variable oP. @ptnum is the number of the currently processed point. This line of code means to obtain the corresponding point position from the geometry of input 1 and use it as the "target position" for reference. @dist in float mix=fit(@dist,chf("Min"),chf("Max"),1,0) is a custom attribute used to control the weight of interpolation. The fit() function maps @dist to a new range. In this example, @dist is mapped from [Min,Max] to [1,0]. chf("Min") and chf("Max") are two slider parameters (representing the minimum and maximum values, respectively) that can be controlled by the user on the interface. The final mix value will smoothly transition between 1 and 0 as @dist changes, controlling the interpolation ratio of the control point. The lerp() function in @P=lerp(@P,oP,mix) is used to perform linear interpolation between two vectors (the current position @P and the target position oP). Specifically, the mix value controls the weight of the interpolation: when mix is close to 1, the point position is closer to the target position oP; when mix is close to 0, the point position remains at the original position @P. The final result assigns the interpolated new position to @P, allowing the current point position to move smoothly toward the target position, producing a gradual effect based on distance or control factors.
[0080] In general, the effect of this code is to smoothly interpolate between the current point position and the target position (the geometry from input 1) according to the size of @dist. Users can control the range of interpolation through the Min and Max sliders to achieve a soft movement or gradient effect based on distance. That is, after using the above code, the vertex with a dist value of 1 on the target object (that is, the vertex farther away from the target model) has a movement degree of 100%, and the vertex with a dist value of 0 on the target object (that is, the point closer to the target model) has a movement degree of 0%.
[0081] In an optional embodiment, points are further scattered inside the generated soft object to improve the detail generation effect. By properly configuring the rendering pipeline, the soft object is exported in layers to achieve high-quality rendering output.
[0082] The soft object simulation method proposed in the present disclosure brings many significant beneficial effects in achieving efficient and low-cost generation of soft objects and following the movement of animation models:
[0083] 1. Reduce computing resource usage
[0084] Traditional soft object simulation methods, such as Houdini's Vellum system, usually rely on complex spring and particle simulations, resulting in high computing resource requirements. The present disclosure uses the VDB format for volume generation and combines Boolean operations to remove redundant volumes, significantly reducing the amount of calculation and memory usage. This method greatly improves simulation efficiency, making it easier to handle large-scale and highly complex animation scenes.
[0085] 2. Improve operational simplicity and flexibility
[0086] By introducing Point Deform, Lag and Spring nodes, users can complete complex soft object simulations with relatively simple steps. These nodes effectively reduce the complexity of settings and adjustments, and through intuitive parameter control, such as delay and elastic effects, users can achieve natural soft body motion effects more quickly, reducing the learning curve, so that even beginners can quickly get started.
[0087] 3. Precisely control the dynamic performance of soft objects
[0088] The present disclosure uses the distance attribute dist to dynamically control the motion behavior of soft objects. By mapping the distance between a point and the model surface, the part close to the model remains stable, while the part far from the model exhibits a larger motion amplitude. This distance-based dynamic control makes the motion of the generated soft object more in line with the laws of physics, greatly improving the realism of the final visual effect.
[0089] 4. Improve the flexibility of soft object generation and simulation
[0090] This method is not only applicable to static models, but can also efficiently generate soft objects on animated models and follow the movement of the model. This flexibility makes this technology suitable for a variety of application scenarios, especially in complex character animation and visual effects production, and can effectively meet the needs of generating different types of soft objects, such as the simulation of foam, fat and other substances.
[0091] 5. Reduce learning costs and development time
[0092] Compared with the traditional complex simulation process, the technical solution disclosed in this paper greatly reduces the learning cost through simplified operation steps and intuitive control interface. Developers can master and apply this technology in a short time and quickly realize the generation and animation effects of soft objects in the production environment. This not only speeds up the pace of project development, but also reduces the dependence on expensive hardware resources and optimizes the workflow.
[0093] 6. Improve production efficiency, suitable for large-scale animation scenes
[0094] The present invention can meet the needs of soft object simulation in complex animation scenes and is suitable for large-scale production environments. Its efficient soft object generation and simulation solution significantly improves production efficiency while ensuring the effect. It is suitable for projects that require a lot of visual effects, such as movies, games, and advertisements, and provides a more cost-effective solution for the special effects industry.
[0095] In summary, the present invention not only overcomes the problems of high resource consumption and complex operation of existing soft object simulation methods, but also realizes the efficient generation of soft objects and realistic animation simulation effects. It provides users with a powerful, flexible and low-cost solution, which has wide application potential and practical value in the field of visual effects production.
[0096] Corresponding to the above method embodiment, the present disclosure also provides a simulation device for a soft object, such as Fig. 9 As shown, the device comprises:
[0097] The point scattering module 80 is used to obtain a target model and generate multiple points on the surface of the target model.
[0098] The attribute determination module 81 is used to determine the size attributes corresponding to the multiple points.
[0099] The object generation module 82 is used to generate, for each point among the multiple points, a target object having a size attribute matching that of the current point at the location of the current point.
[0100] The overlapping removal module 83 is used to remove the object area on the target object that overlaps with the interior of the target model to obtain the target object located on the surface of the target model.
[0101] The motion simulation module 84 is used to perform soft object motion simulation on the target object located on the surface of the target model to obtain a soft object that moves along with the target model.
[0102] The above-mentioned simulation device for soft objects generates objects at scattered points on the surface of the target model and controls the generated objects to simulate the movement of the soft objects, thereby obtaining a soft object that follows the movement of the target model. This method can not only generate soft objects on the target model, but also improve the generation efficiency and generation cost of the soft objects while reducing the demand for computing resources.
[0103] Specifically, the above-mentioned scattering module 80 is used to: obtain a static three-dimensional model and determine the static three-dimensional model as the target model; and / or obtain a three-dimensional model with animation, freeze the animation time of the three-dimensional model with animation, and determine the three-dimensional model with frozen animation time as the target model.
[0104] Furthermore, the above-mentioned point scattering module 80 is also used to: convert the target model into a grid model with a point-line-surface structure; and randomly generate a plurality of points on the outer surface of the grid model.
[0105] Furthermore, the attribute determination module 81 is used to generate noise maps corresponding to the multiple points respectively, and generate size attributes corresponding to the multiple points respectively based on the noise maps.
[0106] Furthermore, the attribute determination module 81 is also used to: for the noise images corresponding to the multiple points, convert the attributes of the noise images into grayscale values, normalize the grayscale values to obtain normalized grayscale values, and determine the normalized grayscale values as size attributes.
[0107] Furthermore, the object generation module 82 is used to: determine a target volume corresponding to the current point based on a size attribute corresponding to the current point; and generate a target object matching the target volume at the location of the current point.
[0108] Furthermore, the data format of the target object is a three-dimensional volume data format.
[0109] Furthermore, the above-mentioned overlap removal module 83 is used to: convert the target model into a first model in a three-dimensional volume data format; subtract the first model from the target object to remove the volume of the target object located inside the first model, and obtain the target object located on the surface of the target model.
[0110] Furthermore, the motion simulation module 84 is used to: determine the target distance between each vertex on the target object located on the surface of the target model and the target model surface; determine the motion attribute corresponding to each vertex according to the target distance corresponding to each vertex; wherein the motion attribute is used to indicate the lag effect and / or jitter effect of the soft object moving on the surface of the target model.
[0111] Furthermore, the movement degree corresponding to the movement attribute corresponding to the vertex is in direct proportion to the target distance corresponding to the vertex.
[0112] The soft object simulation device provided in the embodiment of the present disclosure has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0113] The present disclosure also provides an electronic device, such as Fig.10 As shown, the electronic device includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned soft object simulation method.
[0114] Specifically, the simulation method of the soft object includes: obtaining a target model and generating multiple points on the surface of the target model; determining the size attributes corresponding to the multiple points respectively; for each point in the multiple points, generating a target object matching the size attributes corresponding to the current point at the position of the current point; removing the object area on the target object that overlaps with the interior of the target model to obtain the target object located on the surface of the target model; and performing soft object motion simulation on the target object located on the surface of the target model to obtain a soft object that follows the movement of the target model.
[0115] In the above-mentioned simulation method of soft objects, objects are generated at scattered points on the surface of the target model, and the generated objects are controlled to simulate the movement of the soft objects, so as to obtain a soft object that follows the movement of the target model. This method can not only generate soft objects on the target model, but also improve the generation efficiency and generation cost of the soft objects while reducing the demand for computing resources.
[0116] In an optional embodiment, the step of obtaining the target model includes at least one of the following: obtaining a static three-dimensional model and determining the static three-dimensional model as the target model; obtaining a three-dimensional model with animation, freezing the animation time of the three-dimensional model with animation, and determining the three-dimensional model with frozen animation time as the target model.
[0117] In an optional embodiment, the step of generating a plurality of points on the surface of the target model includes: converting the target model into a mesh model having a point-line-surface structure; and randomly generating a plurality of points on the outer surface of the mesh model.
[0118] In an optional embodiment, the step of determining the size attributes respectively corresponding to the plurality of points includes: generating noise maps respectively corresponding to the plurality of points, and generating the size attributes respectively corresponding to the plurality of points based on the noise maps.
[0119] In an optional embodiment, the above-mentioned step of generating size attributes corresponding to multiple points based on the noise map includes: for the noise maps corresponding to the multiple points, converting the attributes of the noise map into grayscale values, normalizing the grayscale values to obtain normalized grayscale values, and determining the normalized grayscale values as the size attributes.
[0120] In an optional embodiment, the step of generating a target object matching the size attribute corresponding to the current point at the location of the current point includes: determining the target volume corresponding to the current point based on the size attribute corresponding to the current point; and generating a target object matching the target volume at the location of the current point.
[0121] In an optional embodiment, the data format of the target object is a three-dimensional volume data format.
[0122] In an optional embodiment, the above-mentioned step of removing the object area on the target object that overlaps with the interior of the target model to obtain the target object located on the surface of the target model includes: converting the target model into a first model in a three-dimensional volume data format; subtracting the first model from the target object to remove the volume of the target object located inside the first model to obtain the target object located on the surface of the target model.
[0123] In an optional embodiment, the above-mentioned step of performing soft object motion simulation on the target object located on the surface of the target model to obtain a soft object that follows the movement of the target model includes: determining the target distance between each vertex on the target object located on the surface of the target model and the target model surface; determining the motion attribute corresponding to each vertex according to the target distance corresponding to each vertex; wherein the motion attribute is used to indicate the lag effect and / or jitter effect of the soft object moving on the surface of the target model.
[0124] In an optional embodiment, the movement degree corresponding to the movement attribute corresponding to the vertex is directly proportional to the target distance corresponding to the vertex.
[0125] Further, Fig.10 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 101 , the communication interface 103 and the memory 100 are connected via the bus 102 .
[0126] The memory 100 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0127] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100 and completes the steps of the method of the above embodiment in combination with its hardware.
[0128] The embodiment of the present disclosure also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned soft object simulation method. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0129] Specifically, the simulation method of the soft object includes: obtaining a target model and generating multiple points on the surface of the target model; determining the size attributes corresponding to the multiple points respectively; for each point in the multiple points, generating a target object matching the size attributes corresponding to the current point at the position of the current point; removing the object area on the target object that overlaps with the interior of the target model to obtain the target object located on the surface of the target model; and performing soft object motion simulation on the target object located on the surface of the target model to obtain a soft object that follows the movement of the target model.
[0130] In the above-mentioned simulation method of soft objects, objects are generated at scattered points on the surface of the target model, and the generated objects are controlled to simulate the movement of the soft objects, so as to obtain a soft object that follows the movement of the target model. This method can not only generate soft objects on the target model, but also improve the generation efficiency and generation cost of the soft objects while reducing the demand for computing resources.
[0131] In an optional embodiment, the step of obtaining the target model includes at least one of the following: obtaining a static three-dimensional model and determining the static three-dimensional model as the target model; obtaining a three-dimensional model with animation, freezing the animation time of the three-dimensional model with animation, and determining the three-dimensional model with frozen animation time as the target model.
[0132] In an optional embodiment, the step of generating a plurality of points on the surface of the target model includes: converting the target model into a mesh model having a point-line-surface structure; and randomly generating a plurality of points on the outer surface of the mesh model.
[0133] In an optional embodiment, the step of determining the size attributes respectively corresponding to the plurality of points includes: generating noise maps respectively corresponding to the plurality of points, and generating the size attributes respectively corresponding to the plurality of points based on the noise maps.
[0134] In an optional embodiment, the above-mentioned step of generating size attributes corresponding to multiple points based on the noise map includes: for the noise maps corresponding to the multiple points, converting the attributes of the noise map into grayscale values, normalizing the grayscale values to obtain normalized grayscale values, and determining the normalized grayscale values as the size attributes.
[0135] In an optional embodiment, the step of generating a target object matching the size attribute corresponding to the current point at the location of the current point includes: determining the target volume corresponding to the current point based on the size attribute corresponding to the current point; and generating a target object matching the target volume at the location of the current point.
[0136] In an optional embodiment, the data format of the target object is a three-dimensional volume data format.
[0137] In an optional embodiment, the above-mentioned step of removing the object area on the target object that overlaps with the interior of the target model to obtain the target object located on the surface of the target model includes: converting the target model into a first model in a three-dimensional volume data format; subtracting the first model from the target object to remove the volume of the target object located inside the first model to obtain the target object located on the surface of the target model.
[0138] In an optional embodiment, the above-mentioned step of performing soft object motion simulation on the target object located on the surface of the target model to obtain a soft object that follows the movement of the target model includes: determining the target distance between each vertex on the target object located on the surface of the target model and the target model surface; determining the motion attribute corresponding to each vertex according to the target distance corresponding to each vertex; wherein the motion attribute is used to indicate the lag effect and / or jitter effect of the soft object moving on the surface of the target model.
[0139] In an optional embodiment, the movement degree corresponding to the movement attribute corresponding to the vertex is directly proportional to the target distance corresponding to the vertex.
[0140] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a terminal device, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0141] In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present disclosure. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0142] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for simulating a soft object, characterized in that: The method comprises: Acquire a target model, and generate a plurality of points on a surface of the target model; Determine the size attributes corresponding to the multiple points respectively; For each of the multiple points, generating a target object having a size attribute matching that of the current point at the location of the current point; Removing the object area on the target object that overlaps with the interior of the target model to obtain the target object located on the surface of the target model; A soft object motion simulation is performed on the target object located on the surface of the target model to obtain a soft object that moves along with the target model.
2. The method according to claim 1, characterized in that The step of obtaining the target model includes at least one of the following: Acquire a stationary three-dimensional model, and determine the stationary three-dimensional model as the target model; A three-dimensional model with animation is acquired, the animation time of the three-dimensional model with animation is frozen, and the three-dimensional model with the frozen animation time is determined as the target model.
3. The method according to claim 1, characterized in that The step of generating a plurality of points on the surface of the target model comprises: Converting the target model into a mesh model having a point-line-surface structure; A plurality of points are randomly generated on an outer surface of the mesh model.
4. The method according to claim 1, characterized in that: The step of determining the size attributes corresponding to the plurality of points respectively comprises: Noise maps corresponding to the plurality of points are generated, and size attributes corresponding to the plurality of points are generated based on the noise maps.
5. The method according to claim 4, characterized in that The step of generating the size attributes corresponding to the plurality of points respectively based on the noise map comprises: For the noise images respectively corresponding to the multiple points, the attributes of the noise images are converted into grayscale values, and the grayscale values are normalized to obtain normalized grayscale values, and the normalized grayscale values are determined as size attributes.
6. The method according to claim 1, characterized in that The step of generating a target object at the location of the current point that matches the size attribute corresponding to the current point includes: Determining a target volume corresponding to the current point based on a size attribute corresponding to the current point; A target object matching the target volume is generated at the location of the current point.
7. The method according to claim 6, characterized in that The data format of the target object is a three-dimensional volume data format.
8. The method according to claim 7, characterized in that The step of removing the object area on the target object that overlaps with the interior of the target model to obtain the target object located on the surface of the target model includes: Converting the target model into a first model in a three-dimensional volume data format; The first model is subtracted from the target object to remove the volume of the target object located inside the first model, thereby obtaining the target object located on the surface of the target model.
9. The method according to claim 1, characterized in that: The step of performing soft object motion simulation on the target object located on the surface of the target model to obtain a soft object that moves following the target model includes: Determine the target distance between each vertex on the target object located on the surface of the target model and the surface of the target model; According to the target distance corresponding to each vertex, the motion attribute corresponding to each vertex is determined; wherein the motion attribute is used to indicate the hysteresis effect and / or jitter effect of the soft object moving on the surface of the target model.
10. The method according to claim 9, characterized in that The degree of movement corresponding to the movement attribute corresponding to the vertex is directly proportional to the target distance corresponding to the vertex.
11. A simulation device for a soft object, characterized in that: The device comprises: A point scattering module is used to obtain a target model and generate a plurality of points on the surface of the target model; An attribute determination module, used to determine the size attributes corresponding to the plurality of points respectively; An object generation module, for generating, for each of the plurality of points, a target object matching a size attribute corresponding to the current point at a location of the current point; An overlapping removal module, used for removing the object area on the target object that overlaps with the interior of the target model, to obtain the target object located on the surface of the target model; The motion simulation module is used to perform soft object motion simulation on the target object located on the surface of the target model to obtain a soft object that moves along with the target model.
12. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the soft object simulation method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the soft object simulation method according to any one of claims 1 to 10.