Clothing model rendering method and device, electronic equipment and storage medium
Through deformation detection and wrinkle noise generation of virtual character clothing models, dynamic wrinkle rendering is achieved, solving the problem of static wrinkle effect in the existing technology and enhancing the visual reality.
Patent Information
- Application Number
- CN202411470233.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art is difficult to realistically simulate the wrinkles of the fabric worn by the virtual character in different postures without increasing the computational burden, and the resulting wrinkle effect is usually static and lacks authenticity.
By conducting deformation detection on the target clothing model of the virtual character, the extruded area is identified, and fold noise is generated based on the positions of each vertex in the extruded area, and then the vertices are positionally offset to achieve dynamic fold rendering.
It realizes the rendering of folds based on the dynamic deformation of the clothing model, making the fold effect more realistic, enhancing the visual realism, and is suitable for real-time application scenarios.
Smart Images

Figure CN119425087A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a clothing model rendering method, device, electronic device and storage medium. Background Art
[0002] In application scenarios such as games and virtual reality, realistically simulating the wrinkles of fabrics worn by virtual characters in different postures without increasing too much computational burden is one of the current research hotspots. Among them, fabric wrinkles are not only caused by external forces, but are related to multiple factors such as the fabric material, stretching state, and force direction.
[0003] Currently, the wrinkle effect of cloth is usually generated through image-based technology, which usually adds wrinkle details on the surface of cloth through texture mapping or normal mapping without complex physical calculations.
[0004] However, the wrinkle effect generated by the above method is usually static, difficult to adjust according to the dynamic deformation of the cloth, and lacks authenticity. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a clothing model rendering method, device, electronic device and storage medium to render the wrinkles of the clothing model according to the dynamic deformation of the clothing model, so that the wrinkle effect is more realistic and the visual realism is enhanced.
[0006] In a first aspect, an embodiment of the present application provides a clothing model rendering method, comprising:
[0007] Performing deformation detection on a target clothing model of the virtual character to obtain a squeezed area in the target clothing model;
[0008] According to the position of each first vertex in the squeezed area, obtaining the wrinkle noise of each first vertex;
[0009] The positions of the first vertices are shifted according to the wrinkle noise to render wrinkles on the target clothing model.
[0010] In a second aspect, an embodiment of the present application further provides a clothing model rendering device, comprising:
[0011] A detection module, used to perform deformation detection on a target clothing model of a virtual character to obtain a squeezed area in the target clothing model;
[0012] An acquisition module, configured to acquire wrinkle noise of each first vertex according to the position of each first vertex in the squeezed area;
[0013] The offset module is used to offset the positions of the first vertices according to the wrinkle noise so as to render wrinkles on the target clothing model.
[0014] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to execute any one of the methods described in the first aspect.
[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in any one of the first aspects is executed.
[0016] The present application provides a clothing model rendering method, device, electronic device and storage medium, wherein the method comprises: performing deformation detection on a target clothing model of a virtual character, obtaining a squeezed area in the target clothing model, obtaining wrinkle noise of each first vertex according to the position of each first vertex in the squeezed area, and performing position shifting on each first vertex according to the wrinkle noise to perform wrinkle rendering on the target clothing model. Thus, wrinkle rendering can be performed on the clothing model according to the dynamic deformation of the clothing model, so that the wrinkle effect is more realistic and the visual realism is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 Schematic diagram of the process of the clothing model rendering method provided in the embodiment of the present application Figure 1 ;
[0019] Figure 2 Schematic diagram of the process of the clothing model rendering method provided in the embodiment of the present application Figure 2 ;
[0020] Figure 3 Schematic diagram of the process of the clothing model rendering method provided in the embodiment of the present application Figure 3 ;
[0021] Figure 4 A schematic diagram of a basic clothing model provided in an embodiment of the present application;
[0022] Figure 5 A schematic diagram of a target clothing model provided in an embodiment of the present application;
[0023] Figure 6 A schematic diagram of a rendered target clothing model provided in an embodiment of the present application;
[0024] Figure 7 Schematic diagram of the process of the clothing model rendering method provided in the embodiment of the present application Figure 4 ;
[0025] Figure 8 Schematic diagram of the process of the clothing model rendering method provided in the embodiment of the present application Figure 5 ;
[0026] Fig. 9 Schematic diagram of the process of the clothing model rendering method provided in the embodiment of the present application Figure 6 ;
[0027] Fig.10 A schematic diagram of the structure of a clothing model rendering device provided in an embodiment of the present application;
[0028] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0030] In the field of cloth simulation, there are currently two main ways to add wrinkles to cloth. One is an image-based technology, which usually adds wrinkle details to the cloth surface through texture mapping or normal mapping, but the wrinkle effect it generates is usually static, difficult to adjust according to the dynamic deformation of the cloth, and lacks authenticity. In addition, when dealing with the force and deformation of the cloth, this method often relies on pre-generated maps and cannot generate realistic wrinkle effects based on actual physical conditions. The other is a cloth simulation method using finite element analysis, which divides the cloth into finite element units and uses mechanical equations to calculate the stress and strain of each unit to obtain the deformation of the cloth. However, this method has extremely high computational complexity and usually requires a lot of computing resources and time, making it difficult to apply to real-time scenes.
[0031] Based on this, the present application identifies the squeezed area in the target clothing model and generates wrinkle noise of the vertices in the squeezed area, and then shifts the position of the vertices according to the wrinkle noise, so that the wrinkle effect can adapt to the deformation of the target clothing model and enhance the visual realism.
[0032] Figure 1 Schematic diagram of the process of the clothing model rendering method provided in the embodiment of the present application Figure 1 The execution subject of this embodiment can be an electronic device, such as a mobile phone, a tablet, a computer, etc., wherein a virtual engine is deployed on the electronic device, and the clothing model rendering method of this solution can be executed by using the virtual engine.
[0033] like Figure 1 As shown, the method may include:
[0034] S101, performing deformation detection on a target clothing model of a virtual character to obtain a squeezed area in the target clothing model.
[0035] A virtual engine is started on an electronic device, and a graphical user interface is displayed. The graphical user interface displays an application scenario, which includes virtual characters, such as virtual people, virtual animals, etc. The application scenario may be, for example, a game scene or a virtual reality scene. The target clothing model is a clothing model (i.e., fabric) worn by the virtual character in the application scenario.
[0036] The target clothing model worn by the virtual character is subjected to deformation detection to obtain a squeezed area in the target clothing model, wherein the squeezed area is an area where the target clothing model is squeezed due to the action of the virtual character. For example, when the virtual character bends his arm, the squeezed area in the target clothing model is an area corresponding to the bending of the arm.
[0037] As an example, the application scenario is a real-time application scenario, and the target clothing model is a real-time clothing model worn by a virtual character in the real-time application scenario.
[0038] S102 . Obtain wrinkle noise of each first vertex according to the position of each first vertex in the squeezed area.
[0039] The first vertices are vertices constituting the squeezed region. According to the positions of the first vertices in the squeezed region, a preset noise generation algorithm is used to generate wrinkle noise of the first vertices, wherein the wrinkle noise may be Simplex noise.
[0040] S103. According to the wrinkle noise, position shift is performed on each first vertex to render wrinkles on the target clothing model.
[0041] According to the wrinkle noise, each first vertex is shifted in position, that is, the wrinkle noise of each first vertex is applied to each first vertex in the target clothing model to achieve the position shift of each first vertex, thereby performing wrinkle rendering on the target clothing model.
[0042] In this embodiment, by identifying the squeezed area in the target clothing model and generating wrinkle noise of the vertices in the squeezed area, and then shifting the position of the vertices according to the wrinkle noise, the wrinkle effect can adapt to the deformation of the target clothing model and enhance the visual realism.
[0043] Figure 2 Schematic diagram of the process of the clothing model rendering method provided in the embodiment of the present application Figure 2 ,like Figure 2 As shown, in an optional implementation manner, the above step S102, obtaining the wrinkle noise of each first vertex according to the position of each first vertex in the squeezed area, may include:
[0044] S201 . Determine a target vertex gradient of each first vertex according to the position of each first vertex.
[0045] The position of the first vertex can be the position P(x, y, z) in the world coordinate system, and the directions of the coordinate axes of the world coordinate system can be obtained by referring to Figure 5 Related tags in .
[0046] According to the position of each first vertex, a target vertex gradient of each first vertex is determined, where the target vertex gradient is the gradient of the first vertex, and the target vertex gradient is used to indicate the deformation direction at each first vertex and the deformation degree in the deformation direction.
[0047] It can be understood that the target vertex gradient is a three-dimensional vector having a direction and a magnitude, wherein the direction is used to indicate the deformation direction at the first vertex, ie, the gradient direction, and the magnitude is used to indicate the degree of deformation in the deformation direction.
[0048] In an optional implementation, the above step S201, determining the target vertex gradient of each first vertex according to the position of each first vertex, may include:
[0049] According to the position of each first vertex and a preset step length, the position of the second vertex corresponding to each first vertex is obtained;
[0050] According to the position of the second vertex, the area of the region where the second vertex is located in the target clothing model is obtained;
[0051] The target vertex gradient of each first vertex is determined according to the area of the squeezed region and the area of the region where the second vertex is located.
[0052] Among them, the position of the first vertex is the position P(x, y, z) in the world coordinate system. According to the preset step size h, it is offset in the X, Y, and Z directions respectively to obtain the second vertex corresponding to the first vertex in the X, Y, and Z directions respectively, which can be expressed as P+set(h,0,0), P+set(0,h,0), and P+set(0,0,h).
[0053] According to the position of the second vertex, the area of the region where the second vertex is located in the target clothing model is obtained, wherein the region where the second vertex is located is the region formed by the second vertices, and according to the area of the squeezed region formed by each first vertex and the area where the second vertex is located, the target vertex gradient of each first vertex in the X, Y, and Z directions is determined.
[0054] In an optional embodiment, the target vertex gradient of the first vertex P(x, y, z) It can be expressed as:
[0055]
[0056] The specific code is as follows:
[0057] vector p = @P; / / Get the position of the first vertex
[0058] float h = 0.01; / / step length
[0059] float center = point(1,"Area",p); / / Get the area of the squeezed area where the first vertex is located
[0060] float Area_x_plus=point(1,"Area",p+set(h,0,0)); / / The first vertex is offset by h in the X direction
[0061] float Area_y_plus=point(1,"Area",p+set(0,h,0)); / / The first vertex is offset by h in the Y direction
[0062] float Area_z_plus=point(1,"Area",p+set(0,0,h)); / / The first vertex is offset by h in the Z direction
[0063] / / Calculate the gradient
[0064] vector grad;
[0065] grad.x=(Area_x_plus-center) / h;
[0066] grad.y=(Area_y_plus-center) / h;
[0067] grad.z=(Area_z_plus-center) / h;
[0068] Among them, grad.x, grad.y, and grad.z represent the target vertex gradients of the first vertex in the X direction, Y direction, and Z direction respectively, Area_x_plus represents the area of the region where the second vertex offset in the X direction is located, that is, f(x+h,y,z), Area_y_plus represents the area of the region where the second vertex offset in the Y direction is located, that is, f(x,y+h,z), Area_z_plus represents the area of the region where the second vertex offset in the Z direction is located, that is, f(x,y,z+h), and f(x,y,z) represents the area of the squeezed region where the first vertex is located.
[0069] It is worth noting that if the area where the second vertex in the target clothing model is located includes but is not limited to one, the area of one area and the area of the squeezed area can be selected according to a preset screening rule to jointly calculate the target vertex gradient of the first vertex.
[0070] S202: Determine the three-dimensional noise of each first vertex according to the position of each first vertex.
[0071] A preset noise generation algorithm is used to generate three-dimensional noise of each first vertex according to the position of each first vertex, wherein the three-dimensional noise is noise existing in the three-dimensional space of the first vertex, and the three-dimensional noise may be Simplex noise.
[0072] The calculation process of Simplex noise is as follows:
[0073] Step 1: Determine the location:
[0074] The coordinates of the first vertex (input point) can be given a three-dimensional coordinate, such as (x, y, z), indicating that noise is generated at this position and the position is divided into two parts:
[0075] The integer part is used to determine the "grid unit" where this position is located (like the squares on a chessboard); the decimal part indicates the relative position of this position in the grid unit.
[0076] Step 2: Skewing:
[0077] The grid used by Simplex noise is not a normal square grid, but a "slanted" triangular structure. In order to adapt to this structure, the input coordinates need to be slightly tilted. This step helps make the generated noise distribution more uniform.
[0078] Step 3: Find the four vertices:
[0079] For Simplex noise in three-dimensional space, find the four vertices in the tetrahedron (similar to the shape of a pyramid) where the input point is located. These vertices are the key to noise generation and they determine the final noise value.
[0080] Step 4: Calculate the distance:
[0081] Calculate the distance from the input point (first vertex) to each vertex. This distance determines the "contribution" of each vertex to the final noise: the closer the vertex is to the input point, the greater its contribution, and the farther away, the smaller its contribution.
[0082] Step 5: Generate random directions (gradients):
[0083] For each vertex, a "random direction vector" is generated. This is the gradient. The gradient can be understood as "the force that this point wants to push the noise in a certain direction."
[0084] By calculating the relative position of the input point and each vertex, and combining these random directions, the contribution of each vertex can be obtained.
[0085] Step 6: Merge contributions:
[0086] Finally, the program adds the contributions of all four vertices together to generate a final noise value, such as weighted accumulation, to obtain the noise value of the input point, where the weights of these contributions depend on the distance between the vertex and the input point. The closer the vertex, the greater the contribution, and the farther the vertex, the smaller the contribution.
[0087] As an example, the implementation code is as follows:
[0088] / / Calculate 3D Simplex noise
[0089] float simplexNoise(vec3 position,int seed){
[0090] / / Calculate the offset coordinates
[0091] vec3 Pi = floor(position);
[0092] vec3 Pf = fract(position);
[0093] / / Calculate the Skew factor
[0094] float skew=(Pi.x+Pi.y+Pi.z)*F3;
[0095] / / Calculate Simplex coordinates
[0096] vec3 p0=Pi+vec3(0.0,0.0,0.0);
[0097] vec3 p1=Pi+vec3(1.0,0.0,0.0)+vec3((skew+Pf.x)*F3,0.0,0.0);
[0098] vec3 p2=Pi+vec3(0.0,1.0,0.0)+vec3((skew+Pf.y)*F3,1.0,0.0);
[0099] vec3 p3=Pi+vec3(0.0,0.0,1.0)+vec3((skew+Pf.z)*F3,1.0,1.0);
[0100] / / Calculate gradient and contribution
[0101] float t0=0.6-dot(p0,p0);
[0102] float t1=0.6-dot(p1,p1);
[0103] float t2=0.6-dot(p2,p2);
[0104] float t3=0.6-dot(p3,p3);
[0105] / / Calculate the contribution of each point
[0106] t0*=t0;
[0107] t1*=t1;
[0108] t2*=t2;
[0109] t3*=t3;
[0110] / / Calculate the normalization factor
[0111] float n0 = t0 * t0;
[0112] float n1 = t1*t1;
[0113] float n2 = t2*t2;
[0114] float n3 = t3*t3;
[0115] / / Calculate the gradient
[0116] vec3 grad0=hash3(seed,p0);
[0117] vec3 grad1=hash3(seed,p1);
[0118] vec3 grad2=hash3(seed,p2);
[0119] vec3 grad3=hash3(seed,p3);
[0120] / / Calculate the noise value
[0121] float noise=n0*dot(grad0,Pf);
[0122] noise+=n1*dot(grad1,vec3(Pf.x-(1.0-skew),Pf.y,Pf.z));
[0123] noise+=n2*dot(grad2,vec3(Pf.x,Pf.y-(1.0-skew),Pf.z));
[0124] noise+=n3*dot(grad3,vec3(Pf.x,Pf.y,Pf.z-(1.0-skew)));
[0125] In the above code, vec is the abbreviation of vector, and Pi is the result of using the floor() function to round position. It represents the integer part of position and is used to determine the grid cell where a given point is located. Space is usually divided into discrete grid cells, and Pi is used to locate which cell the current position is located in. Pi.x, Pi.y, and Pi.z represent the values of Pi on the x-axis, y-axis, and z-axis respectively.
[0126] Pf is the result of taking the decimal part of position using the fract() function. It represents the decimal part of position and is used to calculate the offset of the point relative to the grid cell (determined by Pi). Pf indicates the location of the current position inside the cell where it is located. Pf.x, Pf.y, and Pf.z represent the values of Pf on the x-axis, y-axis, and z-axis, respectively.
[0127] The principle of simplex noise is based on tetrahedrons in three-dimensional space (rather than regular grid cubes). In order to map the input three-dimensional coordinates to such a tetrahedron structure, some mathematical transformations are needed to "tilt" the coordinate system, which requires the use of F3, and the value of F3 can be a constant of 1 / 3, for example.
[0128] p0, p1, p2, p3: These vectors represent the positions of the four vertices of the tetrahedron. They are calculated from the input point Pi (integer grid position) and Pf (fractional offset), representing the relative position of the input point in a cell within the Simplex space.
[0129] dot(p0,p0): dot(p0,p0) represents the square of the distance from vertex p0 to the input point (i.e. the square of the length of the p0 vector). The same is true for other vertices p1, p2, and p3.
[0130] t0*: square of t0, so that the contribution close to the input point changes more smoothly, while the contribution far from the input point decays faster. This process ensures that the noise has a smooth and continuous characteristic without abrupt changes.
[0131] Grad0, grad1, grad2, grad3 are four gradient vectors, which correspond to the four vertices p0, p1, p2, p3 in the Simplex mesh respectively. Each gradient vector is generated by a hash function to ensure that they are different at different vertices in order to produce a rich variety of noise forms. These gradient vectors are dot-producted with the relative positions of the input points to calculate the final noise value. The gradient vector not only affects the size of the noise, but also determines the directionality of the noise.
[0132] When calculating the noise value, based on the Simplex noise algorithm, the gradient vector of each vertex is dot-producted with the relative position of the input point to calculate the contribution of each vertex to the final noise.
[0133] n0, n1, n2, n3 are the weights of each vertex, which depend on the distance between the input point and the vertex, indicating the strength of the noise contribution. The final noise value noise is obtained by weighted accumulation of the contribution of each vertex.
[0134] S203 , obtaining wrinkle noise of each first vertex in a corresponding deformation direction according to the target vertex gradient of each first vertex and the three-dimensional noise.
[0135] Among them, the three-dimensional noise is the noise existing at the first vertex in the three-dimensional space, the target vertex gradient is used to indicate the deformation direction at the first vertex and the degree of deformation in the deformation direction, and the wrinkle noise of each first vertex in the corresponding deformation direction is obtained according to the target vertex gradient and the three-dimensional noise.
[0136] In this embodiment, by using noise to generate a natural and rich wrinkle effect, not only can the wrinkle generation efficiency be significantly improved, but also a high visual fidelity can be ensured, which is suitable for real-time application scenarios.
[0137] In an optional implementation, wrinkle noise is obtained by performing a dot product based on the target vertex gradient of each first vertex and the three-dimensional noise.
[0138] In an optional implementation, the above step S103, shifting the position of each first vertex according to the wrinkle noise to render wrinkles on the target clothing model, may include:
[0139] The target position of each first vertex is calculated according to the wrinkle noise and the position of each first vertex.
[0140] Each first vertex is offset to a target position of each first vertex to render wrinkles on the target clothing model.
[0141] Among them, the wrinkle noise has a three-dimensional spatial position, that is, the wrinkle noise is a three-dimensional vector. The wrinkle noise and the position of each first vertex are added to obtain the target position of each first vertex, and each first vertex is offset to the target position of each first vertex to achieve the position offset of each first vertex, so as to render the wrinkles of the target clothing model.
[0142] Figure 3 Schematic diagram of the process of the clothing model rendering method provided in the embodiment of the present application Figure 3 ,like Figure 3 As shown, in an optional implementation, the above step S101, performing deformation detection on the target clothing model of the virtual character to obtain the squeezed area in the target clothing model, may include:
[0143] S301, obtaining a basic clothing model of a virtual character in a preset basic state.
[0144] Among them, the preset basic state can be the state when the virtual character does not perform any action, and the basic clothing model is the clothing model worn by the virtual character when the virtual character does not perform any action, that is, the clothing model when no deformation occurs.
[0145] S302: Based on the basic clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
[0146] The features of the basic clothing model and the target clothing model are extracted, and the features of the basic clothing model and the target clothing model are compared according to the features of the basic clothing model and the target clothing model, so as to perform deformation detection on the target clothing model and determine the squeezed area in the target clothing model.
[0147] In an optional implementation, the above step S202, based on the basic clothing model, performing deformation detection on the target clothing model to determine the squeezed area, may include:
[0148] According to the position of each vertex in the basic clothing model and the position of each vertex in the target clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
[0149] Among them, each vertex in the basic clothing model is the vertex of each area constituting the basic clothing model, and each vertex in the target clothing model is the vertex of each area constituting the target clothing model. The position of each vertex in the basic clothing model and the position of each vertex in the target clothing model are obtained, and the position of each vertex in the basic clothing model and the position of each vertex in the target clothing model are matched to perform deformation detection on the target clothing model and determine the squeezed area in the target clothing model.
[0150] Figure 4 A schematic diagram of a basic clothing model provided in an embodiment of the present application, Figure 5 A schematic diagram of a target clothing model provided in an embodiment of the present application. Three vertices are used to form a regional surface, and each region of the basic clothing model is a triangular surface, and three vertices are used to form a regional surface. Among them, each region of the target clothing model corresponds to each region of the basic clothing model one by one.
[0151] For example, the positions of vertices A, B, and C of a regional surface in the basic clothing model are P1, P2, and P3, and the positions of vertices A′, B′, and C′ of the corresponding regional surface in the target clothing model are P′1, P′2, and P′3. Based on the position difference between P1 and P′1, the position difference between P2 and P′2, and the position difference between P3 and P′3, it can be determined whether the regional surface in the target clothing model is a squeezed area.
[0152] By comparison Figure 4 , Figure 5 Determine the vertex position in Figure 5 The squeezed area in Figure 6 A schematic diagram of a rendered target clothing model provided in an embodiment of the present application, such as Figure 6As shown, dynamic wrinkles are generated by offsetting the positions of the first vertices in the squeezed area, so that the wrinkle effect can adapt to the deformation of the cloth and enhance the visual realism.
[0153] In this embodiment, the squeezed area is identified based on the change in the vertex position of the clothing model, thereby improving the accuracy of identifying the squeezed area.
[0154] Figure 7 Schematic diagram of the process of the clothing model rendering method provided in the embodiment of the present application Figure 4 ,like Figure 7 As shown, in an optional implementation, based on the position of each vertex in the basic clothing model and the position of each vertex in the target clothing model, deformation detection is performed on the target clothing model to determine the squeezed area, which may include:
[0155] S401. Calculate the area of each region of the basic clothing model according to the position of each vertex in the basic clothing model.
[0156] Among them, the position of each vertex in the basic clothing model can be the position in the world coordinate system. For each area of the basic clothing model, the vertices constituting itself, such as A, B, and C, are obtained, the position of each vertex in the world coordinate system is obtained, and the area of each area of the basic clothing model is calculated. The calculation formula is as follows:
[0157]
[0158] Subtract the position of point A that constitutes the regional surface in the basic clothing model from the position of point B and point C respectively to obtain the vector Vector Cross-product and divide by 2 to get the area formed by point A, point B, and point C, denoted as Area1.
[0159] S402: Calculate the area of each region of the target clothing model according to the position of each vertex in the target clothing model.
[0160] The position of each vertex in the target clothing model can be a position in the world coordinate system. For each region of the target clothing model, the vertices constituting the region itself, such as A′, B′, and C′, are obtained, the position of each vertex in the world coordinate system is obtained, and the area of each region of the target clothing model is calculated. The calculation formula is as follows:
[0161]
[0162] Subtract the position of point A that constitutes the regional surface in the target clothing model from the position of point B and point C respectively to obtain the vector Vector Cross-product and divide by 2 to obtain the area surface consisting of A′, B′, and C′, which is recorded as Area2.
[0163] S403: Perform deformation detection on the target clothing model according to the area difference between the area of each area of the basic clothing model and the area of the corresponding area of the target clothing model to determine the squeezed area.
[0164] Among them, each area of the basic clothing model corresponds to each area of the target clothing model one by one, and the area difference between the area of each area of the basic clothing model and the area of the corresponding area of the target clothing model is calculated as the area difference, that is, Area1-Area2. If the area difference is a positive value, it means that the corresponding area of the target clothing model has been squeezed, that is, the corresponding area of the target clothing model is a squeezed area. If the area difference is a negative value, it means that the corresponding area of the target clothing model has been stretched, that is, the corresponding area of the target clothing model is a stretched area. If the area difference is 0, it means that the corresponding area of the target clothing model has not been deformed (including squeezing and stretching).
[0165] In this embodiment, the squeezed area of the target clothing model can be identified through dynamic calculation and processing of vertex area changes, thereby improving the accuracy of identifying the squeezed area.
[0166] Figure 8 Schematic diagram of the process of the clothing model rendering method provided in the embodiment of the present application Figure 5 ,like Figure 8 As shown, in an optional implementation, the above step S403, based on the area difference between the area of each area of the basic clothing model and the area of the corresponding area of the target clothing model, performs deformation detection on the target clothing model to determine the squeezed area, including:
[0167] S501. Perform deformation detection on the target clothing model according to the area difference, and determine the deformation area in the target clothing model.
[0168] If the area difference is not 0, it means that the corresponding area of the target clothing model has been deformed, that is, the corresponding area of the target clothing model is a deformed area. If the area difference is 0, it means that the corresponding area of the target clothing model has not been deformed.
[0169] S502 , remap the area difference of the deformed region to obtain a mapped area difference of the deformed region.
[0170] After the deformation region is determined, the area difference of the deformation region is remapped to obtain the mapping area difference of the deformation region, wherein the area difference of the deformation region can be remapped by B-Spline to obtain the mapping area difference of the deformation region.
[0171] It is worth noting that some points on the B-spline spline curve can be expressed as:
[0172] Point1: Postion 0.5, Value 0;
[0173] Point2: Posiotn 0.838643, Value 0;
[0174] Point3: Position0.9, Value 1;
[0175] Point4: Postion1, Value 1.
[0176] Taking Point1 as an example, Position 0.5, Value 0 means that the mapped area difference of the area difference of 0.5 is 0. The area difference of the deformed area is taken as Position, and the spline curve of the B-spline is queried to obtain the corresponding Value value as the mapped area difference.
[0177] In an optional implementation, before remapping the area difference of the deformed region, the area difference of the deformed region may be normalized and mapped to 0-1, and then the normalized area difference may be remapped to obtain the mapped area difference of the deformed region.
[0178] S503: Determine the squeezed area from the deformed area according to the mapped area difference.
[0179] The deformation region whose mapping area difference satisfies a preset condition is determined as the squeezed region, wherein the preset condition may be greater than 0, that is, the deformation region whose mapping area difference is greater than 0 is determined as the squeezed region.
[0180] In this embodiment, by calculating the change in vertex area and identifying the squeezed area of the target clothing model through remapping, the recognition accuracy of the squeezed area is improved, and by combining with noise technology, the generation efficiency of the wrinkle effect can be significantly improved while maintaining a good effect, which is suitable for real-time application scenarios.
[0181] Fig. 9 Schematic diagram of the process of the clothing model rendering method provided in the embodiment of the present application Figure 6 ,like Fig. 9 As shown, in an optional implementation, the above step S203, obtaining the wrinkle noise of each first vertex in the deformation direction according to the target vertex gradient of each first vertex and the three-dimensional noise, may include:
[0182] S601 . Normalize the target vertex gradient of each first vertex to obtain a normalized target vertex gradient.
[0183] S602 : Smoothing the normalized target vertex gradient to obtain a smoothed target vertex gradient.
[0184] The target vertex gradient of each first vertex is normalized to obtain a normalized target vertex gradient, and the normalized target vertex gradient of each first vertex is smoothed according to the normalized target vertex gradients of other first vertices within a preset range of each first vertex, such as assigning the first vertex an average of the normalized target vertex gradients of other first vertices within the preset range of the first vertex as the smoothed target vertex gradient of the first vertex, to obtain blurred data of the first vertex.
[0185] The preset range may be a certain range centered on the first vertex, and this embodiment does not specifically limit the preset range.
[0186] In this embodiment, by normalizing and smoothing the target vertex gradients, the processing efficiency is improved and the vertex gradients can obtain a smooth transition, thereby enabling the wrinkle noise of each first vertex to transition smoothly, thereby avoiding a sudden change in the wrinkle noise of a certain first vertex, resulting in a visually unnatural transition.
[0187] Based on the same inventive concept, the embodiment of the present application also provides a clothing model rendering device corresponding to the clothing model rendering method. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned clothing model rendering method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0188] Fig.10 This is a structural schematic diagram of a clothing model rendering device provided in an embodiment of the present application, which can be integrated into an electronic device.
[0189] like Fig.10 As shown, the device may include:
[0190] A detection module 701 is used to perform deformation detection on a target clothing model of a virtual character to obtain a squeezed area in the target clothing model;
[0191] An acquisition module 702 is used to acquire wrinkle noise of each first vertex according to the position of each first vertex in the squeezed area;
[0192] The offset module 703 is used to offset the position of each first vertex according to the wrinkle noise, so as to render wrinkles on the target clothing model.
[0193] In an optional implementation, the acquisition module 702 is specifically configured to:
[0194] Determine a target vertex gradient of each first vertex according to the position of each first vertex, wherein the target vertex gradient of each first vertex is used to indicate a deformation direction at each first vertex and a deformation degree in the deformation direction;
[0195] Determine the three-dimensional noise of each first vertex according to the position of each first vertex;
[0196] According to the target vertex gradient of each first vertex and the three-dimensional noise, the wrinkle noise of each first vertex in the deformation direction is obtained.
[0197] In an optional implementation, the acquisition module 702 is specifically configured to:
[0198] According to the position of each first vertex and a preset step length, the position of the second vertex corresponding to each first vertex is obtained;
[0199] According to the position of the second vertex, the area of the region where the second vertex is located in the target clothing model is obtained;
[0200] The target vertex gradient of each first vertex is determined according to the area of the squeezed region and the area of the region where the second vertex is located.
[0201] In an optional implementation, the acquisition module 702 is specifically configured to:
[0202] A dot product is performed based on the target vertex gradient of each first vertex and the three-dimensional noise to obtain wrinkle noise.
[0203] In an optional implementation, the detection module 701 is specifically configured to:
[0204] Obtaining a basic clothing model of the virtual character in a preset basic state;
[0205] Based on the basic clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
[0206] In an optional implementation, the detection module 701 is specifically configured to:
[0207] According to the position of each vertex in the basic clothing model and the position of each vertex in the target clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
[0208] In an optional implementation, the detection module 701 is specifically configured to:
[0209] Calculate the area of each region of the basic clothing model according to the position of each vertex in the basic clothing model;
[0210] According to the position of each vertex in the target clothing model, the area of each region of the target clothing model is calculated;
[0211] According to the area difference between the area of each area of the basic clothing model and the area of the corresponding area of the target clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
[0212] In an optional implementation, the detection module 701 is specifically configured to:
[0213] According to the area difference, deformation detection is performed on the target clothing model to determine the deformation area in the target clothing model;
[0214] Remapping the area difference of the deformed region to obtain the mapped area difference of the deformed region;
[0215] Based on the mapped area difference, the squeezed area is determined from the deformed area.
[0216] In an optional implementation, the acquisition module 702 is specifically configured to:
[0217] Normalizing the target vertex gradient of each first vertex to obtain a normalized target vertex gradient;
[0218] The normalized target vertex gradient is smoothed to obtain a smoothed target vertex gradient.
[0219] In an optional implementation, the offset module 703 is specifically configured to:
[0220] Calculate the target position of each first vertex according to the wrinkle noise and the position of each first vertex;
[0221] Each first vertex is offset to a target position of each first vertex to render wrinkles on the target clothing model.
[0222] In this embodiment, the detection module is used to perform deformation detection on the target clothing model of the virtual character to obtain the squeezed area in the target clothing model, the acquisition module is used to obtain the wrinkle noise of each first vertex according to the position of each first vertex in the squeezed area, and the offset module is used to offset the position of each first vertex according to the wrinkle noise to render wrinkles on the target clothing model. In this way, the wrinkle rendering of the clothing model can be performed according to the dynamic deformation of the clothing model, so that the wrinkle effect is more realistic and the visual realism is improved.
[0223] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Fig.11As shown, the device may include: a processor 801, a memory 802 and a bus 803, the memory 802 stores machine-readable instructions executable by the processor 801, when the electronic device is running, the processor 801 communicates with the memory 802 through the bus 803, and the processor 801 executes the machine-readable instructions to perform the following steps:
[0224] Performing deformation detection on the target clothing model of the virtual character to obtain the squeezed area in the target clothing model;
[0225] According to the position of each first vertex in the squeezed area, obtaining the wrinkle noise of each first vertex;
[0226] According to the wrinkle noise, the position of each first vertex is offset to render wrinkles on the target clothing model.
[0227] In an optional implementation, obtaining the wrinkle noise of each first vertex according to the position of each first vertex in the squeezed area includes:
[0228] Determine a target vertex gradient of each first vertex according to the position of each first vertex, wherein the target vertex gradient of each first vertex is used to indicate a deformation direction at each first vertex and a deformation degree in the deformation direction;
[0229] Determine the three-dimensional noise of each first vertex according to the position of each first vertex;
[0230] According to the target vertex gradient of each first vertex and the three-dimensional noise, the wrinkle noise of each first vertex in the deformation direction is obtained.
[0231] In an optional implementation, determining the target vertex gradient of each first vertex according to the position of each first vertex includes:
[0232] According to the position of each first vertex and a preset step length, the position of the second vertex corresponding to each first vertex is obtained;
[0233] According to the position of the second vertex, the area of the region where the second vertex is located in the target clothing model is obtained;
[0234] The target vertex gradient of each first vertex is determined according to the area of the squeezed region and the area of the region where the second vertex is located.
[0235] In an optional implementation, obtaining the wrinkle noise of each first vertex in the corresponding deformation direction according to the target vertex gradient and the three-dimensional noise includes:
[0236] A dot product is performed based on the target vertex gradient of each first vertex and the three-dimensional noise to obtain wrinkle noise.
[0237] In an optional implementation, deformation detection is performed on a target clothing model of a virtual character to obtain a squeezed area in the target clothing model, including:
[0238] Obtaining a basic clothing model of the virtual character in a preset basic state;
[0239] Based on the basic clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
[0240] In an optional implementation, based on the basic clothing model, deformation detection is performed on the target clothing model to determine the squeezed area, including:
[0241] According to the position of each vertex in the basic clothing model and the position of each vertex in the target clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
[0242] In an optional implementation, based on the position of each vertex in the base clothing model and the position of each vertex in the target clothing model, deformation detection is performed on the target clothing model to determine the squeezed area, including:
[0243] Calculate the area of each region of the basic clothing model according to the position of each vertex in the basic clothing model;
[0244] According to the position of each vertex in the target clothing model, the area of each region of the target clothing model is calculated;
[0245] According to the area difference between the area of each area of the basic clothing model and the area of the corresponding area of the target clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
[0246] In an optional implementation, deformation detection is performed on the target clothing model to determine the squeezed area according to the area difference between the area of each area of the basic clothing model and the area of the corresponding area of the target clothing model, including:
[0247] According to the area difference, deformation detection is performed on the target clothing model to determine the deformation area in the target clothing model;
[0248] Remapping the area difference of the deformed region to obtain the mapped area difference of the deformed region;
[0249] Based on the mapped area difference, the squeezed area is determined from the deformed area.
[0250] In an optional implementation, obtaining wrinkle noise of each first vertex in the deformation direction according to the target vertex gradient of each first vertex and the three-dimensional noise includes:
[0251] Normalizing the target vertex gradient of each first vertex to obtain a normalized target vertex gradient;
[0252] The normalized target vertex gradient is smoothed to obtain a smoothed target vertex gradient.
[0253] In an optional implementation, the position of each first vertex is offset according to the wrinkle noise to render wrinkles on the target clothing model, including:
[0254] Calculate the target position of each first vertex according to the wrinkle noise and the position of each first vertex;
[0255] Each first vertex is offset to a target position of each first vertex to render wrinkles on the target clothing model.
[0256] In this embodiment, the processor executes machine-readable instructions to perform deformation detection on the target clothing model of the virtual character, obtain the squeezed area in the target clothing model, obtain the wrinkle noise of each first vertex according to the position of each first vertex in the squeezed area, and shift the position of each first vertex according to the wrinkle noise to render wrinkles on the target clothing model. In this way, wrinkle rendering can be performed on the clothing model according to the dynamic deformation of the clothing model, so that the wrinkle effect is more realistic and the visual realism is improved.
[0257] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor performs the following steps:
[0258] Performing deformation detection on the target clothing model of the virtual character to obtain the squeezed area in the target clothing model;
[0259] According to the position of each first vertex in the squeezed area, obtaining the wrinkle noise of each first vertex;
[0260] According to the wrinkle noise, the position of each first vertex is offset to render wrinkles on the target clothing model.
[0261] In an optional implementation, obtaining the wrinkle noise of each first vertex according to the position of each first vertex in the squeezed area includes:
[0262] Determine a target vertex gradient of each first vertex according to the position of each first vertex, wherein the target vertex gradient of each first vertex is used to indicate a deformation direction at each first vertex and a deformation degree in the deformation direction;
[0263] Determine the three-dimensional noise of each first vertex according to the position of each first vertex;
[0264] According to the target vertex gradient of each first vertex and the three-dimensional noise, the wrinkle noise of each first vertex in the deformation direction is obtained.
[0265] In an optional implementation, determining the target vertex gradient of each first vertex according to the position of each first vertex includes:
[0266] According to the position of each first vertex and a preset step length, the position of the second vertex corresponding to each first vertex is obtained;
[0267] According to the position of the second vertex, the area of the region where the second vertex is located in the target clothing model is obtained;
[0268] The target vertex gradient of each first vertex is determined according to the area of the squeezed region and the area of the region where the second vertex is located.
[0269] In an optional implementation, obtaining the wrinkle noise of each first vertex in the corresponding deformation direction according to the target vertex gradient and the three-dimensional noise includes:
[0270] A dot product is performed based on the target vertex gradient of each first vertex and the three-dimensional noise to obtain wrinkle noise.
[0271] In an optional implementation, deformation detection is performed on a target clothing model of a virtual character to obtain a squeezed area in the target clothing model, including:
[0272] Obtaining a basic clothing model of the virtual character in a preset basic state;
[0273] Based on the basic clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
[0274] In an optional implementation, based on the basic clothing model, deformation detection is performed on the target clothing model to determine the squeezed area, including:
[0275] According to the position of each vertex in the basic clothing model and the position of each vertex in the target clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
[0276] In an optional implementation, based on the position of each vertex in the base clothing model and the position of each vertex in the target clothing model, deformation detection is performed on the target clothing model to determine the squeezed area, including:
[0277] Calculate the area of each region of the basic clothing model according to the position of each vertex in the basic clothing model;
[0278] According to the position of each vertex in the target clothing model, the area of each region of the target clothing model is calculated;
[0279] According to the area difference between the area of each area of the basic clothing model and the area of the corresponding area of the target clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
[0280] In an optional implementation, deformation detection is performed on the target clothing model to determine the squeezed area according to the area difference between the area of each area of the basic clothing model and the area of the corresponding area of the target clothing model, including:
[0281] According to the area difference, deformation detection is performed on the target clothing model to determine the deformation area in the target clothing model;
[0282] Remapping the area difference of the deformed region to obtain the mapped area difference of the deformed region;
[0283] Based on the mapped area difference, the squeezed area is determined from the deformed area.
[0284] In an optional implementation, obtaining wrinkle noise of each first vertex in the deformation direction according to the target vertex gradient of each first vertex and the three-dimensional noise includes:
[0285] Normalizing the target vertex gradient of each first vertex to obtain a normalized target vertex gradient;
[0286] The normalized target vertex gradient is smoothed to obtain a smoothed target vertex gradient.
[0287] In an optional implementation, the position of each first vertex is offset according to the wrinkle noise to render wrinkles on the target clothing model, including:
[0288] Calculate the target position of each first vertex according to the wrinkle noise and the position of each first vertex;
[0289] Each first vertex is offset to a target position of each first vertex to render wrinkles on the target clothing model.
[0290] In this embodiment, when the computer program is executed by the processor, the processor performs deformation detection on the target clothing model of the virtual character, obtains the squeezed area in the target clothing model, obtains the wrinkle noise of each first vertex according to the position of each first vertex in the squeezed area, and shifts the position of each first vertex according to the wrinkle noise to render wrinkles on the target clothing model. In this way, wrinkle rendering can be performed on the clothing model according to the dynamic deformation of the clothing model, so that the wrinkle effect is more realistic and the visual realism is improved.
[0291] In the embodiment of the present application, the computer program can also execute other machine-readable instructions when run by the processor to execute other methods described in the embodiment. For the specific execution method steps and principles, please refer to the description of the embodiment, which will not be repeated here.
[0292] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0293] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0294] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0295] 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 application, 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 server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. 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.
[0296] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0297] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned 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-mentioned embodiments within the technical scope disclosed in the present application, 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 application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A clothing model rendering method, characterized in that: include: Performing deformation detection on a target clothing model of the virtual character to obtain a squeezed area in the target clothing model; According to the position of each first vertex in the squeezed area, obtaining the wrinkle noise of each first vertex; The positions of the first vertices are shifted according to the wrinkle noise to render wrinkles on the target clothing model.
2. The method according to claim 1, characterized in that The step of obtaining wrinkle noise of each first vertex according to the position of each first vertex in the squeezed area includes: Determine, according to the position of each first vertex, a target vertex gradient of each first vertex, wherein the target vertex gradient of each first vertex is used to indicate a deformation direction at each first vertex and a deformation degree in the deformation direction; Determining the three-dimensional noise of each first vertex according to the position of each first vertex; According to the target vertex gradient of each first vertex and the three-dimensional noise, the wrinkle noise of each first vertex in the deformation direction is obtained.
3. The method according to claim 2, characterized in that Determining the target vertex gradient of each first vertex according to the position of each first vertex includes: According to the positions of the first vertices and a preset step length, obtaining the positions of the second vertices corresponding to the first vertices; According to the position of the second vertex, acquiring the area of the region where the second vertex is located in the target clothing model; The target vertex gradient of each first vertex is determined according to the area of the squeezed region and the area of the region where the second vertex is located.
4. The method according to claim 2, characterized in that: The step of obtaining the wrinkle noise of each first vertex in the deformation direction according to the target vertex gradient of each first vertex and the three-dimensional noise includes: The wrinkle noise is obtained by performing a dot product on the target vertex gradient of each first vertex and the three-dimensional noise.
5. The method according to claim 1, characterized in that The step of performing deformation detection on the target clothing model of the virtual character to obtain a squeezed area in the target clothing model includes: Acquire a basic clothing model of the virtual character in a preset basic state; Based on the basic clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
6. The method according to claim 5, characterized in that The step of performing deformation detection on the target clothing model based on the basic clothing model to determine the squeezed area includes: According to the position of each vertex in the basic clothing model and the position of each vertex in the target clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
7. The method according to claim 6, characterized in that The step of performing deformation detection on the target clothing model according to the positions of each vertex in the basic clothing model and the positions of each vertex in the target clothing model to determine the squeezed area includes: Calculating the area of each region of the basic clothing model according to the position of each vertex in the basic clothing model; Calculating the area of each region of the target clothing model according to the position of each vertex in the target clothing model; According to the area difference between the area of each area of the basic clothing model and the area of the corresponding area of the target clothing model, deformation detection is performed on the target clothing model to determine the squeezed area.
8. The method according to claim 7, characterized in that The step of performing deformation detection on the target clothing model according to the area difference between the area of each area of the basic clothing model and the area of the corresponding area of the target clothing model to determine the squeezed area comprises: According to the area difference, deformation detection is performed on the target clothing model to determine the deformation area in the target clothing model; Remapping the area difference of the deformed region to obtain a mapped area difference of the deformed region; The squeezed region is determined from the deformed region according to the mapped area difference.
9. The method according to claim 2, characterized in that: The step of obtaining the wrinkle noise of each first vertex in the deformation direction according to the target vertex gradient of each first vertex and the three-dimensional noise includes: Normalizing the target vertex gradients of the first vertices to obtain normalized target vertex gradients; The normalized target vertex gradient is smoothed to obtain a smoothed target vertex gradient.
10. The method according to claim 1, characterized in that The step of performing position shifting on each of the first vertices according to the wrinkle noise to perform wrinkle rendering on the target clothing model includes: Calculating a target position of each first vertex according to the wrinkle noise and the position of each first vertex; The first vertices are offset to target positions of the first vertices to perform wrinkle rendering on the target clothing model.
11. A clothing model rendering device, characterized in that: include: A detection module, used to perform deformation detection on a target clothing model of a virtual character to obtain a squeezed area in the target clothing model; An acquisition module, configured to acquire wrinkle noise of each first vertex according to the position of each first vertex in the squeezed area; The offset module is used to offset the positions of the first vertices according to the wrinkle noise so as to render wrinkles on the target clothing model.
12. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the method described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is executed.