Virtual scene-based clothing data processing method, storage medium and related device

CN115272539BActive Publication Date: 2026-10-30NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210855346.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-19
Publication Date
2026-10-30
Estimated Expiration
2042-07-19

AI Technical Summary

Technical Problem

[0003]有鉴于此,本申请的目的在于提出一种基于虚拟场景的服饰数据处理方法、存储介质及相关设备,以解决将离线解算的服饰布料数据应用于游戏运行时的蒙皮过程的问题

Benefits of technology

[0040]从上面所述可以看出,本申请提供的一种基于虚拟场景的服饰数据处理方法、存储介质及相关设备,在离线阶段获取虚拟人物模型的预设骨骼变形数据、预设服饰顶点数据以及可以表征虚拟人物模型的骨骼特征和服饰顶点特征的骨骼服饰权重矩阵,以实现在离线阶段解决在游戏场景中虚拟人物模型的服饰数据处理过程中所涉及的大量运算的问题,节约了解算数据的时间,此外,在运行阶段,驱动虚拟人物模型以获取当前姿态下的虚拟人物模型的实时骨骼变形数据集和实时服饰顶点数据集,根据离线阶段得到的预设骨骼变形数据集和运行阶段得到的实时骨骼变形数据集,得到第一骨骼数据集,进一步地,根据实时服饰顶点数据集、第一骨骼数据集和骨骼服饰权重矩阵对当前虚拟人物模型的变形情况自动插值生成服饰数据的变形过程的数据结果,以确定当前姿态下所述虚拟人物模型的服饰布料状态,本申请将离线阶段获取的虚拟人物模型的相关数据数据与实时蒙皮过程相结合,在兼顾效率的同时又能保证最终服饰数据的处理效果,使处理效果最大程度还原服饰所呈现出来的变化状态,并且可以并行处理虚拟人物模型的所有骨骼点数据和服饰顶点数据,可以大大提高在虚拟人物模型开发过程中实时服饰数据的拟合速度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115272539B_ABST
    Figure CN115272539B_ABST
Patent Text Reader

Abstract

The application provides a virtual scene-based clothing data processing method, a storage medium and related equipment, the method comprising: extracting a preset bone deformation data set and a preset clothing vertex data set of a virtual character model obtained in advance in different postures; determining a bone clothing weight matrix according to the preset bone deformation data set and the preset clothing vertex data set; driving the virtual character model to obtain a real-time bone deformation data set and a real-time clothing vertex data set of the virtual character model in a current posture; obtaining a first bone data set according to the preset bone deformation data set and the real-time bone deformation data set; and determining a clothing material state of the virtual character model in the current posture according to the real-time clothing vertex data set, the first bone data set and the bone clothing weight matrix.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer graphics technology, and in particular to a method, storage medium and related equipment for processing clothing data based on virtual scenes. Background Technology

[0002] With the rapid development of physical simulation animation technology, graphics hardware computing technology is also constantly improving. For game development, the simulation of clothing and cloth for virtual characters is a very important technical aspect. In the existing technology, clothing and cloth simulation usually adopts offline physical simulation cloth solving method or real-time skinning solving method. Although the offline physical simulation cloth solving method is faster, its effect is generally average and it cannot highly simulate the details of clothing. On the other hand, the real-time skinning solving method has a better simulation effect, but it is time-consuming, consumes more memory, and is inefficient. Summary of the Invention

[0003] In view of this, the purpose of this application is to propose a method, storage medium and related equipment for processing clothing data based on virtual scenes, so as to solve the problem of applying offline calculated clothing fabric data to the skinning process during game runtime.

[0004] To achieve the above objectives, this application provides a method for processing clothing data based on a virtual scene, comprising:

[0005] Extract the pre-acquired skeleton deformation dataset and pre-acquired clothing vertex dataset of the virtual character model under different poses;

[0006] Determine the skeleton and clothing weight matrix based on the preset skeleton deformation dataset and the preset clothing vertex dataset;

[0007] Drive the virtual character model to obtain the real-time skeletal deformation dataset and real-time clothing vertex dataset of the virtual character model in the current pose;

[0008] The first bone dataset is obtained based on the preset bone deformation dataset and the real-time bone deformation dataset;

[0009] The clothing fabric state of the virtual character model in the current pose is determined based on the real-time clothing vertex dataset, the first skeleton dataset, and the skeleton clothing weight matrix.

[0010] Optionally, the step of extracting the pre-acquired pre-defined skeletal deformation dataset and pre-defined clothing vertex dataset of the virtual character model under different poses further includes:

[0011] The motion data of the virtual character model under different postures is obtained, and the virtual character model is driven to perform shape transformation based on the motion data to obtain the shape transformation result of the virtual character model.

[0012] Set up interpolation extraction nodes, and extract the preset bone deformation data and preset clothing vertex dataset of the virtual character model in the shape transformation result according to the interpolation extraction nodes.

[0013] Optionally, the step of extracting the pre-acquired pre-defined skeletal deformation dataset and pre-defined clothing vertex dataset of the virtual character model under different poses further includes:

[0014] Obtain the static 3D model of the virtual character, the static skeletal dataset of the virtual character, and the static clothing dataset of the target clothing;

[0015] The static skeleton dataset and the static clothing dataset are bound to the static 3D model to obtain the virtual character model.

[0016] Optionally, determining the skeleton-clothing weight matrix based on the preset skeleton deformation dataset and the preset clothing vertex dataset further includes:

[0017] Based on the preset bone deformation dataset, a preset bone deformation matrix is ​​obtained; wherein, the preset bone deformation matrix is ​​composed of the bone deformation quaternions corresponding to all bones of the virtual character model in different poses;

[0018] Based on the preset clothing vertex dataset, a preset clothing vertex matrix is ​​obtained; wherein, the preset clothing vertex matrix is ​​composed of the three-dimensional coordinates of all clothing vertices corresponding to the virtual character model in different poses;

[0019] Calculate the axial-angular distance between the data in each row of the preset bone deformation matrix and the data in other rows to obtain the first axial-angular distance matrix;

[0020] The skeletal clothing weight matrix is ​​obtained based on the first axial-angular distance matrix and the preset clothing vertex matrix.

[0021] Optionally, obtaining the first bone dataset based on the preset bone deformation dataset and the real-time bone deformation dataset further includes:

[0022] Based on the real-time skeletal deformation dataset, a real-time skeletal deformation matrix is ​​obtained; wherein, the real-time skeletal deformation matrix is ​​composed of the skeletal deformation quaternions corresponding to all bones of the virtual character model in the current pose;

[0023] Calculate the axial-angular distance between the data in each row of the real-time skeleton deformation matrix and the data in each row of the preset skeleton deformation matrix to obtain the second axial-angular distance matrix;

[0024] The first skeletal dataset is obtained based on the second axial-angular distance matrix and the radial basis function formula.

[0025] Optionally, determining the clothing fabric state of the virtual character model in the current pose based on the real-time clothing vertex dataset, the first skeleton dataset, and the skeleton clothing weight matrix further includes:

[0026] Perform a weight extraction operation based on the first skeleton dataset and the skeleton clothing weight matrix to obtain the interpolated clothing vertex dataset under the current posture of the virtual character.

[0027] The comprehensive clothing vertex dataset is obtained based on the real-time clothing vertex dataset and the interpolated clothing vertex dataset;

[0028] The clothing fabric state of the virtual character model in the current pose is determined based on the comprehensive clothing vertex dataset.

[0029] Optionally, the step of setting interpolation extraction nodes and extracting preset skeletal deformation data and preset clothing vertex datasets of the virtual character model from the morphological transformation results according to the interpolation extraction nodes further includes:

[0030] A preset time interval is set between every two interpolation extraction nodes;

[0031] A simplification operation is performed at the preset time interval to extract the preset skeletal deformation data and preset clothing vertex dataset of the virtual character model from the shape transformation results.

[0032] To achieve the above objectives, this application provides a clothing data processing device based on a virtual scene, the device comprising:

[0033] The offline data acquisition module is configured to extract the preset skeletal deformation dataset and preset clothing vertex dataset of the virtual character model in different poses.

[0034] The offline weight calculation module is configured to determine the skeleton and clothing weight matrix based on the preset skeleton deformation dataset and the preset clothing vertex dataset.

[0035] The first running module is configured to drive the virtual character model to obtain the real-time skeletal deformation dataset and the real-time clothing vertex dataset of the virtual character model in the current posture.

[0036] The second running module is configured to obtain the first bone dataset based on the preset bone deformation dataset and the real-time bone deformation dataset.

[0037] The third running module is configured to determine the clothing fabric state of the virtual character model in the current pose based on the real-time clothing vertex dataset, the first skeleton dataset, and the skeleton clothing weight matrix.

[0038] To achieve the above objectives, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the clothing data processing method based on a virtual scene as described in any of the above claims.

[0039] To achieve the above objectives, this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the clothing data processing method based on any one of the above-described methods.

[0040] As can be seen from the above, the clothing data processing method, storage medium, and related devices provided in this application based on virtual scenes acquire preset skeletal deformation data, preset clothing vertex data, and a skeletal clothing weight matrix that can characterize the skeletal features and clothing vertex features of the virtual character model in the offline stage. This solves the problem of a large amount of computation involved in the clothing data processing of virtual character models in game scenes in the offline stage, saving the time of data decomposition. In addition, in the runtime stage, the virtual character model is driven to obtain the real-time skeletal deformation dataset and real-time clothing vertex dataset of the virtual character model in the current posture. Based on the preset skeletal deformation dataset obtained in the offline stage and the real-time skeletal deformation dataset obtained in the runtime stage, the data is processed. The dataset is used to obtain the first skeleton dataset. Further, based on the real-time clothing vertex dataset, the first skeleton dataset, and the skeleton clothing weight matrix, the deformation process of the clothing data is automatically interpolated to determine the clothing fabric state of the virtual character model in the current pose. This application combines the relevant data of the virtual character model obtained in the offline stage with the real-time skinning process, which can ensure the processing effect of the final clothing data while taking into account efficiency. This allows the processing effect to restore the changing state of the clothing to the greatest extent. Moreover, it can process all the skeleton point data and clothing vertex data of the virtual character model in parallel, which can greatly improve the fitting speed of real-time clothing data in the development of virtual character models. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 A schematic flowchart of a clothing data processing method based on a virtual scene provided for the application embodiment;

[0043] Figure 2 A schematic diagram of the 2D pattern and UV coordinate system of the clothing provided in the embodiments of this application;

[0044] Figure 3 This is a schematic diagram of the suture calculation process provided in the embodiments of this application;

[0045] Figure 4 A schematic diagram of the retopography process provided in an embodiment of this application;

[0046] Figure 5 A schematic diagram of a clothing data processing device based on a virtual scene provided in an embodiment of this application;

[0047] Figure 6 This is a schematic diagram of a more specific electronic device hardware structure provided in this embodiment. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.

[0049] It should be noted that, unless otherwise defined, the technical or scientific terms used in this application should have the ordinary meaning understood by one of ordinary skill in the art to which this disclosure pertains. The terms "first," "second," and similar terms used in this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the term encompasses the elements or objects listed following the term and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0050] As described in the background section, in practical applications, such as skin display in game scenes, virtual character models usually need to pose in different ways to display clothing. Therefore, in the game development process, how to present the clothing fabric of virtual characters in the game scene smoothly and without any sense of incongruity, while ensuring the simulation efficiency of clothing fabric, is a crucial issue.

[0051] However, the applicant's research revealed that most of the current mainstream real-time cloth simulation solutions for games suffer from the dilemma of good results but low efficiency or good efficiency but mediocre results, making it difficult to balance efficiency and effectiveness.

[0052] To address the aforementioned issues, this application provides a method for processing clothing data based on a virtual scene, a storage medium, and related equipment.

[0053] The technical solutions of this disclosure will be further described in detail below through specific embodiments.

[0054] In practical implementation, this application can be applied, but is not limited to, to the data processing of clothing in the fields of game virtual character model creation, film and television production, or animation. The clothing worn by the virtual character model involved in this application can be, but is not limited to, simulated and calculated by loading relevant clothing data into Marvelous Designer software. Marvelous Designer is a 3D clothing design software with intuitive pattern design functions. Its amazing design supports polylines, free curve drawing, and synchronous interactive 3D draping design. Any form of modification is immediately reflected in the fully 3D real-time draping clothing design interface. The motion data of the virtual character model involved in this application can be obtained, but is not limited to, through MAYA software. MAYA software is a 3D modeling and animation software. It can export the body motion Alembic file that drives the movement of the virtual character through MAYA, import the Alembic file into Marvelous Designer software, and synchronously drive the body and clothing of the virtual character model to obtain 3D static clothing data and 3D dynamic clothing data.

[0055] refer to Figure 1 This is a schematic diagram of a method for processing clothing data based on a virtual scene, provided in the embodiments of the application.

[0056] Step S101: Extract the preset skeletal deformation dataset and preset clothing vertex dataset of the virtual character model obtained in different poses.

[0057] In practice, it is necessary to first obtain a virtual character model, which can be obtained through, but is not limited to, the following methods:

[0058] As an optional implementation, a 2D pattern of the garment can be drawn in Marvelous Designer software based on the garment's design drawings. The stitching calculation process can then be performed using the software to obtain a 3D finished garment sample. A static garment dataset of the target garment to be simulated is then obtained from the 3D finished garment sample.

[0059] refer to Figure 2This is a schematic diagram of the 2D pattern and UV coordinate system of the clothing provided in the embodiments of this application.

[0060] In practice, in addition to a three-dimensional spatial coordinate system, polygons also possess a two-dimensional UV coordinate system. Similar to the X, Y, and Z axes of a spatial model, the UV coordinate system allows mapping the vertices of the polygon to pixels in the image. The texture map of the 2D garment pattern in the UV coordinate system defines the positional information of each point on the 2D garment pattern. These points are interconnected with the 3D garment data, allowing for precise mapping of each point on the 2D garment pattern to the surface of the virtual character model. The software then performs smooth image interpolation at the gaps between points.

[0061] refer to Figure 3 This is a schematic diagram of the stitching calculation process in an embodiment of this application.

[0062] The 2D pattern of the clothing is created by designing the clothing design drawings. A UV coordinate system is generated based on the 2D pattern. The UV coordinate system is arranged in the environment background to obtain the required data for the virtual character model. Then, the clothing data in 3D form is obtained through the stitching calculation of the software.

[0063] refer to Figure 4 This is a schematic diagram of the retopography process provided in an embodiment of this application.

[0064] It should be noted that the static and dynamic data of 3D clothing need to be retopologized to facilitate the drawing and production of 3D textures. Similarly, quadrilaterals are better than triangular faces for subsequent use. Therefore, we need to use the 3D model to retopologize the model created in Marvelous Designer software, so that its skin structure becomes quadrilaterals.

[0065] Furthermore, in practical implementation, Alembic files can be exported from Maya software to guide the virtual character model in presenting different body movements. These Alembic files can include, but are not limited to, cached data and animation data. Further, a static 3D model of the virtual character and a static skeleton dataset matching the static 3D model are obtained. The static clothing dataset of the target garment and the static skeleton dataset of the virtual character are then bound to the static 3D model of the virtual character using Maya software, resulting in a virtual character model with preset skeleton and clothing data bindings.

[0066] Furthermore, by importing the virtual character model with preset skeletal data binding and preset clothing data binding, along with the Alembic file, into Marvelous Designer software to drive the body and clothing to perform motion calculations, virtual character models in different poses can be obtained. Finally, the preset skeletal deformation dataset and preset clothing vertex dataset of the virtual character model obtained in advance in different poses can be extracted.

[0067] It should be noted that, in the actual implementation, each data point in the preset bone deformation dataset and each data point in the preset clothing vertex dataset are in one-to-one correspondence.

[0068] The preset skeletal deformation dataset includes skeletal pose data and quaternions of each bone in the virtual character model corresponding to the skeletal pose data. The quaternions of the bones are a multidimensional representation of the skeletal data, which is composed of the rotation of each joint of the body skeleton.

[0069] The preset clothing vertex dataset includes skeletal pose data and corresponding clothing vertex data. The vertex data of the virtual character model consists of the positions of each clothing vertex matched to the body of the virtual character model.

[0070] As an optional embodiment, motion data of the virtual character model in different postures can be obtained, and the virtual character model can be driven to perform morphological transformation based on the motion data to obtain the morphological transformation result of the virtual character model, namely posture A, posture B... posture N.

[0071] Furthermore, interpolation extraction nodes are set up, and preset skeletal deformation data and preset clothing vertex datasets of the virtual character model are extracted from the morphological transformation results according to the interpolation extraction nodes.

[0072] It should be noted that the distance between each interpolation extraction node can be 30 frames apart, and there can be, but is not limited to, empty frame nodes with a distance of 30 frames between every two interpolation extraction nodes, to ensure that each acquired pose is not repeated and to meet the linear interpolation requirements.

[0073] In some embodiments, a preset time interval can be set, such as 30 frames. The preset time interval can be inserted into the execution device in the form of an instruction. When the execution device receives the extraction instruction, it can extract the preset bone deformation data and preset clothing vertex dataset of the virtual character model in the morphological transformation result according to the interpolation extraction nodes based on the preset time interval. For example, when the execution device receives an extraction instruction containing the preset time interval, it can extract the preset bone deformation data and preset clothing vertex dataset of the virtual character model in the morphological transformation result every 30 frames according to the arrangement order of the interpolation extraction nodes.

[0074] Step S102: Determine the skeleton and clothing weight matrix based on the preset skeleton deformation dataset and the preset clothing vertex dataset.

[0075] Specifically, after obtaining the preset bone deformation dataset and the preset clothing vertex dataset, the preset bone deformation dataset is converted into a preset bone deformation matrix, with rows representing the rotation quaternions of each bone and columns representing each pose. The preset clothing vertex dataset is converted into a preset clothing vertex matrix, with rows representing each vertex of the clothing and columns representing each pose. The axial-angular distance for each row of the preset bone deformation matrix is ​​calculated, and this axial-angular distance is then substituted into a Gaussian kernel function to obtain the Phi matrix, which represents the correlation between each bone. The transpose of the Phi matrix is ​​multiplied by the Phi matrix, and the inverse of the identity matrix is ​​obtained. This result is then multiplied by the preset clothing vertex matrix to obtain the bone and clothing weight matrix.

[0076] Specifically, the preset clothing vertex dataset can be visually represented in the following ways:

[0077] Posture A {{Vertex 1 position}, {Vertex 2 position}, ..., {Vertex N position}} Posture B {{Vertex 1 position}, {Vertex 2 position}, ..., {Vertex N position}} Posture N {{Vertex 1 position}, {Vertex 2 position}, ..., {Vertex N position}}

[0078] Specifically, the preset clothing vertex matrix is ​​composed of the three-dimensional coordinates of all clothing vertices corresponding to the virtual character model in different poses, and can be represented in the following way:

[0079] Posture A {{skeleton 1}, {skeleton 2}, ..., {skeleton n}} Posture B {{skeleton 1}, {skeleton 2}, ..., {skeleton n}} Posture N {{skeleton 1}, {skeleton 2}, ..., {skeleton n}}

[0080] Further, the axial-angular distance between the data in each row of the preset bone deformation matrix and the data in other rows is calculated to obtain the first axial-angular distance matrix. Based on the first axial-angular distance matrix and the preset clothing vertex matrix, the bone clothing weight matrix is ​​obtained.

[0081] As an optional embodiment, in the x-direction of the uv coordinate system, the axial-angular distance between two bones can be obtained by subtracting the row coordinate of the i-th bone from the row coordinate of any bone in the preset bone deformation matrix. This axial-angular distance is then substituted into the Gaussian kernel function to obtain the Phi matrix.

[0082]

[0083] in, Exp(·) represents the axial angular distance, and exp(·) represents the Gaussian kernel function. The Phi matrix represents the axial-angular distance between two bones.

[0084] Furthermore, by traversing all the bones of the virtual character model, the Phi matrix corresponding to each bone is obtained:

[0085]

[0086] The weight matrix for the skeletal clothing is as follows:

[0087]

[0088] Among them, W x Let D be the skeleton clothing weight matrix in the x-direction of the UV coordinate system. x This is the preset clothing vertex matrix in the x-direction of the uv coordinate system.

[0089] As an optional embodiment, in the y-direction of the uv coordinate system, the axial-angular distance between two bones can be obtained by subtracting the row coordinate of the j-th bone from the row coordinate of any one bone in the preset bone deformation matrix. This axial-angular distance is then substituted into the Gaussian kernel function to obtain the Phi matrix.

[0090]

[0091] in, Exp(·) represents the axial angular distance, and exp(·) represents the Gaussian kernel function. The Phi matrix represents the axial-angular distance between two bones.

[0092] Furthermore, by traversing all the bones of the virtual character model, the Phi matrix corresponding to each bone is obtained:

[0093]

[0094] The weight matrix for the skeletal clothing is as follows:

[0095]

[0096] Among them, W y Let D be the skeletal clothing weight matrix in the y-direction of the UV coordinate system. y This is the preset clothing vertex matrix in the y-direction of the uv coordinate system.

[0097] As an optional embodiment, in the z-direction of the uv coordinate system, the axial-angular distance between two bones can be obtained by subtracting the row coordinate of the k-th bone from the row coordinate of any bone in the preset bone deformation matrix. This axial-angular distance is then substituted into the Gaussian kernel function to obtain the Phi matrix.

[0098]

[0099] in, Exp(·) represents the axial angular distance, and exp(·) represents the Gaussian kernel function. The Phi matrix represents the axial-angular distance between two bones.

[0100] Furthermore, by traversing all the bones of the virtual character model, the Phi matrix corresponding to each bone is obtained:

[0101]

[0102] The weight matrix for the skeleton and clothing is as follows:

[0103]

[0104] Among them, W z Let D be the skeleton clothing weight matrix in the z-direction of the uv coordinate system. z This is the preset clothing vertex matrix in the z-direction of the uv coordinate system.

[0105] As an optional embodiment, the weights of the skeletal clothing are represented as follows:

[0106] Vertex 1 0.2 0 0.3 0.5 Vertex 2 0.85 0.2 0.4 0.6 Vertex 3 0 0.4 0.5 0.4 Vertex 4 0.1 0.3 0.7 0.1

[0107] Step S103: Drive the virtual character model to obtain the real-time skeletal deformation dataset and real-time clothing vertex dataset of the virtual character model in the target pose.

[0108] In practical implementation, the virtual character model can be driven to move within the game simulation. A suitable posture for the virtual character model can be determined according to actual needs, and this posture can be defined as the target posture. The real-time skeletal deformation dataset and real-time clothing vertex dataset of the virtual character model under the target posture can be obtained.

[0109] Step S104: Obtain the first bone dataset based on the preset bone deformation dataset and the real-time bone deformation dataset.

[0110] As an optional embodiment, a real-time skeletal deformation matrix is ​​obtained based on the real-time skeletal deformation dataset. The real-time skeletal deformation matrix is ​​composed of the skeletal deformation quaternions corresponding to all bones of the virtual character model in the current posture. The axial-angular distance between the data in each row of the real-time skeletal deformation matrix and the data in each row of the preset skeletal deformation matrix is ​​calculated to obtain a second axial-angular distance matrix. The first skeletal dataset is obtained based on the second axial-angular distance matrix and the radial basis function formula. The length of the first skeletal dataset is the number of action postures in the preset skeletal deformation dataset.

[0111] Step S105: Determine the clothing fabric state of the virtual character model in the current pose based on the real-time clothing vertex dataset, the first skeleton dataset, and the skeleton clothing weight matrix.

[0112] As an optional embodiment, a weight extraction operation can be performed based on the first skeleton dataset and the skeleton clothing weight matrix to obtain the interpolated clothing vertex dataset under the current posture of the virtual character. Further, a comprehensive clothing vertex dataset can be obtained based on the real-time clothing vertex dataset and the interpolated clothing vertex dataset. Finally, the clothing fabric state of the virtual character model under the current posture can be determined based on the comprehensive clothing vertex dataset.

[0113] Specifically, the first skeleton dataset is multiplied and summed with the skeleton and clothing weight matrix obtained in the offline step to obtain the value of the clothing vertex at the current moment. This value is added to the real-time clothing vertex dataset to obtain the comprehensive clothing vertex dataset. Finally, the clothing fabric state of the current virtual character is adjusted in the GPU based on the comprehensive clothing vertex dataset.

[0114] It should be noted that this application calculates based on all skeletal point data and clothing vertex data of the virtual character model. All clothing vertex data is computed in parallel on the GPU. Therefore, the time required to adjust the overall clothing state of the virtual character model is the same as the time required to adjust the clothing state of a single clothing point of the virtual character model, saving runtime and improving clothing fitting efficiency.

[0115] As can be seen from the above, the clothing data processing method based on virtual scenes provided in this application acquires preset skeletal deformation data, preset clothing vertex data, and a skeletal-clothing weight matrix that can characterize the skeletal features and clothing vertex features of the virtual character model in the offline stage. This solves the problem of a large amount of computation involved in the clothing data processing of the virtual character model in the game scene in the offline stage, saving the time of data decomposition. In addition, in the runtime stage, the virtual character model is driven to obtain the real-time skeletal deformation dataset and real-time clothing vertex dataset of the virtual character model in the current posture. Based on the preset skeletal deformation dataset obtained in the offline stage and the real-time skeletal deformation dataset obtained in the runtime stage, the following is obtained: Further, based on the first skeleton dataset, the deformation process of the clothing data is automatically interpolated according to the deformation of the current virtual character model using the real-time clothing vertex dataset, the first skeleton dataset, and the skeleton clothing weight matrix. This determines the clothing fabric state of the virtual character model in the current pose. This application combines the relevant data of the virtual character model obtained in the offline stage with the real-time skinning process. While taking into account efficiency, it can also ensure the processing effect of the final clothing data, so that the processing effect can restore the changing state of the clothing to the greatest extent. Moreover, it can process all the skeleton point data and clothing vertex data of the virtual character model in parallel, which can greatly improve the fitting speed of real-time clothing data in the development process of virtual character models.

[0116] Based on the same concept, this application also provides a clothing data processing device based on a virtual scene.

[0117] refer to Figure 5 This is a schematic diagram of a clothing data processing device based on a virtual scene, provided in an embodiment of this application.

[0118] The device includes:

[0119] The offline data acquisition module 501 is configured to extract the preset skeletal deformation dataset and preset clothing vertex dataset of the virtual character model in different poses.

[0120] The offline weight calculation module 502 is configured to determine the skeleton and clothing weight matrix based on the preset skeleton deformation dataset and the preset clothing vertex dataset.

[0121] The first running module 503 is configured to drive the virtual character model to obtain the real-time skeletal deformation dataset and the real-time clothing vertex dataset of the virtual character model in the current posture.

[0122] The second running module 504 is configured to obtain a first bone dataset based on the preset bone deformation dataset and the real-time bone deformation dataset.

[0123] The third running module 505 is configured to determine the clothing fabric state of the virtual character model in the current pose based on the real-time clothing vertex dataset, the first skeleton dataset, and the skeleton clothing weight matrix.

[0124] Optionally, the offline data acquisition module 501 is further configured to acquire motion data of the virtual character model under different postures, drive the virtual character model to perform morphological transformation based on the motion data, and obtain the morphological transformation result of the virtual character model.

[0125] Set up interpolation extraction nodes, and extract the preset bone deformation data and preset clothing vertex dataset of the virtual character model in the shape transformation result according to the interpolation extraction nodes.

[0126] Optionally, the offline data acquisition module 501 is further configured to acquire a static 3D model of the virtual character, a static skeletal dataset of the virtual character, and a static clothing dataset of the target clothing.

[0127] The static skeleton dataset and the static clothing dataset are bound to the static 3D model to obtain the virtual character model.

[0128] Optionally, the offline weight calculation module 502 is further configured to obtain a preset bone deformation matrix based on the preset bone deformation dataset; wherein the preset bone deformation matrix is ​​composed of the bone deformation quaternions corresponding to all bones of the virtual character model in different poses;

[0129] Based on the preset clothing vertex dataset, a preset clothing vertex matrix is ​​obtained; wherein, the preset clothing vertex matrix is ​​composed of the three-dimensional coordinates of all clothing vertices corresponding to the virtual character model in different poses;

[0130] Calculate the axial-angular distance between the data in each row of the preset bone deformation matrix and the data in other rows to obtain the first axial-angular distance matrix;

[0131] The skeletal clothing weight matrix is ​​obtained based on the first axial-angular distance matrix and the preset clothing vertex matrix.

[0132] Optionally, the second running module 504 is further configured to obtain a real-time skeletal deformation matrix based on the real-time skeletal deformation dataset; wherein the real-time skeletal deformation matrix is ​​composed of skeletal deformation quaternions corresponding to all bones of the virtual character model in the current pose;

[0133] Calculate the axial-angular distance between the data in each row of the real-time skeleton deformation matrix and the data in each row of the preset skeleton deformation matrix to obtain the second axial-angular distance matrix;

[0134] The first skeletal dataset is obtained based on the second axial-angular distance matrix and the radial basis function formula.

[0135] Optionally, the third running module 505 is further configured to perform a weight extraction operation based on the first skeleton dataset and the skeleton clothing weight matrix to obtain the interpolated clothing vertex dataset under the current posture of the virtual character.

[0136] The comprehensive clothing vertex dataset is obtained based on the real-time clothing vertex dataset and the interpolated clothing vertex dataset;

[0137] The clothing fabric state of the virtual character model in the current pose is determined based on the comprehensive clothing vertex dataset.

[0138] Optionally, the offline data acquisition module 501 is further configured to set a preset time interval between every two interpolation extraction nodes;

[0139] A simplification operation is performed at the preset time interval to extract the preset skeletal deformation data and preset clothing vertex dataset of the virtual character model from the shape transformation results.

[0140] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing the embodiments of this application, the functions of each module can be implemented in one or more software and / or hardware.

[0141] The device described above is used to implement the corresponding virtual scene-based clothing data processing method in the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0142] Based on the same concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the clothing data processing method based on a virtual scene as described in any of the above embodiments.

[0143] Figure 6 This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 610, a memory 620, an input / output interface 630, a communication interface 640, and a bus 650. The processor 610, memory 620, input / output interface 630, and communication interface 640 are interconnected internally via the bus 650.

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

[0145] The memory 620 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 620 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 620 and is called and executed by the processor 610.

[0146] The input / output interface 630 is used to connect input / output modules to enable information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.

[0147] The communication interface 640 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (e.g., USB, Ethernet cable) or wireless means (e.g., mobile network, Wi-Fi, Bluetooth).

[0148] Bus 650 includes a pathway for transmitting information between various components of the device, such as processor 610, memory 620, input / output interface 630, and communication interface 640.

[0149] It should be noted that although the above-described device only shows the processor 610, memory 620, input / output interface 630, communication interface 640, and bus 650, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0150] The electronic devices described above are used to implement the corresponding virtual scene-based clothing data processing methods in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0151] Based on the same concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the clothing data processing method based on a virtual scene as described in any of the above embodiments.

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

Claims

1. A method for processing clothing data based on virtual scenes, characterized in that, include: Extract the preset bone deformation dataset and preset clothing vertex dataset of the virtual character model under different postures. Each data in the preset bone deformation dataset and each data in the preset clothing vertex dataset are in one-to-one correspondence. The preset bone deformation dataset includes bone posture data and quaternions of each bone in the virtual character model corresponding to the bone posture data. Each data in the preset clothing vertex dataset is composed of the position of each clothing vertex matched to the body of the virtual character model. Determine the skeleton and clothing weight matrix based on the preset skeleton deformation dataset and the preset clothing vertex dataset; Drive the virtual character model to obtain the real-time skeletal deformation dataset and real-time clothing vertex dataset of the virtual character model in the current pose; The first bone dataset is obtained based on the preset bone deformation dataset and the real-time bone deformation dataset; The clothing fabric state of the virtual character model in the current pose is determined based on the real-time clothing vertex dataset, the first skeleton dataset, and the skeleton clothing weight matrix. The step of determining the skeleton-clothing weight matrix based on the preset skeleton deformation dataset and the preset clothing vertex dataset further includes: Based on the preset bone deformation dataset, a preset bone deformation matrix is ​​obtained; wherein, the preset bone deformation matrix is ​​composed of the bone deformation quaternions corresponding to all bones of the virtual character model in different poses; Based on the preset clothing vertex dataset, a preset clothing vertex matrix is ​​obtained; wherein, the preset clothing vertex matrix is ​​composed of the three-dimensional coordinates of all clothing vertices corresponding to the virtual character model in different poses; Calculate the axial-angular distance between the data in each row of the preset bone deformation matrix and the data in other rows to obtain the first axial-angular distance matrix; The skeletal clothing weight matrix is ​​obtained based on the first axial-angular distance matrix and the preset clothing vertex matrix.

2. The method according to claim 1, characterized in that, The extraction of the pre-acquired pre-defined skeletal deformation dataset and pre-defined clothing vertex dataset of the virtual character model under different poses also includes: The motion data of the virtual character model under different postures is obtained, and the virtual character model is driven to perform shape transformation based on the motion data to obtain the shape transformation result of the virtual character model. Set up interpolation extraction nodes, and extract the preset bone deformation data and preset clothing vertex dataset of the virtual character model in the shape transformation result according to the interpolation extraction nodes.

3. The method according to claim 1, characterized in that, The process of extracting the pre-acquired pre-defined skeletal deformation dataset and pre-defined clothing vertex dataset of the virtual character model under different poses also includes: Obtain the static 3D model of the virtual character, the static skeletal dataset of the virtual character, and the static clothing dataset of the target clothing; The static skeleton dataset and the static clothing dataset are bound to the static 3D model to obtain the virtual character model.

4. The method according to claim 1, characterized in that, The step of obtaining the first bone dataset based on the preset bone deformation dataset and the real-time bone deformation dataset further includes: Based on the real-time skeletal deformation dataset, a real-time skeletal deformation matrix is ​​obtained; wherein, the real-time skeletal deformation matrix is ​​composed of the skeletal deformation quaternions corresponding to all bones of the virtual character model in the current pose; Calculate the axial-angular distance between the data in each row of the real-time skeleton deformation matrix and the data in each row of the preset skeleton deformation matrix to obtain the second axial-angular distance matrix; The first skeletal dataset is obtained based on the second axial-angular distance matrix and the radial basis function formula.

5. The method according to claim 1, characterized in that, The step of determining the clothing fabric state of the virtual character model in the current pose based on the real-time clothing vertex dataset, the first skeleton dataset, and the skeleton clothing weight matrix further includes: Perform a weight extraction operation based on the first skeleton dataset and the skeleton clothing weight matrix to obtain the interpolated clothing vertex dataset under the current posture of the virtual character. Based on the real-time clothing vertex dataset and the interpolated clothing vertex dataset, a comprehensive clothing vertex dataset is obtained; The clothing fabric state of the virtual character model in the current pose is determined based on the comprehensive clothing vertex dataset.

6. The method according to claim 2, characterized in that, The step of setting interpolation extraction nodes and extracting preset skeletal deformation data and preset clothing vertex datasets of the virtual character model from the shape transformation results according to the interpolation extraction nodes also includes: A preset time interval is set between every two interpolation extraction nodes; A simplification operation is performed at the preset time interval to extract the preset skeletal deformation data and preset clothing vertex dataset of the virtual character model from the shape transformation results.

7. A clothing data processing device based on a virtual scene, characterized in that, include: The offline data acquisition module is configured to extract a preset skeletal deformation dataset and a preset clothing vertex dataset of a virtual character model in different poses. Each data point in the preset skeletal deformation dataset and each data point in the preset clothing vertex dataset are in one-to-one correspondence. The preset skeletal deformation dataset includes skeletal pose data and quaternions of each bone in the virtual character model corresponding to the skeletal pose data. Each data point in the preset clothing vertex dataset is composed of the position of each clothing vertex matched to the body of the virtual character model. The offline weight calculation module is configured to determine the skeleton and clothing weight matrix based on the preset skeleton deformation dataset and the preset clothing vertex dataset. The first running module is configured to drive the virtual character model to obtain the real-time skeletal deformation dataset and the real-time clothing vertex dataset of the virtual character model in the current posture. The second running module is configured to obtain the first bone dataset based on the preset bone deformation dataset and the real-time bone deformation dataset. The third running module is configured to determine the clothing fabric state of the virtual character model in the current pose based on the real-time clothing vertex dataset, the first skeleton dataset, and the skeleton clothing weight matrix. The offline weight calculation module is specifically configured as follows: Based on the preset bone deformation dataset, a preset bone deformation matrix is ​​obtained; wherein, the preset bone deformation matrix is ​​composed of the bone deformation quaternions corresponding to all bones of the virtual character model in different poses; Based on the preset clothing vertex dataset, a preset clothing vertex matrix is ​​obtained; wherein, the preset clothing vertex matrix is ​​composed of the three-dimensional coordinates of all clothing vertices corresponding to the virtual character model in different poses; Calculate the axial-angular distance between the data in each row of the preset bone deformation matrix and the data in other rows to obtain the first axial-angular distance matrix; The skeletal clothing weight matrix is ​​obtained based on the first axial-angular distance matrix and the preset clothing vertex matrix.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions for causing the computer to perform the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Mould penetration prevention method and device in game, electronic equipment and storage medium

    CN112435318A